Ipopt Documentation  
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IpZeroMatrix.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 __IPZEROMATRIX_HPP__
8 #define __IPZEROMATRIX_HPP__
9 
10 #include "IpUtils.hpp"
11 #include "IpMatrix.hpp"
12 
13 namespace Ipopt
14 {
15 
18 class ZeroMatrix: public Matrix
19 {
20 public:
22 
24  ZeroMatrix(
25  const MatrixSpace* owner_space
26  );
27 
29  ~ZeroMatrix();
31 
32 protected:
34  virtual void MultVectorImpl(
36  Number alpha,
37  const Vector& x,
38  Number beta,
39  Vector& y
40  ) const;
41 
42  virtual void TransMultVectorImpl(
43  Number alpha,
44  const Vector& x,
45  Number beta,
46  Vector& y
47  ) const;
48 
49  virtual void ComputeRowAMaxImpl(
50  Vector& /*rows_norms*/,
51  bool /*init*/
52  ) const
53  { }
54 
55  virtual void ComputeColAMaxImpl(
56  Vector& /*cols_norms*/,
57  bool /*init*/
58  ) const
59  { }
60 
61  virtual void PrintImpl(
62  const Journalist& jnlst,
63  EJournalLevel level,
64  EJournalCategory category,
65  const std::string& name,
66  Index indent,
67  const std::string& prefix
68  ) const;
70 
71 private:
80 
82  ZeroMatrix();
83 
85  ZeroMatrix(
86  const ZeroMatrix&
87  );
88 
90  void operator=(
91  const ZeroMatrix&
92  );
94 };
95 
98 {
99 public:
101 
104  Index nrows,
105  Index ncols
106  )
107  : MatrixSpace(nrows, ncols)
108  { }
109 
112  { }
114 
115  virtual Matrix* MakeNew() const
116  {
117  return MakeNewZeroMatrix();
118  }
119 
122  {
123  return new ZeroMatrix(this);
124  }
125 
126 private:
135 
137  ZeroMatrixSpace();
138 
141  const ZeroMatrixSpace&
142  );
143 
145  void operator=(
146  const ZeroMatrixSpace&
147  );
149 };
150 } // namespace Ipopt
151 #endif
virtual void ComputeColAMaxImpl(Vector &, bool) const
Compute the max-norm of the columns in the matrix.
Class for matrix space for ZeroMatrix.
void operator=(const ZeroMatrix &)
Default Assignment Operator.
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Vector Base Class.
Definition: IpVector.hpp:47
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
EJournalLevel
Print Level Enum.
virtual void ComputeRowAMaxImpl(Vector &, bool) const
Compute the max-norm of the rows in the matrix.
Class for Matrices with only zero entries.
ZeroMatrix * MakeNewZeroMatrix() const
Method for creating a new matrix of this specific type.
ZeroMatrixSpace(Index nrows, Index ncols)
Constructor, given the number of row and columns.
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.
Matrix Base Class.
Definition: IpMatrix.hpp:27
ZeroMatrix()
Default Constructor.
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:326
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
virtual ~ZeroMatrixSpace()
Destructor.
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
void operator=(const ZeroMatrixSpace &)
Default Assignment Operator.
Class responsible for all message output.
~ZeroMatrix()
Destructor.
EJournalCategory
Category Selection Enum.
ZeroMatrixSpace()
Default Constructor.