TMtx TensorProd(TVec MtxCol, TVec MtxRow)
Calculates the tensor product of two vectors.
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.TMtx.Rows property is set to mtxCol.Dew.Math.TMtxVecBase.Length and Dew.Math.TMtx.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: TMtx.AddTensorProd