MatrixInt::SetVal Method

Overload List

#SignatureDescription
1TMtxInt *SetVal(const int Value) const;Set all calling object elements to Value.
2TMtxVecInt *SetVal(const int Value, const int Index, const int Len) const;Set calling object elements [Index]..[Index+Len-1] to Value.
3TMtxInt *SetVal(const int Value, int Row, int Col, int ToRow, int ToCol) const;Initializes matrix values to Value.

Overload 1: TMtxInt *SetVal(const int Value) const;

Set all calling object elements to Value.

#NameTypeDescription
1Valueconst int
Examples
#include "MtxExprInt.h"
#include "Units.MtxExprInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExprInt;

void Example()
{
    MatrixInt a;

    a = {{1, 2}, {3, 4}};
    a.SetVal(5, 2, 2); // a = [1,1,5,5]
}
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 2: TMtxVecInt *SetVal(const int Value, const int Index, const int Len) const;

Set calling object elements [Index]..[Index+Len-1] to Value.

#NameTypeDescription
1Valueconst int
2Indexconst int
3Lenconst int
Remarks:

An exception is raised if array borders are overrun/underrun.

Examples
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TMtxInt* a;
    CreateIt(a);
    a->SetIt(2,2,DewArray<int>{1,2,3,4});
    a->SetVal(5,2,2);  // a = [1,1,5,5]
    FreeIt(a);
}
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 3: TMtxInt *SetVal(const int Value, int Row, int Col, int ToRow, int ToCol) const;

Initializes matrix values to Value.

#NameTypeDescription
1Valueconst int
2Rowint
3Colint
4ToRowint
5ToColint
Remarks:

Sets the calling matrix elements [Row,Col]..[ToRow,ToCol] to Value. An exception is raised if TMtxVecBase::ConditionCheck is true and array bounds are overrun.

See Also: MatrixInt::SetIt, MatrixInt::SetZero
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler