function TensorProd(const Vec1: TVecInt; const Vec2: TVecInt): TMtxInt;
Calculates the tensor product of two vectors.
Result: stored in self (calling object), returns self for chaining
Remarks:
Calculates the tensor product of Vec1 and Vec2 vectors and stores the results in the calling matrix. The MatrixInt.Rows property is set to Vec1.TMtxVecBase.Length and MatrixInt.Cols property is set to Vec2.TMtxVecBase.Length. The TMtxVecInt.IntPrecision property of the calling matrix is adjusted automatically.
Examples
var Vec1,Vec2: TVecInt;
V: TMtxInt;
begin
CreateIt(Vec1,Vec2);
CreateIt(V);
try
Vec1.Size(3);
Vec1.SetIt([0,2,3]
Vec2.Copy(Vec1);
V.TensorProd(Vec1,Vec2);
// V becomes:
// [0,0,0]
// [0,4,6]
// [0,6,9]
finally
FreeIt(Vec1,Vec2);
FreeIt(V);
end;
end;