home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-bin.lha / include / octave / NLP.h < prev    next >
C/C++ Source or Header  |  1996-10-12  |  3KB  |  143 lines

  1. // NLP.h                                                -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. #if !defined (octave_NLP_h)
  25. #define octave_NLP_h 1
  26.  
  27. #include "dColVector.h"
  28. #include "Objective.h"
  29. #include "Bounds.h"
  30. #include "LinConst.h"
  31. #include "NLConst.h"
  32.  
  33. extern "C++" {
  34.  
  35. #ifndef Vector
  36. #define Vector ColumnVector
  37. #endif
  38.  
  39. class NLP
  40. {
  41.  public:
  42.  
  43.   NLP (void);
  44.  
  45.   NLP (const Vector& x, const Objective& phi);
  46.  
  47.   NLP (const Vector& x, const Objective& phi, const Bounds& b);
  48.  
  49.   NLP (const Vector& x, const Objective& phi, const Bounds& b, const
  50.        LinConst& lc);
  51.  
  52.   NLP (const Vector& x, const Objective& phi, const Bounds& b, const
  53.        LinConst& lc, const NLConst& nlc);
  54.  
  55.   NLP (const Vector& x, const Objective& phi, const LinConst& lc); 
  56.  
  57.   NLP (const Vector& x, const Objective& phi, const LinConst& lc,
  58.        const NLConst& nlc);
  59.  
  60.   NLP (const Vector& x, const Objective& phi, const NLConst& nlc); 
  61.  
  62.   NLP (const Vector& x, const Objective& phi, const Bounds& b, const
  63.        NLConst& nlc);
  64.  
  65.   ~NLP (void);
  66.  
  67.   NLP& operator = (const NLP& a);
  68.  
  69.   int size (void) const;
  70.  
  71.  protected:
  72.  
  73.   Vector x;
  74.   Objective phi;  
  75.   Bounds bnds;
  76.   LinConst lc;
  77.   NLConst nlc;
  78. };
  79.  
  80. inline NLP::NLP (void) {}
  81.  
  82. inline NLP::NLP (const Vector& xx, const Objective& obj)
  83.   : x (xx), phi (obj) {}
  84.  
  85. inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b)
  86.   : x (xx), phi (obj), bnds (b) {}
  87.  
  88. inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b,
  89.          const LinConst& l) 
  90.   : x (xx), phi (obj), bnds (b), lc (l) {}
  91.  
  92. inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b,
  93.          const LinConst& l, const NLConst& nl) 
  94.   : x (xx), phi (obj), bnds (b), lc (l), nlc (nl) {}
  95.  
  96. inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l)
  97.   : x (xx), phi (obj), lc (l) {}
  98.  
  99. inline NLP::NLP (const Vector& xx, const Objective& obj, const LinConst& l,
  100.          const NLConst& nl) 
  101.   : x (xx), phi (obj), lc (l), nlc (nl) {}
  102.  
  103. inline NLP::NLP (const Vector& xx, const Objective& obj, const NLConst& nl)
  104.   : x (xx), phi (obj), nlc (nl) {}
  105.  
  106. inline NLP::NLP (const Vector& xx, const Objective& obj, const Bounds& b,
  107.          const NLConst& nl) 
  108.   : x (xx), phi (obj), bnds (b), nlc (nl) {}
  109.  
  110. inline NLP::~NLP (void) { }
  111.  
  112. inline NLP&
  113. NLP::operator = (const NLP& a)
  114. {
  115.   if (this != &a)
  116.     {
  117.       x = a.x;
  118.       phi = a.phi;  
  119.       bnds = a.bnds;
  120.       lc = a.lc;
  121.       nlc = a.nlc;
  122.     }
  123.  
  124.   return *this;
  125. }
  126.  
  127. inline int
  128. NLP::size (void) const
  129. {
  130.   return x.capacity ();
  131. }
  132.  
  133. } // extern "C++"
  134.  
  135. #endif
  136.  
  137. /*
  138. ;;; Local Variables: ***
  139. ;;; mode: C++ ***
  140. ;;; page-delimiter: "^/\\*" ***
  141. ;;; End: ***
  142. */
  143.