Mercurial > hg > octave-terminal
changeset 645:21cb3c7dc9e3
[project @ 1994-08-24 06:19:54 by jwe]
author | jwe |
---|---|
date | Wed, 24 Aug 1994 06:27:09 +0000 |
parents | 3a7c78b38ca3 |
children | 209eafc06817 |
files | liboctave/Array.cc liboctave/Array.h liboctave/FSQP.h liboctave/NLEqn.cc liboctave/NPSOL.h liboctave/QPSOL.h liboctave/Range.cc liboctave/Range.h |
diffstat | 8 files changed, 40 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -830,7 +830,7 @@ return nc; } -#if defined (_AIX) +#if defined (_AIX) && defined (__GNUG__) && __GNUC__ > 1 && __GNUC_MINOR__ < 6 template <class T> T& DiagArray<T>::elem (int r, int c)
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -237,13 +237,13 @@ inline T get (int i) { return Array<T>::elem (i); } inline void set (const T& val, int i) { Array<T>::elem (i) = val; } -#if ! defined (_AIX) +#if ! (defined (_AIX) && defined (__GNUG__) && __GNUC__ > 1 && __GNUC_MINOR__ < 6) class Proxy { public: inline Proxy (DiagArray<T> *ref, int r, int c) - : object (ref), i (r), j (c) { } + : i (r), j (c), object (ref) { } inline const Proxy& operator = (const T& val) const { @@ -314,7 +314,7 @@ int cols (void) const; int columns (void) const; -#if defined (_AIX) +#if defined (_AIX) && defined (__GNUG__) && __GNUC__ > 1 && __GNUC_MINOR__ < 6 T& elem (int r, int c); T& checkelem (int r, int c); T& operator () (int r, int c);
--- a/liboctave/FSQP.h +++ b/liboctave/FSQP.h @@ -24,12 +24,12 @@ #if !defined (octave_FSQP_h) #define octave_FSQP_h 1 +#ifndef FSQP_MISSING + #if defined (__GNUG__) #pragma interface #endif -#ifndef FSQP_MISSING - #include "NLP.h" extern "C++" { @@ -44,9 +44,9 @@ private: }; -#endif /* FSQP_MISSING */ +} // extern "C++" -} // extern "C++" +#endif /* FSQP_MISSING */ #endif
--- a/liboctave/NLEqn.cc +++ b/liboctave/NLEqn.cc @@ -61,12 +61,12 @@ // Constructors -NLEqn::NLEqn (void) : NLFunc (), x (), n (0) {} +NLEqn::NLEqn (void) : NLFunc (), n (0), x () { } NLEqn::NLEqn (const Vector& xvec, const NLFunc f) - : NLFunc (f), x (xvec), n (xvec.capacity ()) {} + : NLFunc (f), n (xvec.capacity ()), x (xvec) { } -NLEqn::NLEqn (const NLEqn& a) : NLFunc (a.fun, a.jac), x (a.x), n (a.n) {} +NLEqn::NLEqn (const NLEqn& a) : NLFunc (a.fun, a.jac), n (a.n), x (a.x) { } void NLEqn::resize (int nn)
--- a/liboctave/NPSOL.h +++ b/liboctave/NPSOL.h @@ -24,12 +24,12 @@ #if !defined (octave_NPSOL_h) #define octave_NPSOL_h 1 +#ifndef NPSOL_MISSING + #if defined (__GNUG__) #pragma interface #endif -#ifndef NPSOL_MISSING - #include "dColVector.h" #include "NLP.h" @@ -192,9 +192,9 @@ inline NPSOL::NPSOL (const NPSOL& a) : NLP (a.x, a.phi, a.bnds, a.lc, a.nlc) { } -#endif /* NPSOL_MISSING */ +} // extern "C++" -} // extern "C++" +#endif /* NPSOL_MISSING */ #endif
--- a/liboctave/QPSOL.h +++ b/liboctave/QPSOL.h @@ -24,12 +24,12 @@ #if !defined (octave_QPSOL_h) #define octave_QPSOL_h 1 +#ifndef QPSOL_MISSING + #if defined (__GNUG__) #pragma interface #endif -#ifndef QPSOL_MISSING - #include "dMatrix.h" #include "dColVector.h" #include "QP.h" @@ -127,9 +127,9 @@ return *this; } -#endif /* QPSOL_MISSING */ +} // extern "C++" -} // extern "C++" +#endif /* QPSOL_MISSING */ #endif
--- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -33,6 +33,24 @@ #include <limits.h> #include "Range.h" +#include "dMatrix.h" + +Matrix +Range::matrix_value (void) const +{ + Matrix retval; + + if (rng_nelem > 0) + { + retval.resize (1, rng_nelem); + double b = rng_base; + double increment = rng_inc; + for (int i = 0; i < rng_nelem; i++) + retval.elem (0, i) = b + i * increment; + } + + return retval; +} // NOTE: max and min only return useful values if nelem > 0.