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

Method Extract

SRC/matrix/Matrix.cpp:1745–1778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1743
1744
1745int
1746Matrix::Extract(const Matrix &V, int init_row, int init_col, double fact)
1747{
1748 int pos_Rows, pos_Cols;
1749 int res = 0;
1750
1751 int VnumRows = V.numRows;
1752 int VnumCols = V.numCols;
1753
1754 int final_row = init_row + numRows - 1;
1755 int final_col = init_col + numCols - 1;
1756
1757 if ((init_row >= 0) && (final_row < VnumRows) && (init_col >= 0) && (final_col < VnumCols))
1758 {
1759 for (int i=0; i<numCols; i++)
1760 {
1761 pos_Cols = init_col + i;
1762 for (int j=0; j<numRows; j++)
1763 {
1764 pos_Rows = init_row + j;
1765
1766 (*this)(j,i) = V(pos_Rows,pos_Cols)*fact;
1767 }
1768 }
1769 }
1770 else
1771 {
1772 opserr << "WARNING: Matrix::Extract(const Matrix &V, int init_row, int init_col, double fact): ";
1773 opserr << "position outside bounds \n";
1774 res = -1;
1775 }
1776
1777 return res;
1778}
1779
1780
1781Matrix operator*(double a, const Matrix &V)

Callers 15

setDomainMethod · 0.45
updateMethod · 0.45
setDomainMethod · 0.45
updateMethod · 0.45
updateMethod · 0.45
updateMethod · 0.45
formRMethod · 0.45
formKMethod · 0.45
updateMethod · 0.45
getdDef_duMethod · 0.45
formRMethod · 0.45
formKMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected