| Proxy.hpp | | Proxy.hpp | |
|
| // Copyright (C) 2010-2011 NICTA (www.nicta.com.au) | | // Copyright (C) 2010-2012 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2010-2011 Conrad Sanderson | | // Copyright (C) 2010-2012 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr(); | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| } | | | |
| arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X); | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) | |
| | | == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class Proxy< Col<eT> > | | class Proxy< Col<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Col<eT> stored_type; | | typedef Col<eT> stored_type; | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 91 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return 1; } | | arma_inline uword get_n_cols() const { return 1; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr(); | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| } | | | |
| arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X); | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) | |
| | | == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class Proxy< Row<eT> > | | class Proxy< Row<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Row<eT> stored_type; | | typedef Row<eT> stored_type; | |
| | | | |
| skipping to change at line 121 | | skipping to change at line 125 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return 1; } | | arma_inline uword get_n_rows() const { return 1; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr(); | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| } | | | |
| arma_inline bool is_alias(const Mat<eT>& X) const { return (&Q == &X); | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&Q) | |
| | | == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename eT, typename gen_type> | | template<typename eT, typename gen_type> | |
| class Proxy< Gen<eT, gen_type > > | | class Proxy< Gen<eT, gen_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Gen<eT, gen_type> stored_type; | | typedef Gen<eT, gen_type> stored_type; | |
| | | | |
| skipping to change at line 153 | | skipping to change at line 159 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols; } | | arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Mat<elem_type>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename op_type> | | template<typename T1, typename op_type> | |
| class Proxy< Op<T1, op_type> > | | class Proxy< Op<T1, op_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Mat<elem_type> stored_type; | | typedef Mat<elem_type> stored_type; | |
| | | | |
| skipping to change at line 185 | | skipping to change at line 193 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memp | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| tr(); } | | | |
| arma_inline bool is_alias(const Mat<elem_type>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename T2, typename glue_type> | | template<typename T1, typename T2, typename glue_type> | |
| class Proxy< Glue<T1, T2, glue_type> > | | class Proxy< Glue<T1, T2, glue_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Mat<elem_type> stored_type; | | typedef Mat<elem_type> stored_type; | |
| | | | |
| skipping to change at line 217 | | skipping to change at line 227 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memp | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| tr(); } | | | |
| arma_inline bool is_alias(const Mat<elem_type>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class Proxy< subview<eT> > | | class Proxy< subview<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef subview<eT> stored_type; | | typedef subview<eT> stored_type; | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 261 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Mat<eT>& X) const { return (&(Q.m) == | | template<typename eT2> | |
| &X); } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q | |
| | | .m)) == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename eT, typename T1> | | template<typename eT, typename T1> | |
| class Proxy< subview_elem1<eT,T1> > | | class Proxy< subview_elem1<eT,T1> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Mat<eT> stored_type; | | typedef Mat<eT> stored_type; | |
| | | | |
| skipping to change at line 281 | | skipping to change at line 295 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return 1; } | | arma_inline uword get_n_cols() const { return 1; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr(); } | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| arma_inline bool is_alias(const Mat<eT>&) const { return false; } | | | |
| | | template<typename eT2> | |
| | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class Proxy< diagview<eT> > | | class Proxy< diagview<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef diagview<eT> stored_type; | | typedef diagview<eT> stored_type; | |
| | | | |
| skipping to change at line 313 | | skipping to change at line 329 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return 1; } | | arma_inline uword get_n_cols() const { return 1; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Mat<eT>& X) const { return (&(Q.m) == | | template<typename eT2> | |
| &X); } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (void_ptr(&(Q | |
| | | .m)) == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename eop_type> | | template<typename T1, typename eop_type> | |
| class Proxy< eOp<T1, eop_type > > | | class Proxy< eOp<T1, eop_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef eOp<T1, eop_type> stored_type; | | typedef eOp<T1, eop_type> stored_type; | |
| | | | |
| skipping to change at line 345 | | skipping to change at line 363 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.get_n_rows(); } | | arma_inline uword get_n_rows() const { return Q.get_n_rows(); } | |
| arma_inline uword get_n_cols() const { return Q.get_n_cols(); } | | arma_inline uword get_n_cols() const { return Q.get_n_cols(); } | |
| arma_inline uword get_n_elem() const { return Q.get_n_elem(); } | | arma_inline uword get_n_elem() const { return Q.get_n_elem(); } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Mat<elem_type>& X) const { return Q.P. | | template<typename eT2> | |
| is_alias(X); } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return Q.P.is_alias( | |
| | | X); } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename T2, typename eglue_type> | | template<typename T1, typename T2, typename eglue_type> | |
| class Proxy< eGlue<T1, T2, eglue_type > > | | class Proxy< eGlue<T1, T2, eglue_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef eGlue<T1, T2, eglue_type> stored_type; | | typedef eGlue<T1, T2, eglue_type> stored_type; | |
| | | | |
| skipping to change at line 377 | | skipping to change at line 397 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.get_n_rows(); } | | arma_inline uword get_n_rows() const { return Q.get_n_rows(); } | |
| arma_inline uword get_n_cols() const { return Q.get_n_cols(); } | | arma_inline uword get_n_cols() const { return Q.get_n_cols(); } | |
| arma_inline uword get_n_elem() const { return Q.get_n_elem(); } | | arma_inline uword get_n_elem() const { return Q.get_n_elem(); } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row, col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Mat<elem_type>& X) const { return (Q.P | | template<typename eT2> | |
| 1.is_alias(X) || Q.P2.is_alias(X)); } | | arma_inline bool is_alias(const Mat<eT2>& X) const { return (Q.P1.is_alia | |
| | | s(X) || Q.P2.is_alias(X)); } | |
| }; | | }; | |
| | | | |
| template<typename out_eT, typename T1, typename op_type> | | template<typename out_eT, typename T1, typename op_type> | |
| class Proxy< mtOp<out_eT, T1, op_type> > | | class Proxy< mtOp<out_eT, T1, op_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef out_eT elem_type; | | typedef out_eT elem_type; | |
| typedef typename get_pod_type<out_eT>::result pod_type; | | typedef typename get_pod_type<out_eT>::result pod_type; | |
| typedef Mat<out_eT> stored_type; | | typedef Mat<out_eT> stored_type; | |
| | | | |
| skipping to change at line 409 | | skipping to change at line 431 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row,col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row,col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr( | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| ); } | | | |
| arma_inline bool is_alias(const Mat<out_eT>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename out_eT, typename T1, typename T2, typename glue_type> | | template<typename out_eT, typename T1, typename T2, typename glue_type> | |
| class Proxy< mtGlue<out_eT, T1, T2, glue_type > > | | class Proxy< mtGlue<out_eT, T1, T2, glue_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef out_eT elem_type; | | typedef out_eT elem_type; | |
| typedef typename get_pod_type<out_eT>::result pod_type; | | typedef typename get_pod_type<out_eT>::result pod_type; | |
| typedef Mat<out_eT> stored_type; | | typedef Mat<out_eT> stored_type; | |
| | | | |
| skipping to change at line 441 | | skipping to change at line 465 | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | | arma_inline elem_type operator[] (const uword i) const
{ return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row,col); } | | arma_inline elem_type at (const uword row, const uword col) const
{ return Q.at(row,col); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr( | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| ); } | | | |
| arma_inline bool is_alias(const Mat<out_eT>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Mat<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| //! @} | | //! @} | |
| | | | |
End of changes. 14 change blocks. |
| 52 lines changed or deleted | | 61 lines changed or added | |
|
| ProxyCube.hpp | | ProxyCube.hpp | |
|
| // Copyright (C) 2010-2011 NICTA (www.nicta.com.au) | | // Copyright (C) 2010-2012 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2010-2011 Conrad Sanderson | | // Copyright (C) 2010-2012 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| | | | |
| skipping to change at line 59 | | skipping to change at line 59 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.m | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| emptr(); } | | | |
| arma_inline bool is_alias(const Cube<elem_type>& X) const { return (&Q | | template<typename eT2> | |
| == &X); } | | arma_inline bool is_alias(const Cube<eT2>& X) const { return (void_ptr(&Q | |
| | | ) == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename eT, typename gen_type> | | template<typename eT, typename gen_type> | |
| class ProxyCube< GenCube<eT, gen_type > > | | class ProxyCube< GenCube<eT, gen_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef GenCube<eT, gen_type> stored_type; | | typedef GenCube<eT, gen_type> stored_type; | |
| | | | |
| skipping to change at line 93 | | skipping to change at line 95 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows;
} | | arma_inline uword get_n_rows() const { return Q.n_rows;
} | |
| arma_inline uword get_n_cols() const { return Q.n_cols;
} | | arma_inline uword get_n_cols() const { return Q.n_cols;
} | |
| arma_inline uword get_n_elem_slice() const { return Q.n_rows*Q.n_cols;
} | | arma_inline uword get_n_elem_slice() const { return Q.n_rows*Q.n_cols;
} | |
| arma_inline uword get_n_slices() const { return Q.n_slices;
} | | arma_inline uword get_n_slices() const { return Q.n_slices;
} | |
| arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols*Q.n
_slices; } | | arma_inline uword get_n_elem() const { return Q.n_rows*Q.n_cols*Q.n
_slices; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Cube<elem_type>&) const { return false | | template<typename eT2> | |
| ; } | | arma_inline bool is_alias(const Cube<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename op_type> | | template<typename T1, typename op_type> | |
| class ProxyCube< OpCube<T1, op_type> > | | class ProxyCube< OpCube<T1, op_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Cube<elem_type> stored_type; | | typedef Cube<elem_type> stored_type; | |
| | | | |
| skipping to change at line 127 | | skipping to change at line 131 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.mem | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| ptr(); } | | | |
| arma_inline bool is_alias(const Cube<elem_type>&) const { return false | | template<typename eT2> | |
| ; } | | arma_inline bool is_alias(const Cube<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename T2, typename glue_type> | | template<typename T1, typename T2, typename glue_type> | |
| class ProxyCube< GlueCube<T1, T2, glue_type> > | | class ProxyCube< GlueCube<T1, T2, glue_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef Cube<elem_type> stored_type; | | typedef Cube<elem_type> stored_type; | |
| | | | |
| skipping to change at line 161 | | skipping to change at line 167 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.mem | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| ptr(); } | | | |
| arma_inline bool is_alias(const Cube<elem_type>&) const { return false | | template<typename eT2> | |
| ; } | | arma_inline bool is_alias(const Cube<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class ProxyCube< subview_cube<eT> > | | class ProxyCube< subview_cube<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef eT elem_type; | | typedef eT elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef subview_cube<eT> stored_type; | | typedef subview_cube<eT> stored_type; | |
| | | | |
| skipping to change at line 195 | | skipping to change at line 203 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Cube<elem_type>& X) const { return (&( | | template<typename eT2> | |
| Q.m) == &X); } | | arma_inline bool is_alias(const Cube<eT2>& X) const { return (void_ptr(&( | |
| | | Q.m)) == void_ptr(&X)); } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename eop_type> | | template<typename T1, typename eop_type> | |
| class ProxyCube< eOpCube<T1, eop_type > > | | class ProxyCube< eOpCube<T1, eop_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef eOpCube<T1, eop_type> stored_type; | | typedef eOpCube<T1, eop_type> stored_type; | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 239 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.get_n_rows();
} | | arma_inline uword get_n_rows() const { return Q.get_n_rows();
} | |
| arma_inline uword get_n_cols() const { return Q.get_n_cols();
} | | arma_inline uword get_n_cols() const { return Q.get_n_cols();
} | |
| arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice();
} | | arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice();
} | |
| arma_inline uword get_n_slices() const { return Q.get_n_slices();
} | | arma_inline uword get_n_slices() const { return Q.get_n_slices();
} | |
| arma_inline uword get_n_elem() const { return Q.get_n_elem();
} | | arma_inline uword get_n_elem() const { return Q.get_n_elem();
} | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Cube<elem_type>& X) const { return Q.P | | template<typename eT2> | |
| .is_alias(X); } | | arma_inline bool is_alias(const Cube<eT2>& X) const { return Q.P.is_alias | |
| | | (X); } | |
| }; | | }; | |
| | | | |
| template<typename T1, typename T2, typename eglue_type> | | template<typename T1, typename T2, typename eglue_type> | |
| class ProxyCube< eGlueCube<T1, T2, eglue_type > > | | class ProxyCube< eGlueCube<T1, T2, eglue_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type elem_type; | | typedef typename T1::elem_type elem_type; | |
| typedef typename get_pod_type<elem_type>::result pod_type; | | typedef typename get_pod_type<elem_type>::result pod_type; | |
| typedef eGlueCube<T1, T2, eglue_type> stored_type; | | typedef eGlueCube<T1, T2, eglue_type> stored_type; | |
| | | | |
| skipping to change at line 263 | | skipping to change at line 275 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.get_n_rows();
} | | arma_inline uword get_n_rows() const { return Q.get_n_rows();
} | |
| arma_inline uword get_n_cols() const { return Q.get_n_cols();
} | | arma_inline uword get_n_cols() const { return Q.get_n_cols();
} | |
| arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice();
} | | arma_inline uword get_n_elem_slice() const { return Q.get_n_elem_slice();
} | |
| arma_inline uword get_n_slices() const { return Q.get_n_slices();
} | | arma_inline uword get_n_slices() const { return Q.get_n_slices();
} | |
| arma_inline uword get_n_elem() const { return Q.get_n_elem();
} | | arma_inline uword get_n_elem() const { return Q.get_n_elem();
} | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q; | | arma_inline ea_type get_ea() const { return Q; } | |
| } | | | |
| arma_inline bool is_alias(const Cube<elem_type>& X) const { return (Q. | | template<typename eT2> | |
| P1.is_alias(X) || Q.P2.is_alias(X)); } | | arma_inline bool is_alias(const Cube<eT2>& X) const { return (Q.P1.is_ali | |
| | | as(X) || Q.P2.is_alias(X)); } | |
| }; | | }; | |
| | | | |
| template<typename out_eT, typename T1, typename op_type> | | template<typename out_eT, typename T1, typename op_type> | |
| class ProxyCube< mtOpCube<out_eT, T1, op_type> > | | class ProxyCube< mtOpCube<out_eT, T1, op_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef out_eT elem_type; | | typedef out_eT elem_type; | |
| typedef typename get_pod_type<out_eT>::result pod_type; | | typedef typename get_pod_type<out_eT>::result pod_type; | |
| typedef Cube<out_eT> stored_type; | | typedef Cube<out_eT> stored_type; | |
| | | | |
| skipping to change at line 297 | | skipping to change at line 311 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| (); } | | | |
| arma_inline bool is_alias(const Cube<out_eT>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Cube<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| template<typename out_eT, typename T1, typename T2, typename glue_type> | | template<typename out_eT, typename T1, typename T2, typename glue_type> | |
| class ProxyCube< mtGlueCube<out_eT, T1, T2, glue_type > > | | class ProxyCube< mtGlueCube<out_eT, T1, T2, glue_type > > | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef out_eT elem_type; | | typedef out_eT elem_type; | |
| typedef typename get_pod_type<out_eT>::result pod_type; | | typedef typename get_pod_type<out_eT>::result pod_type; | |
| typedef Cube<out_eT> stored_type; | | typedef Cube<out_eT> stored_type; | |
| | | | |
| skipping to change at line 331 | | skipping to change at line 347 | |
| | | | |
| arma_inline uword get_n_rows() const { return Q.n_rows; } | | arma_inline uword get_n_rows() const { return Q.n_rows; } | |
| arma_inline uword get_n_cols() const { return Q.n_cols; } | | arma_inline uword get_n_cols() const { return Q.n_cols; } | |
| arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | | arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } | |
| arma_inline uword get_n_slices() const { return Q.n_slices; } | | arma_inline uword get_n_slices() const { return Q.n_slices; } | |
| arma_inline uword get_n_elem() const { return Q.n_elem; } | | arma_inline uword get_n_elem() const { return Q.n_elem; } | |
| | | | |
| arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | | arma_inline elem_type operator[] (const uword i)
const { return Q[i]; } | |
| arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | | arma_inline elem_type at (const uword row, const uword col, const
uword slice) const { return Q.at(row, col, slice); } | |
| | | | |
|
| arma_inline ea_type get_ea() const { return Q.memptr | | arma_inline ea_type get_ea() const { return Q.memptr(); } | |
| (); } | | | |
| arma_inline bool is_alias(const Cube<out_eT>&) const { return false; | | template<typename eT2> | |
| } | | arma_inline bool is_alias(const Cube<eT2>&) const { return false; } | |
| }; | | }; | |
| | | | |
| //! @} | | //! @} | |
| | | | |
End of changes. 10 change blocks. |
| 38 lines changed or deleted | | 42 lines changed or added | |
|
| glue_relational_meat.hpp | | glue_relational_meat.hpp | |
|
| // Copyright (C) 2009-2011 NICTA (www.nicta.com.au) | | // Copyright (C) 2009-2012 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2009-2011 Conrad Sanderson | | // Copyright (C) 2009-2012 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| #undef arma_applier_mat | | #undef arma_applier_mat | |
| #undef arma_applier_cube | | #undef arma_applier_cube | |
| | | | |
| #define arma_applier_mat(operator_rel, operator_str) \ | | #define arma_applier_mat(operator_rel, operator_str) \ | |
| {\ | | {\ | |
| const Proxy<T1> P1(X.A);\ | | const Proxy<T1> P1(X.A);\ | |
| const Proxy<T2> P2(X.B);\ | | const Proxy<T2> P2(X.B);\ | |
| \ | | \ | |
| arma_debug_assert_same_size(P1, P2, operator_str);\ | | arma_debug_assert_same_size(P1, P2, operator_str);\ | |
| \ | | \ | |
|
| const uword n_rows = P1.get_n_rows();\ | | const bool bad_alias = (Proxy<T1>::has_subview && P1.is_alias(out)) || (P | |
| const uword n_cols = P1.get_n_cols();\ | | roxy<T2>::has_subview && P2.is_alias(out));\ | |
| \ | | \ | |
|
| out.set_size(n_rows, n_cols);\ | | if(bad_alias == false)\ | |
| \ | | | |
| uword* out_mem = out.memptr();\ | | | |
| \ | | | |
| const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy<T | | | |
| 2>::prefer_at_accessor);\ | | | |
| \ | | | |
| if(prefer_at_accessor == false)\ | | | |
| {\ | | {\ | |
|
| typename Proxy<T1>::ea_type A = P1.get_ea();\ | | | |
| typename Proxy<T2>::ea_type B = P2.get_ea();\ | | | |
| \ | | \ | |
|
| const uword n_elem = out.n_elem;\ | | const uword n_rows = P1.get_n_rows();\ | |
| | | const uword n_cols = P1.get_n_cols();\ | |
| | | \ | |
| | | out.set_size(n_rows, n_cols);\ | |
| \ | | \ | |
|
| for(uword i=0; i<n_elem; ++i)\ | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor || Proxy | |
| | | <T2>::prefer_at_accessor);\ | |
| | | \ | |
| | | if(prefer_at_accessor == false)\ | |
| {\ | | {\ | |
|
| out_mem[i] = (A[i] operator_rel B[i]) ? uword(1) : uword(0);\ | | typename Proxy<T1>::ea_type A = P1.get_ea();\ | |
| | | typename Proxy<T2>::ea_type B = P2.get_ea();\ | |
| | | \ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (A[i] operator_rel B[i]) ? uword(1) : uword(0);\ | |
| | | }\ | |
| }\ | | }\ | |
|
| }\ | | else\ | |
| else\ | | | |
| {\ | | | |
| uword count = 0;\ | | | |
| \ | | | |
| for(uword col=0; col<n_cols; ++col)\ | | | |
| {\ | | {\ | |
|
| | | uword count = 0;\ | |
| | | \ | |
| | | for(uword col=0; col<n_cols; ++col)\ | |
| for(uword row=0; row<n_rows; ++row, ++count)\ | | for(uword row=0; row<n_rows; ++row, ++count)\ | |
| {\ | | {\ | |
| out_mem[count] = (P1.at(row,col) operator_rel P2.at(row,col)) ? uwo
rd(1) : uword(0);\ | | out_mem[count] = (P1.at(row,col) operator_rel P2.at(row,col)) ? uwo
rd(1) : uword(0);\ | |
| }\ | | }\ | |
| }\ | | }\ | |
| }\ | | }\ | |
|
| | | else\ | |
| | | {\ | |
| | | const unwrap<typename Proxy<T1>::stored_type> tmp1(P1.Q);\ | |
| | | const unwrap<typename Proxy<T2>::stored_type> tmp2(P2.Q);\ | |
| | | \ | |
| | | out = (tmp1.M) operator_rel (tmp2.M);\ | |
| | | }\ | |
| } | | } | |
| | | | |
| #define arma_applier_cube(operator_rel, operator_str) \ | | #define arma_applier_cube(operator_rel, operator_str) \ | |
| {\ | | {\ | |
| const ProxyCube<T1> P1(X.A);\ | | const ProxyCube<T1> P1(X.A);\ | |
| const ProxyCube<T2> P2(X.B);\ | | const ProxyCube<T2> P2(X.B);\ | |
| \ | | \ | |
| arma_debug_assert_same_size(P1, P2, operator_str);\ | | arma_debug_assert_same_size(P1, P2, operator_str);\ | |
| \ | | \ | |
|
| const uword n_rows = P1.get_n_rows();\ | | const bool bad_alias = (ProxyCube<T1>::has_subview && P1.is_alias(out)) | | |
| const uword n_cols = P1.get_n_cols();\ | | | (ProxyCube<T2>::has_subview && P2.is_alias(out));\ | |
| const uword n_slices = P1.get_n_slices();\ | | | |
| \ | | | |
| out.set_size(n_rows, n_cols, n_slices);\ | | | |
| \ | | | |
| uword* out_mem = out.memptr();\ | | | |
| \ | | | |
| const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || Pro | | | |
| xyCube<T2>::prefer_at_accessor);\ | | | |
| \ | | \ | |
|
| if(prefer_at_accessor == false)\ | | if(bad_alias == false)\ | |
| {\ | | {\ | |
|
| typename ProxyCube<T1>::ea_type A = P1.get_ea();\ | | | |
| typename ProxyCube<T2>::ea_type B = P2.get_ea();\ | | | |
| \ | | \ | |
|
| const uword n_elem = out.n_elem;\ | | const uword n_rows = P1.get_n_rows();\ | |
| | | const uword n_cols = P1.get_n_cols();\ | |
| | | const uword n_slices = P1.get_n_slices();\ | |
| \ | | \ | |
|
| for(uword i=0; i<n_elem; ++i)\ | | out.set_size(n_rows, n_cols, n_slices);\ | |
| | | \ | |
| | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | const bool prefer_at_accessor = (ProxyCube<T1>::prefer_at_accessor || P | |
| | | roxyCube<T2>::prefer_at_accessor);\ | |
| | | \ | |
| | | if(prefer_at_accessor == false)\ | |
| {\ | | {\ | |
|
| out_mem[i] = (A[i] operator_rel B[i]) ? uword(1) : uword(0);\ | | typename ProxyCube<T1>::ea_type A = P1.get_ea();\ | |
| | | typename ProxyCube<T2>::ea_type B = P2.get_ea();\ | |
| | | \ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (A[i] operator_rel B[i]) ? uword(1) : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | uword count = 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, ++count)\ | |
| | | {\ | |
| | | out_mem[count] = (P1.at(row,col,slice) operator_rel P2.at(row,col,s | |
| | | lice)) ? uword(1) : uword(0);\ | |
| | | }\ | |
| }\ | | }\ | |
| }\ | | }\ | |
| else\ | | else\ | |
| {\ | | {\ | |
|
| uword count = 0;\ | | const unwrap_cube<typename ProxyCube<T1>::stored_type> tmp1(P1.Q);\ | |
| | | const unwrap_cube<typename ProxyCube<T2>::stored_type> tmp2(P2.Q);\ | |
| \ | | \ | |
|
| for(uword slice = 0; slice < n_slices; ++slice)\ | | out = (tmp1.M) operator_rel (tmp2.M);\ | |
| for(uword col = 0; col < n_cols; ++col)\ | | | |
| for(uword row = 0; row < n_rows; ++row, ++count)\ | | | |
| {\ | | | |
| out_mem[count] = (P1.at(row,col,slice) operator_rel P2.at(row,col,sli | | | |
| ce)) ? uword(1) : uword(0);\ | | | |
| }\ | | | |
| }\ | | }\ | |
| } | | } | |
| | | | |
| template<typename T1, typename T2> | | template<typename T1, typename T2> | |
| inline | | inline | |
| void | | void | |
| glue_rel_lt::apply | | glue_rel_lt::apply | |
| ( | | ( | |
| Mat <uword>& out, | | Mat <uword>& out, | |
| const mtGlue<uword, T1, T2, glue_rel_lt>& X | | const mtGlue<uword, T1, T2, glue_rel_lt>& X | |
| | | | |
End of changes. 18 change blocks. |
| 47 lines changed or deleted | | 73 lines changed or added | |
|
| op_relational_meat.hpp | | op_relational_meat.hpp | |
|
| // Copyright (C) 2009-2010 NICTA (www.nicta.com.au) | | // Copyright (C) 2009-2012 NICTA (www.nicta.com.au) | |
| // Copyright (C) 2009-2010 Conrad Sanderson | | // Copyright (C) 2009-2012 Conrad Sanderson | |
| // | | // | |
| // This file is part of the Armadillo C++ library. | | // This file is part of the Armadillo C++ library. | |
| // It is provided without any warranty of fitness | | // It is provided without any warranty of fitness | |
| // for any purpose. You can redistribute this file | | // for any purpose. You can redistribute this file | |
| // and/or modify it under the terms of the GNU | | // and/or modify it under the terms of the GNU | |
| // Lesser General Public License (LGPL) as published | | // Lesser General Public License (LGPL) as published | |
| // by the Free Software Foundation, either version 3 | | // by the Free Software Foundation, either version 3 | |
| // of the License or (at your option) any later version. | | // of the License or (at your option) any later version. | |
| // (see http://www.opensource.org/licenses for more info) | | // (see http://www.opensource.org/licenses for more info) | |
| | | | |
| //! \addtogroup op_relational | | //! \addtogroup op_relational | |
| //! @{ | | //! @{ | |
| | | | |
|
| | | #undef operator_rel | |
| | | | |
| | | #undef arma_applier_mat_pre | |
| | | #undef arma_applier_mat_post | |
| | | | |
| | | #undef arma_applier_cube_pre | |
| | | #undef arma_applier_cube_post | |
| | | | |
| | | #define arma_applier_mat_pre(operator_rel) \ | |
| | | {\ | |
| | | typedef typename T1::elem_type eT;\ | |
| | | typedef typename Proxy<T1>::ea_type ea_type;\ | |
| | | \ | |
| | | const eT val = X.aux;\ | |
| | | \ | |
| | | const Proxy<T1> P(X.m);\ | |
| | | \ | |
| | | const uword n_rows = P.get_n_rows();\ | |
| | | const uword n_cols = P.get_n_cols();\ | |
| | | \ | |
| | | const bool bad_alias = ( Proxy<T1>::has_subview && P.is_alias(out) );\ | |
| | | \ | |
| | | if(bad_alias == false)\ | |
| | | {\ | |
| | | out.set_size(n_rows, n_cols);\ | |
| | | \ | |
| | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | if(Proxy<T1>::prefer_at_accessor == false)\ | |
| | | {\ | |
| | | ea_type PA = P.get_ea();\ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (val operator_rel PA[i]) ? uword(1) : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | uword count = 0;\ | |
| | | \ | |
| | | for(uword col=0; col < n_cols; ++col)\ | |
| | | for(uword row=0; row < n_rows; ++row, ++count)\ | |
| | | {\ | |
| | | out_mem[count] = (val operator_rel P.at(row,col)) ? uword(1) : uwor | |
| | | d(0);\ | |
| | | }\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);\ | |
| | | \ | |
| | | out = (val) operator_rel (tmp.M);\ | |
| | | }\ | |
| | | } | |
| | | | |
| | | #define arma_applier_mat_post(operator_rel) \ | |
| | | {\ | |
| | | typedef typename T1::elem_type eT;\ | |
| | | typedef typename Proxy<T1>::ea_type ea_type;\ | |
| | | \ | |
| | | const eT val = X.aux;\ | |
| | | \ | |
| | | const Proxy<T1> P(X.m);\ | |
| | | \ | |
| | | const uword n_rows = P.get_n_rows();\ | |
| | | const uword n_cols = P.get_n_cols();\ | |
| | | \ | |
| | | const bool bad_alias = ( Proxy<T1>::has_subview && P.is_alias(out) );\ | |
| | | \ | |
| | | if(bad_alias == false)\ | |
| | | {\ | |
| | | out.set_size(n_rows, n_cols);\ | |
| | | \ | |
| | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | if(Proxy<T1>::prefer_at_accessor == false)\ | |
| | | {\ | |
| | | ea_type PA = P.get_ea();\ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (PA[i] operator_rel val) ? uword(1) : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | uword count = 0;\ | |
| | | \ | |
| | | for(uword col=0; col < n_cols; ++col)\ | |
| | | for(uword row=0; row < n_rows; ++row, ++count)\ | |
| | | {\ | |
| | | out_mem[count] = (P.at(row,col) operator_rel val) ? uword(1) : uwor | |
| | | d(0);\ | |
| | | }\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);\ | |
| | | \ | |
| | | out = (tmp.M) operator_rel (val);\ | |
| | | }\ | |
| | | } | |
| | | | |
| | | #define arma_applier_cube_pre(operator_rel) \ | |
| | | {\ | |
| | | typedef typename T1::elem_type eT;\ | |
| | | typedef typename ProxyCube<T1>::ea_type ea_type;\ | |
| | | \ | |
| | | const eT val = X.aux;\ | |
| | | \ | |
| | | const ProxyCube<T1> P(X.m);\ | |
| | | \ | |
| | | const uword n_rows = P.get_n_rows();\ | |
| | | const uword n_cols = P.get_n_cols();\ | |
| | | const uword n_slices = P.get_n_slices();\ | |
| | | \ | |
| | | const bool bad_alias = ( ProxyCube<T1>::has_subview && P.is_alias(out) ); | |
| | | \ | |
| | | \ | |
| | | if(bad_alias == false)\ | |
| | | {\ | |
| | | out.set_size(n_rows, n_cols, n_slices);\ | |
| | | \ | |
| | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | if(ProxyCube<T1>::prefer_at_accessor == false)\ | |
| | | {\ | |
| | | ea_type PA = P.get_ea();\ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (val operator_rel PA[i]) ? uword(1) : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | uword count = 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, ++count)\ | |
| | | {\ | |
| | | out_mem[count] = (val operator_rel P.at(row,col,slice)) ? uword(1) | |
| | | : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | const unwrap_cube<typename ProxyCube<T1>::stored_type> tmp(P.Q);\ | |
| | | \ | |
| | | out = (val) operator_rel (tmp.M);\ | |
| | | }\ | |
| | | } | |
| | | | |
| | | #define arma_applier_cube_post(operator_rel) \ | |
| | | {\ | |
| | | typedef typename T1::elem_type eT;\ | |
| | | typedef typename ProxyCube<T1>::ea_type ea_type;\ | |
| | | \ | |
| | | const eT val = X.aux;\ | |
| | | \ | |
| | | const ProxyCube<T1> P(X.m);\ | |
| | | \ | |
| | | const uword n_rows = P.get_n_rows();\ | |
| | | const uword n_cols = P.get_n_cols();\ | |
| | | const uword n_slices = P.get_n_slices();\ | |
| | | \ | |
| | | const bool bad_alias = ( ProxyCube<T1>::has_subview && P.is_alias(out) ); | |
| | | \ | |
| | | \ | |
| | | if(bad_alias == false)\ | |
| | | {\ | |
| | | out.set_size(n_rows, n_cols, n_slices);\ | |
| | | \ | |
| | | uword* out_mem = out.memptr();\ | |
| | | \ | |
| | | if(ProxyCube<T1>::prefer_at_accessor == false)\ | |
| | | {\ | |
| | | ea_type PA = P.get_ea();\ | |
| | | const uword n_elem = out.n_elem;\ | |
| | | \ | |
| | | for(uword i=0; i<n_elem; ++i)\ | |
| | | {\ | |
| | | out_mem[i] = (PA[i] operator_rel val) ? uword(1) : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | uword count = 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, ++count)\ | |
| | | {\ | |
| | | out_mem[count] = (P.at(row,col,slice) operator_rel val) ? uword(1) | |
| | | : uword(0);\ | |
| | | }\ | |
| | | }\ | |
| | | }\ | |
| | | else\ | |
| | | {\ | |
| | | const unwrap_cube<typename ProxyCube<T1>::stored_type> tmp(P.Q);\ | |
| | | \ | |
| | | out = (tmp.M) operator_rel (val);\ | |
| | | }\ | |
| | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_lt_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lt_pre>&
X) | | op_rel_lt_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lt_pre>&
X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_pre( < ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val < A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val < A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val < A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lt_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lt_post
>& X) | | op_rel_gt_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gt_pre>&
X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_pre( > ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] < val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] < val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] < val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gt_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gt_pre>&
X) | | op_rel_lteq_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lteq_p
re>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_pre( <= ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val > A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val > A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val > A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gt_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gt_post
>& X) | | op_rel_gteq_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gteq_p
re>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_pre( >= ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] > val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] > val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] > val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lteq_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lteq_p
re>& X) | | op_rel_lt_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lt_post
>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( < ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val <= A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val <= A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val <= A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lteq_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lteq_
post>& X) | | op_rel_gt_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gt_post
>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( > ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] <= val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] <= val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] <= val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gteq_pre::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gteq_p
re>& X) | | op_rel_lteq_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_lteq_
post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( <= ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val >= A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val >= A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val >= A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_gteq_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gteq_
post>& X) | | op_rel_gteq_post::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_gteq_
post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( >= ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] >= val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] >= val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] >= val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_eq::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_eq>& X) | | op_rel_eq::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_eq>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( == ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] == val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] == val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] == val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_noteq::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_noteq>& X
) | | op_rel_noteq::apply(Mat<uword>& out, const mtOp<uword, T1, op_rel_noteq>& X
) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_mat_post( != ); | |
| typedef typename Proxy<T1>::ea_type ea_type; | | | |
| | | | |
| const Proxy<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] != val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] != val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] != val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| // | | // | |
| // | | // | |
| // | | // | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_lt_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_lt_
pre>& X) | | op_rel_lt_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_lt_
pre>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_pre( < ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val < A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val < A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val < A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lt_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_lt
_post>& X) | | op_rel_gt_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_gt_
pre>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_pre( > ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] < val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] < val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] < val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gt_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_gt_
pre>& X) | | op_rel_lteq_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_l
teq_pre>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_pre( <= ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val > A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val > A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val > A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gt_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_gt
_post>& X) | | op_rel_gteq_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_g
teq_pre>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_pre( >= ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] > val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] > val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] > val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lteq_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_l
teq_pre>& X) | | op_rel_lt_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_lt
_post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( < ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val <= A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val <= A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val <= A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_lteq_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_
lteq_post>& X) | | op_rel_gt_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_gt
_post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( > ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] <= val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] <= val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] <= val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
|
| op_rel_gteq_pre::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_g
teq_pre>& X) | | op_rel_lteq_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_
lteq_post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( <= ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (val >= A[i]) ? uword(1) : uword(0); | | | |
| out_mem[j] = (val >= A[j]) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (val >= A[i]) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_gteq_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_
gteq_post>& X) | | op_rel_gteq_post::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_
gteq_post>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( >= ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] >= val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] >= val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] >= val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_eq::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_eq>& X) | | op_rel_eq::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_eq>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( == ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | | |
| | | | |
| const eT val = X.aux; | | | |
| ea_type A = Y.get_ea(); | | | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] == val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] == val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] == val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | } | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| inline | | inline | |
| void | | void | |
| op_rel_noteq::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_note
q>& X) | | op_rel_noteq::apply(Cube<uword>& out, const mtOpCube<uword, T1, op_rel_note
q>& X) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| typedef typename T1::elem_type eT; | | arma_applier_cube_post( != ); | |
| typedef typename ProxyCube<T1>::ea_type ea_type; | | } | |
| | | | |
| const ProxyCube<T1> Y(X.m); | | | |
| | | | |
|
| out.set_size(Y.get_n_rows(), Y.get_n_cols(), Y.get_n_slices()); | | #undef arma_applier_mat_pre | |
| | | #undef arma_applier_mat_post | |
| | | | |
|
| const eT val = X.aux; | | #undef arma_applier_cube_pre | |
| ea_type A = Y.get_ea(); | | #undef arma_applier_cube_post | |
| uword* out_mem = out.memptr(); | | | |
| const uword n_elem = out.n_elem; | | | |
| | | | |
| uword i,j; | | | |
| | | | |
| for(i=0, j=1; j<n_elem; i+=2, j+=2) | | | |
| { | | | |
| out_mem[i] = (A[i] != val) ? uword(1) : uword(0); | | | |
| out_mem[j] = (A[j] != val) ? uword(1) : uword(0); | | | |
| } | | | |
| | | | |
| if(i < n_elem) | | | |
| { | | | |
| out_mem[i] = (A[i] != val) ? uword(1) : uword(0); | | | |
| } | | | |
| } | | | |
| | | | |
| //! @} | | //! @} | |
| | | | |
End of changes. 36 change blocks. |
| 493 lines changed or deleted | | 253 lines changed or added | |
|