Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SensPCalculator.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 __ASPCALCULATOR_HPP__
8 #define __ASPCALCULATOR_HPP__
9
10 #include "IpAlgStrategy.hpp"
11 #include "SensSimpleBacksolver.hpp"
12 #include "SensSchurData.hpp"
13
14 namespace Ipopt
15 {
16
17 class PCalculator : public AlgorithmStrategyObject
18 {
29 public:
30
31 PCalculator(SmartPtr<SensBacksolver> backsolver,
32 SmartPtr<SchurData> A_data)
33 :
34 backsolver_(backsolver),
35 data_A_init(ConstPtr(A_data->MakeNewSchurDataCopy())),
36 data_A_(A_data)
37 {
38 }
39
40 virtual ~PCalculator()
41 {
42 }
43
45 virtual bool InitializeImpl(const OptionsList& options,
46 const std::string& prefix)
47 {
48 return true;
49 }
50
52 virtual bool ComputeP()=0;
53
55 virtual bool GetSchurMatrix(const SmartPtr<const SchurData>& B, SmartPtr<Matrix>& S) =0;
56
57 virtual void PrintImpl(const Journalist& jnlst,
58 EJournalLevel level,
59 EJournalCategory category,
60 const std::string& name,
61 Index indent,
62 const std::string& prefix) const =0;
63
64 void Print(const Journalist& jnlst,
65 EJournalLevel level,
66 EJournalCategory category,
67 const std::string& name,
68 Index indent=0,
69 const std::string& prefix="") const
70 {
71 if (jnlst.ProduceOutput(level, category)) {
72 PrintImpl(jnlst, level, category, name, indent, prefix);
73 }
74 }
75
76 void Print(SmartPtr<const Journalist> jnlst,
77 EJournalLevel level,
78 EJournalCategory category,
79 const std::string& name,
80 Index indent,
81 const std::string& prefix) const
82 {
83 if (IsValid(jnlst) && jnlst->ProduceOutput(level, category)) {
84 PrintImpl(*jnlst, level, category, name, indent, prefix);
85 }
86 }
87
91 SmartPtr<SensBacksolver> Solver() const
92 {
93 return backsolver_;
94 }
95
96 SmartPtr<const SchurData> data_A() const
97 {
98 return ConstPtr(data_A_);
99 }
100
101 SmartPtr<SchurData> data_A_nonconst() const
102 {
103 return data_A_;
104 }
105
106 void reset_data_A()
107 {
108 data_A_ = data_A_init->MakeNewSchurDataCopy();
109 }
110
111 private:
112
113 SmartPtr<SensBacksolver> backsolver_;
114
115 SmartPtr<const SchurData> data_A_init;
116 SmartPtr<SchurData> data_A_;
117
118
119 };
120
121
122 }
123
124 #endif
Ipopt::PCalculator::data_A_init
SmartPtr< const SchurData > data_A_init
Definition: SensPCalculator.hpp:115
Ipopt::IsValid
bool IsValid(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:579
Ipopt::PCalculator::backsolver_
SmartPtr< SensBacksolver > backsolver_
Definition: SensPCalculator.hpp:113
IpAlgStrategy.hpp
Ipopt::PCalculator::~PCalculator
virtual ~PCalculator()
Definition: SensPCalculator.hpp:40
Ipopt::AlgorithmStrategyObject
This is the base class for all algorithm strategy objects.
Definition: IpAlgStrategy.hpp:35
Ipopt::PCalculator::PrintImpl
virtual void PrintImpl(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const =0
SensSchurData.hpp
Ipopt::PCalculator::Print
void Print(const Journalist &jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent=0, const std::string &prefix="") const
Definition: SensPCalculator.hpp:64
Ipopt::PCalculator
Definition: SensPCalculator.hpp:17
Ipopt::PCalculator::data_A_nonconst
SmartPtr< SchurData > data_A_nonconst() const
Definition: SensPCalculator.hpp:101
Ipopt::PCalculator::GetSchurMatrix
virtual bool GetSchurMatrix(const SmartPtr< const SchurData > &B, SmartPtr< Matrix > &S)=0
Function to extract a SchurMatrix corresponding to $B K^{-1} A$.
Ipopt::PCalculator::Solver
SmartPtr< SensBacksolver > Solver() const
Accessor methods for data and backsolver.
Definition: SensPCalculator.hpp:91
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:51
Ipopt::SmartPtr
Template class for Smart Pointers.
Definition: IpSmartPtr.hpp:172
SensSimpleBacksolver.hpp
Ipopt::OptionsList
This class stores a list of user set options.
Definition: IpOptionsList.hpp:32
Ipopt::PCalculator::PCalculator
PCalculator(SmartPtr< SensBacksolver > backsolver, SmartPtr< SchurData > A_data)
This class is the interface for implementations of any class that calculates the matrix of the follo...
Definition: SensPCalculator.hpp:31
Ipopt::PCalculator::Print
void Print(SmartPtr< const Journalist > jnlst, EJournalLevel level, EJournalCategory category, const std::string &name, Index indent, const std::string &prefix) const
Definition: SensPCalculator.hpp:76
Ipopt::PCalculator::data_A
SmartPtr< const SchurData > data_A() const
Definition: SensPCalculator.hpp:96
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::ConstPtr
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
Definition: IpSmartPtr.hpp:572
Ipopt::PCalculator::data_A_
SmartPtr< SchurData > data_A_
Definition: SensPCalculator.hpp:116
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:134
Ipopt::PCalculator::reset_data_A
void reset_data_A()
Definition: SensPCalculator.hpp:106
Ipopt::PCalculator::ComputeP
virtual bool ComputeP()=0
Function to start the computation of P from E_0 and KKT.
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::PCalculator::InitializeImpl
virtual bool InitializeImpl(const OptionsList &options, const std::string &prefix)
Overloaded from AlgorithmStrategyObject.
Definition: SensPCalculator.hpp:45
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:70