Ipopt Documentation  
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:
25  const MatrixSpace* owner_space
26  );
27 
31 
32 protected:
35  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:
83 
86  const ZeroMatrix&
87  );
88 
90  void operator=(
91  const ZeroMatrix&
92  );
94 };
95 
98 {
99 public:
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:
138 
141  const ZeroMatrixSpace&
142  );
143 
145  void operator=(
146  const ZeroMatrixSpace&
147  );
149 };
150 } // namespace Ipopt
151 #endif
IpUtils.hpp
Ipopt::MatrixSpace
MatrixSpace base class, corresponding to the Matrix base class.
Definition: IpMatrix.hpp:327
Ipopt::ZeroMatrix::ComputeRowAMaxImpl
virtual void ComputeRowAMaxImpl(Vector &, bool) const
Compute the max-norm of the rows in the matrix.
Definition: IpZeroMatrix.hpp:49
Ipopt::ZeroMatrixSpace::ZeroMatrixSpace
ZeroMatrixSpace()
Default Constructor.
Ipopt::ZeroMatrixSpace::ZeroMatrixSpace
ZeroMatrixSpace(const ZeroMatrixSpace &)
Copy Constructor.
Ipopt::ZeroMatrix::operator=
void operator=(const ZeroMatrix &)
Default Assignment Operator.
Ipopt
This file contains a base class for all exceptions and a set of macros to help with exceptions.
Definition: IpInexactAlgBuilder.hpp:14
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:15
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:28
Ipopt::EJournalLevel
EJournalLevel
Print Level Enum.
Definition: IpJournalist.hpp:32
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:17
Ipopt::ZeroMatrix::TransMultVectorImpl
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
Ipopt::ZeroMatrix
Class for Matrices with only zero entries.
Definition: IpZeroMatrix.hpp:19
Ipopt::ZeroMatrix::PrintImpl
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.
Ipopt::EJournalCategory
EJournalCategory
Category Selection Enum.
Definition: IpJournalist.hpp:52
Ipopt::ZeroMatrix::ZeroMatrix
ZeroMatrix(const MatrixSpace *owner_space)
Constructor, taking the corresponding matrix space.
Ipopt::ZeroMatrix::ZeroMatrix
ZeroMatrix(const ZeroMatrix &)
Copy Constructor.
Ipopt::ZeroMatrixSpace::ZeroMatrixSpace
ZeroMatrixSpace(Index nrows, Index ncols)
Constructor, given the number of row and columns.
Definition: IpZeroMatrix.hpp:103
Ipopt::ZeroMatrixSpace::MakeNew
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
Definition: IpZeroMatrix.hpp:115
Ipopt::ZeroMatrix::ZeroMatrix
ZeroMatrix()
Default Constructor.
Ipopt::Journalist
Class responsible for all message output.
Definition: IpJournalist.hpp:117
Ipopt::ZeroMatrixSpace::MakeNewZeroMatrix
ZeroMatrix * MakeNewZeroMatrix() const
Method for creating a new matrix of this specific type.
Definition: IpZeroMatrix.hpp:121
Ipopt::ZeroMatrix::MultVectorImpl
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
IpMatrix.hpp
Ipopt::ZeroMatrix::ComputeColAMaxImpl
virtual void ComputeColAMaxImpl(Vector &, bool) const
Compute the max-norm of the columns in the matrix.
Definition: IpZeroMatrix.hpp:55
Ipopt::ZeroMatrixSpace::operator=
void operator=(const ZeroMatrixSpace &)
Default Assignment Operator.
Ipopt::ZeroMatrixSpace::~ZeroMatrixSpace
virtual ~ZeroMatrixSpace()
Destructor.
Definition: IpZeroMatrix.hpp:111
Ipopt::ZeroMatrixSpace
Class for matrix space for ZeroMatrix.
Definition: IpZeroMatrix.hpp:98
Ipopt::ZeroMatrix::~ZeroMatrix
~ZeroMatrix()
Destructor.
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:48