Anonymous user
Conjugate transpose: Difference between revisions
Updated D entry
(Updated D entry) |
|||
Line 325:
/// some bits of mantissa.
bool areEqual(T)(in Complex!T[][][] matrices, in size_t nBits=20)
static bool allSame(U)(in U[] v) pure nothrow {
return v[1 .. $].all!(c => c == v[0]);
Line 336:
}
if (!allSame(x))
return false;
if (!allSame(y))
return false;
Line 350:
bool isHermitian(T)(in Complex!T[][] m, in Complex!T[][] ct)
return [m, ct].areEqual;
}
Line 359:
}
auto complexIdentitymatrix(in size_t side) /*pure nothrow*/ {
return iota(side)
.map!(r => side.iota.map!(c => complex(r == c)).array)
|