Ipopt  3.11.9
IpTripletHelper.hpp
Go to the documentation of this file.
1 // Copyright (C) 2004, 2009 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: IpTripletHelper.hpp 1861 2010-12-21 21:34:47Z andreasw $
6 //
7 // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
8 
9 #ifndef __IPTRIPLETHELPER_HPP__
10 #define __IPTRIPLETHELPER_HPP__
11 
12 #include "IpTypes.hpp"
13 #include "IpException.hpp"
14 
15 namespace Ipopt
16 {
17 
18  DECLARE_STD_EXCEPTION(UNKNOWN_MATRIX_TYPE);
19  DECLARE_STD_EXCEPTION(UNKNOWN_VECTOR_TYPE);
20 
22  class Matrix;
23  class GenTMatrix;
24  class SymTMatrix;
25  class DiagMatrix;
26  class IdentityMatrix;
27  class ExpansionMatrix;
28  class ScaledMatrix;
29  class SymScaledMatrix;
30  class SumMatrix;
31  class SumSymMatrix;
32  class ZeroMatrix;
33  class CompoundMatrix;
34  class CompoundSymMatrix;
35  class TransposeMatrix;
37  class Vector;
38 
40  {
41  public:
45  static Index GetNumberEntries(const Matrix& matrix);
46 
48  static void FillRowCol(Index n_entries, const Matrix& matrix, Index* iRow, Index* jCol, Index row_offset=0, Index col_offset=0);
49 
51  static void FillValues(Index n_entries, const Matrix& matrix, Number* values);
52 
54  static void FillValuesFromVector(Index dim, const Vector& vector, Number* values);
55 
57  static void PutValuesInVector(Index dim, const double* values, Vector& vector);
59 
60  private:
62  static Index GetNumberEntries_(const SumMatrix& matrix);
63 
65  static Index GetNumberEntries_(const SumSymMatrix& matrix);
66 
68  static Index GetNumberEntries_(const CompoundMatrix& matrix);
69 
71  static Index GetNumberEntries_(const CompoundSymMatrix& matrix);
72 
74  static Index GetNumberEntries_(const TransposeMatrix& matrix);
75 
78 
79  static void FillRowCol_(Index n_entries, const GenTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
80 
81  static void FillValues_(Index n_entries, const GenTMatrix& matrix, Number* values);
82 
83  static void FillRowCol_(Index n_entries, const SymTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
84 
85  static void FillValues_(Index n_entries, const SymTMatrix& matrix, Number* values);
86 
87  static void FillRowCol_(Index n_entries, const DiagMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
88 
89  static void FillValues_(Index n_entries, const DiagMatrix& matrix, Number* values);
90 
91  static void FillRowCol_(Index n_entries, const IdentityMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
92 
93  static void FillValues_(Index n_entries, const IdentityMatrix& matrix, Number* values);
94 
95  static void FillRowCol_(Index n_entries, const ExpansionMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
96 
97  static void FillValues_(Index n_entries, const ExpansionMatrix& matrix, Number* values);
98 
99  static void FillRowCol_(Index n_entries, const SumMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
100 
101  static void FillValues_(Index n_entries, const SumMatrix& matrix, Number* values);
102 
103  static void FillRowCol_(Index n_entries, const SumSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
104 
105  static void FillValues_(Index n_entries, const SumSymMatrix& matrix, Number* values);
106 
107  static void FillRowCol_(Index n_entries, const CompoundMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
108 
109  static void FillValues_(Index n_entries, const CompoundMatrix& matrix, Number* values);
110 
111  static void FillRowCol_(Index n_entries, const CompoundSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
112 
113  static void FillValues_(Index n_entries, const CompoundSymMatrix& matrix, Number* values);
114 
115  static void FillRowCol_(Index n_entries, const ScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
116 
117  static void FillValues_(Index n_entries, const ScaledMatrix& matrix, Number* values);
118 
119  static void FillRowCol_(Index n_entries, const SymScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
120 
121  static void FillValues_(Index n_entries, const SymScaledMatrix& matrix, Number* values);
122 
123  static void FillRowCol_(Index n_entries, const TransposeMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
124 
125  static void FillValues_(Index n_entries, const TransposeMatrix& matrix, Number* values);
126 
127  static void FillRowCol_(Index n_entries, const ExpandedMultiVectorMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
128 
129  static void FillValues_(Index n_entries, const ExpandedMultiVectorMatrix& matrix, Number* values);
130 
131  };
132 } // namespace Ipopt
133 
134 #endif
Ipopt::SymScaledMatrix
Class for a Matrix in conjunction with its scaling factors for row and column scaling.
Definition: IpSymScaledMatrix.hpp:27
Ipopt::CompoundSymMatrix
Class for symmetric matrices consisting of other matrices.
Definition: IpCompoundSymMatrix.hpp:25
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const ExpandedMultiVectorMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillValuesFromVector
static void FillValuesFromVector(Index dim, const Vector &vector, Number *values)
fill the values from the vector into a dense double* structure
Ipopt::ScaledMatrix
Class for a Matrix in conjunction with its scaling factors for row and column scaling.
Definition: IpScaledMatrix.hpp:27
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const SumSymMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const SumMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::SumMatrix
Class for Matrices which are sum of matrices.
Definition: IpSumMatrix.hpp:25
Ipopt::TripletHelper::FillValues
static void FillValues(Index n_entries, const Matrix &matrix, Number *values)
fill the values for the triplet format from the matrix
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const GenTMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const CompoundMatrix &matrix)
find the total number of triplet entries for the CompoundMatrix
Ipopt
Definition: matlabjournal.hpp:14
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const ExpandedMultiVectorMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::Matrix
Matrix Base Class.
Definition: IpMatrix.hpp:28
Ipopt::TripletHelper::FillRowCol
static void FillRowCol(Index n_entries, const Matrix &matrix, Index *iRow, Index *jCol, Index row_offset=0, Index col_offset=0)
fill the irows, jcols structure for the triplet format from the matrix
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const IdentityMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const SumSymMatrix &matrix)
find the total number of triplet entries for the SumSymMatrix
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const SumMatrix &matrix, Number *values)
Ipopt::CompoundMatrix
Class for Matrices consisting of other matrices.
Definition: IpCompoundMatrix.hpp:35
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const TransposeMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const GenTMatrix &matrix, Number *values)
Ipopt::TripletHelper::GetNumberEntries
static Index GetNumberEntries(const Matrix &matrix)
find the total number of triplet entries of a Matrix
Ipopt::SumSymMatrix
Class for Matrices which are sum of symmetric matrices.
Definition: IpSumSymMatrix.hpp:25
Ipopt::TripletHelper
Definition: IpTripletHelper.hpp:40
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const IdentityMatrix &matrix, Number *values)
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const SumMatrix &matrix)
find the total number of triplet entries for the SumMatrix
Ipopt::ZeroMatrix
Class for Matrices with only zero entries.
Definition: IpZeroMatrix.hpp:21
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const ScaledMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
IpTypes.hpp
Ipopt::TripletHelper::PutValuesInVector
static void PutValuesInVector(Index dim, const double *values, Vector &vector)
put the values from the double* back into the vector
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const CompoundMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const SymScaledMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const TransposeMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const DiagMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const SymTMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const SumSymMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const ExpandedMultiVectorMatrix &matrix)
find the total number of triplet entries for the TransposeMatrix
Ipopt::IdentityMatrix
Class for Matrices which are multiples of the identity matrix.
Definition: IpIdentityMatrix.hpp:22
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const CompoundSymMatrix &matrix, Number *values)
Ipopt::GenTMatrix
Class for general matrices stored in triplet format.
Definition: IpGenTMatrix.hpp:37
Ipopt::ExpandedMultiVectorMatrix
Class for Matrices with few rows that consists of Vectors, together with a premultiplied Expansion ma...
Definition: IpExpandedMultiVectorMatrix.hpp:30
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const ScaledMatrix &matrix, Number *values)
Ipopt::DiagMatrix
Class for diagonal matrices.
Definition: IpDiagMatrix.hpp:21
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const CompoundMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const ExpansionMatrix &matrix, Number *values)
Ipopt::SymTMatrix
Class for symmetric matrices stored in triplet format.
Definition: IpSymTMatrix.hpp:43
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const TransposeMatrix &matrix)
find the total number of triplet entries for the TransposeMatrix
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const SymScaledMatrix &matrix, Number *values)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const SymTMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const CompoundSymMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::TransposeMatrix
Class for Matrices which are the transpose of another matrix.
Definition: IpTransposeMatrix.hpp:24
IpException.hpp
Ipopt::ExpansionMatrix
Class for expansion/projection matrices.
Definition: IpExpansionMatrix.hpp:28
Ipopt::TripletHelper::FillRowCol_
static void FillRowCol_(Index n_entries, const ExpansionMatrix &matrix, Index row_offset, Index col_offset, Index *iRow, Index *jCol)
Ipopt::DECLARE_STD_EXCEPTION
DECLARE_STD_EXCEPTION(SUFFIX_EMPTY)
Ipopt::TripletHelper::FillValues_
static void FillValues_(Index n_entries, const DiagMatrix &matrix, Number *values)
Ipopt::TripletHelper::GetNumberEntries_
static Index GetNumberEntries_(const CompoundSymMatrix &matrix)
find the total number of triplet entries for the CompoundSymMatrix
Ipopt::Vector
Vector Base Class.
Definition: IpVector.hpp:48