This is the basic C++ program of C++ armadillo library which shows how to get the element of matrix which are non finite numbers. It can be carried out by the help of inbuilt function "find_nonfinite"in armadillo library. It takes one parameter i.e input matrix name.
Return a column vector containing the indices of elements of X that are non-finite (ie. ±Inf or NaN)
The output vector must have the type uvec (ie. the indices are stored as unsigned integers of type uword)
X is interpreted as a vector, with column-by-column ordering of the elements of X
Comments