Mercurial > hg > octave-lojdl
changeset 1359:a6994c934a50
[project @ 1995-09-05 21:30:26 by jwe]
author | jwe |
---|---|
date | Tue, 05 Sep 1995 21:30:26 +0000 |
parents | dc9c01f66a19 |
children | 7eb93d12654c |
files | liboctave/Array.h liboctave/CColVector.h liboctave/CDiagMatrix.h liboctave/CMatrix.h liboctave/CRowVector.h liboctave/DAE.h liboctave/FSQP.h liboctave/MArray.h liboctave/Matrix.h liboctave/NPSOL.h liboctave/ODE.h liboctave/QPSOL.h liboctave/dColVector.h liboctave/dDiagMatrix.h liboctave/dMatrix.h liboctave/dRowVector.h liboctave/mx-base.h liboctave/mx-kludge.h liboctave/sun-utils.h |
diffstat | 19 files changed, 146 insertions(+), 188 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -40,14 +40,13 @@ template <class T> class Array3; template <class T> class DiagArray; -/* - * The real representation of all arrays. - */ +// The real representation of all arrays. template <class T> class ArrayRep { -// Rethink resize()? + // Rethink resize()? + friend class Array<T>; friend class Array2<T>; friend class Array3<T>; @@ -80,10 +79,8 @@ int count; }; -/* - * One dimensional array class. Handles the reference counting for - * all the derived classes. - */ +// One dimensional array class. Handles the reference counting for +// all the derived classes. template <class T> class Array @@ -113,7 +110,8 @@ T& checkelem (int n); T& operator () (int n); -// No checking. + // No checking. + T& xelem (int n); T elem (int n) const; @@ -128,9 +126,7 @@ T *fortran_vec (void); }; -/* - * Two dimensional array class. - */ +// Two dimensional array class. template <class T> class Array2 : public Array<T> @@ -165,7 +161,8 @@ T& checkelem (int i, int j); T& operator () (int i, int j); -// No checking. + // No checking. + T& xelem (int i, int j); T elem (int i, int j) const; @@ -176,9 +173,7 @@ void resize (int n, int m, const T& val); }; -/* - * Three dimensional array class. - */ +// Three dimensional array class. template <class T> class Array3 : public Array2<T> @@ -206,7 +201,8 @@ T& checkelem (int i, int j, int k); T& operator () (int i, int j, int k); -// No checking. + // No checking. + T& xelem (int i, int j, int k); T elem (int i, int j, int k) const; @@ -217,20 +213,18 @@ void resize (int n, int m, int k, const T& val); }; -/* - * A two-dimensional array with diagonal elements only. - * - * Idea and example code for Proxy class and functions from: - * - * From: kanze@us-es.sel.de (James Kanze) - * Subject: Re: How to overload [] to do READ/WRITE differently ? - * Message-ID: <KANZE.93Nov29151407@slsvhdt.us-es.sel.de> - * Sender: news@us-es.sel.de - * Date: 29 Nov 1993 14:14:07 GMT - * -- - * James Kanze email: kanze@us-es.sel.de - * GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France - */ +// A two-dimensional array with diagonal elements only. +// +// Idea and example code for Proxy class and functions from: +// +// From: kanze@us-es.sel.de (James Kanze) +// Subject: Re: How to overload [] to do READ/WRITE differently ? +// Message-ID: <KANZE.93Nov29151407@slsvhdt.us-es.sel.de> +// Sender: news@us-es.sel.de +// Date: 29 Nov 1993 14:14:07 GMT +// -- +// James Kanze email: kanze@us-es.sel.de +// GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France template <class T> class DiagArray : public Array<T> @@ -275,9 +269,9 @@ private: -// XXX FIXME XXX -- this is declared private to keep the user from -// taking the address of a Proxy. Maybe it should be implemented by -// means of a companion function in the DiagArray class. + // XXX FIXME XXX -- this is declared private to keep the user from + // taking the address of a Proxy. Maybe it should be implemented + // by means of a companion function in the DiagArray class. inline T *operator& () const { assert (0); return (T *) 0; } @@ -353,7 +347,8 @@ T& operator () (int r, int c); #endif -// No checking. + // No checking. + T& xelem (int r, int c); T elem (int r, int c) const;
--- a/liboctave/CColVector.h +++ b/liboctave/CColVector.h @@ -55,7 +55,7 @@ int operator == (const ComplexColumnVector& a) const; int operator != (const ComplexColumnVector& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations ComplexColumnVector& insert (const ColumnVector& a, int r); ComplexColumnVector& insert (const ComplexColumnVector& a, int r); @@ -73,11 +73,11 @@ friend ComplexColumnVector conj (const ComplexColumnVector& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one ComplexColumnVector extract (int r1, int r2) const; -// column vector by column vector -> column vector operations + // column vector by column vector -> column vector operations ComplexColumnVector& operator += (const ColumnVector& a); ComplexColumnVector& operator -= (const ColumnVector& a); @@ -85,7 +85,7 @@ ComplexColumnVector& operator += (const ComplexColumnVector& a); ComplexColumnVector& operator -= (const ComplexColumnVector& a); -// column vector by scalar -> column vector operations + // column vector by scalar -> column vector operations friend ComplexColumnVector operator + (const ComplexColumnVector& a, double s); @@ -105,7 +105,7 @@ friend ComplexColumnVector operator / (const ColumnVector& a, const Complex& s); -// scalar by column vector -> column vector operations + // scalar by column vector -> column vector operations friend ComplexColumnVector operator + (double s, const ComplexColumnVector& a); @@ -125,7 +125,7 @@ friend ComplexColumnVector operator / (const Complex& s, const ColumnVector& a); -// matrix by column vector -> column vector operations + // matrix by column vector -> column vector operations friend ComplexColumnVector operator * (const ComplexMatrix& a, const ColumnVector& b); @@ -133,7 +133,7 @@ friend ComplexColumnVector operator * (const ComplexMatrix& a, const ComplexColumnVector& b); -// column vector by column vector -> column vector operations + // column vector by column vector -> column vector operations friend ComplexColumnVector operator + (const ComplexColumnVector& a, const ColumnVector& b); @@ -155,12 +155,12 @@ friend ComplexColumnVector quotient (const ColumnVector& a, const ComplexColumnVector& b); -// matrix by column vector -> column vector operations + // matrix by column vector -> column vector operations friend ComplexColumnVector operator * (const Matrix& a, const ComplexColumnVector& b); -// diagonal matrix by column vector -> column vector operations + // diagonal matrix by column vector -> column vector operations friend ComplexColumnVector operator * (const DiagMatrix& a, const ComplexColumnVector& b); @@ -171,7 +171,7 @@ friend ComplexColumnVector operator * (const ComplexDiagMatrix& a, const ComplexColumnVector& b); -// other operations + // other operations friend ComplexColumnVector map (c_c_Mapper f, const ComplexColumnVector& a); void map (c_c_Mapper f); @@ -179,7 +179,7 @@ Complex min (void) const; Complex max (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const ComplexColumnVector& a); friend istream& operator >> (istream& is, ComplexColumnVector& a);
--- a/liboctave/CDiagMatrix.h +++ b/liboctave/CDiagMatrix.h @@ -85,11 +85,11 @@ friend ComplexDiagMatrix conj (const ComplexDiagMatrix& a); -// resize is the destructive analog for this one + // resize is the destructive analog for this one ComplexMatrix extract (int r1, int c1, int r2, int c2) const; -// extract row or column i. + // extract row or column i ComplexRowVector row (int i) const; ComplexRowVector row (char *s) const; @@ -100,7 +100,7 @@ ComplexDiagMatrix inverse (int& info) const; ComplexDiagMatrix inverse (void) const; -// diagonal matrix by diagonal matrix -> diagonal matrix operations + // diagonal matrix by diagonal matrix -> diagonal matrix operations ComplexDiagMatrix& operator += (const DiagMatrix& a); ComplexDiagMatrix& operator -= (const DiagMatrix& a); @@ -108,7 +108,7 @@ ComplexDiagMatrix& operator += (const ComplexDiagMatrix& a); ComplexDiagMatrix& operator -= (const ComplexDiagMatrix& a); -// diagonal matrix by scalar -> diagonal matrix operations + // diagonal matrix by scalar -> diagonal matrix operations friend ComplexDiagMatrix operator * (const ComplexDiagMatrix& a, double s); friend ComplexDiagMatrix operator / (const ComplexDiagMatrix& a, double s); @@ -116,13 +116,13 @@ friend ComplexDiagMatrix operator * (const DiagMatrix& a, const Complex& s); friend ComplexDiagMatrix operator / (const DiagMatrix& a, const Complex& s); -// scalar by diagonal matrix -> diagonal matrix operations + // scalar by diagonal matrix -> diagonal matrix operations friend ComplexDiagMatrix operator * (double s, const ComplexDiagMatrix& a); friend ComplexDiagMatrix operator * (const Complex& s, const DiagMatrix& a); -// diagonal matrix by diagonal matrix -> diagonal matrix operations + // diagonal matrix by diagonal matrix -> diagonal matrix operations friend ComplexDiagMatrix operator * (const ComplexDiagMatrix& a, const ComplexDiagMatrix& b); @@ -147,12 +147,12 @@ friend ComplexDiagMatrix product (const DiagMatrix& a, const ComplexDiagMatrix& b); -// other operations + // other operations ComplexColumnVector diag (void) const; ComplexColumnVector diag (int k) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const ComplexDiagMatrix& a);
--- a/liboctave/CMatrix.h +++ b/liboctave/CMatrix.h @@ -67,7 +67,7 @@ int operator == (const ComplexMatrix& a) const; int operator != (const ComplexMatrix& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations ComplexMatrix& insert (const Matrix& a, int r, int c); ComplexMatrix& insert (const RowVector& a, int r, int c); @@ -109,11 +109,11 @@ friend ComplexMatrix conj (const ComplexMatrix& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one ComplexMatrix extract (int r1, int c1, int r2, int c2) const; -// extract row or column i. + // extract row or column i. ComplexRowVector row (int i) const; ComplexRowVector row (char *s) const; @@ -160,7 +160,7 @@ ComplexColumnVector lssolve (const ComplexColumnVector& b, int& info, int& rank) const; -// column vector by row vector -> matrix operations + // column vector by row vector -> matrix operations friend ComplexMatrix operator * (const ColumnVector& a, const ComplexRowVector& b); @@ -171,7 +171,7 @@ friend ComplexMatrix operator * (const ComplexColumnVector& a, const ComplexRowVector& b); -// diagonal matrix by scalar -> matrix operations + // diagonal matrix by scalar -> matrix operations friend ComplexMatrix operator + (const DiagMatrix& a, const Complex& s); friend ComplexMatrix operator - (const DiagMatrix& a, const Complex& s); @@ -184,7 +184,7 @@ friend ComplexMatrix operator - (const ComplexDiagMatrix& a, const Complex& s); -// scalar by diagonal matrix -> matrix operations + // scalar by diagonal matrix -> matrix operations friend ComplexMatrix operator + (const Complex& s, const DiagMatrix& a); friend ComplexMatrix operator - (const Complex& s, const DiagMatrix& a); @@ -197,7 +197,7 @@ friend ComplexMatrix operator - (const Complex& s, const ComplexDiagMatrix& a); -// matrix by diagonal matrix -> matrix operations + // matrix by diagonal matrix -> matrix operations ComplexMatrix& operator += (const DiagMatrix& a); ComplexMatrix& operator -= (const DiagMatrix& a); @@ -212,7 +212,7 @@ friend ComplexMatrix operator * (const Matrix& a, const ComplexDiagMatrix& b); -// diagonal matrix by matrix -> matrix operations + // diagonal matrix by matrix -> matrix operations friend ComplexMatrix operator + (const DiagMatrix& a, const ComplexMatrix& b); @@ -235,7 +235,7 @@ friend ComplexMatrix operator * (const ComplexDiagMatrix& a, const ComplexMatrix& b); -// matrix by matrix -> matrix operations + // matrix by matrix -> matrix operations ComplexMatrix& operator += (const Matrix& a); ComplexMatrix& operator -= (const Matrix& a); @@ -243,11 +243,11 @@ ComplexMatrix& operator += (const ComplexMatrix& a); ComplexMatrix& operator -= (const ComplexMatrix& a); -// unary operations + // unary operations Matrix operator ! (void) const; -// matrix by scalar -> matrix operations + / matrix by scalar -> matrix operations friend ComplexMatrix operator + (const Matrix& a, const Complex& s); friend ComplexMatrix operator - (const Matrix& a, const Complex& s); @@ -259,7 +259,7 @@ friend ComplexMatrix operator * (const ComplexMatrix& a, double s); friend ComplexMatrix operator / (const ComplexMatrix& a, double s); -// scalar by matrix -> matrix operations + // scalar by matrix -> matrix operations friend ComplexMatrix operator + (double s, const ComplexMatrix& a); friend ComplexMatrix operator - (double s, const ComplexMatrix& a); @@ -271,7 +271,7 @@ friend ComplexMatrix operator * (const Complex& s, const Matrix& a); friend ComplexMatrix operator / (const Complex& s, const Matrix& a); -// matrix by diagonal matrix -> matrix operations + // matrix by diagonal matrix -> matrix operations friend ComplexMatrix operator + (const ComplexMatrix& a, const DiagMatrix& b); @@ -287,7 +287,7 @@ friend ComplexMatrix operator * (const ComplexMatrix& a, const ComplexDiagMatrix& b); -// matrix by matrix -> matrix operations + // matrix by matrix -> matrix operations friend ComplexMatrix operator + (const ComplexMatrix& a, const Matrix& b); friend ComplexMatrix operator - (const ComplexMatrix& a, const Matrix& b); @@ -308,7 +308,7 @@ friend ComplexMatrix product (const Matrix& a, const ComplexMatrix& b); friend ComplexMatrix quotient (const Matrix& a, const ComplexMatrix& b); -// other operations + // other operations friend ComplexMatrix map (c_c_Mapper f, const ComplexMatrix& a); void map (c_c_Mapper f); @@ -337,7 +337,7 @@ ComplexRowVector column_max (void) const; ComplexRowVector column_max_loc (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const ComplexMatrix& a); friend istream& operator >> (istream& is, ComplexMatrix& a);
--- a/liboctave/CRowVector.h +++ b/liboctave/CRowVector.h @@ -54,7 +54,7 @@ int operator == (const ComplexRowVector& a) const; int operator != (const ComplexRowVector& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations ComplexRowVector& insert (const RowVector& a, int c); ComplexRowVector& insert (const ComplexRowVector& a, int c); @@ -72,11 +72,11 @@ friend ComplexRowVector conj (const ComplexRowVector& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one ComplexRowVector extract (int c1, int c2) const; -// row vector by row vector -> row vector operations + // row vector by row vector -> row vector operations ComplexRowVector& operator += (const RowVector& a); ComplexRowVector& operator -= (const RowVector& a); @@ -84,7 +84,7 @@ ComplexRowVector& operator += (const ComplexRowVector& a); ComplexRowVector& operator -= (const ComplexRowVector& a); -// row vector by scalar -> row vector operations + // row vector by scalar -> row vector operations friend ComplexRowVector operator + (const ComplexRowVector& a, double s); friend ComplexRowVector operator - (const ComplexRowVector& a, double s); @@ -96,7 +96,7 @@ friend ComplexRowVector operator * (const RowVector& a, const Complex& s); friend ComplexRowVector operator / (const RowVector& a, const Complex& s); -// scalar by row vector -> row vector operations + // scalar by row vector -> row vector operations friend ComplexRowVector operator + (double s, const ComplexRowVector& a); friend ComplexRowVector operator - (double s, const ComplexRowVector& a); @@ -108,7 +108,7 @@ friend ComplexRowVector operator * (const Complex& s, const RowVector& a); friend ComplexRowVector operator / (const Complex& s, const RowVector& a); -// row vector by matrix -> row vector + // row vector by matrix -> row vector friend ComplexRowVector operator * (const ComplexRowVector& a, const ComplexMatrix& b); @@ -116,7 +116,7 @@ friend ComplexRowVector operator * (const RowVector& a, const ComplexMatrix& b); -// row vector by row vector -> row vector operations + // row vector by row vector -> row vector operations friend ComplexRowVector operator + (const ComplexRowVector& a, const RowVector& b); @@ -138,7 +138,7 @@ friend ComplexRowVector quotient (const RowVector& a, const ComplexRowVector& b); -// other operations + // other operations friend ComplexRowVector map (c_c_Mapper f, const ComplexRowVector& a); void map (c_c_Mapper f); @@ -146,7 +146,7 @@ Complex min (void) const; Complex max (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const ComplexRowVector& a); friend istream& operator >> (istream& is, ComplexRowVector& a);
--- a/liboctave/DAE.h +++ b/liboctave/DAE.h @@ -63,10 +63,8 @@ protected: -/* - * Some of this is probably too closely related to DASSL, but hey, - * this is just a first attempt... - */ + // Some of this is probably too closely related to DASSL, but hey, + // this is just a first attempt... Vector xdot;
--- a/liboctave/FSQP.h +++ b/liboctave/FSQP.h @@ -42,8 +42,7 @@ private: }; -#endif /* FSQP_MISSING */ - +#endif #endif /*
--- a/liboctave/MArray.h +++ b/liboctave/MArray.h @@ -36,9 +36,7 @@ template <class T> class MArray2; template <class T> class MDiagArray; -/* - * One dimensional array with math ops. - */ +// One dimensional array with math ops. template <class T> class MArray : public Array<T> @@ -63,31 +61,31 @@ return *this; } -// Element by element MArray by scalar ops. + // element by element MArray by scalar ops friend MArray<T>& operator += (MArray<T>& a, const T& s); friend MArray<T>& operator -= (MArray<T>& a, const T& s); -// Element by element MArray by MArray ops. + // element by element MArray by MArray ops friend MArray<T>& operator += (MArray<T>& a, const MArray<T>& b); friend MArray<T>& operator -= (MArray<T>& a, const MArray<T>& b); -// Element by element MArray by scalar ops. + // element by element MArray by scalar ops friend MArray<T> operator + (const MArray<T>& a, const T& s); friend MArray<T> operator - (const MArray<T>& a, const T& s); friend MArray<T> operator * (const MArray<T>& a, const T& s); friend MArray<T> operator / (const MArray<T>& a, const T& s); -// Element by element scalar by MArray ops. + // element by element scalar by MArray ops friend MArray<T> operator + (const T& s, const MArray<T>& a); friend MArray<T> operator - (const T& s, const MArray<T>& a); friend MArray<T> operator * (const T& s, const MArray<T>& a); friend MArray<T> operator / (const T& s, const MArray<T>& a); -// Element by element MArray by MArray ops. + // element by element MArray by MArray ops friend MArray<T> operator + (const MArray<T>& a, const MArray<T>& b); @@ -99,9 +97,7 @@ friend MArray<T> operator - (const MArray<T>& a); }; -/* - * Two dimensional array with math ops. - */ +// Two dimensional array with math ops. template <class T> class MArray2 : public Array2<T> @@ -127,31 +123,31 @@ return *this; } -// Element by element MArray2 by scalar ops. + // element by element MArray2 by scalar ops friend MArray2<T>& operator += (MArray2<T>& a, const T& s); friend MArray2<T>& operator -= (MArray2<T>& a, const T& s); -// Element by element MArray2 by MArray2 ops. + // element by element MArray2 by MArray2 ops friend MArray2<T>& operator += (MArray2<T>& a, const MArray2<T>& b); friend MArray2<T>& operator -= (MArray2<T>& a, const MArray2<T>& b); -// Element by element MArray2 by scalar ops. + // element by element MArray2 by scalar ops friend MArray2<T> operator + (const MArray2<T>& a, const T& s); friend MArray2<T> operator - (const MArray2<T>& a, const T& s); friend MArray2<T> operator * (const MArray2<T>& a, const T& s); friend MArray2<T> operator / (const MArray2<T>& a, const T& s); -// Element by element scalar by MArray2 ops. + // element by element scalar by MArray2 ops friend MArray2<T> operator + (const T& s, const MArray2<T>& a); friend MArray2<T> operator - (const T& s, const MArray2<T>& a); friend MArray2<T> operator * (const T& s, const MArray2<T>& a); friend MArray2<T> operator / (const T& s, const MArray2<T>& a); -// Element by element MArray2 by MArray2 ops. + // element by element MArray2 by MArray2 ops friend MArray2<T> operator + (const MArray2<T>& a, const MArray2<T>& b); friend MArray2<T> operator - (const MArray2<T>& a, const MArray2<T>& b); @@ -162,9 +158,7 @@ friend MArray2<T> operator - (const MArray2<T>& a); }; -/* - * Two dimensional diagonal array with math ops. - */ +// Two dimensional diagonal array with math ops. template <class T> class MDiagArray : public DiagArray<T> @@ -192,21 +186,21 @@ return *this; } -// Element by element MDiagArray by MDiagArray ops. + // element by element MDiagArray by MDiagArray ops friend MDiagArray<T>& operator += (MDiagArray<T>& a, const MDiagArray<T>& b); friend MDiagArray<T>& operator -= (MDiagArray<T>& a, const MDiagArray<T>& b); -// Element by element MDiagArray by scalar ops. + // element by element MDiagArray by scalar ops friend MDiagArray<T> operator * (const MDiagArray<T>& a, const T& s); friend MDiagArray<T> operator / (const MDiagArray<T>& a, const T& s); -// Element by element scalar by MDiagArray ops. + // element by element scalar by MDiagArray ops friend MDiagArray<T> operator * (const T& s, const MDiagArray<T>& a); -// Element by element MDiagArray by MDiagArray ops. + // element by element MDiagArray by MDiagArray ops friend MDiagArray<T> operator + (const MDiagArray<T>& a, const MDiagArray<T>& b);
--- a/liboctave/Matrix.h +++ b/liboctave/Matrix.h @@ -21,12 +21,8 @@ */ -/* - -Should probably say something here about why these classes are not -represented by some sort of inheritance tree... - -*/ +// Should probably say something here about why these classes are not +// represented by some sort of inheritance tree... #if !defined (octave_Matrix_h) #define octave_Matrix_h 1
--- a/liboctave/NPSOL.h +++ b/liboctave/NPSOL.h @@ -190,8 +190,7 @@ inline NPSOL::NPSOL (const NPSOL& a) : NLP (a.x, a.phi, a.bnds, a.lc, a.nlc) { } -#endif /* NPSOL_MISSING */ - +#endif #endif /*
--- a/liboctave/ODE.h +++ b/liboctave/ODE.h @@ -101,10 +101,8 @@ protected: -/* - * Some of this is probably too closely related to LSODE, but hey, - * this is just a first attempt... - */ + // Some of this is probably too closely related to LSODE, but hey, + // this is just a first attempt... int n; double t;
--- a/liboctave/QPSOL.h +++ b/liboctave/QPSOL.h @@ -125,8 +125,7 @@ return *this; } -#endif /* QPSOL_MISSING */ - +#endif #endif /*
--- a/liboctave/dColVector.h +++ b/liboctave/dColVector.h @@ -54,7 +54,7 @@ int operator == (const ColumnVector& a) const; int operator != (const ColumnVector& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations ColumnVector& insert (const ColumnVector& a, int r); @@ -68,24 +68,24 @@ friend ColumnVector real (const ComplexColumnVector& a); friend ColumnVector imag (const ComplexColumnVector& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one ColumnVector extract (int r1, int r2) const; -// column vector by column vector -> column vector operations + // column vector by column vector -> column vector operations ColumnVector& operator += (const ColumnVector& a); ColumnVector& operator -= (const ColumnVector& a); -// matrix by column vector -> column vector operations + // matrix by column vector -> column vector operations friend ColumnVector operator * (const Matrix& a, const ColumnVector& b); -// diagonal matrix by column vector -> column vector operations + // diagonal matrix by column vector -> column vector operations friend ColumnVector operator * (const DiagMatrix& a, const ColumnVector& b); -// other operations + // other operations friend ColumnVector map (d_d_Mapper f, const ColumnVector& a); friend ColumnVector map (d_c_Mapper f, const ComplexColumnVector& a); @@ -94,7 +94,7 @@ double min (void) const; double max (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const ColumnVector& a); friend istream& operator >> (istream& is, ColumnVector& a);
--- a/liboctave/dDiagMatrix.h +++ b/liboctave/dDiagMatrix.h @@ -74,11 +74,11 @@ friend DiagMatrix real (const ComplexDiagMatrix& a); friend DiagMatrix imag (const ComplexDiagMatrix& a); -// resize is the destructive analog for this one + // resize is the destructive analog for this one Matrix extract (int r1, int c1, int r2, int c2) const; -// extract row or column i. + // extract row or column i. RowVector row (int i) const; RowVector row (char *s) const; @@ -89,22 +89,22 @@ DiagMatrix inverse (void) const; DiagMatrix inverse (int& info) const; -// diagonal matrix by diagonal matrix -> diagonal matrix operations + // diagonal matrix by diagonal matrix -> diagonal matrix operations DiagMatrix& operator += (const DiagMatrix& a); DiagMatrix& operator -= (const DiagMatrix& a); -// diagonal matrix by diagonal matrix -> diagonal matrix operations + // diagonal matrix by diagonal matrix -> diagonal matrix operations friend DiagMatrix operator * (const DiagMatrix& a, const DiagMatrix& b); -// other operations + // other operations ColumnVector diag (void) const; ColumnVector diag (int k) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const DiagMatrix& a);
--- a/liboctave/dMatrix.h +++ b/liboctave/dMatrix.h @@ -67,7 +67,7 @@ int operator == (const Matrix& a) const; int operator != (const Matrix& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations Matrix& insert (const Matrix& a, int r, int c); Matrix& insert (const RowVector& a, int r, int c); @@ -92,11 +92,11 @@ friend Matrix real (const ComplexMatrix& a); friend Matrix imag (const ComplexMatrix& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one Matrix extract (int r1, int c1, int r2, int c2) const; -// extract row or column i. + // extract row or column i. RowVector row (int i) const; RowVector row (char *s) const; @@ -161,41 +161,41 @@ Matrix& operator += (const DiagMatrix& a); Matrix& operator -= (const DiagMatrix& a); -// unary operations + // unary operations Matrix operator ! (void) const; -// column vector by row vector -> matrix operations + // column vector by row vector -> matrix operations friend Matrix operator * (const ColumnVector& a, const RowVector& a); -// diagonal matrix by scalar -> matrix operations + // diagonal matrix by scalar -> matrix operations friend Matrix operator + (const DiagMatrix& a, double s); friend Matrix operator - (const DiagMatrix& a, double s); -// scalar by diagonal matrix -> matrix operations + // scalar by diagonal matrix -> matrix operations friend Matrix operator + (double s, const DiagMatrix& a); friend Matrix operator - (double s, const DiagMatrix& a); -// matrix by diagonal matrix -> matrix operations + // matrix by diagonal matrix -> matrix operations friend Matrix operator + (const Matrix& a, const DiagMatrix& b); friend Matrix operator - (const Matrix& a, const DiagMatrix& b); friend Matrix operator * (const Matrix& a, const DiagMatrix& b); -// diagonal matrix by matrix -> matrix operations + // diagonal matrix by matrix -> matrix operations friend Matrix operator + (const DiagMatrix& a, const Matrix& b); friend Matrix operator - (const DiagMatrix& a, const Matrix& b); friend Matrix operator * (const DiagMatrix& a, const Matrix& b); -// matrix by matrix -> matrix operations + // matrix by matrix -> matrix operations friend Matrix operator * (const Matrix& a, const Matrix& b); -// other operations + // other operations friend Matrix map (d_d_Mapper f, const Matrix& a); friend Matrix map (d_c_Mapper f, const ComplexMatrix& a); @@ -225,7 +225,7 @@ RowVector column_max (void) const; RowVector column_max_loc (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const Matrix& a); friend istream& operator >> (istream& is, Matrix& a); @@ -233,8 +233,6 @@ int read (FILE *fptr, char *type); int write (FILE *fptr, char *type); -// Until templates really work with g++: - private: Matrix (double *d, int r, int c) : MArray2<double> (d, r, c) { }
--- a/liboctave/dRowVector.h +++ b/liboctave/dRowVector.h @@ -53,7 +53,7 @@ int operator == (const RowVector& a) const; int operator != (const RowVector& a) const; -// destructive insert/delete/reorder operations + // destructive insert/delete/reorder operations RowVector& insert (const RowVector& a, int c); @@ -67,20 +67,20 @@ friend RowVector real (const ComplexRowVector& a); friend RowVector imag (const ComplexRowVector& a); -// resize is the destructive equivalent for this one + // resize is the destructive equivalent for this one RowVector extract (int c1, int c2) const; -// row vector by row vector -> row vector operations + // row vector by row vector -> row vector operations RowVector& operator += (const RowVector& a); RowVector& operator -= (const RowVector& a); -// row vector by matrix -> row vector + // row vector by matrix -> row vector friend RowVector operator * (const RowVector& a, const Matrix& b); -// other operations + // other operations friend RowVector map (d_d_Mapper f, const RowVector& a); friend RowVector map (d_c_Mapper f, const ComplexRowVector& a); @@ -89,7 +89,7 @@ double min (void) const; double max (void) const; -// i/o + // i/o friend ostream& operator << (ostream& os, const RowVector& a); friend istream& operator >> (istream& is, RowVector& a);
--- a/liboctave/mx-base.h +++ b/liboctave/mx-base.h @@ -24,30 +24,22 @@ #if !defined (octave_mx_base_h) #define octave_mx_base_h 1 -/* - * Matrix classes. - */ +// Matrix classes. #include "dMatrix.h" #include "CMatrix.h" -/* - * Column Vector classes. - */ +// Column Vector classes. #include "dColVector.h" #include "CColVector.h" -/* - * Row Vector classes. - */ +// Row Vector classes. #include "dRowVector.h" #include "CRowVector.h" -/* - * Diagonal Matrix classes. - */ +// Diagonal Matrix classes. #include "dDiagMatrix.h" #include "CDiagMatrix.h"
--- a/liboctave/mx-kludge.h +++ b/liboctave/mx-kludge.h @@ -32,9 +32,7 @@ #ifdef KLUDGE_VECTORS -/* - * Like type operations for vectors. - */ +// Like type operations for vectors. // Element by element vector by scalar ops. @@ -66,9 +64,7 @@ #ifdef KLUDGE_MATRICES -/* - * Like type operations for matrices - */ +// Like type operations for matrices // Element by element matrix by scalar ops. @@ -100,9 +96,7 @@ #ifdef KLUDGE_DIAG_MATRICES -/* - * Like type operations for diagonal matrices. - */ +// Like type operations for diagonal matrices. // Element by element MDiagArray by scalar ops.
--- a/liboctave/sun-utils.h +++ b/liboctave/sun-utils.h @@ -26,21 +26,17 @@ #if defined (sun) -/* - * I think that this is really only needed if linking to Fortran - * compiled libraries on a Sun. It should never be called. - * There should probably be a sysdep.cc file, eh? - */ +// I think that this is really only needed if linking to Fortran +// compiled libraries on a Sun. It should never be called. +// There should probably be a sysdep.cc file, eh? extern "C" int MAIN_ (void); -/* - * This is only needed to dereference pointers to doubles if mixing - * GCC and Sun f77/cc compiled code. See the GCC manual (where the - * function access_double() is described) and the Sun f77 manual, - * which explains that doubles are not always aligned on 8 byte - * boundaries. - */ +// This is only needed to dereference pointers to doubles if mixing +// GCC and Sun f77/cc compiled code. See the GCC manual (where the +// function access_double() is described) and the Sun f77 manual, +// which explains that doubles are not always aligned on 8 byte +// boundaries. #if defined (__GNUC__)