Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Vector Class Reference

#include <Vector.h>

List of all members.

Public Methods

 Vector ()
 constructors and destructor. More...

 Vector (int)
 Vector (const Vector &)
 Vector (double *data, int size)
 ~Vector ()
int setData (double *newData, int size)
 utility methods. More...

int Assemble (const Vector &V, const ID &l, double fact=1.0)
double Norm (void) const
int Size (void) const
int resize (int newSize)
void Zero (void)
int Normalize (void)
int addVector (double factThis, const Vector &other, double factOther)
int addMatrixVector (double factThis, const Matrix &m, const Vector &v, double factOther)
int addMatrixTransposeVector (double factThis, const Matrix &m, const Vector &v, double factOther)
double operator() (int x) const
 overloaded operators. More...

double& operator() (int x)
double operator[] (int x) const
double& operator[] (int x)
 these two operator do bounds checks. More...

Vector operator() (const ID &rows) const
Vector& operator= (const Vector &V)
Vector& operator= (const Tensor &T)
Vector& operator+= (double fact)
Vector& operator-= (double fact)
Vector& operator *= (double fact)
Vector& operator/= (double fact)
Vector operator+ (double fact) const
Vector operator- (double fact) const
Vector operator * (double fact) const
Vector operator/ (double fact) const
Vector& operator+= (const Vector &V)
Vector& operator-= (const Vector &V)
Vector operator+ (const Vector &V) const
Vector operator- (const Vector &V) const
double operator^ (const Vector &V) const
Vector operator/ (const Matrix &M) const
int Assemble (const Vector &V, int init_row, double fact=1.0)
 methods added by Remo. More...

int Extract (const Vector &V, int init_row, double fact=1.0)

Friends

ostream& operator<< (ostream &s, const Vector &V)
istream& operator>> (istream &s, Vector &V)
Vector operator * (double a, const Vector &V)


Detailed Description

The Vector class provides the vector abstraction. A vector of order {size} is an ordered 1d array of {size} numbers. For example a vector of order 5: \

\

In the Vector class the data is stored in a 1d double array of length equal to the order of the Vector. At present time none of the methods are declared as being virtual. THIS MAY CHANGE FOR PARALLEL. \

Definition at line 70 of file Vector.h.


Constructor & Destructor Documentation

Vector::Vector ( )
 

constructors and destructor.

Definition at line 48 of file Vector.cpp.

Vector::Vector ( int size )
 

To construct a Vector of order .

Definition at line 66 of file Vector.cpp.

Vector::Vector ( const Vector & other )
 

To construct a Vector of order {size}. The constructor creates an array to store the data and zeroes this array. If not enough memory is available a warning message is printed and a Vector of order is returned. The {Zero()} method is invoked on the new Vector before it is returned.

Definition at line 110 of file Vector.cpp.

Vector::Vector ( double * data,
int size )
 

To construct a Vector of order {size} whose data will be stored in the array pointed to by {data}. The array pointed to by data is not set to zero by the constructor. Note that delete will not be called on this array in the destructor. It is up to the user to ensure that the array pointed to by {data} is at least as large as {size}, if this is not the case erroneous results or a segmentation fault may occur.

Definition at line 94 of file Vector.cpp.

Vector::~Vector ( )
 

To construct a Vector using another Vector. The new Vector will be identical to the Vector {other}. The constructor creates an array to store the data and zeroes this array. If not enough memory is available a warning message is printed and a Vector of order is returned. The contents of the array are then set equal to the contents of {other}.

Definition at line 141 of file Vector.cpp.


Member Function Documentation

int Vector::Assemble ( const Vector & V,
int init_row,
double fact = 1.0 )
 

methods added by Remo.

Definition at line 1086 of file Vector.cpp.

int Vector::Assemble ( const Vector & V,
const ID & l,
double fact = 1.0 )
 

Assembles into the current Vector the Vector {V}. The contents of the current Vector at location ({loc(i)}) is set equal to the current value plus {fact} times the value of the Vector {V} at location ({i}). returns if successful. A warning message is printed for each invalid location in the current Vector or {V} and a is returned.

Definition at line 211 of file Vector.cpp.

int Vector::Extract ( const Vector & V,
int init_row,
double fact = 1.0 )
 

Definition at line 1111 of file Vector.cpp.

double Vector::Norm ( void ) const
 

Returns the 2 norm of the Vector. Returns the {sqrt()} of the result of invoking the operator on the current Vector with the current Vector as the argument.

Definition at line 614 of file Vector.cpp.

Referenced by LinearCrdTransf3d::LinearCrdTransf3d(), PDeltaCrdTransf3d::PDeltaCrdTransf3d(), ZeroLengthSection::setDomain(), ZeroLengthND::setDomain(), ZeroLength::setDomain(), CTestNormUnbalance::test(), CTestNormDispIncr::test(), CTestEnergyIncr::test(), NLBeamColumn3d::update(), and NLBeamColumn2d::update().

int Vector::Normalize ( void )
 

Definition at line 238 of file Vector.cpp.

int Vector::Size ( void ) const [inline]
 

{Vector &operator=(const Vector &other);}

Definition at line 233 of file Vector.h.

Referenced by Assemble(), DOF_Group::DOF_Group(), FE_Element::FE_Element(), LagrangeMP_FE::LagrangeMP_FE(), LagrangeSP_FE::LagrangeSP_FE(), LinearCrdTransf2d::LinearCrdTransf2d(), LinearCrdTransf3d::LinearCrdTransf3d(), PDeltaCrdTransf2d::PDeltaCrdTransf2d(), PDeltaCrdTransf3d::PDeltaCrdTransf3d(), PathSeries::PathSeries(), PathTimeSeries::PathTimeSeries(), PenaltyMP_FE::PenaltyMP_FE(), PenaltySP_FE::PenaltySP_FE(), RigidBeam::RigidBeam(), RigidDiaphragm::RigidDiaphragm(), RigidRod::RigidRod(), Matrix::Solve(), TransformationDOF_Group::TransformationDOF_Group(), SparseGenColLinSOE::addB(), ProfileSPDLinSOE::addB(), FullGenLinSOE::addB(), BandSPDLinSOE::addB(), BandGenLinSOE::addB(), TrussSection::addInertiaLoadToUnbalance(), Truss::addInertiaLoadToUnbalance(), Node::addInertiaLoadToUnbalance(), FourNodeQuad::addInertiaLoadToUnbalance(), ElasticBeam3d::addInertiaLoadToUnbalance(), ElasticBeam2d::addInertiaLoadToUnbalance(), EightNodeBrick::addInertiaLoadToUnbalance(), DispBeamColumn3d::addInertiaLoadToUnbalance(), DispBeamColumn2d::addInertiaLoadToUnbalance(), TrussSection::addLoad(), Truss::addLoad(), NLBeamColumn3d::addLoad(), NLBeamColumn2d::addLoad(), FourNodeQuad::addLoad(), ElasticBeam3d::addLoad(), ElasticBeam2d::addLoad(), EightNodeBrick::addLoad(), DispBeamColumn3d::addLoad(), DispBeamColumn2d::addLoad(), BeamWithHinges3d::addLoad(), BeamWithHinges2d::addLoad(), EarthquakePattern::addMotion(), Domain::addNode(), Node::addUnbalancedLoad(), Newmark::domainChanged(), MinUnbalDispNorm::domainChanged(), HHT::domainChanged(), DisplacementControl::domainChanged(), ArcLength::domainChanged(), TransformationDOF_Group::doneID(), X11Renderer::drawLine(), X11Renderer::drawPolygon(), X11Renderer::drawText(), PathTimeSeries::getDuration(), PathSeries::getDuration(), PathTimeSeries::getFactor(), PathSeries::getFactor(), PathTimeSeries::getPeakFactor(), PathSeries::getPeakFactor(), Node::getRV(), PenaltySP_FE::getResidual(), LagrangeSP_FE::getResidual(), DomainDecompositionAnalysis::getResidual(), PenaltySP_FE::getTangForce(), LagrangeSP_FE::getTangForce(), Node::getUnbalancedLoad(), DOF_Group::incrNodeDisp(), Node::incrTrialAccel(), Node::incrTrialDisp(), Node::incrTrialVel(), TrapezoidalTimeSeriesIntegrator::integrate(), operator *(), Matrix::operator *(), operator+(), operator-(), operator/(), operator<<(), operator>>(), Matrix::operator^(), MaxNodeDispRecorder::record(), PathTimeSeries::recvSelf(), PathSeries::recvSelf(), FileDatastore::recvVector(), PathTimeSeries::sendSelf(), PathSeries::sendSelf(), Node::sendSelf(), NodalLoad::sendSelf(), FileDatastore::sendVector(), SparseGenColLinSOE::setB(), ProfileSPDLinSOE::setB(), FullGenLinSOE::setB(), BandSPDLinSOE::setB(), BandGenLinSOE::setB(), Domain::setEigenvalues(), Node::setEigenvector(), TransformationFE::setID(), SymArpackSolver::setSize(), BandArpackSolver::setSize(), Node::setTrialAccel(), Node::setTrialDisp(), Node::setTrialVel(), NewtonLineSearch::solveCurrentStep(), Newmark::update(), HHT::update(), and DOF_Group::~DOF_Group().

void Vector::Zero ( void ) [inline]
 

Definition at line 241 of file Vector.h.

Referenced by LagrangeMP_FE::LagrangeMP_FE(), LagrangeSP_FE::LagrangeSP_FE(), TransformationFE::getD_Force(), FE_Element::getD_Force(), BandArpackSolver::getEigenvector(), TransformationFE::getKsForce(), FE_Element::getKsForce(), TransformationFE::getKtForce(), FE_Element::getKtForce(), TransformationFE::getLastResponse(), FE_Element::getLastResponse(), TransformationFE::getM_Force(), FE_Element::getM_Force(), Node::getRV(), ZeroLengthND::getResistingForce(), ZeroLength::getResistingForce(), TrussSection::getResistingForce(), Truss::getResistingForce(), FourNodeQuad::getResistingForce(), DispBeamColumn3d::getResistingForce(), DispBeamColumn2d::getResistingForce(), CorotTruss::getResistingForce(), BeamWithHinges3d::getResponse(), BeamWithHinges2d::getResponse(), TransformationFE::getTangForce(), FE_Element::getTangForce(), FourNodeQuad::getTangentStiff(), DispBeamColumn3d::getTangentStiff(), DispBeamColumn2d::getTangentStiff(), Node::recvSelf(), NLBeamColumn3d::recvSelf(), NLBeamColumn2d::recvSelf(), MaxNodeDispRecorder::restart(), NLBeamColumn3d::revertToLastCommit(), NLBeamColumn2d::revertToLastCommit(), SectionAggregator::revertToStart(), NLBeamColumn3d::revertToStart(), NLBeamColumn2d::revertToStart(), EnhancedQuad::revertToStart(), ElasticSection3d::revertToStart(), ElasticSection2d::revertToStart(), BeamWithHinges3d::revertToStart(), BeamWithHinges2d::revertToStart(), NLBeamColumn3d::setDomain(), NLBeamColumn2d::setDomain(), EnhancedQuad::setDomain(), BeamWithHinges2d::setDomain(), CTestNormUnbalance::start(), CTestNormDispIncr::start(), CTestEnergyIncr::start(), NLBeamColumn3d::update(), NLBeamColumn2d::update(), TrussSection::zeroLoad(), Truss::zeroLoad(), NLBeamColumn3d::zeroLoad(), NLBeamColumn2d::zeroLoad(), FourNodeQuad::zeroLoad(), ElasticBeam3d::zeroLoad(), ElasticBeam2d::zeroLoad(), DispBeamColumn3d::zeroLoad(), BeamWithHinges3d::zeroLoad(), BeamWithHinges2d::zeroLoad(), FE_Element::zeroResidual(), DOF_Group::zeroUnbalance(), and Node::zeroUnbalancedLoad().

int Vector::addMatrixTransposeVector ( double factThis,
const Matrix & m,
const Vector & v,
double factOther )
 

Definition at line 463 of file Vector.cpp.

Referenced by ZeroLengthSection::getResistingForce(), CorotTruss::getResistingForce(), NLBeamColumn3d::update(), and NLBeamColumn2d::update().

int Vector::addMatrixVector ( double factThis,
const Matrix & m,
const Vector & v,
double factOther )
 

Definition at line 330 of file Vector.cpp.

Referenced by EightNodeBrick::FormEquiBodyForce(), FE_Element::addD_Force(), FE_Element::addKcForce(), FE_Element::addKiForce(), FE_Element::addKsForce(), FE_Element::addKtForce(), FE_Element::addLocalD_Force(), FE_Element::addLocalKcForce(), FE_Element::addLocalKiForce(), FE_Element::addLocalKsForce(), FE_Element::addLocalKtForce(), FE_Element::addLocalM_Force(), DOF_Group::addLocalM_Force(), FE_Element::addM_Force(), DOF_Group::addM_Force(), FE_Element::getD_Force(), FE_Element::getKsForce(), FE_Element::getKtForce(), FE_Element::getM_Force(), NLBeamColumn3d::getResistingForceIncInertia(), NLBeamColumn2d::getResistingForceIncInertia(), FE_Element::getTangForce(), Node::getUnbalancedLoadIncInertia(), NLBeamColumn3d::update(), and NLBeamColumn2d::update().

int Vector::addVector ( double factThis,
const Vector & other,
double factOther )
 

Definition at line 254 of file Vector.cpp.

Referenced by FourNodeQuad::addLoad(), ElasticBeam3d::addLoad(), ElasticBeam2d::addLoad(), DispBeamColumn3d::addLoad(), BeamWithHinges3d::addLoad(), BeamWithHinges2d::addLoad(), DOF_Group::addPIncInertiaToUnbalance(), DOF_Group::addPtoUnbalance(), FE_Element::addRIncInertiaToResidual(), FE_Element::addRtoResidual(), Node::addUnbalancedLoad(), FourNodeQuad::getResistingForce(), ElasticBeam3d::getResistingForce(), ElasticBeam2d::getResistingForce(), DispBeamColumn3d::getResistingForce(), BeamWithHinges3d::getResistingForce(), BeamWithHinges2d::getResistingForce(), Newmark::newStep(), HHT::newStep(), KrylovNewton::solveCurrentStep(), NLBeamColumn3d::update(), NLBeamColumn2d::update(), Newmark::update(), MinUnbalDispNorm::update(), HHT::update(), DisplacementControl::update(), and ArcLength::update().

Vector Vector::operator * ( double fact ) const
 

Definition at line 875 of file Vector.cpp.

Vector & Vector::operator *= ( double fact )
 

Definition at line 807 of file Vector.cpp.

Vector Vector::operator() ( const ID & rows ) const
 

Definition at line 659 of file Vector.cpp.

double & Vector::operator() ( int x ) [inline]
 

Definition at line 264 of file Vector.h.

double Vector::operator() ( int x ) const [inline]
 

overloaded operators.

Definition at line 248 of file Vector.h.

Vector Vector::operator+ ( const Vector & V ) const
 

Definition at line 955 of file Vector.cpp.

Vector Vector::operator+ ( double fact ) const
 

Definition at line 841 of file Vector.cpp.

Vector & Vector::operator+= ( const Vector & V )
 

Definition at line 911 of file Vector.cpp.

Vector & Vector::operator+= ( double fact )
 

Definition at line 781 of file Vector.cpp.

Vector Vector::operator- ( const Vector & V ) const
 

Definition at line 983 of file Vector.cpp.

Vector Vector::operator- ( double fact ) const
 

Definition at line 858 of file Vector.cpp.

Vector & Vector::operator-= ( const Vector & V )
 

Definition at line 933 of file Vector.cpp.

Vector & Vector::operator-= ( double fact )
 

Definition at line 794 of file Vector.cpp.

Vector Vector::operator/ ( const Matrix & M ) const
 

Definition at line 1034 of file Vector.cpp.

Vector Vector::operator/ ( double fact ) const
 

Definition at line 891 of file Vector.cpp.

Vector & Vector::operator/= ( double fact )
 

Definition at line 820 of file Vector.cpp.

Vector & Vector::operator= ( const Tensor & T )
 

Definition at line 728 of file Vector.cpp.

Vector & Vector::operator= ( const Vector & V )
 

Definition at line 691 of file Vector.cpp.

double & Vector::operator[] ( int subscript )
 

these two operator do bounds checks.

Definition at line 626 of file Vector.cpp.

double Vector::operator[] ( int subscript ) const
 

Definition at line 639 of file Vector.cpp.

double Vector::operator^ ( const Vector & V ) const
 

Definition at line 1010 of file Vector.cpp.

int Vector::resize ( int newSize )
 

Definition at line 168 of file Vector.cpp.

Referenced by CTestNormUnbalance::recvSelf(), CTestNormDispIncr::recvSelf(), CTestEnergyIncr::recvSelf(), and UniformExcitation::setDomain().

int Vector::setData ( double * newData,
int size )
 

utility methods.

Definition at line 150 of file Vector.cpp.


Friends And Related Function Documentation

Vector operator * ( double a,
const Vector & V ) [friend]
 

Definition at line 1079 of file Vector.cpp.

ostream & operator<< ( ostream & s,
const Vector & V ) [friend]
 

Definition at line 1057 of file Vector.cpp.

istream & operator>> ( istream & s,
Vector & V ) [friend]
 

Definition at line 1069 of file Vector.cpp.


The documentation for this class was generated from the following files:
Copyright Contact Us