TMtx.Kron Method

Overload List

#SignatureDescription
1TMtx Kron(TMtx SrcMtx1, TMtx SrcMtx2)The Kronecker product between two matrices.
2TMtx Kron(TVec Vec1, TVec Vec2)The Kronecker product between two vectors.

Overload 1: TMtx Kron(TMtx SrcMtx1, TMtx SrcMtx2)

The Kronecker product between two matrices.

#NameTypeDescription
1SrcMtx1TMtxsource TMtx
2SrcMtx2TMtxsource TMtx

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

Remarks:

Calculates the Kronecker product between SrcMtx1 and SrcMtx2 and stores the result in the calling matrix. The Dew.Math.TMtx.Rows, Dew.Math.TMtx.Cols and Dew.Math.TMtxVec.Complex properties of calling matrix are set automatically.

Overload 2: TMtx Kron(TVec Vec1, TVec Vec2)

The Kronecker product between two vectors.

#NameTypeDescription
1Vec1TVecsource TVec
2Vec2TVecsource TVec

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

Remarks:

Calculates the Kronecker product between Vec1 and Vec2 and stores the result in the calling matrix. The Dew.Math.TMtx.Rows, Dew.Math.TMtx.Cols and Dew.Math.TMtxVec.Complex properties of calling matrix are set automatically.

Examples
TMtx A;
TVec V1;
TVec V2;
MtxVec.CreateIt(out A);
MtxVec.CreateIt(out V1, out V2);
try
    {
        V1.SetIt(false,new double[] {1,2,3});
        V2.SetIt(false,new double[] {4,5,6});
        A.Kron(V1,V2);
        // A becomes:
        // [4   5  6]
        // [8  10 12]
        // [12 15 18]
    }
finally
    {
        MtxVec.FreeIt(ref A);
        MtxVec.FreeIt(ref V1, ref V2);
    }
See Also: TVec.Kron