GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
find.cc File Reference
#include "quit.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "ovl.h"
Include dependency graph for find.cc:

Go to the source code of this file.

Macros

#define DO_INT_BRANCH(INTT)
 

Functions

OCTAVE_EXPORT octave_value_list Ffind (const octave_value_list &args, int nargout) j]
 
template<typename T >
octave_value_list find_nonzero_elem_idx (const Array< T > &nda, int nargout, octave_idx_type n_to_find, int direction)
 
template<typename T >
octave_value_list find_nonzero_elem_idx (const Sparse< T > &v, int nargout, octave_idx_type n_to_find, int direction)
 
octave_value_list find_nonzero_elem_idx (const PermMatrix &v, int nargout, octave_idx_type n_to_find, int direction)
 

Variables

nd group nd example If two inputs are ar {n} indicates the maximum number of elements to find from the beginning of the matrix or vector. If three inputs are given
 
 b = sparse (i, j, v, sz(1), sz(2))
 
 esult {} j = [ 1
 
nd group nd example Note that this function is particularly useful for sparse as it extracts the nonzero elements as which can then be used to create the original matrix For example
 
nd group nd example If two inputs are given
 
nd group nd example If two inputs are requesting only the first or last respectively However
 
nd group nd example Note that this function is particularly useful for sparse matrices
 
nd group nd example If two inputs are requesting only the first or last respectively the indices are always returned in ascending order If two outputs are ode {find} returns the row and column indices of nonzero elements of a matrix. For example: xample roup [i, j] = find (2 * eye (2)) esult{} i = [ 1
 
nd group nd example If two inputs are requesting only the first or last respectively the indices are always returned in ascending order If two outputs are requested
 
nd group nd example Note that this function is particularly useful for sparse as it extracts the nonzero elements as vectors
 

Macro Definition Documentation

◆ DO_INT_BRANCH

#define DO_INT_BRANCH (   INTT)
Value:
else if (arg.is_ ## INTT ## _type ()) \
{ \
INTT ## NDArray v = arg.INTT ## _array_value (); \
\
retval = find_nonzero_elem_idx (v, nargout, n_to_find, direction); \
}
octave_value_list find_nonzero_elem_idx(const Array< T > &nda, int nargout, octave_idx_type n_to_find, int direction)
Definition: find.cc:40
octave_value arg
Definition: pr-output.cc:3244
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997

Function Documentation

◆ Ffind()

OCTAVE_EXPORT octave_value_list Ffind ( const octave_value_list args,
int  nargout 
)

◆ find_nonzero_elem_idx() [1/3]

template<typename T >
octave_value_list find_nonzero_elem_idx ( const Array< T > &  nda,
int  nargout,
octave_idx_type  n_to_find,
int  direction 
)

◆ find_nonzero_elem_idx() [2/3]

template<typename T >
octave_value_list find_nonzero_elem_idx ( const Sparse< T > &  v,
int  nargout,
octave_idx_type  n_to_find,
int  direction 
)

◆ find_nonzero_elem_idx() [3/3]

octave_value_list find_nonzero_elem_idx ( const PermMatrix v,
int  nargout,
octave_idx_type  n_to_find,
int  direction 
)

Variable Documentation

◆ ar

nd group nd example If two inputs are requesting only the first or last ar {n} indicates the maximum number of elements to find from the beginning of the matrix or vector. If three inputs are given

Definition at line 388 of file find.cc.

◆ b

b = sparse (i, j, v, sz(1), sz(2))

Definition at line 388 of file find.cc.

◆ esult

esult {} j = [ 1

Definition at line 388 of file find.cc.

◆ example

nd group nd example Note that this function is particularly useful for sparse as it extracts the nonzero elements as which can then be used to create the original matrix For example

Definition at line 388 of file find.cc.

◆ given

nd group nd example If two inputs are given

Definition at line 388 of file find.cc.

◆ However

nd group nd example If two inputs are requesting only the first or last respectively However

Definition at line 388 of file find.cc.

◆ matrices

nd group nd example Note that this function is particularly useful for sparse matrices

Definition at line 388 of file find.cc.

◆ ode

nd group nd example If three outputs are ode {find} returns the row and column indices of nonzero elements of a matrix. For example: xample roup [i, j] = find (2 * eye (2)) esult{} i = [ 1

Definition at line 388 of file find.cc.

◆ requested

nd group nd example If three outputs are requested

Definition at line 388 of file find.cc.

Referenced by octave_nanosleep_wrapper().

◆ vectors

nd group nd example Note that this function is particularly useful for sparse as it extracts the nonzero elements as vectors

Definition at line 388 of file find.cc.