max@0: // Copyright (C) 2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2011 Conrad Sanderson max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: //! \addtogroup arrayops max@0: //! @{ max@0: max@0: max@0: class arrayops max@0: { max@0: public: max@0: max@0: template max@0: arma_hot arma_inline static void max@0: copy(eT* dest, const eT* src, const uword n_elem); max@0: max@0: max@0: template max@0: static inline void max@0: copy_big(eT* dest, const eT* src, const uword n_elem); max@0: max@0: max@0: // max@0: // array = convert(array) max@0: max@0: template max@0: arma_hot arma_inline static void max@0: convert_cx_scalar(out_eT& out, const in_eT& in, const typename arma_not_cx::result* junk1 = 0, const typename arma_not_cx< in_eT>::result* junk2 = 0); max@0: max@0: template max@0: arma_hot arma_inline static void max@0: convert_cx_scalar(out_eT& out, const std::complex& in, const typename arma_not_cx::result* junk = 0); max@0: max@0: template max@0: arma_hot arma_inline static void max@0: convert_cx_scalar(std::complex& out, const std::complex< in_T>& in); max@0: max@0: template max@0: arma_hot inline static void max@0: convert(out_eT* dest, const in_eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static void max@0: convert_cx(out_eT* dest, const in_eT* src, const uword n_elem); max@0: max@0: max@0: // max@0: // array op= array max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_plus(eT* dest, const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_minus(eT* dest, const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_mul(eT* dest, const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_div(eT* dest, const eT* src, const uword n_elem); max@0: max@0: max@0: // max@0: // array op= scalar max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_set(eT* dest, const eT val, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_plus(eT* dest, const eT val, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_minus(eT* dest, const eT val, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static void max@0: inplace_mul(eT* dest, const eT val, const uword n_elem); max@0: max@0: template max@0: arma_hot inline static max@0: void max@0: inplace_div(eT* dest, const eT val, const uword n_elem); max@0: max@0: max@0: // max@0: // scalar = op(array) max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: eT max@0: accumulate(const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: eT max@0: product(const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: bool max@0: is_finite(const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: typename get_pod_type::result max@0: norm_1(const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: eT max@0: norm_2(const eT* src, const uword n_elem, const typename arma_not_cx::result* junk = 0); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: T max@0: norm_2(const std::complex* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: typename get_pod_type::result max@0: norm_k(const eT* src, const uword n_elem, const int k); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: typename get_pod_type::result max@0: norm_max(const eT* src, const uword n_elem); max@0: max@0: template max@0: arma_hot arma_pure inline static max@0: typename get_pod_type::result max@0: norm_min(const eT* src, const uword n_elem); max@0: max@0: }; max@0: max@0: max@0: max@0: //! @}