| 1743 | |
| 1744 | |
| 1745 | int |
| 1746 | Matrix::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 | |
| 1781 | Matrix operator*(double a, const Matrix &V) |
no outgoing calls
no test coverage detected