Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TMtx *Kron(TVec *Vec1, TVec *Vec2); | The Kronecker product between two vectors. |
| 2 | TMtx *Kron(TMtx *SrcMtx1, TMtx *SrcMtx2); | The Kronecker product between two matrices. |
Overload 1: TMtx *Kron(TVec *Vec1, TVec *Vec2);
The Kronecker product between two vectors.
Remarks:
Calculates the Kronecker product between Vec1 and Vec2 and stores the result in the calling matrix. The TMtx::Rows, TMtx::Cols and TMtx::Complex properties of calling matrix are set automatically.
Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TMtx* A;
TVec *V1, *V2;
CreateIt(A);
CreateIt(V1, V2);
V1->SetIt(false, DewArray<double>{1, 2, 3});
V2->SetIt(false, DewArray<double>{4, 5, 6});
A->Kron(V1, V2);
// A becomes:
// [4 5 6]
// [8 10 12]
// [12 15 18]
FreeIt(A);
FreeIt(V1, V2);
}
See Also: TVec::Kron
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler
Overload 2: TMtx *Kron(TMtx *SrcMtx1, TMtx *SrcMtx2);
The Kronecker product between two matrices.
Remarks:
Calculates the Kronecker product between SrcMtx1 and SrcMtx2 and stores the result in the calling matrix. The TMtx::Rows, TMtx::Cols and TMtx::Complex properties of calling matrix are set automatically.
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler