inline const mtOpCube<typename T1::pod_type, T1, op_abs> abs(const BaseCube< std::complex<typename T1::pod_type>,T1>& X, const typename arma_cx_only<typename T1::elem_type>::result* junk = 0) { arma_extra_debug_sigprint(); arma_ignore(junk); return mtOpCube<typename T1::pod_type, T1, op_abs>( X.get_ref() ); }
inline const GenCube<typename T1::pod_type, gen_zeros> imag(const BaseCube<typename T1::pod_type,T1>& X) { arma_extra_debug_sigprint(); const ProxyCube<T1> A(X.get_ref()); return GenCube<typename T1::pod_type, gen_zeros>(A.get_n_rows(), A.get_n_cols(), A.get_n_slices()); }
arma_inline const eOpCube<T1, eop_abs> abs(const BaseCube<typename T1::elem_type,T1>& X, const typename arma_not_cx<typename T1::elem_type>::result* junk = 0) { arma_extra_debug_sigprint(); arma_ignore(junk); return eOpCube<T1, eop_abs>(X.get_ref()); }
inline const OpCube<T1, op_reshape_ext> reshape(const BaseCube<typename T1::elem_type,T1>& X, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices, const uword dim = 0) { arma_extra_debug_sigprint(); arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); return OpCube<T1, op_reshape_ext>(X.get_ref(), in_n_rows, in_n_cols, in_n_slices, dim, 'j'); }
arma_inline const eOpCube<T1, eop_pow> pow(const BaseCube<typename T1::elem_type,T1>& A, const typename T1::elem_type::value_type exponent) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; return eOpCube<T1, eop_pow>(A.get_ref(), eT(exponent)); }
inline const mtGlueCube<typename promote_type<typename T1::elem_type, typename T2::elem_type>::result, T1, T2, glue_mixed_plus> operator+ ( const BaseCube< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T1_result, T1>& X, const BaseCube< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T2_result, T2>& Y ) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT1; typedef typename T2::elem_type eT2; typedef typename promote_type<eT1,eT2>::result out_eT; promote_type<eT1,eT2>::check(); return mtGlueCube<out_eT, T1, T2, glue_mixed_plus>( X.get_ref(), Y.get_ref() ); }
arma_hot arma_warn_unused inline typename T1::elem_type accu(const BaseCube<typename T1::elem_type,T1>& X) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename ProxyCube<T1>::ea_type ea_type; const ProxyCube<T1> A(X.get_ref()); if(ProxyCube<T1>::prefer_at_accessor == false) { ea_type P = A.get_ea(); const uword n_elem = A.get_n_elem(); eT val1 = eT(0); eT val2 = eT(0); uword i,j; for(i=0, j=1; j<n_elem; i+=2, j+=2) { val1 += P[i]; val2 += P[j]; } if(i < n_elem) { val1 += P[i]; } return val1 + val2; } else { const uword n_rows = A.get_n_rows(); const uword n_cols = A.get_n_cols(); const uword n_slices = A.get_n_slices(); eT val = eT(0); for(uword slice=0; slice<n_slices; ++slice) for(uword col=0; col<n_cols; ++col) for(uword row=0; row<n_rows; ++row) { val += A.at(row,col,slice); } return val; } }
arma_warn_unused inline uword size(const BaseCube<typename T1::elem_type, T1>& X, const uword dim) { arma_extra_debug_sigprint(); const ProxyCube<T1> P(X.get_ref()); return SizeCube( P.get_n_rows(), P.get_n_cols(), P.get_n_slices() )( dim ); }
arma_inline const eOpCube<T1, eop_neg> operator- ( const BaseCube<typename T1::elem_type,T1>& X ) { arma_extra_debug_sigprint(); return eOpCube<T1, eop_neg>(X.get_ref()); }
arma_inline const eOpCube<T1, eop_scalar_times> operator* ( const typename T1::elem_type k, const BaseCube<typename T1::elem_type,T1>& X ) { arma_extra_debug_sigprint(); return eOpCube<T1, eop_scalar_times>(X.get_ref(), k); }
arma_inline const eOpCube<T1, eop_scalar_minus_post> operator- ( const BaseCube<typename T1::elem_type,T1>& X, const typename T1::elem_type k ) { arma_extra_debug_sigprint(); return eOpCube<T1, eop_scalar_minus_post>(X.get_ref(), k); }
arma_inline const OpCube<T1, op_min> min ( const BaseCube<typename T1::elem_type, T1>& X, const uword dim = 0 ) { arma_extra_debug_sigprint(); return OpCube<T1, op_min>(X.get_ref(), dim, 0); }
arma_warn_unused arma_inline const mtOpCube<uword, T1, op_index_max> index_max ( const BaseCube<typename T1::elem_type, T1>& X, const uword dim = 0 ) { arma_extra_debug_sigprint(); return mtOpCube<uword, T1, op_index_max>(X.get_ref(), dim, 0, 0); }
inline arma_warn_unused bool is_finite(const BaseCube<typename T1::elem_type,T1>& X) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_cube<T1> tmp(X.get_ref()); const Cube<eT>& A = tmp.M; return A.is_finite(); }
inline uvec find(const BaseCube<typename T1::elem_type,T1>& X, const uword k, const char* direction = "first") { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_cube<T1> tmp(X.get_ref()); const Mat<eT> R( const_cast< eT* >(tmp.M.memptr()), tmp.M.n_elem, 1, false ); return find(R, k, direction); }
inline uvec find_nonfinite(const BaseCube<typename T1::elem_type,T1>& X) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; const unwrap_cube<T1> tmp(X.get_ref()); const Mat<eT> R( const_cast< eT* >(tmp.M.memptr()), tmp.M.n_elem, 1, false ); return find_nonfinite(R); }
inline void op_vectorise_cube_col::apply(Mat<typename T1::elem_type>& out, const BaseCube<typename T1::elem_type, T1>& in) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; if(is_same_type< T1, subview_cube<eT> >::yes) { op_vectorise_cube_col::apply_subview(out, reinterpret_cast< const subview_cube<eT>& >(in.get_ref())); } else { const ProxyCube<T1> P(in.get_ref()); op_vectorise_cube_col::apply_proxy(out, P); } }
arma_inline const eOpCube<T1, eop_factln> factln(const BaseCube<typename T1::elem_type,T1>& A) { arma_extra_debug_sigprint(); return eOpCube<T1, eop_factln>(A.get_ref()); }
inline typename arma_cx_only<typename T1::elem_type>::result op_min::min(const BaseCube<typename T1::elem_type,T1>& X) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; typedef typename get_pod_type<eT>::result T; const ProxyCube<T1> P(X.get_ref()); const uword n_elem = P.get_n_elem(); if(n_elem == 0) { arma_debug_check(true, "min(): object has no elements"); return Datum<eT>::nan; } T min_val = priv::most_pos<T>(); if(ProxyCube<T1>::use_at == false) { typedef typename ProxyCube<T1>::ea_type ea_type; ea_type A = P.get_ea(); uword index = 0; for(uword i=0; i<n_elem; ++i) { const T tmp = std::abs(A[i]); if(tmp < min_val) { min_val = tmp; index = i; } } return( A[index] ); } else { const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); const uword n_slices = P.get_n_slices(); eT min_val_orig = eT(0); for(uword slice=0; slice < n_slices; ++slice) for(uword col=0; col < n_cols; ++col ) for(uword row=0; row < n_rows; ++row ) { const eT tmp_orig = P.at(row,col,slice); const T tmp = std::abs(tmp_orig); if(tmp < min_val) { min_val = tmp; min_val_orig = tmp_orig; } } return min_val_orig; } }
inline typename arma_not_cx<typename T1::elem_type>::result op_min::min(const BaseCube<typename T1::elem_type,T1>& X) { arma_extra_debug_sigprint(); typedef typename T1::elem_type eT; const ProxyCube<T1> P(X.get_ref()); const uword n_elem = P.get_n_elem(); if(n_elem == 0) { arma_debug_check(true, "min(): object has no elements"); return Datum<eT>::nan; } eT min_val = priv::most_pos<eT>(); if(ProxyCube<T1>::use_at == false) { typedef typename ProxyCube<T1>::ea_type ea_type; ea_type A = P.get_ea(); uword i,j; for(i=0, j=1; j<n_elem; i+=2, j+=2) { const eT tmp_i = A[i]; const eT tmp_j = A[j]; if(tmp_i < min_val) { min_val = tmp_i; } if(tmp_j < min_val) { min_val = tmp_j; } } if(i < n_elem) { const eT tmp_i = A[i]; if(tmp_i < min_val) { min_val = tmp_i; } } } else { const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); const uword n_slices = P.get_n_slices(); for(uword slice=0; slice < n_slices; ++slice) for(uword col=0; col < n_cols; ++col ) for(uword row=0; row < n_rows; ++row ) { const eT tmp = P.at(row,col,slice); if(tmp < min_val) { min_val = tmp; } } } return min_val; }
OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const typename T1::elem_type in_aux) : m(in_m.get_ref()) , aux(in_aux) { arma_extra_debug_sigprint(); }
eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m) : P (in_m.get_ref()) { arma_extra_debug_sigprint(); }
arma_inline const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_plus> operator+ ( const std::complex<typename T1::pod_type>& k, const BaseCube<typename T1::pod_type, T1>& X ) { arma_extra_debug_sigprint(); return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_plus>('j', X.get_ref(), k); // NOTE: order is swapped }
arma_inline const mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times> operator* ( const std::complex<typename T1::pod_type>& k, const BaseCube<typename T1::pod_type, T1>& X ) { arma_extra_debug_sigprint(); return mtOpCube<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_times>('j', X.get_ref(), k); }
arma_inline const eOpCube<T1, eop_log_approx> log_approx(const BaseCube<typename T1::elem_type,T1>& A) { arma_extra_debug_sigprint(); return eOpCube<T1, eop_log_approx>(A.get_ref()); }