- Main Page
- Classes
- Files

- File List
- File Members

# src/LinAlg/TMatrices/IpTripletHelper.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2009 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Eclipse Public License.
    00004 //
    00005 // $Id: IpTripletHelper.hpp 1861 2010-12-21 21:34:47Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
    00008
    00009 #ifndef __IPTRIPLETHELPER_HPP__
    00010 #define __IPTRIPLETHELPER_HPP__
    00011
    00012 #include "IpTypes.hpp"
    00013 #include "IpException.hpp"
    00014
    00015 namespace Ipopt
    00016 {
    00017
    00018   DECLARE_STD_EXCEPTION(UNKNOWN_MATRIX_TYPE);
    00019   DECLARE_STD_EXCEPTION(UNKNOWN_VECTOR_TYPE);
    00020
    00022   class Matrix;
    00023   class GenTMatrix;
    00024   class SymTMatrix;
    00025   class DiagMatrix;
    00026   class IdentityMatrix;
    00027   class ExpansionMatrix;
    00028   class ScaledMatrix;
    00029   class SymScaledMatrix;
    00030   class SumMatrix;
    00031   class SumSymMatrix;
    00032   class ZeroMatrix;
    00033   class CompoundMatrix;
    00034   class CompoundSymMatrix;
    00035   class TransposeMatrix;
    00036   class ExpandedMultiVectorMatrix;
    00037   class Vector;
    00038
    00039   class TripletHelper
    00040   {
    00041   public:
    00045     static Index GetNumberEntries(const Matrix& matrix);
    00046
    00048     static void FillRowCol(Index n_entries, const Matrix& matrix, Index* iRow, Index* jCol, Index row_offset=0, Index col_offset=0);
    00049
    00051     static void FillValues(Index n_entries, const Matrix& matrix, Number* values);
    00052
    00054     static void FillValuesFromVector(Index dim, const Vector& vector, Number* values);
    00055
    00057     static void PutValuesInVector(Index dim, const double* values, Vector& vector);
    00059
    00060   private:
    00062     static Index GetNumberEntries_(const SumMatrix& matrix);
    00063
    00065     static Index GetNumberEntries_(const SumSymMatrix& matrix);
    00066
    00068     static Index GetNumberEntries_(const CompoundMatrix& matrix);
    00069
    00071     static Index GetNumberEntries_(const CompoundSymMatrix& matrix);
    00072
    00074     static Index GetNumberEntries_(const TransposeMatrix& matrix);
    00075
    00077     static Index GetNumberEntries_(const ExpandedMultiVectorMatrix& matrix);
    00078
    00079     static void FillRowCol_(Index n_entries, const GenTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00080
    00081     static void FillValues_(Index n_entries, const GenTMatrix& matrix, Number* values);
    00082
    00083     static void FillRowCol_(Index n_entries, const SymTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00084
    00085     static void FillValues_(Index n_entries, const SymTMatrix& matrix, Number* values);
    00086
    00087     static void FillRowCol_(Index n_entries, const DiagMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00088
    00089     static void FillValues_(Index n_entries, const DiagMatrix& matrix, Number* values);
    00090
    00091     static void FillRowCol_(Index n_entries, const IdentityMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00092
    00093     static void FillValues_(Index n_entries, const IdentityMatrix& matrix, Number* values);
    00094
    00095     static void FillRowCol_(Index n_entries, const ExpansionMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00096
    00097     static void FillValues_(Index n_entries, const ExpansionMatrix& matrix, Number* values);
    00098
    00099     static void FillRowCol_(Index n_entries, const SumMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00100
    00101     static void FillValues_(Index n_entries, const SumMatrix& matrix, Number* values);
    00102
    00103     static void FillRowCol_(Index n_entries, const SumSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00104
    00105     static void FillValues_(Index n_entries, const SumSymMatrix& matrix, Number* values);
    00106
    00107     static void FillRowCol_(Index n_entries, const CompoundMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00108
    00109     static void FillValues_(Index n_entries, const CompoundMatrix& matrix, Number* values);
    00110
    00111     static void FillRowCol_(Index n_entries, const CompoundSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00112
    00113     static void FillValues_(Index n_entries, const CompoundSymMatrix& matrix, Number* values);
    00114
    00115     static void FillRowCol_(Index n_entries, const ScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00116
    00117     static void FillValues_(Index n_entries, const ScaledMatrix& matrix, Number* values);
    00118
    00119     static void FillRowCol_(Index n_entries, const SymScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00120
    00121     static void FillValues_(Index n_entries, const SymScaledMatrix& matrix, Number* values);
    00122
    00123     static void FillRowCol_(Index n_entries, const TransposeMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00124
    00125     static void FillValues_(Index n_entries, const TransposeMatrix& matrix, Number* values);
    00126
    00127     static void FillRowCol_(Index n_entries, const ExpandedMultiVectorMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
    00128
    00129     static void FillValues_(Index n_entries, const ExpandedMultiVectorMatrix& matrix, Number* values);
    00130
    00131   };
    00132 } // namespace Ipopt
    00133
    00134 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines