/home/coin/SVN-release/CoinAll-1.1.0/Ipopt/src/LinAlg/TMatrices/IpTripletHelper.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2006 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpTripletHelper.hpp 699 2006-04-05 21:05:18Z 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 
00019   class Matrix;
00020   class GenTMatrix;
00021   class SymTMatrix;
00022   class DiagMatrix;
00023   class IdentityMatrix;
00024   class ExpansionMatrix;
00025   class ScaledMatrix;
00026   class SymScaledMatrix;
00027   class SumMatrix;
00028   class SumSymMatrix;
00029   class ZeroMatrix;
00030   class CompoundMatrix;
00031   class CompoundSymMatrix;
00032   class Vector;
00033 
00034   class TripletHelper
00035   {
00036   public:
00040     static Index GetNumberEntries(const Matrix& matrix);
00041 
00043     static void FillRowCol(Index n_entries, const Matrix& matrix, Index* iRow, Index* jCol, Index row_offset=0, Index col_offset=0);
00044 
00046     static void FillValues(Index n_entries, const Matrix& matrix, Number* values);
00047 
00049     static void FillValuesFromVector(Index dim, const Vector& vector, Number* values);
00050 
00052     static void PutValuesInVector(Index dim, const double* values, Vector& vector);
00054 
00055     DECLARE_STD_EXCEPTION(UNKNOWN_MATRIX_TYPE);
00056     DECLARE_STD_EXCEPTION(UNKNOWN_VECTOR_TYPE);
00057 
00058   private:
00060     static Index GetNumberEntries_(const SumMatrix& matrix);
00061 
00063     static Index GetNumberEntries_(const SumSymMatrix& matrix);
00064 
00066     static Index GetNumberEntries_(const CompoundMatrix& matrix);
00067 
00069     static Index GetNumberEntries_(const CompoundSymMatrix& matrix);
00070 
00071     static void FillRowCol_(Index n_entries, const GenTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00072 
00073     static void FillValues_(Index n_entries, const GenTMatrix& matrix, Number* values);
00074 
00075     static void FillRowCol_(Index n_entries, const SymTMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00076 
00077     static void FillValues_(Index n_entries, const SymTMatrix& matrix, Number* values);
00078 
00079     static void FillRowCol_(Index n_entries, const DiagMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00080 
00081     static void FillValues_(Index n_entries, const DiagMatrix& matrix, Number* values);
00082 
00083     static void FillRowCol_(Index n_entries, const IdentityMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00084 
00085     static void FillValues_(Index n_entries, const IdentityMatrix& matrix, Number* values);
00086 
00087     static void FillRowCol_(Index n_entries, const ExpansionMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00088 
00089     static void FillValues_(Index n_entries, const ExpansionMatrix& matrix, Number* values);
00090 
00091     static void FillRowCol_(Index n_entries, const SumMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00092 
00093     static void FillValues_(Index n_entries, const SumMatrix& matrix, Number* values);
00094 
00095     static void FillRowCol_(Index n_entries, const SumSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00096 
00097     static void FillValues_(Index n_entries, const SumSymMatrix& matrix, Number* values);
00098 
00099     static void FillRowCol_(Index n_entries, const CompoundMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00100 
00101     static void FillValues_(Index n_entries, const CompoundMatrix& matrix, Number* values);
00102 
00103     static void FillRowCol_(Index n_entries, const CompoundSymMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00104 
00105     static void FillValues_(Index n_entries, const CompoundSymMatrix& matrix, Number* values);
00106 
00107     static void FillRowCol_(Index n_entries, const ScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00108 
00109     static void FillValues_(Index n_entries, const ScaledMatrix& matrix, Number* values);
00110 
00111     static void FillRowCol_(Index n_entries, const SymScaledMatrix& matrix, Index row_offset, Index col_offset, Index* iRow, Index* jCol);
00112 
00113     static void FillValues_(Index n_entries, const SymScaledMatrix& matrix, Number* values);
00114 
00115   };
00116 } // namespace Ipopt
00117 
00118 #endif

Generated on Sun Nov 14 14:06:36 2010 for Coin-All by  doxygen 1.4.7