/home/coin/SVN-release/CoinAll-1.1.0/Ipopt/src/contrib/CGPenalty/IpPiecewisePenalty.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2007 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpPiecewisePenalty.hpp 510 2006-03-10 21:45:32Z zaiwen wen $
00006 //
00007 // Authors:  Lifeng Chen/Zaiwen Wen      Columbia Univ
00008 
00009 #ifndef __IPPIECEWISEPENALTY_HPP__
00010 #define __IPPIECEWISEPENALTY_HPP__
00011 
00012 #include "IpJournalist.hpp"
00013 #include "IpDebug.hpp"
00014 #include "IpOptionsList.hpp"
00015 #include "IpIpoptCalculatedQuantities.hpp"
00016 #include "IpBacktrackingLSAcceptor.hpp"
00017 #include "IpPDSystemSolver.hpp"
00018 #include <list>
00019 #include <vector>
00020 
00021 namespace Ipopt
00022 {
00023 
00025   typedef struct
00026         PiecewisePenEntry
00027   {
00028     Number pen_r;
00029     Number barrier_obj;
00030     Number infeasi;
00031   }
00032   PiecewisePenEntry;
00033 
00034 
00039   class PiecewisePenalty
00040   {
00041   public:
00045     PiecewisePenalty(Index dim);
00047     ~PiecewisePenalty()
00048     {
00049       //ToDo figure out if that here is necessary
00050       //    Clear();
00051     }
00053 
00054 
00056     // Initialize Piecewise Penalty list
00057     bool IsPiecewisePenaltyListEmpty()
00058     {
00059       return PiecewisePenalty_list_.empty();
00060     }
00061 
00062     void InitPiecewisePenaltyList(Number pen_r, Number barrier_obj, Number infeasi)
00063     {
00064       AddEntry( pen_r, barrier_obj,  infeasi);
00065     }
00066 
00070     bool Acceptable(Number Fzconst, Number Fzlin);
00071 
00073     Number BiggestBarr();
00074 
00077     void UpdateEntry(Number barrier_obj, Number infeasi);
00078 
00081     void AddEntry(Number pen_r, Number barrier_obj, Number infeasi)
00082     {
00083       PiecewisePenEntry TmpEntry;
00084       if (IsPiecewisePenaltyListEmpty()) {
00085         TmpEntry.pen_r = 0.0;
00086       }
00087       else {
00088         TmpEntry.pen_r = pen_r;
00089       }
00090       TmpEntry.barrier_obj = barrier_obj;
00091       TmpEntry.infeasi = infeasi;
00092       PiecewisePenalty_list_.push_back(TmpEntry);
00093     }
00094 
00097     void ResetList(Number pen_r, Number barrier_obj, Number infeasi)
00098     {
00099       PiecewisePenalty_list_.clear();
00100       AddEntry( pen_r, barrier_obj,  infeasi);
00101     }
00102 
00104 
00106     void Clear()
00107     {
00108       PiecewisePenalty_list_.clear();
00109     }
00110 
00112     void Print(const Journalist& jnlst);
00113 
00114   private:
00124     PiecewisePenalty();
00126     PiecewisePenalty(const PiecewisePenalty&);
00127 
00129     void operator=(const PiecewisePenalty&);
00131 
00133     Index dim_;
00134 
00136     Number min_piece_penalty_;
00137 
00139     Index max_piece_number_;
00140 
00142     std::vector<PiecewisePenEntry> PiecewisePenalty_list_;
00143 
00144   };
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152 } // namespace Ipopt
00153 
00154 #endif

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