TSparseMtx::Copy Method

Overload List

#SignatureDescription
1TMtxVec *Copy(TMtxVec *Src);Copy object values.
2TMtxVec *Copy(TMtxVec *Src, const TMtxFloatPrecision dstFloatPrecision);Copy object values.
3TMtxVec *Copy(TMtxVec *Vec, int VecIndex, int Index, int Len);Copy Vec elements [VecIndex]..[VecIndex+Len-1] in the calling object elements [Index]..[Index+Len-1].
4virtual TMtxVec *Copy(TMtxVecInt *Src, const TMtxFloatPrecision dstFloatPrecision);Copy and convert values from TVecInt.
5TMtxVec *Copy(TMtxVecInt *Src, int SrcIndex, int Index, int Len);Copy and convert values from TVecInt at indexes [SrcIndex]...[SrcIndex+Len-1].
6void Copy(TMtxVec *Src, TMtxVec *Dst, const int SrcIdx, const int DstIdx, const int Len);
7void Copy(TSparseMtx *Src, bool StripZeros = false);Copies sparse matrix from Src to the calling object.

Overload 1: TMtxVec *Copy(TMtxVec *Src);

Copy object values.

#NameTypeDescription
1SrcTMtxVec *
Remarks:

Copy each of Vec elements to the calling object. Size and TSparseMtx::Complex properties of the calling object are set implicitly to match Vec object.

Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TVec *a, *b, *c;
    CreateIt(a, b, c);
    a->SetIt(true,DewArray<double>{1,2,3,4});  // a = [1,2,3,4] i.e 1+2i ; 3+4i
    b->Copy(a);                // b = [1,2,3,4]
    c->Copy(a,b);  //concatenate a and b and store in c = [1,2,3,4,1,2,3,4]
    FreeIt(a,b,c);
}
#include "Math387.h"
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Vector a;
    Vector x;
    x.SetIt(DewArray<double>{ 1.0, 2.0, 3.0, 4.0 });
    a.Copy(x);
    if (!a.IsEqual(x, 1e-10, TCompare::cmpAbsolute))
        throw tException("Vector.Copy: mismatch");
}
See Also: TSparseMtx::Assign
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 2: TMtxVec *Copy(TMtxVec *Src, const TMtxFloatPrecision dstFloatPrecision);

Copy object values.

#NameTypeDescription
1SrcTMtxVec *
2dstFloatPrecisionconst TMtxFloatPrecision
Remarks:

Copy each of Vec elements to the calling object. Size and TSparseMtx::Complex properties of the calling object are set implicitly to match Vec object.

Examples
#include "Math387.h"
#include "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TVec *a, *b, *c;
    CreateIt(a, b, c);
    a->SetIt(true, DewArray<double>{1, 2, 3, 4});  // a = [1,2,3,4] i.e 1+2i ; 3+4i
    b->Copy(a, TMtxFloatPrecision::mvSingleComplex);                // convert to single precision
    FreeIt(a, b, c);
}
See Also: TSparseMtx::Assign
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 3: TMtxVec *Copy(TMtxVec *Vec, int VecIndex, int Index, int Len);

Copy Vec elements [VecIndex]..[VecIndex+Len-1] in the calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVec *
2VecIndexint
3Indexint
4Lenint
Remarks:

Size and TSparseMtx::Complex properties must be set explicitly. An exception is raised if TSparseMtx::ConditionCheck is True and array borders are overrun or underrun.

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 4: virtual TMtxVec *Copy(TMtxVecInt *Src, const TMtxFloatPrecision dstFloatPrecision);

Copy and convert values from TVecInt.

#NameTypeDescription
1SrcTMtxVecInt *
2dstFloatPrecisionconst TMtxFloatPrecision
Remarks:

Applies appropriate conversion and copy data from TVecInt. The destinaton data format is determined with dstFloatPrecision.

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 5: TMtxVec *Copy(TMtxVecInt *Src, int SrcIndex, int Index, int Len);

Copy and convert values from TVecInt at indexes [SrcIndex]...[SrcIndex+Len-1].

#NameTypeDescription
1SrcTMtxVecInt *
2SrcIndexint
3Indexint
4Lenint
Remarks:

Applies appropriate conversion and copy data from TVecInt. The results are stored in calling object elements [Index]...[Index+Len-1]. Size and TSparseMtx::Complex properties of the calling object must be set explicitly. An exception is raised if array borders are overrun.

Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 6: void Copy(TMtxVec *Src, TMtxVec *Dst, const int SrcIdx, const int DstIdx, const int Len);

#NameTypeDescription
1SrcTMtxVec *
2DstTMtxVec *
3SrcIdxconst int
4DstIdxconst int
5Lenconst int
Declared in Dew::Math::TMtxVec · Dew.Math/AbstractMtxVec.h · Cross-compiler

Overload 7: void Copy(TSparseMtx *Src, bool StripZeros = false);

Copies sparse matrix from Src to the calling object.

#NameTypeDescription
1SrcTSparseMtx *
2StripZeros = falsebool
Declared in Dew::Math::TSparseMtx · Dew.Math/sparse.h · Cross-compiler