33class CSRProfileConstViewT
37 ProfileT
const& m_profile;
38 DistProfileInfoT
const& m_dist_info ;
39 bool m_is_parallel =
false;
44 typedef ProfileT ProfileType ;
45 typedef typename ProfileType::IndexType IndexType ;
46 typedef DistProfileInfoT DistInfoType ;
49 CSRProfileConstViewT(ProfileT
const& profile,
50 DistInfoType
const& dist_info,
51 bool is_parallel =
false)
53 , m_dist_info(dist_info)
54 , m_is_parallel(is_parallel)
59 return m_profile.getNRows();
64 return m_profile.getNnz();
67 IndexType
const* kcol()
69 return m_profile.kcol();
72 IndexType
const* cols()
75 return m_dist_info.m_cols.data();
77 return m_profile.cols();
80 IndexType
const* dcol()
83 return m_dist_info.dcol(m_profile);
85 return m_profile.dcol();
91:
public CSRProfileConstViewT<typename MatrixT::ProfileType,
92 typename MatrixT::DistStructInfo>
96 typedef MatrixT MatrixType ;
97 typedef typename MatrixType::ProfileType ProfileType ;
98 typedef typename MatrixType::DistStructInfo DistStructInfo ;
100 CSRProfileConstViewT<ProfileType,DistStructInfo> BaseType ;
101 typedef typename MatrixType::ValueType ValueType ;
102 typedef typename BaseType::IndexType IndexType ;
105 CSRConstViewT(MatrixT
const& matrix)
106 : BaseType(matrix.getProfile(), matrix.getDistStructInfo(), matrix.isParallel())
110 ValueType
const* data()
112 return this->m_matrix.data();
116 MatrixType
const& m_matrix;
120class CSRModifierViewT
121:
public CSRProfileConstViewT<typename MatrixT::ProfileType,
122 typename MatrixT::DistStructInfo>
126 typedef MatrixT MatrixType ;
127 typedef typename MatrixType::ProfileType ProfileType ;
128 typedef typename MatrixType::DistStructInfo DistStructInfo ;
130 CSRProfileConstViewT<ProfileType,DistStructInfo> BaseType ;
131 typedef typename MatrixType::ValueType ValueType ;
132 typedef typename BaseType::IndexType IndexType ;
135 CSRModifierViewT(MatrixT& matrix)
136 : BaseType(matrix.getProfile(), matrix.getDistStructInfo(), matrix.isParallel())
139 m_matrix.notifyChanges();
142 virtual ~CSRModifierViewT()
144 m_matrix.endUpdate();
149 return this->m_matrix.data();
153 MatrixType& m_matrix;