Matrix.TensorProd Method

TMtx TensorProd(TVec MtxCol, TVec MtxRow)

Calculates the tensor product of two vectors.

#NameTypeDescription
1MtxColTVecsource TVec
2MtxRowTVecsource TVec

Result: stored in self (calling object), returns self for chaining

Remarks:

Calculates the tensor product of mtxCol and mtxRow vectors and stores the results in the calling matrix. The Dew.Math.Matrix.Rows property is set to mtxCol.Dew.Math.TMtxVecBase.Length and Dew.Math.Matrix.Cols property is set to mtxRow.Dew.Math.TMtxVecBase.Length. The Dew.Math.TMtxVec.Complex property of the calling matrix is adjusted automatically.

Examples
TVec mtxCol;
TVec mtxRow;
TMtx V;
MtxVec.CreateIt(out mtxCol, out mtxRow);
MtxVec.CreateIt(out V);
try
    {
        mtxCol.Size(3);
        mtxCol.SetIt(false,new double[] {0,2,3}
        mtxRow.Copy(mtxCol);
        V.TensorProd(mtxCol,mtxRow);
        // V becomes:
        // [0,0,0]
        // [0,4,6]
        // [0,6,9]
    }
finally
    {
        MtxVec.FreeIt(ref mtxCol, ref mtxRow);
        MtxVec.FreeIt(ref V);
    }
See Also: Matrix.AddTensorProd