123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
- // Copyright 2008-2016 National ICT Australia (NICTA)
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- // ------------------------------------------------------------------------
- //! \addtogroup arrayops
- //! @{
- class arrayops
- {
- public:
-
- template<typename eT>
- arma_hot arma_inline static void
- copy(eT* dest, const eT* src, const uword n_elem);
-
-
- template<typename eT>
- arma_cold inline static void
- copy_small(eT* dest, const eT* src, const uword n_elem);
-
-
- template<typename eT>
- inline static void
- fill_zeros(eT* dest, const uword n_elem);
-
-
- template<typename eT>
- arma_hot inline static void
- replace(eT* mem, const uword n_elem, const eT old_val, const eT new_val);
-
-
- template<typename eT>
- arma_hot inline static void
- clean(eT* mem, const uword n_elem, const eT abs_limit, const typename arma_not_cx<eT>::result* junk = 0);
-
-
- template<typename T>
- arma_hot inline static void
- clean(std::complex<T>* mem, const uword n_elem, const T abs_limit);
-
-
- //
- // array = convert(array)
-
- template<typename out_eT, typename in_eT>
- arma_hot arma_inline static void
- convert_cx_scalar(out_eT& out, const in_eT& in, const typename arma_not_cx<out_eT>::result* junk1 = 0, const typename arma_not_cx< in_eT>::result* junk2 = 0);
-
- template<typename out_eT, typename in_T>
- arma_hot arma_inline static void
- convert_cx_scalar(out_eT& out, const std::complex<in_T>& in, const typename arma_not_cx<out_eT>::result* junk = 0);
-
- template<typename out_T, typename in_T>
- arma_hot arma_inline static void
- convert_cx_scalar(std::complex<out_T>& out, const std::complex< in_T>& in);
-
- template<typename out_eT, typename in_eT>
- arma_hot inline static void
- convert(out_eT* dest, const in_eT* src, const uword n_elem);
-
- template<typename out_eT, typename in_eT>
- arma_hot inline static void
- convert_cx(out_eT* dest, const in_eT* src, const uword n_elem);
-
-
- //
- // array op= array
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_plus(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_minus(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_mul(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_div(eT* dest, const eT* src, const uword n_elem);
-
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_plus_base(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_minus_base(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_mul_base(eT* dest, const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_div_base(eT* dest, const eT* src, const uword n_elem);
-
-
- //
- // array op= scalar
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_set(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_set_simple(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_set_base(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_cold inline static
- void
- inplace_set_small(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT, const uword n_elem>
- arma_hot inline static
- void
- inplace_set_fixed(eT* dest, const eT val);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_plus(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_minus(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static void
- inplace_mul(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_div(eT* dest, const eT val, const uword n_elem);
-
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_plus_base(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_minus_base(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static void
- inplace_mul_base(eT* dest, const eT val, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- void
- inplace_div_base(eT* dest, const eT val, const uword n_elem);
-
-
- //
- // scalar = op(array)
-
- template<typename eT>
- arma_hot inline static
- eT
- accumulate(const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- eT
- product(const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- bool
- is_zero(const eT* mem, const uword n_elem, const eT abs_limit, const typename arma_not_cx<eT>::result* junk = 0);
-
- template<typename T>
- arma_hot inline static
- bool
- is_zero(const std::complex<T>* mem, const uword n_elem, const T abs_limit);
-
- template<typename eT>
- arma_hot inline static
- bool
- is_finite(const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- bool
- has_inf(const eT* src, const uword n_elem);
-
- template<typename eT>
- arma_hot inline static
- bool
- has_nan(const eT* src, const uword n_elem);
- };
- //! @}
|