MatrixInt::RowExchange Method

TMtxInt *RowExchange(int i, int j) const;

Exchanges two matrix Rows.

#NameTypeDescription
1iint
2jint
Remarks:

Exchange the i-th and j-th Rows of the calling matrix in-place. An exception is raised if matrix bounds are overrun. The indexes i and j are zero based. (the first row has index 0).

Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"

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

void Example()
{
    TMtxInt *A, *B;

    CreateIt(A, B);
    A->SetIt(2, 2, DewArray<int>{1, 3,
        2, 4});
    A->RowExchange(0, 1);
    // A becomes:
    // [2,4,
    //  1,3]);
    FreeIt(A, B);
}
See Also: MatrixInt::ColExchange
Declared in Dew::Math::MatrixInt · Dew.Math/MtxExprInt.h · Cross-compiler