51 std::vector<doublereal>&x,
52 const std::vector<integer>& i,
53 const std::vector<integer>& p)
83 for (std::vector<doublereal>::size_type i = 0; i <
Ai.size(); i++) {
84 if (
Ai[i] != m.
Ai[i]) {
85 silent_cerr(
"AddUnchecked: Ai[" << i <<
"] differs" << std::endl);
90 for (std::vector<doublereal>::size_type i = 0; i <
Ap.size(); i++) {
91 if (
Ap[i] != m.
Ap[i]) {
92 silent_cerr(
"AddUnchecked: Ap[" << i <<
"] differs" << std::endl);
99 std::vector<doublereal>::size_type n =
Ax.size();
100 for (std::vector<doublereal>::size_type i = 0; i < n; i++) {
108 std::fill(
Ax.begin(),
Ax.end(), 0.);
122 std::vector<integer>& Ai, std::vector<integer>& Ap,
132 integer *
const AcolSt,
int offset)
const
140 std::vector<integer>& Arow, std::vector<integer>& Acol,
141 std::vector<integer>& AcolSt,
int offset)
const
151 std::vector<doublereal>&x,
152 const std::vector<integer>& i,
153 const std::vector<integer>& p)
181 for (
integer col_idx = 1; col_idx <=
NCols; col_idx++) {
182 integer re = Ap[col_idx] - off;
183 integer ri = Ap[col_idx - 1] - off;
184 for ( ; ri < re; ri++) {
185 integer row_idx = Ai[ri] - off + 1;
187 for (
integer col_in = 1; col_in <= ncols_in; col_in++) {
188 (out.*op)(row_idx, col_in, d*in(col_idx, col_in));
210 for (
integer col_idx = 1; col_idx <=
NCols; col_idx++) {
211 integer re = Ap[col_idx] - off;
212 integer ri = Ap[col_idx - 1] - off;
213 for ( ; ri < re; ri++) {
214 integer row_idx = Ai[ri] - off + 1;
216 for (
integer col_in = 1; col_in <= ncols_in; col_in++) {
217 (out.*op)(col_idx, col_in, d*in(row_idx, col_in));
237 for (
integer col_idx = 1; col_idx <=
NCols; col_idx++) {
238 integer re = Ap[col_idx] - off;
239 integer ri = Ap[col_idx - 1] - off;
240 for ( ; ri < re; ri++) {
241 integer row_idx = Ai[ri] - off + 1;
243 (out.*op)(row_idx, d*in(col_idx));
263 for (
integer col_idx = 1; col_idx <=
NCols; col_idx++) {
264 integer re = Ap[col_idx] - off;
265 integer ri = Ap[col_idx - 1] - off;
266 for ( ; ri < re; ri++) {
267 integer row_idx = Ai[ri] - off + 1;
269 (out.*op)(col_idx, d*in(row_idx));
316 while (i_idx == m.Ap[elem.iCol + 1] - off) {
317 if (++elem.iCol == m.iGetNumCols()) {
318 elem.iRow = m.iGetNumRows();
321 i_idx = m.Ap[elem.iCol] - off;
323 elem.iRow = m.Ai[i_idx] - off;
324 elem.dCoef = m.Ax[i_idx];
347 return elem == op.
elem;
354 return elem != op.
elem;
const_iterator(const CompactSparseMatrixHandler_tpl< off > &m, bool is_end=false)
virtual VectorHandler & MatTVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
virtual integer iGetNumCols(void) const =0
virtual VectorHandler & MatVecMul_base(void(VectorHandler::*op)(integer iRow, const doublereal &dCoef), VectorHandler &out, const VectorHandler &in) const
#define MBDYN_EXCEPT_ARGS
const CompactSparseMatrixHandler_tpl< off > & m
void AddUnchecked(const CompactSparseMatrixHandler &m)
const CompactSparseMatrixHandler_tpl< off >::const_iterator & operator++(void) const
virtual integer MakeCompressedColumnForm(doublereal *const Ax, integer *const Ai, integer *const Ap, int offset=0) const
const std::vector< integer > & Ap
SparseMatrixHandler(const integer &n, const integer &nn=0)
virtual integer iGetSize(void) const =0
const std::vector< integer > & Ai
void reset(bool is_end=false)
bool operator!=(const CompactSparseMatrixHandler_tpl< off >::const_iterator &op) const
std::vector< doublereal > & Ax
virtual ~SparseMatrixHandler(void)
virtual integer MakeIndexForm(doublereal *const Ax, integer *const Arow, integer *const Acol, integer *const AcolSt, int offset=0) const
const SparseMatrixHandler::SparseMatrixElement * operator->(void)
virtual ~CompactSparseMatrixHandler_tpl(void)
SparseMatrixHandler::SparseMatrixElement elem
#define ASSERT(expression)
bool operator==(const CompactSparseMatrixHandler_tpl< off >::const_iterator &op) const
const SparseMatrixHandler::SparseMatrixElement & operator*(void)
MatrixHandler & MatMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
CompactSparseMatrixHandler(const integer &n, const integer &nn, std::vector< doublereal > &x, const std::vector< integer > &i, const std::vector< integer > &p)
CompactSparseMatrixHandler_tpl(const integer &n, const integer &nn, std::vector< doublereal > &x, const std::vector< integer > &i, const std::vector< integer > &p)
MatrixHandler & MatTMatMul_base(void(MatrixHandler::*op)(integer iRow, integer iCol, const doublereal &dCoef), MatrixHandler &out, const MatrixHandler &in) const
virtual ~CompactSparseMatrixHandler()
virtual integer iGetNumRows(void) const =0