The OpenD Programming Language

isSymmetric

Checks if the matrix is symmetric.

template isSymmetric(alias fun = "a == b")
static if(__traits(isSame, naryFun!fun, fun))
bool
isSymmetric
(
Iterator
SliceKind kind
)
(
Slice!(Iterator, 2, kind) matrix
)

Members

Functions

isSymmetric
bool isSymmetric(Slice!(Iterator, 2, kind) matrix)

Examples

import mir.ndslice.slice: sliced;
import mir.ndslice.topology: iota;
assert(iota(2, 2).isSymmetric == false);

assert(
    [1, 2,
     2, 3].sliced(2, 2).isSymmetric == true);

Meta