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_LinConst_h) 00024 #define octave_LinConst_h 1 00025 00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) 00027 #pragma interface 00028 #endif 00029 00030 #include <iostream> 00031 00032 class ColumnVector; 00033 00034 #include <cfloat> 00035 00036 #include "dMatrix.h" 00037 #include "Bounds.h" 00038 00039 class 00040 LinConst : public Bounds 00041 { 00042 public: 00043 00044 LinConst (void) 00045 : Bounds (), A () { } 00046 00047 LinConst (const ColumnVector& l, const Matrix& amat, const ColumnVector& u) 00048 : Bounds (l, u), A (amat) 00049 { 00050 if (Bounds::size () != amat.rows ()) 00051 error ("nonconformant constraint matrix and bounds vectors"); 00052 } 00053 00054 LinConst (const LinConst& a) 00055 : Bounds (a.lb, a.ub), A (a.A) { } 00056 00057 LinConst& operator = (const LinConst& a) 00058 { 00059 if (this != &a) 00060 { 00061 Bounds::operator = (a); 00062 00063 A = a.A; 00064 } 00065 return *this; 00066 } 00067 00068 ~LinConst (void) { } 00069 00070 Matrix constraint_matrix (void) const { return A; } 00071 00072 LinConst& set_constraint_matrix (const Matrix& amat) 00073 { 00074 if (lb.capacity () != amat.rows ()) 00075 error ("inconsistent size for new linear constraint matrix"); 00076 00077 A = amat; 00078 00079 return *this; 00080 } 00081 00082 friend std::ostream& operator << (std::ostream& os, const LinConst& b); 00083 00084 protected: 00085 00086 Matrix A; 00087 00088 private: 00089 00090 void error (const char *msg); 00091 }; 00092 00093 #endif 00094 00095 /* 00096 ;;; Local Variables: *** 00097 ;;; mode: C++ *** 00098 ;;; End: *** 00099 */
SEO | [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送 | ||