9 #ifndef __IPCOMPOUNDVECTOR_HPP__
10 #define __IPCOMPOUNDVECTOR_HPP__
20 class CompoundVectorSpace;
191 const std::string& name,
193 const std::string& prefix)
const;
Number * x
Input: Starting point Output: Optimal solution.
This vectors space is the vector space for CompoundVector.
CompoundVectorSpace(Index ncomp_spaces, Index total_dim)
Constructor, has to be given the number of components and the total dimension of all components combi...
SmartPtr< const VectorSpace > GetCompSpace(Index icomp) const
Method for obtaining an individual component VectorSpace.
CompoundVectorSpace(const CompoundVectorSpace &)
Copy Constructor.
virtual Vector * MakeNew() const
Overloaded MakeNew method for the VectorSpace base class.
virtual void SetCompSpace(Index icomp, const VectorSpace &vec_space)
Method for setting the individual component VectorSpaces.
CompoundVectorSpace()
Default constructor.
virtual CompoundVector * MakeNewCompoundVector(bool create_new=true) const
Method for creating a new vector of this specific type.
std::vector< SmartPtr< const VectorSpace > > comp_spaces_
std::vector of vector spaces for the components
CompoundVectorSpace & operator=(const CompoundVectorSpace &)
Overloaded Equals Operator.
Index NCompSpaces() const
Accessor method to obtain the number of components.
const Index ncomp_spaces_
Number of components.
~CompoundVectorSpace()
Destructor.
Class of Vectors consisting of other vectors.
virtual Number Nrm2Impl() const
Computes the 2-norm of this vector (DNRM2)
virtual void AxpyImpl(Number alpha, const Vector &x)
Add the multiple alpha of vector x to this vector (DAXPY)
virtual ~CompoundVector()
Default destructor.
virtual Number MaxImpl() const
Max value in the vector.
void SetComp(Index icomp, const Vector &vec)
Method for setting the pointer for a component that is a const Vector.
std::vector< SmartPtr< const Vector > > const_comps_
virtual void ElementWiseMultiplyImpl(const Vector &x)
Element-wise multiplication .
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 Number AsumImpl() const
Computes the 1-norm of this vector (DASUM)
virtual Number AmaxImpl() const
Computes the max-norm of this vector (based on IDAMAX)
void operator=(const CompoundVector &)
Overloaded Equals Operator.
CompoundVector()
Default Constructor.
virtual Number SumLogsImpl() const
Computes the sum of the logs of the elements of vector.
std::vector< SmartPtr< Vector > > comps_
Components of the compound vector.
virtual void ElementWiseSgnImpl()
Replaces entries with sgn of the entry.
Number FracToBoundImpl(const Vector &delta, Number tau) const
Fraction to the boundary parameter.
bool IsCompNull(Index i) const
Check if a particular component is null or not.
virtual void ElementWiseDivideImpl(const Vector &x)
Element-wise division .
virtual Number MinImpl() const
Min value in the vector.
virtual void ElementWiseMinImpl(const Vector &x)
Element-wise min against entries in x.
bool IsCompConst(Index i) const
Check if a particular component is const or not.
const CompoundVectorSpace * owner_space_
virtual void ScalImpl(Number alpha)
Scales the vector by scalar alpha (DSCAL)
virtual void ElementWiseMaxImpl(const Vector &x)
Element-wise max against entries in x.
virtual void SetImpl(Number value)
Set each element in the vector to the scalar alpha.
SmartPtr< Vector > GetCompNonConst(Index i)
Return a particular component (non-const version).
virtual void AddScalarImpl(Number scalar)
Add scalar to every component of the vector.
virtual void CopyImpl(const Vector &x)
Copy the data of the vector x into this vector (DCOPY).
virtual void ElementWiseReciprocalImpl()
Element-wise reciprocal.
SmartPtr< const Vector > GetComp(Index i) const
Return a particular component (const version)
virtual void ElementWiseAbsImpl()
Element-wise absolute values.
void AddVectorQuotientImpl(Number a, const Vector &z, const Vector &s, Number c)
Add the quotient of two vectors, y = a * z/s + c * y.
virtual Number DotImpl(const Vector &x) const
Computes inner product of vector x with this (DDOT)
void AddTwoVectorsImpl(Number a, const Vector &v1, Number b, const Vector &v2, Number c)
Add two vectors (a * v1 + b * v2).
CompoundVector(const CompoundVectorSpace *owner_space, bool create_new)
Constructor, given the corresponding CompoundVectorSpace.
virtual void ElementWiseSqrtImpl()
Element-wise square-root.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
Index NComps() const
Number of components of this compound vector.
virtual Number SumImpl() const
Computes the sum of the lements of vector.
CompoundVector(const CompoundVector &)
Copy Constructor.
const Vector * ConstComp(Index i) const
void SetCompNonConst(Index icomp, Vector &vec)
Method for setting the pointer for a component that is a non-const Vector.
Class responsible for all message output.
Template class for Smart Pointers.
void ObjectChanged()
Objects derived from TaggedObject MUST call this method every time their internal state changes to up...
VectorSpace base class, corresponding to the Vector base class.
bool IsValid(const SmartPtr< U > &smart_ptr)
U * GetRawPtr(const SmartPtr< U > &smart_ptr)
EJournalCategory
Category Selection Enum.
int Index
Type of all indices of vectors, matrices etc.
EJournalLevel
Print Level Enum.
double Number
Type of all numbers.