2222
2323// within each specialisation of the Proxy class:
2424//
25- // elem_type = the type of the elements obtained from object Q
26- // pod_type = the underlying type of elements if elem_type is std::complex
27- // stored_type = the type of the Q object
28- // ea_type = the type of the object that provides access to elements via operator[i]
29- // aligned_ea_type = the type of the object that provides access to elements via at_alt(i)
25+ // elem_type = type of the elements obtained from object Q
26+ // pod_type = underlying type of elements if elem_type is std::complex
27+ // stored_type = type of Q object
28+ // ea_type = type of object that provides access to elements via operator[i]
29+ // aligned_ea_type = type of object that provides access to elements via at_alt(i)
3030//
31- // use_at = boolean indicating whether at(row,col) must be used to get elements
32- // use_mp = boolean indicating whether OpenMP can be used while processing elements
33- // has_subview = boolean indicating whether the Q object has a subview
31+ // use_at = boolean to indicate at(row,col) must be used to get elements
32+ // use_mp = boolean to indicate OpenMP can be used while processing elements
33+ // has_subview = boolean to indicate Q object has a subview
3434//
35- // is_row = boolean indicating whether the Q object can be treated a row vector
36- // is_col = boolean indicating whether the Q object can be treated a column vector
37- // is_xvec = boolean indicating whether the Q object is a vector with unknown orientation
35+ // is_row = boolean to indicate Q object can be treated a row vector
36+ // is_col = boolean to indicate Q object can be treated a column vector
37+ // is_xvec = boolean to indicate Q object is a vector with unknown orientation
3838//
39- // Q = object that can be unwrapped via the unwrap family of classes (ie. Q must be convertible to Mat)
39+ // Q = object that can be unwrapped via unwrap family of classes (ie. Q must be convertible to Mat)
4040//
41- // get_n_rows() = return the number of rows in Q
42- // get_n_cols() = return the number of columns in Q
43- // get_n_elem() = return the number of elements in Q
41+ // get_n_rows() = return number of rows in Q
42+ // get_n_cols() = return number of columns in Q
43+ // get_n_elem() = return number of elements in Q
4444//
45- // operator[i] = linear element accessor; valid only if the 'use_at' boolean is false
46- // at(row,col) = access elements via (row,col); valid only if the 'use_at' boolean is true
47- // at_alt(i) = aligned linear element accessor; valid only if the 'use_at' boolean is false and is_aligned() returns true
45+ // operator[i] = linear element accessor; valid only if 'use_at' boolean is false
46+ // at(row,col) = access elements via (row,col); valid only if 'use_at' boolean is true
47+ // at_alt(i) = aligned linear element accessor; valid only if 'use_at' boolean is false and is_aligned() returns true
4848//
49- // get_ea() = return the object that provides linear access to elements via operator[i]
50- // get_aligned_ea() = return the object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
49+ // get_ea() = return object that provides linear access to elements via operator[i]
50+ // get_aligned_ea() = return object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
5151//
52- // is_alias(X) = return true/false indicating whether the Q object aliases matrix X
53- // has_overlap(X) = return true/false indicating whether the Q object has overlap with subview X
54- // is_aligned() = return true/false indicating whether the Q object has aligned memory
52+ // is_alias(X) = return true/false to indicate Q object aliases matrix X
53+ // has_overlap(X) = return true/false to indicate Q object has overlap with subview X
54+ // is_aligned() = return true/false to indicate Q object has aligned memory
5555
5656
5757
@@ -880,10 +880,10 @@ struct Proxy< SpToDOp<T1, op_type> >
880880
881881
882882
883- template <typename T1 >
884- struct Proxy < SpToDOp<T1, op_nonzeros_spmat > >
883+ template <typename eT >
884+ struct Proxy < SpToDOp<SpMat<eT>, op_sp_nonzeros > >
885885 {
886- typedef typename T1::elem_type elem_type;
886+ typedef eT elem_type;
887887 typedef typename get_pod_type<elem_type>::result pod_type;
888888 typedef Mat<elem_type> stored_type;
889889 typedef const elem_type* ea_type;
@@ -897,12 +897,12 @@ struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
897897 static constexpr bool is_col = true ;
898898 static constexpr bool is_xvec = false ;
899899
900- arma_aligned const unwrap_spmat<T1> U ;
901- arma_aligned const Mat<elem_type> Q;
900+ arma_aligned const SpMat<elem_type>& R ;
901+ arma_aligned const Mat<elem_type> Q;
902902
903- inline explicit Proxy (const SpToDOp<T1, op_nonzeros_spmat >& A)
904- : U (A.m)
905- , Q(const_cast <elem_type*>(U.M. values), U.M .n_nonzero, 1, false, true)
903+ inline explicit Proxy (const SpToDOp<SpMat<eT>, op_sp_nonzeros >& A)
904+ : R (A.m)
905+ , Q(const_cast <elem_type*>(R. values), R .n_nonzero, 1, false, true)
906906 {
907907 arma_debug_sigprint ();
908908 }
@@ -929,53 +929,6 @@ struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
929929
930930
931931
932- template <typename out_eT, typename T1, typename op_type>
933- struct Proxy < mtSpToDOp<out_eT, T1, op_type> >
934- {
935- typedef out_eT elem_type;
936- typedef typename get_pod_type<out_eT>::result pod_type;
937- typedef Mat<out_eT> stored_type;
938- typedef const elem_type* ea_type;
939- typedef const Mat<out_eT>& aligned_ea_type;
940-
941- static constexpr bool use_at = false ;
942- static constexpr bool use_mp = false ;
943- static constexpr bool has_subview = false ;
944-
945- static constexpr bool is_row = mtSpToDOp<out_eT, T1, op_type>::is_row;
946- static constexpr bool is_col = mtSpToDOp<out_eT, T1, op_type>::is_col;
947- static constexpr bool is_xvec = mtSpToDOp<out_eT, T1, op_type>::is_xvec;
948-
949- arma_aligned const Mat<out_eT> Q;
950-
951- inline explicit Proxy (const mtSpToDOp<out_eT, T1, op_type>& A)
952- : Q(A)
953- {
954- arma_debug_sigprint ();
955- }
956-
957- arma_inline uword get_n_rows () const { return is_row ? 1 : Q.n_rows ; }
958- arma_inline uword get_n_cols () const { return is_col ? 1 : Q.n_cols ; }
959- arma_inline uword get_n_elem () const { return Q.n_elem ; }
960-
961- arma_inline elem_type operator [] (const uword i) const { return Q[i]; }
962- arma_inline elem_type at (const uword r, const uword c) const { return Q.at (r, c); }
963- arma_inline elem_type at_alt (const uword i) const { return Q.at_alt (i); }
964-
965- arma_inline ea_type get_ea () const { return Q.memptr (); }
966- arma_inline aligned_ea_type get_aligned_ea () const { return Q; }
967-
968- template <typename eT2>
969- constexpr bool is_alias (const Mat<eT2>&) const { return false ; }
970-
971- template <typename eT2>
972- constexpr bool has_overlap (const subview<eT2>&) const { return false ; }
973-
974- arma_inline bool is_aligned () const { return memory::is_aligned (Q.memptr ()); }
975- };
976-
977-
978-
979932template <typename T1, typename T2, typename glue_type>
980933struct Proxy < SpToDGlue<T1, T2, glue_type> >
981934 {
0 commit comments