Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SensSchurData.hpp
Go to the documentation of this file.
1 // Copyright 2009, 2011 Hans Pirnay
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Date : 2009-05-06
6
7 #ifndef __ASSCHURDATA_HPP__
8 #define __ASSCHURDATA_HPP__
9
10 #include "IpVector.hpp"
11 #include "IpIteratesVector.hpp"
12 #include <vector>
13
14 namespace Ipopt
15 {
16
17
18 class SchurData : public ReferencedObject
19 {
31 public:
32
33 SchurData() : initialized_(false), nrows_(0)
34 {}
35
36 virtual ~SchurData()
37 {
38 }
39
40 virtual SmartPtr<SchurData> MakeNewSchurDataCopy() const =0;
41
45 virtual void SetData_Flag(Index dim, const Index* flags, Number v=1.0)=0;
46
48 virtual void SetData_Flag(Index dim, const Index* flags, const Number* values)=0;
49
50 virtual Index SetData_Index(Index dim, const Index* flags, Number v=1.0)=0;
51
52 virtual void SetData_List(const std::vector<Index>& list, Number v=1.0) =0;
53
54 virtual void AddData_List(std::vector<Index> cols, std::vector<Index>& delta_u_sort, Index& new_du_size, Index v)=0;
55
57 virtual Index GetNRowsAdded() const
58 {
59 return nrows_;
60 }
61
62 virtual bool Is_Initialized() const
63 {
64 return initialized_;
65 }
66
67
69 virtual void GetRow(Index i, IteratesVector& v) const = 0;
70
76 virtual void GetMultiplyingVectors(Index row, std::vector<Index>& indices, std::vector<Number>& factors) const =0;
77
79 virtual void Multiply(const IteratesVector& v, Vector& u) const =0;
80
82 virtual void TransMultiply(const Vector& u, IteratesVector& v) const =0;
83
84 virtual void PrintImpl(const Journalist& jnlst,
85 EJournalLevel level,
86 EJournalCategory category,
87 const std::string& name,
88 Index indent,
89 const std::string& prefix) const =0;
90
91 void Print(const Journalist& jnlst,
92 EJournalLevel level,
93 EJournalCategory category,
94 const std::string& name,
95 Index indent=0,
96 const std::string& prefix="") const
97 {
98 if (jnlst.ProduceOutput(level, category)) {
99 PrintImpl(jnlst, level, category, name, indent, prefix);
100 }
101 }
102
103 void Print(SmartPtr<const Journalist> jnlst,
104 EJournalLevel level,
105 EJournalCategory category,
106 const std::string& name,
107 Index indent,
108 const std::string& prefix) const
109 {
110 if (IsValid(jnlst) && jnlst->ProduceOutput(level, category)) {
111 PrintImpl(*jnlst, level, category, name, indent, prefix);
112 }
113 }
114
115 protected:
116
117 virtual void Set_Initialized()
118 {
119 initialized_ = true;
120 }
121
122 virtual void Set_NRows(Index nrows)
123 {
124 nrows_ = nrows;
125 }
126
127 private:
128
130 bool initialized_;
131
133 Index nrows_;
134
135 };
136
137 }
138
139 #endif
Ipopt::SchurData::~SchurData
virtual ~SchurData()
Definition: SensSchurData.hpp:36
Ipopt::IsValid
bool IsValid(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:579
Ipopt::SchurData::SetData_List
virtual void SetData_List(const std::vector< Index > &list, Number v=1.0)=0
Ipopt::IteratesVector
Specialized CompoundVector class specifically for the algorithm iterates.
Definition: IpIteratesVector.hpp:27
IpVector.hpp
Ipopt::SchurData::SetData_Index
virtual Index SetData_Index(Index dim, const Index *flags, Number v=1.0)=0
Ipopt::SchurData::SchurData
SchurData()
This interface serves as a reference point for multiple classes that need to use SchurData (PCalculat...
Definition: SensSchurData.hpp:33
IpIteratesVector.hpp
Ipopt::SchurData::Print
void Print(SmartPtr< const Journalist > jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
Definition: SensSchurData.hpp:103
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:47
Ipopt::SchurData::AddData_List
virtual void AddData_List(std::vector< Index > cols, std::vector< Index > &delta_u_sort, Index &new_du_size, Index v)=0
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::SchurData::Print
void Print(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const
Definition: SensSchurData.hpp:91
Ipopt::SchurData::Set_NRows
virtual void Set_NRows(Index nrows)
Definition: SensSchurData.hpp:122
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
Ipopt::ReferencedObject
ReferencedObject class.
Definition: IpReferenced.hpp:174
Ipopt::SchurData::GetMultiplyingVectors
virtual void GetMultiplyingVectors(Index row, std::vector< Index > &indices, std::vector< Number > &factors) const =0
Returns two vectors that are needed for matrix-vector multiplication of B and P.
Ipopt::SchurData::nrows_
Index nrows_
Number of columns/rows of corresponding Schur Matrix.
Definition: SensSchurData.hpp:133
Ipopt::SchurData::Is_Initialized
virtual bool Is_Initialized() const
Definition: SensSchurData.hpp:62
Ipopt::SchurData::GetNRowsAdded
virtual Index GetNRowsAdded() const
Returns number of rows/columns in schur matrix.
Definition: SensSchurData.hpp:57
Ipopt::SchurData::Set_Initialized
virtual void Set_Initialized()
Definition: SensSchurData.hpp:117
Ipopt::SchurData::initialized_
bool initialized_
Makes sure that data is not set twice accidentially.
Definition: SensSchurData.hpp:130
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::SchurData::GetRow
virtual void GetRow(Index i, IteratesVector &v) const =0
Returns the i-th column vector of the matrix.
Ipopt::SchurData::SetData_Flag
virtual void SetData_Flag(Index dim, const Index *flags, Number v=1.0)=0
Functions to set the Schurdata.
Ipopt::SchurData::Multiply
virtual void Multiply(const IteratesVector &v, Vector &u) const =0
Computes B*v with B in R(mxn)
Ipopt::SchurData::TransMultiply
virtual void TransMultiply(const Vector &u, IteratesVector &v) const =0
Computes A*u with A in R(nxm), KKT in R(n,n)
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::Journalist::ProduceOutput
virtual bool ProduceOutput(EJournalLevel level, EJournalCategory category) const
Method that returns true if there is a Journal that would write output for the given JournalLevel and...
Ipopt::SchurData::PrintImpl
virtual void PrintImpl(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const =0
Ipopt::SchurData
Definition: SensSchurData.hpp:18
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70
Ipopt::SchurData::MakeNewSchurDataCopy
virtual SmartPtr< SchurData > MakeNewSchurDataCopy() const =0