Matrix::RowExchange Method

TMtx *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 "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix 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]);
}
See Also: Matrix::ColExchange
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler