TMtx *TensorProd(TVec *MtxCol, TVec *MtxRow);
Calculates the tensor product of two vectors.
Remarks:
Calculates the tensor product of mtxCol and mtxRow vectors and stores the results in the calling matrix. The TMtx::Rows property is set to mtxCol.TMtx::Length and TMtx::Cols property is set to mtxRow.TMtx::Length. The TMtx::Complex property of the calling matrix is adjusted automatically.
Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;
void Example()
{
TVec *mtxCol, *mtxRow;
TMtx* V;
CreateIt(mtxCol, mtxRow);
CreateIt(V);
mtxCol->Size(3);
mtxCol->SetIt(false, DewArray<double>{0, 2, 3});
mtxRow->Copy(mtxCol);
V->TensorProd(mtxCol, mtxRow);
// V becomes:
// [0,0,0]
// [0,4,6]
// [0,6,9]
FreeIt(mtxCol, mtxRow);
FreeIt(V);
}
See Also: TMtx::AddTensorProd
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler