- HasNan
- Transpose
- TransposeConjugate
- TriL
- TriU
- Diag
- Row
- Col
- Copy
- Concat
- Compare
- CompareByDigits
- CompareEqual
- Flat
- Clip
- Reshape
- Resize
- Set
- SwapRows
- SwapCols
- Split
- Hsplit
- Vsplit
- ArgSort
- Sort
CompareByDigits
Compare the elements of two matrices/vectors with the significant digits precision.
ulong vector::CompareByDigits(
|
Parameters
vec
[in] Vector to compare.
mat
[in] Matrix to compare.
digits
[in] Number of significant digits to compare.
Return Value
The number of mismatched elements of the matrices or vectors being compared: 0 if the matrices are equal, greater than 0 otherwise.
Note
The comparison operators == or != execute an exact element-wise comparison. It is known that the exact comparison of real numbers is of limited use, so the epsilon comparison method was added. It may happen that one matrix can contain elements in a range, for example from 1e-20 to 1e+20. Such matrices can be processed using element-wise comparison up to significant digits.
Example
int size_m=128;
|