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 
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 
131 
134 
135  };
136 
137 }
138 
139 #endif