Ipopt  trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
IpZeroMatrix.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2004, 2008 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Eclipse Public License.
00004 //
00005 // $Id$
00006 //
00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
00008 
00009 #ifndef __IPZEROMATRIX_HPP__
00010 #define __IPZEROMATRIX_HPP__
00011 
00012 #include "IpUtils.hpp"
00013 #include "IpMatrix.hpp"
00014 
00015 namespace Ipopt
00016 {
00017 
00020   class ZeroMatrix : public Matrix
00021   {
00022   public:
00023 
00026 
00029     ZeroMatrix(const MatrixSpace* owner_space);
00030 
00032     ~ZeroMatrix();
00034 
00035   protected:
00038     virtual void MultVectorImpl(Number alpha, const Vector& x,
00039                                 Number beta, Vector& y) const;
00040 
00041     virtual void TransMultVectorImpl(Number alpha, const Vector& x,
00042                                      Number beta, Vector& y) const;
00043 
00044     virtual void ComputeRowAMaxImpl(Vector& rows_norms, bool init) const
00045       {}
00046 
00047     virtual void ComputeColAMaxImpl(Vector& cols_norms, bool init) const
00048       {}
00049 
00050     virtual void PrintImpl(const Journalist& jnlst,
00051                            EJournalLevel level,
00052                            EJournalCategory category,
00053                            const std::string& name,
00054                            Index indent,
00055                            const std::string& prefix) const;
00057 
00058   private:
00068     ZeroMatrix();
00069 
00071     ZeroMatrix(const ZeroMatrix&);
00072 
00074     void operator=(const ZeroMatrix&);
00076   };
00077 
00079   class ZeroMatrixSpace : public MatrixSpace
00080   {
00081   public:
00086     ZeroMatrixSpace(Index nrows, Index ncols)
00087         :
00088         MatrixSpace(nrows, ncols)
00089     {}
00090 
00092     virtual ~ZeroMatrixSpace()
00093     {}
00095 
00098     virtual Matrix* MakeNew() const
00099     {
00100       return MakeNewZeroMatrix();
00101     }
00102 
00104     ZeroMatrix* MakeNewZeroMatrix() const
00105     {
00106       return new ZeroMatrix(this);
00107     }
00108   private:
00118     ZeroMatrixSpace();
00119 
00121     ZeroMatrixSpace(const ZeroMatrixSpace&);
00122 
00124     void operator=(const ZeroMatrixSpace&);
00126   };
00127 } // namespace Ipopt
00128 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines