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

Method addMatrixTransposeProduct

SRC/matrix/Matrix.cpp:870–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

868}
869
870int
871Matrix::addMatrixTransposeProduct(double thisFact,
872 const Matrix &B,
873 const Matrix &C,
874 double otherFact)
875{
876 if (thisFact == 1.0 && otherFact == 0.0)
877 return 0;
878
879#ifdef _G3DEBUG
880 if ((B.numCols != numRows) || (C.numCols != numCols) || (B.numRows != C.numRows)) {
881 opserr << "Matrix::addMatrixProduct(): incompatible matrices, this\n";
882 return -1;
883 }
884#endif
885
886 if (thisFact == 1.0) {
887 int numMults = C.numRows;
888 double *aijPtr = data;
889 for (int j=0; j<numCols; j++) {
890 for (int i=0; i<numRows; i++) {
891 double *bkiPtr = &(B.data)[i*numMults];
892 double *cjkPtr = &(C.data)[j*numMults];
893 double sum = 0.0;
894 for (int k=0; k<numMults; k++) {
895 sum += *bkiPtr++ * *cjkPtr++;
896 }
897 *aijPtr++ += sum * otherFact;
898 }
899 }
900 } else if (thisFact == 0.0) {
901 int numMults = C.numRows;
902 double *aijPtr = data;
903 for (int j=0; j<numCols; j++) {
904 for (int i=0; i<numRows; i++) {
905 double *bkiPtr = &(B.data)[i*numMults];
906 double *cjkPtr = &(C.data)[j*numMults];
907 double sum = 0.0;
908 for (int k=0; k<numMults; k++) {
909 sum += *bkiPtr++ * *cjkPtr++;
910 }
911 *aijPtr++ = sum * otherFact;
912 }
913 }
914 } else {
915 int numMults = C.numRows;
916 double *aijPtr = data;
917 for (int j=0; j<numCols; j++) {
918 for (int i=0; i<numRows; i++) {
919 double *bkiPtr = &(B.data)[i*numMults];
920 double *cjkPtr = &(C.data)[j*numMults];
921 double sum = 0.0;
922 for (int k=0; k<numMults; k++) {
923 sum += *bkiPtr++ * *cjkPtr++;
924 }
925 *aijPtr = *aijPtr * thisFact + sum * otherFact;
926 aijPtr++;
927 }

Callers 15

SSPbrickUP.cppFile · 0.45
GetPermeabilityMatrixMethod · 0.45
getLMethod · 0.45
getdLMethod · 0.45
getdFpMethod · 0.45
MINI.cppFile · 0.45
calculateAllMethod · 0.45
calculateAllMethod · 0.45
transformToGlobalMethod · 0.45
transformToGlobalMethod · 0.45
transformToGlobalMethod · 0.45
transformToGlobalMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected