| 304 | |
| 305 | |
| 306 | int |
| 307 | Matrix::Assemble(const Matrix &V, const ID &rows, const ID &cols, double fact) |
| 308 | { |
| 309 | int pos_Rows, pos_Cols; |
| 310 | int res = 0; |
| 311 | |
| 312 | for (int i=0; i<cols.Size(); i++) { |
| 313 | pos_Cols = cols(i); |
| 314 | for (int j=0; j<rows.Size(); j++) { |
| 315 | pos_Rows = rows(j); |
| 316 | |
| 317 | if ((pos_Cols >= 0) && (pos_Rows >= 0) && (pos_Rows < numRows) && |
| 318 | (pos_Cols < numCols) && (i < V.numCols) && (j < V.numRows)) |
| 319 | (*this)(pos_Rows,pos_Cols) += V(j,i)*fact; |
| 320 | else { |
| 321 | opserr << "WARNING: Matrix::Assemble(const Matrix &V, const ID &l): "; |
| 322 | opserr << " - position (" << pos_Rows << "," << pos_Cols << ") outside bounds \n"; |
| 323 | res = -1; |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | return res; |
| 329 | } |
| 330 | |
| 331 | #ifdef _WIN32 |
| 332 |
no test coverage detected