Ipopt 3.11.9
Loading...
Searching...
No Matches
IpTransposeMatrix.hpp
Go to the documentation of this file.
1// Copyright (C) 2008 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Eclipse Public License.
4//
5// $Id: IpTransposeMatrix.hpp 1861 2010-12-21 21:34:47Z andreasw $
6//
7// Authors: Andreas Waechter IBM 2008-08-25
8
9#ifndef __IPTRANSPOSEMATRIX_HPP__
10#define __IPTRANSPOSEMATRIX_HPP__
11
12#include "IpMatrix.hpp"
13
14namespace Ipopt
15{
16
17 /* forward declarations */
18 class TransposeMatrixSpace;
19
23 class TransposeMatrix : public Matrix
24 {
25 public:
26
29
33
37
43
44 protected:
47 virtual void MultVectorImpl(Number alpha, const Vector& x,
48 Number beta, Vector& y) const
49 {
51 orig_matrix_->TransMultVector(alpha, x, beta, y);
52 }
53
54 virtual void TransMultVectorImpl(Number alpha, const Vector& x,
55 Number beta, Vector& y) const
56 {
58 orig_matrix_->MultVector(alpha, x, beta, y);
59 }
60
63 virtual bool HasValidNumbersImpl() const
64 {
66 return orig_matrix_->HasValidNumbers();
67 }
68
69 virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const
70 {
72 orig_matrix_->ComputeColAMax(rows_norms, init);
73 }
74
75 virtual void ComputeColAMaxImpl(Vector& rows_norms, bool init) const
76 {
78 orig_matrix_->ComputeRowAMax(rows_norms, init);
79 }
80
81 virtual void PrintImpl(const Journalist& jnlst,
82 EJournalLevel level,
83 EJournalCategory category,
84 const std::string& name,
85 Index indent,
86 const std::string& prefix) const;
88
89 private:
100
103
107
110 };
111
114 {
115 public:
119 TransposeMatrixSpace(const MatrixSpace* orig_matrix_space)
120 :
121 MatrixSpace(orig_matrix_space->NCols(), orig_matrix_space->NRows()),
122 orig_matrix_space_(orig_matrix_space)
123 {}
124
127 {}
129
132 virtual Matrix* MakeNew() const
133 {
134 return MakeNewTransposeMatrix();
135 }
136
139 {
140 return new TransposeMatrix(this);
141 }
142
144 {
145 return orig_matrix_space_->MakeNew();
146 }
147
148 private:
159
162
166
169 };
170
171} // namespace Ipopt
172#endif
#define DBG_ASSERT(test)
Definition IpDebug.hpp:38
Number * x
Input: Starting point Output: Optimal solution.
Class responsible for all message output.
MatrixSpace base class, corresponding to the Matrix base class.
Definition IpMatrix.hpp:240
Index NCols() const
Accessor function for the number of columns.
Definition IpMatrix.hpp:269
Index NRows() const
Accessor function for the number of rows.
Definition IpMatrix.hpp:264
Matrix Base Class.
Definition IpMatrix.hpp:28
Template class for Smart Pointers.
This is the matrix space for TransposeMatrix.
TransposeMatrix * MakeNewTransposeMatrix() const
Method for creating a new matrix of this specific type.
virtual Matrix * MakeNew() const
Overloaded MakeNew method for the MatrixSpace base class.
SmartPtr< const MatrixSpace > orig_matrix_space_
Matrix space of the original matrix.
TransposeMatrixSpace(const MatrixSpace *orig_matrix_space)
Constructor, given the dimension of the matrix.
virtual ~TransposeMatrixSpace()
Destructor.
TransposeMatrixSpace()
Default Constructor.
TransposeMatrixSpace(const TransposeMatrixSpace &)
Copy Constructor.
void operator=(const TransposeMatrixSpace &)
Overloaded Equals Operator.
Class for Matrices which are the transpose of another matrix.
virtual void ComputeColAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the columns in the matrix.
void operator=(const TransposeMatrix &)
Overloaded Equals Operator.
virtual bool HasValidNumbersImpl() const
Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
virtual void ComputeRowAMaxImpl(Vector &rows_norms, bool init) const
Compute the max-norm of the rows in the matrix.
TransposeMatrix(const TransposeMatrixSpace *owner_space)
Constructor, initializing with dimensions of the matrix.
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.
TransposeMatrix(const TransposeMatrix &)
Copy Constructor.
SmartPtr< Matrix > orig_matrix_
Pointer to original matrix.
virtual void TransMultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix(transpose) vector multiply.
TransposeMatrix()
Default Constructor.
SmartPtr< const Matrix > OrigMatrix() const
virtual void MultVectorImpl(Number alpha, const Vector &x, Number beta, Vector &y) const
Matrix-vector multiply.
Vector Base Class.
Definition IpVector.hpp:48
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
bool IsValid(const SmartPtr< U > &smart_ptr)
EJournalCategory
Category Selection Enum.
int Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:19
EJournalLevel
Print Level Enum.
double Number
Type of all numbers.
Definition IpTypes.hpp:17