27 eT max_val = priv::most_neg<eT>();
31 for(i=0, j=1; j<n_elem; i+=2, j+=2)
70 eT max_val = priv::most_neg<eT>();
76 for(i=0, j=1; j<n_elem; i+=2, j+=2)
106 index_of_max_val = best_index;
113 template<
typename eT>
122 eT max_val = priv::most_neg<eT>();
124 for(
uword col=0; col<X_n_cols; ++col)
126 const eT tmp_val = X.
at(row,col);
128 if(tmp_val > max_val)
139 template<
typename eT>
148 eT max_val = priv::most_neg<eT>();
150 for(
uword i=0; i<X_n_elem; ++i)
154 if(tmp_val > max_val)
165 template<
typename eT>
174 eT max_val = priv::most_neg<eT>();
176 for(
uword i=0; i<X_n_elem; ++i)
180 if(tmp_val > max_val)
195 template<
typename T1>
202 typedef typename T1::elem_type eT;
221 eT* out_mem = out.
memptr();
223 for(
uword col=0; col<X_n_cols; ++col)
233 arma_debug_check( (X_n_cols == 0),
"max(): given object has zero columns" );
237 eT* out_mem = out.
memptr();
239 for(
uword row=0; row<X_n_rows; ++row)
256 T max_val = priv::most_neg<T>();
258 for(
uword i=0; i<n_elem; ++i)
262 if(tmp_val > max_val)
282 T max_val = priv::most_neg<T>();
284 for(
uword i=0; i<n_elem; ++i)
288 if(tmp_val > max_val)
295 index_of_max_val = index;
309 const uword X_n_cols = X.n_cols;
312 T max_val = priv::most_neg<T>();
314 for(
uword col=0; col<X_n_cols; ++col)
316 const T tmp_val =
std::abs(X.at(row,col));
318 if(tmp_val > max_val)
325 return X.at(row,index);
337 const uword X_n_elem = X.n_elem;
340 T max_val = priv::most_neg<T>();
342 for(
uword i=0; i<X_n_elem; ++i)
346 if(tmp_val > max_val)
365 const uword X_n_elem = X.n_elem;
368 T max_val = priv::most_neg<T>();
370 for(
uword i=0; i<X_n_elem; ++i)
374 if(tmp_val > max_val)
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
void set_size(const uword in_elem)
change the matrix to have user specified dimensions (data is not preserved)
static void apply(Mat< typename T1::elem_type > &out, const Op< T1, op_max > &in)
For each row or for each column, find the maximum value. The result is stored in a dense matrix that ...
const uword n_cols
number of columns in the matrix (read-only)
const uword n_rows
number of rows in the matrix (read-only)
#define arma_extra_debug_print
arma_aligned const T1 & m
storage of reference to the operand (eg. a matrix)
arma_inline arma_warn_unused eT * colptr(const uword in_col)
returns a pointer to array of eTs for a specified column; no bounds check
arma_inline arma_warn_unused eT & at(const uword i)
linear element accessor (treats the matrix as a vector); no bounds check.
arma_inline const eOp< T1, eop_abs > abs(const Base< typename T1::elem_type, T1 > &X, const typename arma_not_cx< typename T1::elem_type >::result *junk=0)
#define arma_extra_debug_sigprint
static eT direct_max(const eT *const X, const uword N)
Class for storing data required to extract and set the diagonals of a matrix.
arma_aligned uword aux_uword_a
storage of auxiliary data, uword format