Ipopt Documentation  
 
Loading...
Searching...
No Matches
IpSumSymMatrix.hpp
Go to the documentation of this file.
1// Copyright (C) 2004, 2008 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
7#ifndef __IPSUMSYMMATRIX_HPP__
8#define __IPSUMSYMMATRIX_HPP__
9
10#include "IpUtils.hpp"
11#include "IpSymMatrix.hpp"
12
13namespace Ipopt
14{
15
16/* forward declarations */
17class SumSymMatrixSpace;
18
24{
25public:
28
33 );
34
38
43 void SetTerm(
46 const SymMatrix& matrix
47 );
48
53 void GetTerm(
57 ) const;
58
60 Index NTerms() const;
61
62protected:
65 virtual void MultVectorImpl(
67 const Vector& x,
69 Vector& y
70 ) const;
71
72 virtual bool HasValidNumbersImpl() const;
73
74 virtual void ComputeRowAMaxImpl(
76 bool init
77 ) const;
78
79 virtual void ComputeColAMaxImpl(
81 bool init
82 ) const;
83
84 virtual void PrintImpl(
85 const Journalist& jnlst,
88 const std::string& name,
90 const std::string& prefix
91 ) const;
93
94private:
104
106
109 const SumSymMatrix&
110 );
111
114 const SumSymMatrix&
115 );
117
119 std::vector<Number> factors_;
120
122 std::vector<SmartPtr<const SymMatrix> > matrices_;
123
126};
127
130{
131public:
134
138 Index ndim,
140 )
142 nterms_(nterms)
143 { }
144
149
152
153 Index NTerms() const
154 {
155 return nterms_;
156 }
158
166 const SymMatrixSpace& space
167 );
168
172 ) const;
173
176
177 virtual SymMatrix* MakeNewSymMatrix() const;
178
179private:
181
182 std::vector<SmartPtr<const SymMatrixSpace> > term_spaces_;
183};
184
185} // namespace Ipopt
186#endif
Templated class which stores one entry for the CachedResult class.
Class responsible for all message output.
Class for matrix space for SumSymMatrix.
SmartPtr< const SymMatrixSpace > GetTermSpace(Index term_idx) const
Get the matrix space for a particular term.
void SetTermSpace(Index term_idx, const SymMatrixSpace &space)
Use this method to set the matrix spaces for the various terms.
Index NTerms() const
Number of terms in the sum.
std::vector< SmartPtr< const SymMatrixSpace > > term_spaces_
SumSymMatrixSpace(Index ndim, Index nterms)
Constructor, given the dimension of the matrix and the number of terms in the sum.
SumSymMatrix * MakeNewSumSymMatrix() const
Method for creating a new matrix of this specific type.
virtual SymMatrix * MakeNewSymMatrix() const
Pure virtual method for creating a new matrix of this specific type.
Class for Matrices which are sum of symmetric matrices.
void SetTerm(Index iterm, Number factor, const SymMatrix &matrix)
Method for setting term iterm for the sum.
SumSymMatrix(const SumSymMatrixSpace *owner_space)
Constructor, initializing with dimensions of the matrix and the number of terms in the sum.
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
virtual void PrintImpl(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
Print detailed information about the matrix.
SumSymMatrix(const SumSymMatrix &)
Copy Constructor.
void GetTerm(Index iterm, Number &factor, SmartPtr< const SymMatrix > &matrix) const
Method for getting term iterm for the sum.
SumSymMatrix()
Default Constructor.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void ComputeColAMaxImpl(Vector &cols_norms, bool init) const
Implementation of ComputeColAMaxImpl, which calls ComputeRowAMaxImpl.
std::vector< Number > factors_
std::vector storing the factors for each term.
Index NTerms() const
Return the number of terms.
void operator=(const SumSymMatrix &)
Default Assignment Operator.
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
std::vector< SmartPtr< const SymMatrix > > matrices_
std::vector storing the matrices for each term.
const SumSymMatrixSpace * owner_space_
Copy of the owner_space as a SumSymMatrixSpace.
~SumSymMatrix()
Destructor.
SymMatrixSpace base class, corresponding to the SymMatrix base class.
This is the base class for all derived symmetric matrix types.
Vector Base Class.
Definition IpVector.hpp:48
#define IPOPTLIB_EXPORT
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
EJournalCategory
Category Selection Enum.
EJournalLevel
Print Level Enum.
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17