Ipopt Documentation  
 
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// Authors: Andreas Waechter IBM 2008-08-25
6
7#ifndef __IPTRANSPOSEMATRIX_HPP__
8#define __IPTRANSPOSEMATRIX_HPP__
9
10#include "IpMatrix.hpp"
11
12namespace Ipopt
13{
14
15/* forward declarations */
16class TransposeMatrixSpace;
17
20{
21public:
24
27 );
28
32
38
39protected:
42 virtual void MultVectorImpl(
44 const Vector& x,
46 Vector& y
47 ) const
48 {
50 orig_matrix_->TransMultVector(alpha, x, beta, y);
51 }
52
53 virtual void TransMultVectorImpl(
55 const Vector& x,
57 Vector& y
58 ) const
59 {
61 orig_matrix_->MultVector(alpha, x, beta, y);
62 }
63
64 virtual bool HasValidNumbersImpl() const
65 {
67 return orig_matrix_->HasValidNumbers();
68 }
69
70 virtual void ComputeRowAMaxImpl(
72 bool init
73 ) const
74 {
76 orig_matrix_->ComputeColAMax(rows_norms, init);
77 }
78
79 virtual void ComputeColAMaxImpl(
81 bool init
82 ) const
83 {
85 orig_matrix_->ComputeRowAMax(rows_norms, init);
86 }
87
88 virtual void PrintImpl(
89 const Journalist& jnlst,
92 const std::string& name,
94 const std::string& prefix
95 ) const;
97
98private:
108
110
113 const TransposeMatrix&
114 );
115
118 const TransposeMatrix&
119 );
121
124};
125
128{
129public:
132
139
142 { }
144
145 virtual Matrix* MakeNew() const
146 {
147 return MakeNewTransposeMatrix();
148 }
149
152 {
153 return new TransposeMatrix(this);
154 }
155
157 {
158 return orig_matrix_space_->MakeNew();
159 }
160
161private:
171
173
177 );
178
182 );
184
187};
188
189} // namespace Ipopt
190#endif
#define DBG_ASSERT(test)
Definition IpDebug.hpp:27
Templated class which stores one entry for the CachedResult class.
Class responsible for all message output.
MatrixSpace base class, corresponding to the Matrix base class.
Definition IpMatrix.hpp:327
Index NCols() const
Accessor function for the number of columns.
Definition IpMatrix.hpp:356
Index NRows() const
Accessor function for the number of rows.
Definition IpMatrix.hpp:350
Matrix Base Class.
Definition IpMatrix.hpp:28
This is the matrix space for TransposeMatrix.
TransposeMatrix * MakeNewTransposeMatrix() const
Method for creating a new matrix of this specific type.
virtual Matrix * MakeNew() const
Pure virtual method for creating a new Matrix of the corresponding type.
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 &)
Default Assignment 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 &)
Default Assignment 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
This file contains a base class for all exceptions and a set of macros to help with exceptions.
SmartPtr< const U > ConstPtr(const SmartPtr< U > &smart_ptr)
bool IsValid(const SmartPtr< U > &smart_ptr)
ipindex Index
Type of all indices of vectors, matrices etc.
Definition IpTypes.hpp:20
EJournalCategory
Category Selection Enum.
EJournalLevel
Print Level Enum.
ipnumber Number
Type of all numbers.
Definition IpTypes.hpp:17