TMtx::RowExchange Method

TMtx *RowExchange(int i, int j);

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 "MtxVec.h"
#include "Units.MtxVec.h"

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

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

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