- HasNan
- Transpose
- TriL
- TriU
- Diag
- Row
- Col
- Copy
- Compare
- CompareByDigits
- 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
vector_b
[in] Vector to compare.
digits
[in] Number of significant digits to compare.
epsilon
[in] Comparison precision. If two values differ in absolute value by less than the specified precision, they are considered equal.
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;
|