///
@safe pure nothrow @nogc
unittest
{
import mir.algorithm.iteration: equal;
import mir.ndslice.allocation: mininitRcslice;
static immutable a = [[3.0, 5, 2], [5.0, 2, 3], [2.0, 3, 1]];
static immutable b = [[2.0, 3], [4.0, 3], [0.0, -5]];
static immutable bt = [[2.0, 4, 0], [3.0, 3, -5]];
static immutable c = [[26.0, 14], [18.0, 6], [16.0, 10]];
auto X = mininitRcslice!double(3, 3);
auto Y = mininitRcslice!double(3, 2);
auto YT = mininitRcslice!double(2, 3);
auto XY = mininitRcslice!double(3, 2);
auto YTX = mininitRcslice!double(2, 3);
auto YTX2 = mininitRcslice!double(2, 3);
auto YTX3 = mininitRcslice!double(3, 2);
auto result = mininitRcslice!double(3, 2);
X[] = a;
Y[] = b;
YT[] = bt;
result[] = c;
symm(Side.Left, Uplo.Upper, 1.0, X.lightScope, Y.lightScope, 0.0, XY.lightScope);
assert(XY.equal(result));
symm(Side.Right, Uplo.Upper, 1.0, X.lightScope, YT.lightScope, 0.0, YTX.lightScope);
assert(YTX.equal(result.transposed));
//symm(Side.Right, Uplo.Upper, 1.0, X.lightScope, Y.transposed.lightScope, 0.0, YTX2.universal.lightScope); //error, the problem is that Y.transposed.lightScope._stride!1 not equal to 1, but YTX2.universal.lightScope._stride!1 is 1
//assert(YTX2.equal(result.transposed));
symm(Side.Left, Uplo.Upper, 1.0, X.lightScope, Y.transposed.lightScope.transposed, 0.0, YTX3.universal.lightScope);
assert(YTX3.transposed.equal(result.transposed));
}