TMtxByte.TensorProd Method

TMtxInt TensorProd(TVecInt Vec1, TVecInt Vec2)

Calculates the tensor product of two vectors.

#NameTypeDescription
1Vec1TVecIntsource TVecInt
2Vec2TVecIntsource TVecInt

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 Dew.Math.TMtxInt.Rows property is set to Vec1.Dew.Math.TMtxVecBase.Length and Dew.Math.TMtxInt.Cols property is set to Vec2.Dew.Math.TMtxVecBase.Length. The Dew.Math.TMtxVecInt.IntPrecision property of the calling matrix is adjusted automatically.

Examples
TVecInt Vec1;
TVecInt Vec2;
TMtxInt V;
MtxVec.CreateIt(out Vec1, out Vec2);
MtxVec.CreateIt(out V);
try
    {
        Vec1.Size(3);
        Vec1.SetIt(new double[] {0,2,3}
        Vec2.Copy(Vec1);
        V.TensorProd(Vec1,Vec2);
        // V becomes:
        // [0,0,0]
        // [0,4,6]
        // [0,6,9]
    }
finally
    {
        MtxVec.FreeIt(ref Vec1, ref Vec2);
        MtxVec.FreeIt(ref V);
    }