Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
Matrix Class Reference#include <Matrix.h>
List of all members.
Public Methods |
| Matrix () |
| constructors and destructor. More...
|
| Matrix (int nrows, int ncols) |
| Matrix (double *data, int nrows, int ncols) |
| Matrix (const Matrix &M) |
| ~Matrix () |
int | noRows () const |
| utility methods. More...
|
int | noCols () const |
void | Zero (void) |
int | resize (int numRow, int numCol) |
int | Assemble (const Matrix &,const ID &rows, const ID &cols, double fact=1.0) |
int | Solve (const Vector &V, Vector &res) const |
int | Solve (const Matrix &M, Matrix &res) const |
int | addMatrix (double factThis, const Matrix &other, double factOther) |
int | addMatrixProduct (double factThis, const Matrix &A, const Matrix &B, double factOther) |
int | addMatrixTripleProduct (double factThis, const Matrix &A, const Matrix &B, double factOther) |
| AB. More...
|
double& | operator() (int row, int col) |
| overloaded operators all of which are pure. More...
|
double | operator() (int row, int col) const |
Matrix | operator() (const ID &rows, const ID &cols) const |
Matrix& | operator= (const Matrix &M) |
Matrix& | operator= (const Tensor &T) |
Matrix& | operator+= (double fact) |
| matrix-scalar operations. More...
|
Matrix& | operator-= (double fact) |
Matrix& | operator *= (double fact) |
Matrix& | operator/= (double fact) |
Matrix | operator+ (double fact) const |
| matrix-scalar operations. More...
|
Matrix | operator- (double fact) const |
Matrix | operator * (double fact) const |
Matrix | operator/ (double fact) const |
Vector | operator * (const Vector &V) const |
| matrix-vector operations. More...
|
Vector | operator^ (const Vector &V) const |
Matrix | operator+ (const Matrix &M) const |
| matrix-matrix operations. More...
|
Matrix | operator- (const Matrix &M) const |
Matrix | operator * (const Matrix &M) const |
Matrix | operator^ (const Matrix &M) const |
| Matrix operator/(const Matrix &M) const;. More...
|
Matrix& | operator+= (const Matrix &M) |
Matrix& | operator-= (const Matrix &M) |
void | Output (ostream &s) const |
| methods to read/write to/from the matrix. More...
|
void | Input (istream &s) |
int | Assemble (const Matrix &V, int init_row, int init_col, double fact=1.0) |
| methods added by Remo. More...
|
int | AssembleTranspose (const Matrix &V, int init_row, int init_col, double fact=1.0) |
int | Extract (const Matrix &V, int init_row, int init_col, double fact=1.0) |
Friends |
ostream& | operator<< (ostream &s, const Matrix &M) |
istream& | operator>> (istream &s, Matrix &M) |
Matrix | operator * (double a, const Matrix &M) |
Detailed Description
The Matrix class provides the matrix abstraction. A matrix of order numRows X numCols is an ordered 2d array of numbers arranged in numRows rows and numCols columns. For example, a matrix
of order 2 X 3:
A = \left[ \begin{array}{ccc} a_{0,0} & a_{0,1} & a_{0,2} \ a_{1,0} & a_{1,1} & a_{1,2} \ \end{array} \right]
The Matrix class provides the implementation of a general unsymmetric matrix. The data for the matrix is stored in a 1d double array of size numRows*numCols with the data for
located at j*numRows + i in the 1d array. This is similar to the ordering of a Fortran 2d array and will permit calls to numerical Fortran libraries, e.g. BLAS, for certain method calls at a future stage. At present no subclassing is permitted (THIS MAY CHANGE), the reason for this is that the Matrix objects are envisioned to be small scale matrices primarily used for the passing of data between objects in the system. To allow subclassing could reduce the efficiency of the program due to the manner in which virtual functions are implemented.\
Definition at line 81 of file Matrix.h.
Constructor & Destructor Documentation
|
constructors and destructor.
Definition at line 54 of file Matrix.cpp. |
Matrix::Matrix (
|
int nrows,
|
|
int ncols )
|
|
|
To construct a Matrix with numRows =
, and numCols =
. No memory is allocated to store the data.
Definition at line 61 of file Matrix.cpp. |
Matrix::Matrix (
|
double * data,
|
|
int nrows,
|
|
int ncols )
|
|
Matrix::Matrix (
|
const Matrix & M )
|
|
|
To construct a Matrix with numRows = {nrows}, and numCols = {ncols} and all coefficients equal to
. The memory for storage of the data is found at the location pointed to by {data}. Note that this memory must have been previously allocated and it must be of appropriate size, erroneous results and segmentation faults can occur otherwise. No additional memory is allocated for the storage of the data.
Definition at line 114 of file Matrix.cpp. |
Member Function Documentation
int Matrix::Assemble (
|
const Matrix & V,
|
|
int init_row,
|
|
int init_col,
|
|
double fact = 1.0 )
|
|
int Matrix::Assemble (
|
const Matrix & V,
|
|
const ID & rows,
|
|
const ID & cols,
|
|
double fact = 1.0 )
|
|
int Matrix::AssembleTranspose (
|
const Matrix & V,
|
|
int init_row,
|
|
int init_col,
|
|
double fact = 1.0 )
|
|
int Matrix::Extract (
|
const Matrix & V,
|
|
int init_row,
|
|
int init_col,
|
|
double fact = 1.0 )
|
|
void Matrix::Input (
|
istream & s )
|
|
void Matrix::Output (
|
ostream & s ) const
|
|
int Matrix::Solve (
|
const Matrix & M,
|
|
Matrix & res ) const
|
|
void Matrix::Zero (
|
void )
|
|
|
Zero's out the Matrix, i.e. sets all the components of the matrix to
. The method tests for the type of Matrix, to see whether the performance can be improved by avoiding having to call the overloaded (i,j) operators if the Matrix is of type genMatrix.
Definition at line 158 of file Matrix.cpp.
Referenced by LagrangeMP_FE::LagrangeMP_FE(), LagrangeSP_FE::LagrangeSP_FE(), RigidBeam::RigidBeam(), RigidDiaphragm::RigidDiaphragm(), RigidRod::RigidRod(), EnhancedQuad::displaySelf(), TransformationDOF_Group::doneID(), ZeroLengthSection::getDamp(), ZeroLengthND::getDamp(), ZeroLength::getDamp(), TrussSection::getDamp(), Truss::getDamp(), FourNodeQuad::getDamp(), ElasticBeam3d::getDamp(), ElasticBeam2d::getDamp(), DispBeamColumn3d::getDamp(), DispBeamColumn2d::getDamp(), CorotTruss::getDamp(), ZeroLengthSection::getMass(), ZeroLengthND::getMass(), ZeroLength::getMass(), TrussSection::getMass(), Truss::getMass(), FourNodeQuad::getMass(), ElasticBeam3d::getMass(), ElasticBeam2d::getMass(), DispBeamColumn3d::getMass(), DispBeamColumn2d::getMass(), CorotTruss::getMass(), TrussSection::getResponse(), Truss::getSecantStiff(), TransformationDOF_Group::getT(), ZeroLengthND::getTangentStiff(), ZeroLength::getTangentStiff(), TrussSection::getTangentStiff(), Truss::getTangentStiff(), FourNodeQuad::getTangentStiff(), DispBeamColumn3d::getTangentStiff(), DispBeamColumn2d::getTangentStiff(), CorotTruss::getTangentStiff(), J2Plasticity::plastic_integrator(), ElasticIsotropic3D::recvSelf(), SectionAggregator::revertToStart(), NLBeamColumn3d::revertToStart(), NLBeamColumn2d::revertToStart(), BeamWithHinges3d::revertToStart(), BeamWithHinges2d::revertToStart(), Node::setNumColR(), Node::setNumEigenvectors(), NLBeamColumn3d::update(), NLBeamColumn2d::update(), J2Plasticity::zero(), FE_Element::zeroTangent(), and DOF_Group::zeroTangent().
|
int Matrix::addMatrix (
|
double factThis,
|
|
const Matrix & other,
|
|
double factOther )
|
|
int Matrix::addMatrixProduct (
|
double factThis,
|
|
const Matrix & A,
|
|
const Matrix & B,
|
|
double factOther )
|
|
int Matrix::addMatrixTripleProduct (
|
double factThis,
|
|
const Matrix & A,
|
|
const Matrix & B,
|
|
double factOther )
|
|
int Matrix::noCols (
|
) const [inline]
|
|
|
Returns the number of columns, numCols, of the Matrix.
Definition at line 274 of file Matrix.h.
Referenced by DOF_Group::DOF_Group(), FE_Element::FE_Element(), Input(), LagrangeMP_FE::LagrangeMP_FE(), LagrangeSP_FE::LagrangeSP_FE(), MP_Constraint::MP_Constraint(), Output(), PenaltyMP_FE::PenaltyMP_FE(), PenaltySP_FE::PenaltySP_FE(), TransformationDOF_Group::TransformationDOF_Group(), SymArpackSOE::addA(), SparseGenColLinSOE::addA(), ProfileSPDLinSOE::addA(), FullGenLinSOE::addA(), BandSPDLinSOE::addA(), BandGenLinSOE::addA(), BandArpackSOE::addA(), Node::addInertiaLoadToUnbalance(), Vector::addMatrixTransposeVector(), Vector::addMatrixVector(), TransformationDOF_Group::doneID(), X11Renderer::drawPolygon(), Node::getRV(), TransformationFE::getResidual(), TransformationFE::getTangent(), PlainHandler::handle(), Vector::operator/(), FileDatastore::recvMatrix(), FileDatastore::sendMatrix(), Node::sendSelf(), MP_Constraint::sendSelf(), TrussSection::setDomain(), Truss::setDomain(), Node::setEigenvector(), TransformationFE::setID(), FE_Element::setKc(), Node::setMass(), Node::setNumColR(), Node::setNumEigenvectors(), Node::setR(), and TransformationFE::transformResponse().
|
int Matrix::noRows (
|
) const [inline]
|
|
|
utility methods.
Definition at line 267 of file Matrix.h.
Referenced by DOF_Group::DOF_Group(), FE_Element::FE_Element(), Input(), LagrangeMP_FE::LagrangeMP_FE(), Output(), TransformationDOF_Group::TransformationDOF_Group(), SymArpackSOE::addA(), SparseGenColLinSOE::addA(), ProfileSPDLinSOE::addA(), FullGenLinSOE::addA(), BandSPDLinSOE::addA(), BandGenLinSOE::addA(), BandArpackSOE::addA(), TransformationDOF_Group::addM_Force(), Vector::addMatrixTransposeVector(), Vector::addMatrixVector(), TransformationDOF_Group::doneID(), X11Renderer::drawPolygon(), Node::getMass(), PlainHandler::handle(), Vector::operator/(), FileDatastore::recvMatrix(), FileDatastore::sendMatrix(), MP_Constraint::sendSelf(), TransformationFE::setID(), Node::setMass(), and Node::setNumColR().
|
Matrix Matrix::operator * (
|
const Matrix & M ) const
|
|
|
matrix-vector operations.
Definition at line 969 of file Matrix.cpp. |
Matrix Matrix::operator * (
|
double fact ) const
|
|
Matrix & Matrix::operator *= (
|
double fact )
|
|
Matrix Matrix::operator() (
|
const ID & rows,
|
|
const ID & cols ) const
|
|
double Matrix::operator() (
|
int row,
|
|
int col ) const [inline]
|
|
double & Matrix::operator() (
|
int row,
|
|
int col ) [inline]
|
|
|
overloaded operators all of which are pure.
Definition at line 282 of file Matrix.h. |
Matrix Matrix::operator+ (
|
const Matrix & M ) const
|
|
Matrix Matrix::operator+ (
|
double fact ) const
|
|
|
matrix-scalar operations.
Definition at line 928 of file Matrix.cpp. |
Matrix & Matrix::operator+= (
|
const Matrix & M )
|
|
Matrix & Matrix::operator+= (
|
double fact )
|
|
|
matrix-scalar operations.
Definition at line 847 of file Matrix.cpp. |
Matrix Matrix::operator- (
|
const Matrix & M ) const
|
|
Matrix Matrix::operator- (
|
double fact ) const
|
|
Matrix & Matrix::operator-= (
|
const Matrix & M )
|
|
Matrix & Matrix::operator-= (
|
double fact )
|
|
Matrix Matrix::operator/ (
|
double fact ) const
|
|
Matrix & Matrix::operator/= (
|
double fact )
|
|
Matrix & Matrix::operator= (
|
const Tensor & T )
|
|
Matrix & Matrix::operator= (
|
const Matrix & M )
|
|
Matrix Matrix::operator^ (
|
const Matrix & M ) const
|
|
|
Matrix operator/(const Matrix &M) const;.
Definition at line 1079 of file Matrix.cpp. |
int Matrix::resize (
|
int numRow,
|
|
int numCol )
|
|
Friends And Related Function Documentation
Matrix operator * (
|
double a,
|
|
const Matrix & M ) [friend]
|
|
ostream & operator<< (
|
ostream & s,
|
|
const Matrix & M ) [friend]
|
|
istream & operator>> (
|
istream & s,
|
|
Matrix & M ) [friend]
|
|
The documentation for this class was generated from the following files:
|