XC Open source finite element analysis program
Public Member Functions | Friends | List of all members
XC::Vector Class Reference
Inheritance diagram for XC::Vector:
XC::EsfBeamColumn3d XC::MovableVector

Public Member Functions

 Vector (void)
 Standard constructor, sets size= 0;.
 
 Vector (const int &, const double &valor=0.0)
 Constructor used to allocate a vector of size size.
 
 Vector (const std::vector< double > &v)
 
 Vector (const Vector2d &v)
 
 Vector (const Vector3d &v)
 
 Vector (const double &, const double &, const double &)
 
 Vector (const Vector &)
 Constructor to init a vector from another.
 
 Vector (double *data, int size)
 Constructor.
 
 Vector (const boost::python::list &)
 Constructor (interfaz Python).
 
virtual ~Vector (void)
 destructor, deletes the [] data
 
int setData (double *newData, int size)
 
const double * getDataPtr (void) const
 
double * getDataPtr (void)
 
bool Nulo (void) const
 
int Assemble (const Vector &V, const ID &l, double fact=1.0)
 Method to assemble into object the XC::Vector V using the XC::ID l. If XC::ID(x) does not exist program writes error message if VECTOR_CHECK defined, otherwise ignores it and goes on.
 
double Norm2 (void) const
 Returns the cuadrado del módulo del vector.
 
double Norm (void) const
 Method to return the norm of vector.
 
double pNorm (int p) const
 
double NormInf (void) const
 Returns the máximo de los valores absolutos de las componentes del vector (norma_infinito).
 
int Size (void) const
 
int getNumBytes (void) const
 
int resize (int newSize)
 Changes vector size.
 
void Zero (void)
 
bool isnan (void) const
 
int reset (const int &newSize)
 
int Normalize (void)
 Normalizes the vector with the euclidean norm.
 
int NormalizeInf (void)
 Normaliza el vector con la norma_infinito.
 
Vector Normalized (void) const
 Returns the normalized vector con la norma euclidea.
 
Vector NormalizedInf (void) const
 Returns the normalized vector con la norma_infinito.
 
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)
 
virtual double & at (const size_t &f)
 Returns the element at the row being passed as parameter. More...
 
virtual const double & at (const size_t &f) const
 Returns the element at the row being passed as parameter. More...
 
virtual bool CheckIndice0 (const size_t &i) const
 Check the index being passed as parameter. More...
 
const double & operator() (int x) const
 
double & operator() (int x)
 
const double & operator[] (int x) const
 
double & operator[] (int x)
 
Vector operator() (const ID &rows) const
 Method to return a vector whose components are the components of the current vector located in positions given by the XC::ID rows.
 
Vectoroperator= (const Vector &V)
 the assignment operator, This is assigned to be a copy of V. if sizes are not compatable this.theData [] is deleted. The data pointers will not point to the same area in mem after the assignment.
 
template<class TNSR >
Vectoroperator= (const TNSR &T)
 
Vectoroperator+= (double fact)
 The += operator adds fact to each element of the vector, data[i]= data[i]+fact.
 
Vectoroperator-= (double fact)
 The -= operator subtracts fact from each element of the vector, data[i]= data[i]-fact.
 
Vectoroperator*= (double fact)
 The *= operator multiplies each element by the factor.
 
Vectoroperator/= (double fact)
 The /= operator divides each element of the vector by fact, theData[i]= theData[i]/fact. Program exits if divide-by-zero would occur with warning message.
 
Vector operator+ (double fact) const
 The + operator returns a XC::Vector of the same size as current, whose components are return(i)= theData[i]+fact;.
 
Vector operator- (double fact) const
 The + operator returns a XC::Vector of the same size as current, whose components are return(i)= theData[i]-fact;.
 
Vector operator* (double fact) const
 The + operator returns a XC::Vector of the same size as current, whose components are return(i)= theData[i]*fact;.
 
Vector operator/ (double fact) const
 The + operator returns a XC::Vector of the same size as current, whose components are return(i)= theData[i]/fact; Exits if divide-by-zero error.
 
Vectoroperator+= (const Vector &V)
 The += operator adds V's data to data, data[i]+=V(i). A check to see if vectors are of same size is performed if VECTOR_CHECK is defined.
 
Vectoroperator-= (const Vector &V)
 The -= operator subtracts V's data from data, data[i]+=V(i). A check to see if vectors are of same size is performed if VECTOR_CHECK is defined.
 
Vector operator+ (const Vector &V) const
 
Vector operator- (const Vector &V) const
 The - operator checks the two vectors are of the same size and then returns a XC::Vector whose components are the vector difference of current and V's data.
 
double operator^ (const Vector &V) const
 Method to perform (Vector)transposed * vector.
 
Vector operator/ (const Matrix &M) const
 Method to return inv(M)*this.
 
double dot (const Vector &) const
 
int Assemble (const Vector &V, int init_row, double fact=1.0)
 
int Extract (const Vector &V, int init_row, double fact=1.0)
 
Vector getComponents (const ID &) const
 Returns a vector with the specified subset of components.
 
void putComponents (const Vector &, const ID &)
 Assigns the specified values to the specified set of vecto's components.
 
void addComponents (const Vector &, const ID &)
 Sums the specified values to the specified set of vecto's components.
 
void write (std::ofstream &)
 Escribe el vector en un archivo binario.
 
void read (std::ifstream &)
 Lee el vector de un archivo binario.
 
std::string toString (void) const
 

Friends

class Message
 
class SystemOfEqn
 
class Matrix
 
class TCP_SocketNoDelay
 
class TCP_Socket
 
class UDP_Socket
 
class MPI_Channel
 
std::ostream & operator<< (std::ostream &s, const Vector &)
 
std::string to_string (const Vector &)
 
Vector operator* (double a, const Vector &V)
 

Member Function Documentation

double & XC::Vector::at ( const size_t &  f)
virtual

Returns the element at the row being passed as parameter.

Returns the number at the row being passed as parameter.

const double & XC::Vector::at ( const size_t &  f) const
virtual

Returns the element at the row being passed as parameter.

Returns the number at the row being passed as parameter.

bool XC::Vector::CheckIndice0 ( const size_t &  i) const
virtual

Check the index being passed as parameter.

Checks the renge for the index being passed as parameter.

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

The + operator checks the two vectors are of the same size if VECTOR_CHECK is defined. Then returns a XC::Vector whose components are the vector sum of current and V's data.


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