MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / Assemble

Method Assemble

SRC/matrix/Matrix.cpp:306–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304
305
306int
307Matrix::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

Callers 15

updateMethod · 0.45
getResponseMethod · 0.45
getResponseMethod · 0.45
getResponseMethod · 0.45
getResponseMethod · 0.45
updateMethod · 0.45
GenericClient.cppFile · 0.45
GenericCopy.cppFile · 0.45

Calls 3

colsFunction · 0.85
rowsFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected