Mercurial > hg > octave-max
changeset 1835:12a94a17509d
[project @ 1996-02-03 07:16:15 by jwe]
author | jwe |
---|---|
date | Sat, 03 Feb 1996 07:28:51 +0000 |
parents | 46ab6238fa79 |
children | 503a75f6b9bc |
files | liboctave/LP.h liboctave/LPsolve.cc liboctave/NLP.h liboctave/NPSOL.cc liboctave/NPSOL.h liboctave/QPSOL.cc liboctave/QPSOL.h liboctave/base-min.h |
diffstat | 8 files changed, 56 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/LP.h +++ b/liboctave/LP.h @@ -1,7 +1,7 @@ // LP.h -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -47,6 +47,24 @@ LP (const ColumnVector& c_arg, const LinConst& l) : base_minimizer (), c (c_arg), lc (l) { } + LP (const LP& a) + : base_minimizer (a), c (a.c), bnds (a.bnds), lc (a.lc) { } + + LP& operator = (const LP& a) + { + if (this != &a) + { + base_minimizer::operator = (a); + + c = a.c; + bnds = a.bnds; + lc = a.lc; + } + return *this; + } + + ~LP (void) { } + protected: ColumnVector c;
--- a/liboctave/LPsolve.cc +++ b/liboctave/LPsolve.cc @@ -31,19 +31,15 @@ #include "LPsolve.h" #include "dColVector.h" +#include "lo-error.h" ColumnVector LPsolve::do_minimize (double&, int&, ColumnVector&) { + (*current_liboctave_error_handler) ("sorry, not implemented"); return ColumnVector (); } -void -LPsolve::set_default_options (void) -{ - // Maybe this isn't needed? -} - /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/liboctave/NLP.h +++ b/liboctave/NLP.h @@ -65,24 +65,26 @@ const NLConst& nl) : base_minimizer (x), phi (obj), bnds (b), nlc (nl) { } + NLP (const NLP& a) + : base_minimizer (a), phi (a.phi), bnds (a.bnds), lc (a.lc), nlc (a.nlc) + { } + NLP& operator = (const NLP& a) { if (this != &a) { - x = a.x; + base_minimizer::operator = (a); + phi = a.phi; bnds = a.bnds; lc = a.lc; nlc = a.nlc; } - return *this; } virtual ~NLP (void) { } - int size (void) const { return x.capacity (); } - protected: Objective phi;
--- a/liboctave/NPSOL.cc +++ b/liboctave/NPSOL.cc @@ -1,7 +1,7 @@ // NPSOL.cc -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -308,15 +308,6 @@ return x; } -NPSOL& -NPSOL::option (char *) -{ - cerr << "This function no longer has any effect.\n" - << "Use the NPSOL_option class instead\n"; - - return *this; -} - NPSOL_options::NPSOL_options (void) { init ();
--- a/liboctave/NPSOL.h +++ b/liboctave/NPSOL.h @@ -165,8 +165,11 @@ NPSOL& operator = (const NPSOL& a) { - NLP::operator = (a); - NPSOL_options::operator = (a); + if (this != &a) + { + NLP::operator = (a); + NPSOL_options::operator = (a); + } return *this; }
--- a/liboctave/QPSOL.cc +++ b/liboctave/QPSOL.cc @@ -1,7 +1,7 @@ // QPSOL.cc -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave.
--- a/liboctave/QPSOL.h +++ b/liboctave/QPSOL.h @@ -1,7 +1,7 @@ // QPSOL.h -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -72,42 +72,44 @@ { public: - QPSOL (void) : QP () { } + QPSOL (void) + : QP (), QPSOL_options () { } - QPSOL (const ColumnVector& x, const Matrix& H) : QP (x, H) { } + QPSOL (const ColumnVector& x, const Matrix& H) + : QP (x, H), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const ColumnVector& c) - : QP (x, H, c) { } + : QP (x, H, c), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const Bounds& b) - : QP (x, H, b) { } + : QP (x, H, b), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const LinConst& lc) - : QP (x, H, lc) { } + : QP (x, H, lc), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const ColumnVector& c, - const Bounds& b) : QP (x, H, c, b) { } + const Bounds& b) + : QP (x, H, c, b), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const ColumnVector& c, - const LinConst& lc) : QP (x, H, c, lc) { } + const LinConst& lc) + : QP (x, H, c, lc), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const Bounds& b, const LinConst& lc) - : QP (x, H, b, lc) { } + : QP (x, H, b, lc), QPSOL_options () { } QPSOL (const ColumnVector& x, const Matrix& H, const ColumnVector& c, - const Bounds& b, const LinConst& lc) : QP (x, H, c, b, lc) { } + const Bounds& b, const LinConst& lc) + : QP (x, H, c, b, lc), QPSOL_options () { } - QPSOL (const QPSOL& a) : QP (a.x, a.H, a.c, a.bnds, a.lc) { } + QPSOL (const QPSOL& a) + : QP (a), QPSOL_options (a) { } QPSOL& operator = (const QPSOL& a) { - x = a.x; - H = a.H; - c = a.c; - bnds = a.bnds; - lc = a.lc; - + QP::operator = (a); + QPSOL_options::operator = (a); return *this; }
--- a/liboctave/base-min.h +++ b/liboctave/base-min.h @@ -1,7 +1,7 @@ // base-min.h -*- C++ -*- /* -Copyright (C) 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -113,6 +113,8 @@ return do_minimize (objf, inform, lambda); } + int size (void) const { return x.capacity (); } + protected: ColumnVector x;