Go to the documentation of this file.
7 #ifndef __IPCOMPOUNDVECTOR_HPP__
8 #define __IPCOMPOUNDVECTOR_HPP__
18 class CompoundVectorSpace;
68 inline Index NComps()
const;
218 const std::string& name,
220 const std::string& prefix
261 inline const Vector* ConstComp(
309 return ncomp_spaces_;
314 bool create_new =
true
322 return MakeNewCompoundVector();
virtual void SetImpl(Number value)
Set each element in the vector to the scalar alpha.
virtual Number SumLogsImpl() const
Sum of logs of entries in the vector.
CompoundVector(const CompoundVector &)
Copy Constructor.
virtual Number Nrm2Impl() const
Computes the 2-norm of this vector (DNRM2)
CompoundVectorSpace()
Default constructor.
virtual void ElementWiseDivideImpl(const Vector &x)
Element-wise division .
SmartPtr< const VectorSpace > GetCompSpace(Index icomp) const
Method for obtaining an individual component VectorSpace.
virtual Number AmaxImpl() const
Computes the max-norm of this vector (based on IDAMAX)
virtual void ElementWiseReciprocalImpl()
Reciprocates the elements of the vector.
CompoundVectorSpace(Index ncomp_spaces, Index total_dim)
Constructor, has to be given the number of components and the total dimension of all components combi...
bool IsCompNull(Index i) const
Check if a particular component is null or not.
void AddTwoVectorsImpl(Number a, const Vector &v1, Number b, const Vector &v2, Number c)
Add two vectors (a * v1 + b * v2).
This file contains a base class for all exceptions and a set of macros to help with exceptions.
double Number
Type of all numbers.
std::vector< SmartPtr< const VectorSpace > > comp_spaces_
std::vector of vector spaces for the components
Index NCompSpaces() const
Accessor method to obtain the number of components.
virtual void ElementWiseSqrtImpl()
Take elementwise square-root of the elements of the vector.
std::vector< SmartPtr< Vector > > comps_
Components of the compound vector.
virtual Number MinImpl() const
Min number in the vector.
virtual void PrintImpl(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
Print the entire vector.
virtual void AxpyImpl(Number alpha, const Vector &x)
Add the multiple alpha of vector x to this vector (DAXPY)
EJournalLevel
Print Level Enum.
SmartPtr< const Vector > GetComp(Index i) const
Return a particular component (const version)
bool IsCompConst(Index i) const
Check if a particular component is const or not.
virtual void CopyImpl(const Vector &x)
Copy the data of the vector x into this vector (DCOPY).
virtual Vector * MakeNew() const
Pure virtual method for creating a new Vector of the corresponding type.
virtual void ScalImpl(Number alpha)
Scales the vector by scalar alpha (DSCAL)
void SetCompNonConst(Index icomp, Vector &vec)
Method for setting the pointer for a component that is a non-const Vector.
virtual ~CompoundVector()
Default destructor.
SmartPtr< Vector > GetCompNonConst(Index i)
Return a particular component (non-const version).
Number FracToBoundImpl(const Vector &delta, Number tau) const
Fraction to boundary parameter.
int Index
Type of all indices of vectors, matrices etc.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
Template class for Smart Pointers.
CompoundVectorSpace & operator=(const CompoundVectorSpace &)
Default Assignment Operator.
EJournalCategory
Category Selection Enum.
Index NComps() const
Number of components of this compound vector.
void AddVectorQuotientImpl(Number a, const Vector &z, const Vector &s, Number c)
Add the quotient of two vectors.
virtual void ElementWiseAbsImpl()
Take elementwise absolute values of the elements of the vector.
const Index ncomp_spaces_
Number of components.
virtual void SetCompSpace(Index icomp, const VectorSpace &vec_space)
Method for setting the individual component VectorSpaces.
CompoundVector(const CompoundVectorSpace *owner_space, bool create_new)
Constructor, given the corresponding CompoundVectorSpace.
Class responsible for all message output.
const Vector * ConstComp(Index i) const
virtual void AddScalarImpl(Number scalar)
Add scalar to every component of vector.
std::vector< SmartPtr< const Vector > > const_comps_
virtual Number SumImpl() const
Sum of entries in the vector.
VectorSpace base class, corresponding to the Vector base class.
virtual void ElementWiseMaxImpl(const Vector &x)
Element-wise max against entries in x.
virtual void ElementWiseMultiplyImpl(const Vector &x)
Element-wise multiplication .
Class of Vectors consisting of other vectors.
void operator=(const CompoundVector &)
Default Assignment Operator.
bool IsValid(const SmartPtr< U > &smart_ptr)
void SetComp(Index icomp, const Vector &vec)
Method for setting the pointer for a component that is a const Vector.
CompoundVector()
Default Constructor.
virtual Number DotImpl(const Vector &x) const
Computes inner product of vector x with this (DDOT)
~CompoundVectorSpace()
Destructor.
const CompoundVectorSpace * owner_space_
CompoundVectorSpace(const CompoundVectorSpace &)
Copy Constructor.
virtual Number MaxImpl() const
Max value in the vector.
virtual void ElementWiseMinImpl(const Vector &x)
Element-wise min against entries in x.
virtual void ElementWiseSgnImpl()
Replaces entries with sgn of the entry.
This vectors space is the vector space for CompoundVector.
virtual CompoundVector * MakeNewCompoundVector(bool create_new=true) const
Method for creating a new vector of this specific type.
virtual Number AsumImpl() const
Computes the 1-norm of this vector (DASUM)