メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

QP.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_QP_h)
00024 #define octave_QP_h 1
00025 
00026 #include "dMatrix.h"
00027 #include "dColVector.h"
00028 #include "Bounds.h"
00029 #include "LinConst.h"
00030 #include "base-min.h"
00031 
00032 class
00033 QP : public base_minimizer
00034 {
00035 public:
00036 
00037   QP (void)
00038     : base_minimizer (), H (), c (), bnds (), lc () { }
00039 
00040   QP (const ColumnVector& x, const Matrix& H_arg)
00041     : base_minimizer (x), H (H_arg), c (), bnds (), lc ()
00042       { make_h_symmetric (); }
00043 
00044   QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg)
00045     : base_minimizer (x), H (H_arg), c (c_arg), bnds (), lc ()
00046       { make_h_symmetric (); }
00047 
00048   QP (const ColumnVector& x, const Matrix& H_arg, const Bounds& b)
00049     : base_minimizer (x), H (H_arg), c (), bnds (b), lc ()
00050       { make_h_symmetric (); }
00051 
00052   QP (const ColumnVector& x, const Matrix& H_arg, const LinConst& l)
00053     : base_minimizer (x), H (H_arg), c (), bnds (), lc (l)
00054       { make_h_symmetric (); }
00055 
00056   QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg,
00057       const Bounds& b)
00058     : base_minimizer (x), H (H_arg), c (c_arg), bnds (b), lc ()
00059       { make_h_symmetric (); }
00060 
00061   QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg,
00062       const LinConst& l)
00063     : base_minimizer (x), H (H_arg), c (c_arg), bnds (), lc (l)
00064       { make_h_symmetric (); }
00065 
00066   QP (const ColumnVector& x, const Matrix& H_arg, const Bounds& b,
00067       const LinConst& l)
00068     : base_minimizer (x), H (H_arg), c (), bnds (b), lc (l)
00069       { make_h_symmetric (); }
00070 
00071   QP (const ColumnVector& x, const Matrix& H_arg, const ColumnVector& c_arg,
00072       const Bounds& b, const LinConst& l)
00073     : base_minimizer (x), H (H_arg), c (c_arg), bnds (b), lc (l)
00074       { make_h_symmetric (); }
00075 
00076   QP (const QP& qp)
00077     : base_minimizer (qp), H (qp.H), c (qp.c), bnds (qp.bnds), lc (qp.lc) { }
00078 
00079   QP& operator = (const QP& qp)
00080     {
00081       if (this != &qp)
00082         {
00083           base_minimizer::operator = (qp);
00084 
00085           H = qp.H;
00086           c = qp.c;
00087           bnds = qp.bnds;
00088           lc = qp.lc;
00089         }
00090       return *this;
00091     }
00092 
00093   virtual ~QP (void) { }
00094 
00095   Matrix hessian (void) const { return H; }
00096 
00097   ColumnVector linear_obj_coeff (void) const { return c; }
00098 
00099   Bounds bounds (void) const { return bnds; }
00100 
00101   LinConst linear_constraints (void) const { return lc; }
00102 
00103 protected:
00104 
00105   Matrix H;  
00106   ColumnVector c;
00107   Bounds bnds;
00108   LinConst lc;
00109 
00110 private:
00111 
00112   Matrix make_h_symmetric (void) { return 0.5 * (H + H.transpose ()); }
00113 };
00114 
00115 #endif
00116 
00117 /*
00118 ;;; Local Variables: ***
00119 ;;; mode: C++ ***
00120 ;;; End: ***
00121 */

Wed Dec 29 11:52:17 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送