Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TMtx *Kron(TVec *Vec1, TVec *Vec2) const; | The Kronecker product between two vectors. |
| 2 | TMtx *Kron(TMtx *Mtx1, TMtx *Mtx2) const; |
Overload 1: TMtx *Kron(TVec *Vec1, TVec *Vec2) const;
The Kronecker product between two vectors.
Remarks:
Calculates the Kronecker product between Vec1 and Vec2 and stores the result in the calling matrix. The Matrix::Rows, Matrix::Cols and Matrix::Complex properties of calling matrix are set automatically.
Examples
#include "MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
Matrix A;
Vector 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]
}
See Also: Vector::Kron
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler
Overload 2: TMtx *Kron(TMtx *Mtx1, TMtx *Mtx2) const;
Examples
#include "MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
Matrix A;
Vector V1, V2;
V1 = {1, 2, 3};
V2 = {4, 5, 6};
A.Kron(V1, V2);
// A becomes:
// [4 5 6]
// [8 10 12]
// [12 15 18]
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler