]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.26
authorfred <fred>
Mon, 10 Feb 1997 20:15:44 +0000 (20:15 +0000)
committerfred <fred>
Mon, 10 Feb 1997 20:15:44 +0000 (20:15 +0000)
26 files changed:
flower/Makefile
flower/Variables.make
flower/assoc.hh
flower/associter.hh
flower/choleski.hh
flower/compare.hh
flower/cursor.hh
flower/cursor.inl
flower/dataf.cc
flower/dstream.cc
flower/dstream.hh
flower/interval.hh
flower/lgetopt.hh
flower/list.hh
flower/matrix.hh
flower/path.cc
flower/scalar.hh
flower/smat.cc
flower/string.hh
flower/stringutil.hh
flower/textdb.hh
flower/textstr.hh
flower/tvsmat.hh
flower/varray.hh
flower/vector.hh
flower/vsmat.hh

index 1b8b0013f8ecfc61b0056b987662007c0075cfee..9c692641150bde2f5e9c4bec672a6021d00d8db6 100644 (file)
@@ -17,6 +17,10 @@ realclean: clean
 fversion.hh: Variables.make make_version
        make_version $(MAJVER) $(MINVER) $(PATCHLEVEL) "$(CXX) `$(CXXVER)`" > $@
 
+.PHONY: docxx
+docxx: $(hh) $(cc) $(templatecc) $(inl)
+       -mkdir docxx
+       doc++ -p -d docxx $(hh) $(cc) $(templatecc) $(inl)
 
 dist:
        -mkdir $(DDIR)
index 90d8cc8dc6a5eddba64d59c889fc62b9351e0719..0dc6c79705610f0195050e2c525070d88ce71c06 100644 (file)
@@ -1,6 +1,7 @@
 MAJVER=1
 MINVER=0
-PATCHLEVEL=25
+PATCHLEVEL=26
+
 PACKAGENAME=flower
 
 #PROFILEFLAG=-pg
index 4e0594519f631c5b4c59b528f010623194ca34ba..154a0242a22749c3ec7494d432168cfad114b332 100644 (file)
@@ -12,11 +12,13 @@ struct Assoc_ent_ {
 };
 
 /// hungarian: map
+/** mindblowingly stupid Associative array implementation
+ */
 template<class K, class V>
 struct Assoc {
     Array< Assoc_ent_<K,V> > arr;
 
-    /****************/
+    /* ************** */
     
     int find(K key) const {
        for (int i = 0; i < arr.size(); i++) {
@@ -60,7 +62,7 @@ public:
        int i = find_creat(key);
        arr[i].val = val;
     }
-    /**
+    /*
     should create "set" template
     */
     V& operator[](K key) {
@@ -71,7 +73,5 @@ public:
        return arr[find(key)].val;
     }
 };
-/** mindblowingly stupid Associative array implementation
- */
 
 #endif
index bb312b8e9e1df5c94980c817e5e7492b5e76e85d..34b88df22d005f302072a3bb2d470daecb44cd0c 100644 (file)
@@ -35,8 +35,5 @@ struct Assoc_iter {
     K key() { return assoc_.arr[i].key; }
     V &val() { return assoc_.arr[i].val; }    
 };
-/*
-  Iterator
- */
 
 #endif
index c6cb91723be6651b93827d351cad814ac24a5159..14cf5e2326d8f4bbdf2fae00faaa87d13921a70d 100644 (file)
@@ -3,6 +3,13 @@
 
 #include "matrix.hh"
 
+/**
+    structure for using the LU decomposition of a positive definite .
+
+    #P# is split  into
+
+    LD transpose(L)
+    */
 struct Choleski_decomposition {
 
     /// lower triangle of Choleski decomposition
@@ -11,36 +18,27 @@ struct Choleski_decomposition {
     /// diagonal 
     Vector D;
     ///Create decomposition of P
-    Choleski_decomposition(Matrix P);
     /**
     PRE
     P needs to be symmetric positive definite
     */
     
+    Choleski_decomposition(Matrix P);
     Vector solve(Vector rhs) const;
-    Vector operator * (Vector rhs) const { return solve (rhs); }
-    /**
+        /**
     solve Px = rhs
     */
-
-    Matrix inverse() const;
-    /**
+Vector operator * (Vector rhs) const { return solve (rhs); }
+  /**
     return the inverse of the matrix P.
     */
 
-    Matrix original() const;
+    Matrix inverse() const;
     /**
     return P,  calc'ed from L and D
     */
+    Matrix original() const;
+  
         
 };
-/**
-    structure for using the LU decomposition of a positive definite .
-
-    #P# is split  into
-
-    LD transpose(L)
-    */
-    
-
 #endif
index f0e886e539a6a8692f197f3a941f04afd492884e..30a1998ad34671935bacd51d834abeb8e617c207 100644 (file)
@@ -29,6 +29,10 @@ operator op(type t1, type t2)\
 #endif
 
 /// handy notations for a signed comparison
+/**
+    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
+    Please fill a & in the type argument if necessary.    
+    */
 #define template_instantiate_compare(type, function, prefix) \
 prefix one_operator(type, function, >)\
 prefix one_operator(type, function, >=)\
@@ -41,10 +45,6 @@ prefix inline type max(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
 prefix inline type min(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
   \
 prefix  bool operator<(type t1, type t2) /* stupid fix to allow ; */
-     /**
-    make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
-    Please fill a & in the type argument if necessary.    
-    */
 
 
     
index 14847706882b267e51abd65f758aacdc8ce99b7b..d8274d2493c422cfbb70f82fef6863a77794e6d8 100644 (file)
@@ -6,14 +6,22 @@
 #include "link.hh"
 template<class T> class List;
 
-///
+/// iterator to List
+/** 
+  add and insert extend the list
+  items are always stored as copies in List, but:
+  List<String> :  copies of String stored 
+  List<String*> : copies of String* stored!
+
+    the operations add and insert actually delegate the work to List class.
+ */
 template<class T>
 class Cursor 
 {
  public:
-    Cursor( const List<T>& list, Link<T>* pointer = 0 );
     /** this isn't true, actually, #list# surely isn't const, but I get
       tired of the warning messages.  */
+    Cursor( const List<T>& list, Link<T>* pointer = 0 );
     
     Cursor( const Cursor<T>& cursor );
 
@@ -49,7 +57,6 @@ class Cursor
     bool backward();
 
     /// put (copy) after me in List
-    void add( const T& thing );
     /**
       analogously to editor. ok() interpreted as at end
       of line.
@@ -61,9 +68,9 @@ class Cursor
       cursor points to same object, cursor.next() is newly added
       object.
       */
+    void add( const T& thing );
 
     /// put (copy) before me in List
-    void insert( const T& thing );
     /**
       analogously to editor. ok() interpreted as at begin of
       line.
@@ -76,6 +83,7 @@ class Cursor
       is newly inserted object.
       */
     
+    void insert( const T& thing );
     ///
     void backspace();
 
@@ -90,14 +98,6 @@ private:
     List<T>& list_;
     Link<T>* pointer_;
 };
-/** 
-  add and insert extend the list
-  items are always stored as copies in List, but:
-  List<String> :  copies of String stored 
-  List<String*> : copies of String* stored!
-
-    the operations add and insert actually delegate the work to List class.
- */
 
 
 /*
index 278d865bffe115879d89f520ff86f8bc188a46c8..54d3703e60732ddc3d9c7bd1653f658c558a78f1 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef CURSOR_INL
 #define CURSOR_INL
 #include <assert.h>
-//#include "list.hh"
+
 
 template<class T>
 inline
index d050e278c54850b8b3db273eec0548ff8a5c04d0..e3c42ad45f24abd4133b8619c711c7ef2b7df7e5 100644 (file)
@@ -79,6 +79,9 @@ Data_file::get_word()
 }
 
 /// get a char.
+/**
+   Only class member who uses text_file::get
+   */
 char
 Data_file::data_get() {
     char c =  get(); 
@@ -91,9 +94,6 @@ Data_file::data_get() {
 
     return c;
 }
-/**
-   Only class member who uses text_file::get
-   */
 
 /// read line, gobble '\n'    
 String Data_file::get_line()     
index 02b218d3cf44c76606c722cb6afcff9188daba57..b045a0f455bf4d53cf4a5fff7c89cd7693e52bb6 100644 (file)
@@ -58,7 +58,9 @@ Dstream::silence(String s)
        return false;
     return (*silent)[s];
 }
-///
+
+/** only output possibility. Delegates all conversion to String class.
+ */
 Dstream &
 Dstream::operator<<(String s)
 {
@@ -93,8 +95,6 @@ Dstream::operator<<(String s)
     return *this;    
 }
 
-/** only output possibility. Delegates all conversion to String class.
- */
 
 Dstream::Dstream(ostream *r, const char * cfg_nm )
 {
index e38f30128f80ce52fd4534162425ce2a18719cee..0143eb05104fa4490c07d1e077b70cc46cafd52b 100644 (file)
@@ -11,6 +11,20 @@ template<class K,class V>
 struct Assoc;
 
 /// debug stream
+ /**
+   a class for providing debug output of nested structures,
+   with indents according to \{\}()[].
+
+   One can turn on and off specific messages using the Assoc silent.
+   This can be done automatically:
+
+   #define DEBUG  dstream_.identify_as(__PRETTY_FUNCTION__) 
+
+   DEBUG << "a message\n";
+   
+   Init for the class names which should be silent can be given in a rc file. 
+   
+  */
 class Dstream
 {
     ostream *os;
@@ -23,29 +37,15 @@ public:
 
     bool silence(String);
     
-    Dstream(ostream *r, const char  * rcfile);
     /**
       if rcfile == 0, then do not read any rc file
       */
       
+    Dstream(ostream *r, const char  * rcfile);
     virtual ~Dstream();
     Dstream &identify_as(String s);
     
     Dstream &operator << (String s);
 };
- /**
-   a class for providing debug output of nested structures,
-   with indents according to \{\}()[].
-
-   One can turn on and off specific messages using the Assoc silent.
-   This can be done automatically:
-
-   #define DEBUG  dstream_.identify_as(__PRETTY_FUNCTION__) 
-
-   DEBUG << "a message\n";
-   
-   Init for the class names which should be silent can be given in a rc file. 
-   
-  */
 #endif
 
index acf437ad0ac98b7ff4da2b37e87c5b1099641e75..9cff84fb3cc65d01d3377cd87840bd77a86dcde9 100644 (file)
 
 
 /// a T interval
+/**
+  this represents the closed interval [left,right].
+  No invariants. T must be a totally ordered ring
+  */
 template<class T>
 struct Interval_t {
     T left, right;
 
-    /****************/
+    /* ************** */
     
     T center() { return (left + right) / T(2);}
     void translate(T t) {
@@ -43,11 +47,11 @@ struct Interval_t {
     T max()const { return right;}
     T min()const{ return left; }
     T &min(){ return left; }
-    void unite(Interval_t<T> h);
     /**
       PRE
       *this and h are comparable
       */
+    void unite(Interval_t<T> h);
     void intersect(Interval_t<T> h);
 
     T length() const;
@@ -68,10 +72,6 @@ struct Interval_t {
     String str() const;    
     bool elt_q(T r);
 };
-/**
-  this represents the closed interval [left,right].
-  No invariants. T must be a totally ordered ring
-  */
 
 /// partial ordering
 template<class T>
index 0ff3e084198ff8cbdbe4f1e13aa5dc247866adaf..67deb700bc703fd24e17ed14849ee75d2c3c08ba 100644 (file)
@@ -15,15 +15,16 @@ struct long_option_init {
 };
 
 
-///
+///  C++ for version of long_getopt.
+/** For processing GNU style command line arguments.  No pointer
+  (return values, arguments) contents are copied.  */
 class Getopt_long {
 public:
-    ///
+    /** errorcodes: no error, argument expected, no argument expected,
+      unknown option, illegal argument (eg. int expected).  */
     enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
                E_ILLEGALARG } ;
 
-    /** errorcodes: no error, argument expected, no argument expected,
-      unknown option, illegal argument (eg. int expected).  */
 
 private:
 
@@ -48,12 +49,12 @@ private:
     void report(Errorcod c);
 public:
     /// what to do with  errors
-    void seterror(ostream *os);
     /**
        report messages on  #*os#, and abort.
        if #os# is null, then do not report nor abort, just set #error#
       */
        
+    void seterror(ostream *os);
     /// argument. Set to 0 if not present
     char* optarg;
 
@@ -73,18 +74,14 @@ public:
     Getopt_long(int c,  char **v, long_option_init *lo);
 
     /// get the next option
-    long_option_init *operator()();
     /**
-      RETURN: pointer to next option found.
+      @return pointer to next option found.
       0 if error occurred, or next argument is no option.
       */
+    long_option_init *operator()();
 
     char *current_arg();
     char * get_next_arg();
     Errorcod error;
 };
-/**
-  C++ for version of long_getopt. For processing GNU style command line arguments.
-  No pointer  (return values, arguments) contents are copied.
-  */
 #endif
index 4a4aab2f5b28ecf9e5b398457e9e2658816e5008..4f3c1aa825e4b8c8976a8540ca9b855b9a633488 100644 (file)
@@ -6,6 +6,27 @@ template<class T> class Cursor;
 template<class T> class Link;
 
 /// all-purpose doubly linked list
+/**
+  a doubly linked list; 
+  List can be seen as all items written down on paper,
+  from top to bottom
+
+  class Cursor is used to extend List
+
+   items are always stored as copies in List, but:
+   #List<String># :  copies of #String# stored 
+   #List<String*># : copies of #String*# stored! 
+   (do not use, use \Ref{PointerList} #<String*># instead.)
+   {\bf note:} 
+   retrieving "invalid" cursors, i.e. 
+   #top()/bottom()# from empty list, #find()# without success,
+    results in a nonvalid Cursor ( #!ok()# )
+
+
+    INVARIANTEN!
+*/
+
 template<class T>
 class List
 {
@@ -30,8 +51,7 @@ class List
     void concatenate(List<T> const &s);
     
     /// make *this empty
-    void set_empty();
-    /**
+     /**
 
       POST:
       size == 0
@@ -39,15 +59,14 @@ class List
       WARNING:
       contents lost, and not deleted.
       */
-    
+     void set_empty();
+  
     /// add after after_me
     void add( const T& thing, Cursor<T> &after_me );
 
     /// put thing before #before_me#
     void insert( const T& thing, Cursor<T> &before_me );
-    
-    void remove( Cursor<T> me );
-    /** Remove link pointed to by me. Destructor of contents called
+     /** Remove link pointed to by me. Destructor of contents called
       (nop for pointers)
 
       POST
@@ -56,34 +75,15 @@ class List
 
       WARNING: do not use #me# after calling
       */
+    void remove( Cursor<T> me );
+   
 
-    /****************/
+    /* ************** */
     
     int size_;
     Link<T>* top_;
     Link<T>* bottom_;
 };
-/**
-  a doubly linked list; 
-  List can be seen as all items written down on paper,
-  from top to bottom
-
-  class Cursor is used to extend List
-
-   items are always stored as copies in List, but:
-   #List<String># :  copies of #String# stored 
-   #List<String*># : copies of #String*# stored! 
-   (do not use, use \Ref{PointerList} #<String*># instead.)
-   {\bf note:} 
-   retrieving "invalid" cursors, i.e. 
-   #top()/bottom()# from empty list, #find()# without success,
-    results in a nonvalid Cursor ( #!ok()# )
-
-
-    INVARIANTEN!
-*/
-
 
 #include "list.inl"
 #include "cursor.hh"
index 5283dc71ef45df9d30588b6e26957167abba05b9..73a9f0487e5a221e7207705a082001409417d71e 100644 (file)
@@ -6,6 +6,16 @@
 #include "vector.hh"
 
 /// a Real matrix
+/** This is a class for a nonsquare block of #Real#s.  The
+    implementation of sparse matrices is done in the appropriate #smat#
+    class. Matrix only does the mathematical actions (adding,
+    multiplying, etc.)
+
+    
+    TODO
+    implement ref counting?  */
+
+
 class Matrix {
     virtual_smat *dat;
     
@@ -15,11 +25,11 @@ public:
     int rows() const { return dat->rows(); }
 
     /// return the size of a matrix
-    int dim() const;
     /**
-      PRE
+      @pre
       the matrix needs to be square.
     */
+    int dim() const;
      
     // Matrix() { dat = 0; } 
     ~Matrix() { delete dat; }
@@ -40,7 +50,6 @@ public:
     void operator/=(Real a) { (*this) *= 1/a; }
     
     /// add a row
-    void insert_row(Vector v,int k);
     /**
       add a row to the matrix before  row k
 
@@ -48,25 +57,26 @@ public:
       v.dim() == cols()
       0 <= k <= rows()
     */
+    void insert_row(Vector v,int k);
     ///
-    void delete_row(int k) { dat->delete_row(k); }
     /**
       delete a row from this matrix.
 
       PRE
       0 <= k < rows();
     */
+    void delete_row(int k) { dat->delete_row(k); }
     void delete_column(int k) { dat->delete_column(k); }
-    ///
-    Matrix(int n);
+
     /**
       square n matrix, initialised to null
     */
-    ///
-    Matrix(int n, int m);
+    Matrix(int n);
+
     /**
       n x m matrix, init to 0
     */
+    Matrix(int n, int m);
     Matrix(const Matrix &m);
 
     /// dyadic product: v * w.transpose
@@ -98,18 +108,18 @@ public:
 
     Real norm() const;
     /// swap
-    void swap_columns(int c1, int c2);
     /**
       PRE
       0 <= c1,c2 < cols()
     */
+    void swap_columns(int c1, int c2);
 
     /// swap
-    void swap_rows(int c1, int c2);
     /**
       PRE
       0 <= c1,c2 < rows()
     */
+    void swap_rows(int c1, int c2);
 
 
     Vector row(int ) const;
@@ -119,16 +129,6 @@ public:
     void print() const;
 };
 
-/** This is a class for a nonsquare block of #Real#s.  The
-    implementation of sparse matrices is done in the appropriate #smat#
-    class. Matrix only does the mathematical actions (adding,
-    multiplying, etc.)
-
-    
-    TODO
-    implement ref counting?  */
-
-
 inline Vector
 operator *(Vector &v, const Matrix& m) { return m.left_multiply(v); }
 Matrix operator *(const Matrix& m1,const Matrix &m2);
index 2fd7eea3cb5b1321f66e92310d0c32bf11b8342c..2737d1cd154173d19d293971d493af9d0bb75f07 100644 (file)
@@ -8,7 +8,10 @@
 #define PATHSEP '/'
 #endif
 
-
+/**
+   INPUT: path the original full filename
+   OUTPUT: 4 components of the path. They can be empty
+*/
 void
 split_path(String path, 
           String &drive, String &dirs, String &filebase, String &extension)
@@ -45,11 +48,6 @@ split_path(String path,
        filebase = path;
        }
 }
-/**
-   INPUT: path the original full filename
-   OUTPUT: 4 components of the path. They can be empty
-*/
-
 
 File_path::File_path(String pref)
 {
@@ -58,7 +56,11 @@ File_path::File_path(String pref)
 }
 
 
-///
+///find a file
+/**
+  It will search in the current dir, in the construction-arg, and
+  in any other added path, in this order.
+  */
 String
 File_path::find(String nm)
 {
@@ -75,7 +77,3 @@ File_path::find(String nm)
      }
      return "";
 }
-/**
-  It will search in the current dir, in the construction-arg, and
-  in any other added path, in this order.
-  */
index bff21618c62de4db000573427b79e69145ad90ca..0213a92f0d9013df8116769c2499da8c348ce9f5 100644 (file)
@@ -24,9 +24,9 @@ struct Scalar : public String {
     operator Real();
     operator int();
     ///
-    operator bool() const;
     /** perl -like string to bool conversion
      */
+    operator bool() const;
 
 };
 
index f2143507b654766ecdd99557c6079237f0c8dc98..d89e3bc285e9c2482af7ae844dad4252a8eb0b19 100644 (file)
@@ -182,7 +182,7 @@ Full_storage::clone()
 {
     return new Full_storage(*this);
 }
-/****************************************************************/
+
 
 virtual_smat *
 virtual_smat::get_full(int n, int m)
index 7ed274979d8df163dba37c1c9931bcb228ca381d..e58f6146997405e7471a6e24316909e100c089c3 100644 (file)
 #include "stringutil.hh"
 
 /// the smart string class.
+/** 
+
+  Intuitive string class. provides 
+
+  ref counting through #String_handle#
+
+  conversion from bool, int, double, char *, char.
+
+  conversion to int, upcase, downcase
+
+
+  printable. 
+
+  indexing (pos, posAny, lastPos)
+
+  cutting (left, right, mid)
+
+  concat (+=, +)
+
+  signed comparison (<, >, ==, etc)
+
+  No operator[] is provided, since this would be enormously  slow. If needed,
+  convert to const char *. 
+*/
 class String
 {
 protected:
@@ -27,8 +51,8 @@ protected:
 
 public:
     /// init to ""
-    String() {  }                  
     /** needed because other constructors are provided.*/
+    String() {  }                  
     String(Rational);
     /// String s = "abc";
     String( const char* source ); 
@@ -95,11 +119,11 @@ public:
     int lastPos( const char* string ) const;
 
     /// index of leftmost c
-    int pos(char c ) const;
     /**
     RETURN:
     0 if not found, else index + 1
     */
+    int pos(char c ) const;
     int pos(const char* string ) const;
     int posAny(const char* string ) const;
 
@@ -117,30 +141,6 @@ public:
     int len() const;
 
 };
-/** 
-
-  Intuitive string class. provides 
-
-  ref counting thru #String_handle#
-
-  conversion from bool, int, double, char *, char.
-
-  conversion to int, upcase, downcase
-
-
-  printable. 
-
-  indexing (pos, posAny, lastPos)
-
-  cutting (left, right, mid)
-
-  concat (+=, +)
-
-  signed comparison (<, >, ==, etc)
-
-  No operator[] is provided, since this would be enormously  slow. If needed,
-  convert to const char *. 
-*/
 
 #include "compare.hh"
 
index d7f70816173dddbf4715bad6bc7bba70d0ab262c..6a7feb126ab44e17e985cae8672944f521759d1b 100644 (file)
@@ -8,7 +8,12 @@
 
 const INITIALMAX=8;
 class String_handle;
+
 /// Internal String struct
+/**
+   the data itself. Handles simple tasks (resizing, resetting)
+   */
+
 class StringData {
     // GNU malloc: storage overhead is 8 bytes anyway.
 
@@ -43,6 +48,10 @@ friend class String_handle;
     }
 
 
+    /** POST: maxlen >= j.
+      IN: j, maximum stringlength.    
+      contents thrown away.
+    */
     void setmax(int j) {       
        OKW();
        if (j > maxlen) {
@@ -54,11 +63,11 @@ friend class String_handle;
            length = 0;
        }
     }
+    
     /** POST: maxlen >= j.
-      IN: j, maximum stringlength.    
-      contents thrown away.
-    */
-    ///
+      IN: j, maximum stringlength.
+      contents are kept if it grows.
+      */
     void remax(int j) {
        OKW();
        if (j > maxlen) {
@@ -70,10 +79,6 @@ friend class String_handle;
        //    length = strlen(string);
        }
     }
-    /** POST: maxlen >= j.
-      IN: j, maximum stringlength.
-      contents are kept if it grows.
-      */    
     /// check if writeable.
     void OKW() {
 
@@ -153,13 +158,13 @@ friend class String_handle;
     }
 };
 
-/**
-   the data itself. Handles simple tasks (resizing, resetting)
-   */
 
 
-/****************************************************************/
 /// ref. counting for strings
+/**
+   handles ref. counting, and provides a very thin
+   interface using char *
+ */
 class String_handle {
     StringData* data;
     
@@ -229,11 +234,6 @@ public:
     void trunc(int j) { copy(); data->trunc(j); }
     int len() const { return data->length; }
 };
-/**
-   handles ref. counting, and provides a very thin
-   interface using char *
- */
-
 
 #ifdef NDEBUG
 #if (NDEBUG == BLONDE)
index afb04f0725772e1927b23a928416e47e6b44c5c3..cdc889853936e6b3cec33ef29e4cc33f02bd9da1 100644 (file)
@@ -3,8 +3,7 @@
 
 #include "textstr.hh"
 
-/**: do "#" comments, read quote enclosed  fields */
-
+/** do "#" comments, read quote enclosed  fields */
 /// a "const" Array. Contents can't be changed.
 class Text_record : Array<String>  
 {
@@ -28,6 +27,9 @@ public:
     Array<String>::size;           
 };
 
+/**
+    add a subrec/fieldsep/record separator
+    */
 /// abstraction for a datafile
 class Text_db : private Data_file
 {
@@ -50,8 +52,4 @@ public:
     }
 };
 
-
-/**
-    add a subrec/fieldsep/record separator
-    */
 #endif
index c89f58cf8db52c29d6b37f7e45ba980cdf152a44..489682effdee2969795d929d479ce56f74b32c06 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef TEXTSTR_HH
 #define TEXTSTR_HH
 
@@ -7,13 +8,21 @@
 #include "varray.hh"
 
 /// line counting input stream.
+/**
+ a stream for textfiles. linecounting. Thin interface getchar and
+ ungetchar.  (ungetc is unlimited) 
+
+ should protect get and unget against improper use
+*/
+
+
 class Text_stream
 {
     int line_no;
 
     // could just have used streams. 
     FILE *f;  
-       Array<char> pushback;
+    Array<char> pushback;
     String name;
     
  public:
@@ -61,14 +70,6 @@ class Text_stream
     /// GNU format message.
     void message(String s); 
 };
-/**
- a stream for textfiles. linecounting. Thin interface getchar and
- ungetchar.  (ungetc is unlimited) 
-
- should protect get and unget against improper use
-*/
-
-
 /// read a data file
 class Data_file : private Text_stream
 {
index 32f981d2e93d89d9e1f3eb54c1237ebf700507c4..847c650b48d57d4254c05b6b30e202adf3259731 100644 (file)
@@ -3,6 +3,17 @@
 #include "varray.hh"
 
 /// a  matrix storage baseclass.
+/** base class for interface with matrix storageclasses.  There are no
+    iterators for matrixclasses, since matrices are (like arrays)
+    explicitly int-indexed.
+
+    Iteration is provided by *_next, *_ok, which update and check both
+    index variables simultaneously.
+
+    TODO
+    determine type of product matrix.
+
+*/
 class virtual_smat {
     
 
@@ -17,11 +28,11 @@ public:
     virtual int cols() const = 0;
     
     /// set the size. contents lost
-    virtual void set_size(int i, int j) = 0;
     /**      
       PRE
       i >=0, j>=0
     */
+    virtual void set_size(int i, int j) = 0;
     
     /// set the size to square dimen. contents lost
     virtual void set_size(int i) = 0;
@@ -29,8 +40,7 @@ public:
       PRE
       i>=0
     */
-    /// set the size to i
-    virtual void resize(int i, int j) = 0;
+    /// set the size to i,j 
     /**
 
       keep contents. If enlarged contents unspecified
@@ -39,18 +49,18 @@ public:
       i>=0, j>=0
     
     */
+    virtual void resize(int i, int j) = 0;
 
     /// set the size to square dimen. contents kept
-    virtual void resize(int i) = 0;
     /**    
     Keep contents. If enlarged contents are unspecified
     
     PRE
     i>=0  
     */
+    virtual void resize(int i) = 0;
     
     /// access an element
-    virtual Real& elem(int i,int j) = 0;
     /**
     access an element.
 
@@ -58,6 +68,7 @@ public:
     in the 0-part of a sparse matrix.
     */
 
+    virtual Real& elem(int i,int j) = 0;
     /// access a element, no modify
     virtual const Real& elem(int i, int j) const = 0;
 
@@ -67,51 +78,50 @@ public:
 #endif
 
     /// add a row
-    virtual void insert_row(int k)=0;
     /**
     add a row to the matrix before  row k. Contents
     of added row are unspecified
 
       0 <= k <= rows()
     */
-
+  virtual void insert_row(int k)=0;
+  
     /// delete a row 
-    virtual void delete_row(int k)=0;
-      /**
+          /**
       delete a row from this matrix.
 
       PRE
       0 <= k < rows();
-    */
+    */virtual void delete_row(int k)=0;
+
     virtual ~virtual_smat() { }
     virtual virtual_smat *clone()=0;
 
 
     /// is there a next?
-    virtual bool mult_ok(int i, int j) const=0;
-    /**
+      /**
       at end of matrix? when doing loop
 
       for(i=0; i<h; i++)
         for(j=0; j<w; j++)
           ...
 
-    */
+    */ virtual bool mult_ok(int i, int j) const=0;
     /// iterate
-    virtual void mult_next(int &i, int &j) const  = 0;
-    /**
+       /**
       walk through matrix (regular multiply)
       get next j for row i, or get next row i and reset j.
       this will make sparse matrix implementation easy.
     
       PRE
       mult_ok(i,j)
-     */
-    virtual bool trans_ok(int i, int j) const=0;
-    /**
+     */virtual void mult_next(int &i, int &j) const  = 0;
+  /**
       valid matrix entry. return false if at end of row
     */
-    virtual void trans_next(int &i, int &j) const  = 0;
+    virtual bool trans_ok(int i, int j) const=0;
+   
     /**
       walk through matrix (transposed multiply).
       Get next i (for column j)
@@ -119,22 +129,12 @@ public:
       PRE
       ver_ok(i,j)
      */
+    virtual void trans_next(int &i, int &j) const  = 0;
 
     /// generate a "Full_storage" matrix    
     virtual_smat<Real> *get_full(int n, int m);
 
 };
     
-/** base class for interface with matrix storageclasses.  There are no
-    iterators for matrixclasses, since matrices are (like arrays)
-    explicitly int-indexed.
-
-    Iteration is provided by *_next, *_ok, which update and check both
-    index variables simultaneously.
-
-    TODO
-    determine type of product matrix.
-
-*/
 
 #endif
index 229fdf3c4567728973d0412132e9bb22ab938c99..0daafb84f817721c4d7cd198ba0f31741afaceb0 100644 (file)
@@ -16,6 +16,15 @@ inline void arrcpy(T*dest, T*src, int count) {
 }
 
 ///scaleable array/stack template, for T with def ctor.
+/**
+
+  This template implements a scaleable vector. With (or without) range
+  checking. It may be flaky for objects with complicated con- and
+  destructors. The type T should have a default constructor. It is
+  best suited for simple types, such as int, double or String
+
+  It uses stack terminology, (push, pop, top), and  can be used as a stack.
+  */
 template<class T>
 class Array {
 protected:
@@ -166,14 +175,5 @@ public:
        return r;
     }
 };
-/**
-
-  This template implements a scaleable vector. With (or without) range
-  checking. It may be flaky for objects with complicated con- and
-  destructors. The type T should have a default constructor. It is
-  best suited for simple types, such as int, double or String
-
-  It uses stack terminology, (push, pop, top), and  can be used as a stack.
-  */
 
 #endif
index c039d5ce89276d024cf6d187b5b4e3122a633f76..266254dbb82834be54cf56da1d6ebd73b0a196eb 100644 (file)
@@ -10,6 +10,9 @@ class String;
 void set_matrix_debug(Dstream&ds);
 
 /// a row of numbers
+/**
+    a vector. Storage is handled in Array, Vector only does the mathematics.
+ */
 class Vector  {
     Array<Real> dat;
 public:
@@ -75,9 +78,6 @@ public:
     /// set to j-th element of unit-base
     void set_unit(int j) ;
 };
-/**
-    a vector. Storage is handled in Array, Vector only does the mathematics.
- */
 
 inline Vector
 operator+(Vector a, Vector const &b) {
index 3112ae9b253f40ed9959f014b4874a468d19f61f..8765cbfe9491aa3e3926ddb8cf2a29ebe7bab29d 100644 (file)
@@ -17,12 +17,12 @@ public:
     virtual int cols() const = 0;
     
     /// set the size. contents lost
-    virtual void set_size(int i, int j) = 0;
     /**      
       PRE
       i >=0, j>=0
     */
     
+    virtual void set_size(int i, int j) = 0;
     /// set the size to square dimen. contents lost
     virtual void set_size(int i) = 0;
     /**