Overload List
| # | Signature | Description |
|---|---|---|
| 1 | bool Equal(TMtx *Mtx, double Tolerance = 0); | Compares two matrices. |
| 2 | bool Equal(TMtx *Mtx, double Tolerance, TCompare Compare); | Allows to specify the comparison method via the Compare parameter. |
Overload 1: bool Equal(TMtx *Mtx, double Tolerance = 0);
Compares two matrices.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Mtx | TMtx * | |
| 2 | Tolerance = 0 | double |
Remarks:
Compares Mtx with the calling matrix and returns true if the matrices are equal (if all elements match in position and value). Tolerance defines the comparison tolerance. The maximum difference between elements may not exceed: +/-Tolerance. If Tolerance is omitted, a direct comparison algorithm is used.
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;
bool c;
CreateIt(A, B);
A->SetIt(2, 2, false, DewArray<double>{1, 2, 2, 4}); // 2x2, real matrix
B->SetIt(2, 2, false, DewArray<double>{1, 2, 2, 4}); // 2x2, real matrix
c = A->Equal(B, 1e-8); // Check for differences bigger than 0.00000001
c = A->Equal(B); // Check for an exact match
FreeIt(A, B);
}
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler