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

Method Solve

SRC/matrix/Matrix.cpp:365–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363#endif
364
365int
366Matrix::Solve(const Vector &b, Vector &x) const
367{
368
369 int n = numRows;
370
371#ifdef _G3DEBUG
372 if (numRows != numCols) {
373 opserr << "Matrix::Solve(b,x) - the matrix of dimensions "
374 << numRows << ", " << numCols << " is not square " << endln;
375 return -1;
376 }
377
378 if (n != x.Size()) {
379 opserr << "Matrix::Solve(b,x) - dimension of x, " << numRows << "is not same as matrix " << x.Size() << endln;
380 return -2;
381 }
382
383 if (n != b.Size()) {
384 opserr << "Matrix::Solve(b,x) - dimension of x, " << numRows << "is not same as matrix " << b.Size() << endln;
385 return -2;
386 }
387#endif
388
389 // check work area can hold all the data
390 if (dataSize > sizeDoubleWork) {
391
392 if (matrixWork != 0) {
393 delete [] matrixWork;
394 matrixWork = 0;
395 }
396 matrixWork = new (nothrow) double[dataSize];
397 sizeDoubleWork = dataSize;
398
399 if (matrixWork == 0) {
400 opserr << "WARNING: Matrix::Solve() - out of memory creating work area's\n";
401 sizeDoubleWork = 0;
402 return -3;
403 }
404 }
405
406 // check work area can hold all the data
407 if (n > sizeIntWork) {
408
409 if (intWork != 0) {
410 delete [] intWork;
411 intWork = 0;
412 }
413 intWork = new (nothrow) int[n];
414 sizeIntWork = n;
415
416 if (intWork == 0) {
417 opserr << "WARNING: Matrix::Solve() - out of memory creating work area's\n";
418 sizeIntWork = 0;
419 return -3;
420 }
421 }
422

Callers 15

invIsoMappingFunction · 0.45
getCBDIinfluenceMatrixFunction · 0.45
getTheta0Method · 0.45
updateMethod · 0.45
updateMethod · 0.45
updateMethod · 0.45
getSectionWeightsMethod · 0.45
getWeightsDerivMethod · 0.45
updateMethod · 0.45

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected