| unwrap.hpp | | unwrap.hpp | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| // 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 unwrap | | //! \addtogroup unwrap | |
| //! @{ | | //! @{ | |
| | | | |
| template<typename T1> | | template<typename T1> | |
|
| class unwrap | | struct unwrap_default | |
| { | | { | |
|
| public: | | | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| inline unwrap(const T1& A) // TODO: change this to Base ? | | inline unwrap_default(const T1& A) // TODO: change this to Base ? | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| const Mat<eT> M; | | const Mat<eT> M; | |
| }; | | }; | |
| | | | |
|
| | | template<typename T1> | |
| | | struct unwrap_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit unwrap_Mat_fixed(const T1& A) | |
| | | : M(A) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct unwrap_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct unwrap_redirect<T1, false> { typedef unwrap_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct unwrap_redirect<T1, true> { typedef unwrap_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class unwrap : public unwrap_redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | public: | |
| | | | |
| | | inline unwrap(const T1& A) | |
| | | : unwrap_redirect< T1, is_Mat_fixed<T1>::value >::result(A) | |
| | | { | |
| | | } | |
| | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class unwrap< Mat<eT> > | | class unwrap< Mat<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline unwrap(const Mat<eT>& A) | | inline unwrap(const Mat<eT>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| skipping to change at line 74 | | skipping to change at line 106 | |
| | | | |
| inline unwrap(const Col<eT>& A) | | inline unwrap(const Col<eT>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| const Col<eT>& M; | | const Col<eT>& M; | |
| }; | | }; | |
| | | | |
|
| | | template<typename eT> | |
| | | class unwrap< subview_col<eT> > | |
| | | { | |
| | | public: | |
| | | | |
| | | inline unwrap(const subview_col<eT>& A) | |
| | | : M( const_cast<eT*>( A.colptr(0) ), A.n_rows, 1, false, false ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| template<typename out_eT, typename T1, typename T2, typename glue_type> | | template<typename out_eT, typename T1, typename T2, typename glue_type> | |
| class unwrap< mtGlue<out_eT, T1, T2, glue_type> > | | class unwrap< mtGlue<out_eT, T1, T2, glue_type> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline unwrap(const mtGlue<out_eT, T1, T2, glue_type>& A) | | inline unwrap(const mtGlue<out_eT, T1, T2, glue_type>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| skipping to change at line 120 | | skipping to change at line 166 | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
| inline | | inline | |
| unwrap_check(const T1& A, const Mat<eT>&) | | unwrap_check(const T1& A, const Mat<eT>&) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~unwrap_check() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| const Mat<eT> M; | | const Mat<eT> M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class unwrap_check< Mat<eT> > | | class unwrap_check< Mat<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| unwrap_check(const Mat<eT>& A, const Mat<eT>& B) | | unwrap_check(const Mat<eT>& A, const Mat<eT>& B) | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 187 | |
| , M ( (&A == &B) ? (*M_local) : A ) | | , M ( (&A == &B) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check() | | ~unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class unwrap_check< Row<eT> > | | class unwrap_check< Row<eT> > | |
| { | | { | |
| | | | |
| skipping to change at line 176 | | skipping to change at line 213 | |
| , M ( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? (*M_local)
: A ) | | , M ( (&A == reinterpret_cast<const Row<eT>*>(&B)) ? (*M_local)
: A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check() | | ~unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Row<eT>* M_local; | | const Row<eT>* M_local; | |
| const Row<eT>& M; | | const Row<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class unwrap_check< Col<eT> > | | class unwrap_check< Col<eT> > | |
| { | | { | |
| | | | |
| skipping to change at line 205 | | skipping to change at line 239 | |
| , M ( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? (*M_local)
: A ) | | , M ( (&A == reinterpret_cast<const Col<eT>*>(&B)) ? (*M_local)
: A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check() | | ~unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Col<eT>* M_local; | | const Col<eT>* M_local; | |
| const Col<eT>& M; | | const Col<eT>& M; | |
| | | | |
| }; | | }; | |
| | | | |
|
| | | template<typename eT> | |
| | | class unwrap_check< subview_col<eT> > | |
| | | { | |
| | | public: | |
| | | | |
| | | inline | |
| | | unwrap_check(const subview_col<eT>& A, const Mat<eT>& B) | |
| | | : M( const_cast<eT*>( A.colptr(0) ), A.n_rows, 1, (&(A.m) == &B), false | |
| | | ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| // | | // | |
| // | | // | |
| // | | // | |
| | | | |
| template<typename T1> | | template<typename T1> | |
| class unwrap_check_mixed | | class unwrap_check_mixed | |
| { | | { | |
| public: | | public: | |
| | | | |
| typedef typename T1::elem_type eT1; | | typedef typename T1::elem_type eT1; | |
| | | | |
| template<typename eT2> | | template<typename eT2> | |
| inline | | inline | |
| unwrap_check_mixed(const T1& A, const Mat<eT2>&) | | unwrap_check_mixed(const T1& A, const Mat<eT2>&) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~unwrap_check_mixed() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| const Mat<eT1> M; | | const Mat<eT1> M; | |
| }; | | }; | |
| | | | |
| template<typename eT1> | | template<typename eT1> | |
| class unwrap_check_mixed< Mat<eT1> > | | class unwrap_check_mixed< Mat<eT1> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| template<typename eT2> | | template<typename eT2> | |
| inline | | inline | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 304 | |
| , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | | , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check_mixed() | | ~unwrap_check_mixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT1>* M_local; | | const Mat<eT1>* M_local; | |
| const Mat<eT1>& M; | | const Mat<eT1>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT1> | | template<typename eT1> | |
| class unwrap_check_mixed< Row<eT1> > | | class unwrap_check_mixed< Row<eT1> > | |
| { | | { | |
| | | | |
| skipping to change at line 294 | | skipping to change at line 331 | |
| , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | | , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check_mixed() | | ~unwrap_check_mixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Row<eT1>* M_local; | | const Row<eT1>* M_local; | |
| const Row<eT1>& M; | | const Row<eT1>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT1> | | template<typename eT1> | |
| class unwrap_check_mixed< Col<eT1> > | | class unwrap_check_mixed< Col<eT1> > | |
| { | | { | |
| | | | |
| skipping to change at line 324 | | skipping to change at line 358 | |
| , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | | , M ( (void_ptr(&A) == void_ptr(&B)) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~unwrap_check_mixed() | | ~unwrap_check_mixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Col<eT1>* M_local; | | const Col<eT1>* M_local; | |
| const Col<eT1>& M; | | const Col<eT1>& M; | |
| }; | | }; | |
| | | | |
| // | | // | |
| | | | |
| template<typename T1> | | template<typename T1> | |
|
| class partial_unwrap | | struct partial_unwrap_default | |
| { | | { | |
|
| public: | | | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| inline partial_unwrap(const T1& A) // TODO: change this to Base ? | | inline partial_unwrap_default(const T1& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| ~partial_unwrap() | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_Mat_fixed(const T1& A) | |
| | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT> M; | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_redirect<T1, false> { typedef partial_unwrap_default< | |
| | | T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_redirect<T1, true> { typedef partial_unwrap_Mat_fixe | |
| | | d<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap : public partial_unwrap_redirect<T1, is_Mat_fixed<T1>: | |
| | | :value >::result | |
| | | { | |
| | | public: | |
| | | | |
| | | inline partial_unwrap(const T1& A) | |
| | | : partial_unwrap_redirect< T1, is_Mat_fixed<T1>::value >::result(A) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Mat<eT> > | | class partial_unwrap< Mat<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Mat<eT>& A) | | partial_unwrap(const Mat<eT>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return eT(1); } | | inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Row<eT> > | | class partial_unwrap< Row<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Row<eT>& A) | | partial_unwrap(const Row<eT>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return eT(1); } | | inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Col<eT> > | | class partial_unwrap< Col<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Col<eT>& A) | | partial_unwrap(const Col<eT>& A) | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename eT> | |
| | | class partial_unwrap< subview_col<eT> > | |
| | | { | |
| | | public: | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap() | | partial_unwrap(const subview_col<eT>& A) | |
| | | : M( const_cast<eT*>( A.colptr(0) ), A.n_rows, 1, false, false ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline eT get_val() const { return eT(1); } | | inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT>& M; | | const Mat<eT> M; | |
| }; | | }; | |
| | | | |
| template<typename T1> | | template<typename T1> | |
|
| class partial_unwrap< Op<T1, op_htrans> > | | struct partial_unwrap_htrans_default | |
| { | | { | |
|
| public: | | | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| inline | | inline partial_unwrap_htrans_default(const Op<T1, op_htrans>& A) | |
| partial_unwrap(const Op<T1,op_htrans>& A) | | | |
| : M(A.m) | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| ~partial_unwrap() | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_htrans_Mat_fixed(const Op<T1, op_htrans>& | |
| | | A) | |
| | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT> M; | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_htrans_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans_redirect<T1, false> { typedef partial_unwrap_h | |
| | | trans_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans_redirect<T1, true> { typedef partial_unwrap_h | |
| | | trans_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap< Op<T1, op_htrans> > : public partial_unwrap_htrans_re | |
| | | direct<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | public: | |
| | | | |
| | | inline partial_unwrap(const Op<T1, op_htrans>& A) | |
| | | : partial_unwrap_htrans_redirect< T1, is_Mat_fixed<T1>::value >::result | |
| | | (A) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Op< Mat<eT>, op_htrans> > | | class partial_unwrap< Op< Mat<eT>, op_htrans> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Mat<eT>, op_htrans>& A) | | partial_unwrap(const Op< Mat<eT>, op_htrans>& A) | |
| : M(A.m) | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_inline eT get_val() const { return eT(1); } | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return eT(1); } | | | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Op< Row<eT>, op_htrans> > | | class partial_unwrap< Op< Row<eT>, op_htrans> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Row<eT>, op_htrans>& A) | | partial_unwrap(const Op< Row<eT>, op_htrans>& A) | |
| : M(A.m) | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_inline eT get_val() const { return eT(1); } | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return eT(1); } | | | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Op< Col<eT>, op_htrans> > | | class partial_unwrap< Op< Col<eT>, op_htrans> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Col<eT>, op_htrans>& A) | | partial_unwrap(const Op< Col<eT>, op_htrans>& A) | |
| : M(A.m) | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename eT> | |
| | | class partial_unwrap< Op< subview_col<eT>, op_htrans> > | |
| | | { | |
| | | public: | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap() | | partial_unwrap(const Op< subview_col<eT>, op_htrans>& A) | |
| | | : M( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, 1, false, false ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline eT get_val() const { return eT(1); } | | arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT>& M; | | const Mat<eT> M; | |
| }; | | }; | |
| | | | |
| template<typename T1> | | template<typename T1> | |
|
| class partial_unwrap< Op<T1, op_htrans2> > | | struct partial_unwrap_htrans2_default | |
| { | | { | |
|
| public: | | | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| inline | | inline partial_unwrap_htrans2_default(const Op<T1, op_htrans2>& A) | |
| partial_unwrap(const Op<T1,op_htrans2>& A) | | | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.m) | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_inline eT get_val() const { return val; } | |
| ~partial_unwrap() | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans2_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_htrans2_Mat_fixed(const Op<T1, op_htrans2> | |
| | | & A) | |
| | | : val(A.aux) | |
| | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline eT get_val() const { return val; } | | arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
|
| const Mat<eT> M; | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_htrans2_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans2_redirect<T1, false> { typedef partial_unwrap_ | |
| | | htrans2_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_htrans2_redirect<T1, true> { typedef partial_unwrap_ | |
| | | htrans2_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap< Op<T1, op_htrans2> > : public partial_unwrap_htrans2_ | |
| | | redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | public: | |
| | | | |
| | | inline partial_unwrap(const Op<T1, op_htrans2>& A) | |
| | | : partial_unwrap_htrans2_redirect< T1, is_Mat_fixed<T1>::value >::resul | |
| | | t(A) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap< Op< Mat<eT>, op_htrans2> > | | class partial_unwrap< Op< Mat<eT>, op_htrans2> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Mat<eT>, op_htrans2>& A) | | partial_unwrap(const Op< Mat<eT>, op_htrans2>& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.m) | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| | | | |
| skipping to change at line 619 | | skipping to change at line 741 | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Row<eT>, op_htrans2>& A) | | partial_unwrap(const Op< Row<eT>, op_htrans2>& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.m) | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| | | | |
| skipping to change at line 647 | | skipping to change at line 763 | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const Op< Col<eT>, op_htrans2>& A) | | partial_unwrap(const Op< Col<eT>, op_htrans2>& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.m) | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| template<typename T1> | | template<typename eT> | |
| class partial_unwrap< eOp<T1, eop_scalar_times> > | | class partial_unwrap< Op< subview_col<eT>, op_htrans2> > | |
| { | | { | |
| public: | | public: | |
| | | | |
|
| typedef typename T1::elem_type eT; | | | |
| | | | |
| inline | | inline | |
|
| partial_unwrap(const eOp<T1,eop_scalar_times>& A) | | partial_unwrap(const Op< subview_col<eT>, op_htrans2>& A) | |
| : val(A.aux) | | : val( A.aux ) | |
| , M (A.P.Q) | | , M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, 1, false, false ) | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline | | | |
| ~partial_unwrap() | | | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
|
| static const bool do_trans = false; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| const Mat<eT> M; | | const Mat<eT> M; | |
| }; | | }; | |
| | | | |
|
| template<typename eT> | | template<typename T1> | |
| class partial_unwrap< eOp<Mat<eT>, eop_scalar_times> > | | struct partial_unwrap_scalar_times_default | |
| { | | { | |
|
| public: | | typedef typename T1::elem_type eT; | |
| | | | |
|
| inline | | inline partial_unwrap_scalar_times_default(const eOp<T1, eop_scalar_times | |
| partial_unwrap(const eOp<Mat<eT>,eop_scalar_times>& A) | | >& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.P.Q) | | , M (A.P.Q) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | arma_hot arma_inline eT get_val() const { return val; } | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return val; } | | | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
|
| const eT val; | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_scalar_times_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_scalar_times_Mat_fixed(const eOp<T1, eop_s | |
| | | calar_times>& A) | |
| | | : val(A.aux) | |
| | | , M (A.P.Q) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_scalar_times_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_scalar_times_redirect<T1, false> { typedef partial_un | |
| | | wrap_scalar_times_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_scalar_times_redirect<T1, true> { typedef partial_un | |
| | | wrap_scalar_times_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap< eOp<T1, eop_scalar_times> > : public partial_unwrap_s | |
| | | calar_times_redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | public: | |
| | | inline partial_unwrap(const eOp<T1, eop_scalar_times>& A) | |
| | | : partial_unwrap_scalar_times_redirect< T1, is_Mat_fixed<T1>::value >:: | |
| | | result(A) | |
| | | { | |
| | | } | |
| | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
|
| class partial_unwrap< eOp<Row<eT>, eop_scalar_times> > | | class partial_unwrap< eOp<Mat<eT>, eop_scalar_times> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| inline | | inline | |
|
| partial_unwrap(const eOp<Row<eT>,eop_scalar_times>& A) | | partial_unwrap(const eOp<Mat<eT>,eop_scalar_times>& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.P.Q) | | , M (A.P.Q) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename eT> | |
| | | class partial_unwrap< eOp<Row<eT>, eop_scalar_times> > | |
| | | { | |
| | | public: | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap() | | partial_unwrap(const eOp<Row<eT>,eop_scalar_times>& A) | |
| | | : val(A.aux) | |
| | | , M (A.P.Q) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| | | | |
| skipping to change at line 761 | | skipping to change at line 914 | |
| public: | | public: | |
| | | | |
| inline | | inline | |
| partial_unwrap(const eOp<Col<eT>,eop_scalar_times>& A) | | partial_unwrap(const eOp<Col<eT>,eop_scalar_times>& A) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.P.Q) | | , M (A.P.Q) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| inline | | | |
| ~partial_unwrap() | | | |
| { | | | |
| arma_extra_debug_sigprint(); | | | |
| } | | | |
| | | | |
| inline eT get_val() const { return val; } | | inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| // | | // | |
| | | | |
| template<typename T1> | | template<typename T1> | |
|
| class partial_unwrap_check | | struct partial_unwrap_check_default | |
| { | | { | |
|
| public: | | | |
| | | | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| arma_hot inline | | inline partial_unwrap_check_default(const T1& A, const Mat<eT>&) | |
| partial_unwrap_check(const T1& A, const Mat<eT>&) | | | |
| : M(A) | | : M(A) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_check_Mat_fixed(const T1& A, const Mat<eT> | |
| | | & B) | |
| | | : M_local( (&A == &B) ? new Mat<eT>(A) : 0 ) | |
| | | , M ( (&A == &B) ? (*M_local) : A ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap_check() | | ~partial_unwrap_check_Mat_fixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT> M; | | const Mat<eT>* M_local; | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_check_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_redirect<T1, false> { typedef partial_unwrap_ch | |
| | | eck_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_redirect<T1, true> { typedef partial_unwrap_ch | |
| | | eck_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap_check : public partial_unwrap_check_redirect<T1, is_Ma | |
| | | t_fixed<T1>::value >::result | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | public: | |
| | | inline partial_unwrap_check(const T1& A, const Mat<eT>& B) | |
| | | : partial_unwrap_check_redirect< T1, is_Mat_fixed<T1>::value >::result( | |
| | | A, B) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< Mat<eT> > | | class partial_unwrap_check< Mat<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
| partial_unwrap_check(const Mat<eT>& A, const Mat<eT>& B) | | partial_unwrap_check(const Mat<eT>& A, const Mat<eT>& B) | |
| : M_local ( (&A == &B) ? new Mat<eT>(A) : 0 ) | | : M_local ( (&A == &B) ? new Mat<eT>(A) : 0 ) | |
| , M ( (&A == &B) ? (*M_local) : A ) | | , M ( (&A == &B) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| | | | |
| skipping to change at line 858 | | skipping to change at line 1043 | |
| , M ( (&A == &B) ? (*M_local) : A ) | | , M ( (&A == &B) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| | | | |
| skipping to change at line 892 | | skipping to change at line 1074 | |
| , M ( (&A == &B) ? (*M_local) : A ) | | , M ( (&A == &B) ? (*M_local) : A ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| template<typename T1> | | template<typename eT> | |
| class partial_unwrap_check< Op<T1, op_htrans> > | | class partial_unwrap_check< subview_col<eT> > | |
| { | | { | |
| public: | | public: | |
| | | | |
|
| | | arma_hot inline | |
| | | partial_unwrap_check(const subview_col<eT>& A, const Mat<eT>& B) | |
| | | : M( const_cast<eT*>( A.colptr(0) ), A.n_rows, 1, (&(A.m) == &B), false | |
| | | ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans_default | |
| | | { | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| arma_hot inline | | inline partial_unwrap_check_htrans_default(const Op<T1, op_htrans>& A, co | |
| partial_unwrap_check(const Op<T1,op_htrans>& A, const Mat<eT>&) | | nst Mat<eT>&) | |
| : M(A.m) | | : M(A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_check_htrans_Mat_fixed(const Op<T1, op_htr | |
| | | ans>& A, const Mat<eT>& B) | |
| | | : M_local( (&(A.m) == &B) ? new Mat<eT>(A.m) : 0 ) | |
| | | , M ( (&(A.m) == &B) ? (*M_local) : A.m ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap_check() | | ~partial_unwrap_check_htrans_Mat_fixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
|
| const Mat<eT> M; | | const Mat<eT>* M_local; | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_check_htrans_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans_redirect<T1, false> { typedef partial_un | |
| | | wrap_check_htrans_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans_redirect<T1, true> { typedef partial_un | |
| | | wrap_check_htrans_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap_check< Op<T1, op_htrans> > : public partial_unwrap_che | |
| | | ck_htrans_redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | public: | |
| | | inline partial_unwrap_check(const Op<T1, op_htrans>& A, const Mat<eT>& B) | |
| | | : partial_unwrap_check_htrans_redirect< T1, is_Mat_fixed<T1>::value >:: | |
| | | result(A, B) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< Op< Mat<eT>, op_htrans> > | | class partial_unwrap_check< Op< Mat<eT>, op_htrans> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
| partial_unwrap_check(const Op< Mat<eT>, op_htrans>& A, const Mat<eT>& B) | | partial_unwrap_check(const Op< Mat<eT>, op_htrans>& A, const Mat<eT>& B) | |
| : M_local ( (&A.m == &B) ? new Mat<eT>(A.m) : 0 ) | | : M_local ( (&A.m == &B) ? new Mat<eT>(A.m) : 0 ) | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| | | | |
| skipping to change at line 988 | | skipping to change at line 1225 | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| | | | |
| skipping to change at line 1022 | | skipping to change at line 1256 | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return eT(1); } | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = false; | | static const bool do_times = false; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| template<typename T1> | | template<typename eT> | |
| class partial_unwrap_check< Op<T1, op_htrans2> > | | class partial_unwrap_check< Op< subview_col<eT>, op_htrans> > | |
| { | | { | |
| public: | | public: | |
| | | | |
|
| | | arma_hot inline | |
| | | partial_unwrap_check(const Op< subview_col<eT>, op_htrans>& A, const Mat< | |
| | | eT>& B) | |
| | | : M( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, 1, (&(A.m.m) == &B), | |
| | | false ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | arma_hot arma_inline eT get_val() const { return eT(1); } | |
| | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = false; | |
| | | | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans2_default | |
| | | { | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| arma_hot inline | | inline partial_unwrap_check_htrans2_default(const Op<T1, op_htrans2>& A, | |
| partial_unwrap_check(const Op<T1,op_htrans2>& A, const Mat<eT>&) | | const Mat<eT>&) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.m) | | , M (A.m) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans2_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_check_htrans2_Mat_fixed(const Op<T1, op_ht | |
| | | rans2>& A, const Mat<eT>& B) | |
| | | : val (A.aux) | |
| | | , M_local( (&(A.m) == &B) ? new Mat<eT>(A.m) : 0 ) | |
| | | , M ( (&(A.m) == &B) ? (*M_local) : A.m ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap_check() | | ~partial_unwrap_check_htrans2_Mat_fixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
|
| const eT val; | | const eT val; | |
| const Mat<eT> M; | | const Mat<eT>* M_local; | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_check_htrans2_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans2_redirect<T1, false> { typedef partial_u | |
| | | nwrap_check_htrans2_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_htrans2_redirect<T1, true> { typedef partial_u | |
| | | nwrap_check_htrans2_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap_check< Op<T1, op_htrans2> > : public partial_unwrap_ch | |
| | | eck_htrans2_redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | public: | |
| | | inline partial_unwrap_check(const Op<T1, op_htrans2>& A, const Mat<eT>& B | |
| | | ) | |
| | | : partial_unwrap_check_htrans2_redirect< T1, is_Mat_fixed<T1>::value >: | |
| | | :result(A, B) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< Op< Mat<eT>, op_htrans2> > | | class partial_unwrap_check< Op< Mat<eT>, op_htrans2> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
| partial_unwrap_check(const Op< Mat<eT>, op_htrans2>& A, const Mat<eT>& B) | | partial_unwrap_check(const Op< Mat<eT>, op_htrans2>& A, const Mat<eT>& B) | |
| : val (A.aux) | | : val (A.aux) | |
| | | | |
| skipping to change at line 1087 | | skipping to change at line 1381 | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const eT val; | | const eT val; | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| | | | |
| skipping to change at line 1123 | | skipping to change at line 1414 | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const eT val; | | const eT val; | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< Op< Col<eT>, op_htrans2> > | | class partial_unwrap_check< Op< Col<eT>, op_htrans2> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
|
| partial_unwrap_check(const Op< Mat<eT>, op_htrans2>& A, const Mat<eT>& B) | | partial_unwrap_check(const Op< Col<eT>, op_htrans2>& A, const Mat<eT>& B) | |
| : val (A.aux) | | : val (A.aux) | |
| , M_local ( (&A.m == &B) ? new Mat<eT>(A.m) : 0 ) | | , M_local ( (&A.m == &B) ? new Mat<eT>(A.m) : 0 ) | |
| , M ( (&A.m == &B) ? (*M_local) : A.m ) | | , M ( (&A.m == &B) ? (*M_local) : A.m ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| | | | |
|
| if(M_local) | | if(M_local) { delete M_local; } | |
| { | | | |
| delete M_local; | | | |
| } | | | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = true; | | static const bool do_trans = true; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| // the order below is important | | // the order below is important | |
| const eT val; | | const eT val; | |
| const Mat<eT>* M_local; | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| template<typename T1> | | template<typename eT> | |
| class partial_unwrap_check< eOp<T1, eop_scalar_times> > | | class partial_unwrap_check< Op< subview_col<eT>, op_htrans2> > | |
| { | | { | |
| public: | | public: | |
| | | | |
|
| | | arma_hot inline | |
| | | partial_unwrap_check(const Op< subview_col<eT>, op_htrans2>& A, const Mat | |
| | | <eT>& B) | |
| | | : val( A.aux ) | |
| | | , M ( const_cast<eT*>( A.m.colptr(0) ), A.m.n_rows, 1, (&(A.m.m) == &B | |
| | | ), false ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = true; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_scalar_times_default | |
| | | { | |
| typedef typename T1::elem_type eT; | | typedef typename T1::elem_type eT; | |
| | | | |
|
| arma_hot inline | | inline partial_unwrap_check_scalar_times_default(const eOp<T1, eop_scalar | |
| partial_unwrap_check(const eOp<T1,eop_scalar_times>& A, const Mat<eT>&) | | _times>& A, const Mat<eT>&) | |
| : val(A.aux) | | : val(A.aux) | |
| , M (A.P.Q) | | , M (A.P.Q) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
|
| | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_scalar_times_Mat_fixed | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | inline explicit partial_unwrap_check_scalar_times_Mat_fixed(const eOp<T1, | |
| | | eop_scalar_times>& A, const Mat<eT>& B) | |
| | | : val ( A.aux ) | |
| | | , M_local( (&(A.P.Q) == &B) ? new Mat<eT>(A.P.Q) : 0 ) | |
| | | , M ( (&(A.P.Q) == &B) ? (*M_local) : A.P.Q ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| inline | | inline | |
|
| ~partial_unwrap_check() | | ~partial_unwrap_check_scalar_times_Mat_fixed() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
|
| const eT val; | | const eT val; | |
| const Mat<eT> M; | | const Mat<eT>* M_local; | |
| | | const Mat<eT>& M; | |
| | | }; | |
| | | | |
| | | template<typename T1, bool condition> | |
| | | struct partial_unwrap_check_scalar_times_redirect {}; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_scalar_times_redirect<T1, false> { typedef part | |
| | | ial_unwrap_check_scalar_times_default<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | struct partial_unwrap_check_scalar_times_redirect<T1, true> { typedef part | |
| | | ial_unwrap_check_scalar_times_Mat_fixed<T1> result; }; | |
| | | | |
| | | template<typename T1> | |
| | | class partial_unwrap_check< eOp<T1, eop_scalar_times> > : public partial_un | |
| | | wrap_check_scalar_times_redirect<T1, is_Mat_fixed<T1>::value >::result | |
| | | { | |
| | | typedef typename T1::elem_type eT; | |
| | | | |
| | | public: | |
| | | inline partial_unwrap_check(const eOp<T1, eop_scalar_times>& A, const Mat | |
| | | <eT>& B) | |
| | | : partial_unwrap_check_scalar_times_redirect< T1, is_Mat_fixed<T1>::val | |
| | | ue >::result(A, B) | |
| | | { | |
| | | } | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< eOp<Mat<eT>, eop_scalar_times> > | | class partial_unwrap_check< eOp<Mat<eT>, eop_scalar_times> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
|
| partial_unwrap_check(const eOp<Mat<eT>,eop_scalar_times>& A, const Mat<eT | | partial_unwrap_check(const eOp<Mat<eT>,eop_scalar_times>& A, const Mat<eT | |
| >&) | | >& B) | |
| : val(A.aux) | | : val (A.aux) | |
| , M (A.P.Q) | | , M_local( (&(A.P.Q) == &B) ? new Mat<eT>(A.P.Q) : 0 ) | |
| | | , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
|
| | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< eOp<Row<eT>, eop_scalar_times> > | | class partial_unwrap_check< eOp<Row<eT>, eop_scalar_times> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
|
| partial_unwrap_check(const eOp<Row<eT>,eop_scalar_times>& A, const Mat<eT
>&) | | partial_unwrap_check(const eOp<Row<eT>,eop_scalar_times>& A, const Mat<eT
>& B) | |
| : val(A.aux) | | : val(A.aux) | |
|
| , M (A.P.Q) | | , M_local( (&(A.P.Q) == &B) ? new Mat<eT>(A.P.Q) : 0 ) | |
| | | , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
|
| | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
| template<typename eT> | | template<typename eT> | |
| class partial_unwrap_check< eOp<Col<eT>, eop_scalar_times> > | | class partial_unwrap_check< eOp<Col<eT>, eop_scalar_times> > | |
| { | | { | |
| public: | | public: | |
| | | | |
| arma_hot inline | | arma_hot inline | |
|
| partial_unwrap_check(const eOp<Col<eT>,eop_scalar_times>& A, const Mat<eT | | partial_unwrap_check(const eOp<Col<eT>,eop_scalar_times>& A, const Mat<eT | |
| >&) | | >& B) | |
| : val(A.aux) | | : val ( A.aux ) | |
| , M (A.P.Q) | | , M_local( (&(A.P.Q) == &B) ? new Mat<eT>(A.P.Q) : 0 ) | |
| | | , M ( (&(A.P.Q) == &B) ? *M_local : A.P.Q ) | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
| } | | } | |
| | | | |
| inline | | inline | |
| ~partial_unwrap_check() | | ~partial_unwrap_check() | |
| { | | { | |
| arma_extra_debug_sigprint(); | | arma_extra_debug_sigprint(); | |
|
| | | | |
| | | if(M_local) { delete M_local; } | |
| } | | } | |
| | | | |
| arma_hot arma_inline eT get_val() const { return val; } | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| static const bool do_trans = false; | | static const bool do_trans = false; | |
| static const bool do_times = true; | | static const bool do_times = true; | |
| | | | |
| const eT val; | | const eT val; | |
|
| | | const Mat<eT>* M_local; | |
| const Mat<eT>& M; | | const Mat<eT>& M; | |
| }; | | }; | |
| | | | |
|
| | | template<typename eT> | |
| | | class partial_unwrap_check< eOp<subview_col<eT>, eop_scalar_times> > | |
| | | { | |
| | | public: | |
| | | | |
| | | arma_hot inline | |
| | | partial_unwrap_check(const eOp<subview_col<eT>,eop_scalar_times>& A, cons | |
| | | t Mat<eT>& B) | |
| | | : val( A.aux ) | |
| | | , M ( const_cast<eT*>( A.P.Q.colptr(0) ), A.P.Q.n_rows, 1, (&(A.P.Q.m) | |
| | | == &B), false ) | |
| | | { | |
| | | arma_extra_debug_sigprint(); | |
| | | } | |
| | | | |
| | | arma_hot arma_inline eT get_val() const { return val; } | |
| | | | |
| | | static const bool do_trans = false; | |
| | | static const bool do_times = true; | |
| | | | |
| | | const eT val; | |
| | | const Mat<eT> M; | |
| | | }; | |
| | | | |
| //! @} | | //! @} | |
| | | | |
End of changes. 110 change blocks. |
| 225 lines changed or deleted | | 661 lines changed or added | |
|