From: fred Date: Fri, 14 Feb 1997 22:40:06 +0000 (+0000) Subject: flower-1.0.27 X-Git-Tag: release/1.5.59~6337 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c77ab47277f3eff288f68ddb77392ea0c2ac6015;p=lilypond.git flower-1.0.27 --- diff --git a/flower/choleski.hh b/flower/choleski.hh index 14cf5e2326..f5e9fb4f5a 100644 --- a/flower/choleski.hh +++ b/flower/choleski.hh @@ -4,7 +4,8 @@ #include "matrix.hh" /** - structure for using the LU decomposition of a positive definite . + Choleski decomposition of a matrix + structure for using the LU decomposition of a positive definite matrix. #P# is split into @@ -17,22 +18,23 @@ struct Choleski_decomposition { /// diagonal Vector D; - ///Create decomposition of P - /** + + /** Create decomposition of P. PRE P needs to be symmetric positive definite */ Choleski_decomposition(Matrix P); - Vector solve(Vector rhs) const; - /** + + /** solve Px = rhs */ -Vector operator * (Vector rhs) const { return solve (rhs); } + Vector solve(Vector rhs) const; + + Vector operator * (Vector rhs) const { return solve (rhs); } /** return the inverse of the matrix P. */ - Matrix inverse() const; /** return P, calc'ed from L and D diff --git a/flower/interval.hh b/flower/interval.hh index 9cff84fb3c..aae16381db 100644 --- a/flower/interval.hh +++ b/flower/interval.hh @@ -12,8 +12,7 @@ #include "real.hh" -/// a T interval -/** +/** a T interval. this represents the closed interval [left,right]. No invariants. T must be a totally ordered ring */ @@ -73,16 +72,16 @@ struct Interval_t { bool elt_q(T r); }; -/// partial ordering -template -int Interval__compare(const Interval_t&,Interval_t const&); + /** inclusion ordering. Crash if not comparable. */ +template +int Interval__compare(const Interval_t&,Interval_t const&); -/**************************************************************** +/* INLINE - ****************************************************************/ + */ #include "compare.hh" diff --git a/flower/lgetopt.hh b/flower/lgetopt.hh index 67deb700bc..31fb2c55eb 100644 --- a/flower/lgetopt.hh +++ b/flower/lgetopt.hh @@ -15,9 +15,9 @@ 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. */ +/** 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, @@ -48,8 +48,7 @@ private: /// report an error and abort void report(Errorcod c); public: - /// what to do with errors - /** + /** what to do with errors. report messages on #*os#, and abort. if #os# is null, then do not report nor abort, just set #error# */ @@ -73,8 +72,7 @@ public: /// construct: pass arguments and option info. Getopt_long(int c, char **v, long_option_init *lo); - /// get the next option - /** + /** get the next option. @return pointer to next option found. 0 if error occurred, or next argument is no option. */ diff --git a/flower/matrix.hh b/flower/matrix.hh index 73a9f0487e..a633d6657a 100644 --- a/flower/matrix.hh +++ b/flower/matrix.hh @@ -5,8 +5,7 @@ #include "vsmat.hh" #include "vector.hh" -/// a Real matrix -/** This is a class for a nonsquare block of #Real#s. The +/** 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.) @@ -24,9 +23,8 @@ public: int cols() const { return dat->cols(); } int rows() const { return dat->rows(); } - /// return the size of a matrix - /** - @pre + /** return the size of a matrix. + PRE the matrix needs to be square. */ int dim() const; @@ -49,8 +47,7 @@ public: void operator*=(Real a); void operator/=(Real a) { (*this) *= 1/a; } - /// add a row - /** + /** add a row. add a row to the matrix before row k PRE @@ -58,8 +55,7 @@ public: 0 <= k <= rows() */ void insert_row(Vector v,int k); - /// - /** + /** . delete a row from this matrix. PRE @@ -107,15 +103,13 @@ public: Matrix transposed() const ; Real norm() const; - /// swap - /** + /** swap. PRE 0 <= c1,c2 < cols() */ void swap_columns(int c1, int c2); - /// swap - /** + /** swap. PRE 0 <= c1,c2 < rows() */ diff --git a/flower/path.cc b/flower/path.cc index 2737d1cd15..3dc38366f2 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -9,8 +9,8 @@ #endif /** - INPUT: path the original full filename - OUTPUT: 4 components of the path. They can be empty + @param path the original full filename + @return 4 components of the path. They can be empty */ void split_path(String path, @@ -56,8 +56,7 @@ File_path::File_path(String pref) } -///find a file -/** +/** find a file. It will search in the current dir, in the construction-arg, and in any other added path, in this order. */ diff --git a/flower/scalar.hh b/flower/scalar.hh index 0213a92f0d..5cdfa427da 100644 --- a/flower/scalar.hh +++ b/flower/scalar.hh @@ -23,8 +23,8 @@ struct Scalar : public String { bool isnum(); operator Real(); operator int(); - /// - /** perl -like string to bool conversion + + /** perl -like string to bool conversion. */ operator bool() const; diff --git a/flower/stringutil.hh b/flower/stringutil.hh index 6a7feb126a..2f62caee3d 100644 --- a/flower/stringutil.hh +++ b/flower/stringutil.hh @@ -9,8 +9,7 @@ const INITIALMAX=8; class String_handle; -/// Internal String struct -/** +/** Internal String struct. the data itself. Handles simple tasks (resizing, resetting) */ @@ -145,8 +144,8 @@ friend class String_handle; length = j; } - /** not really safe. Can alter length without StringData knowing it. - */ + /** access a char. not really safe. Can alter length without + *StringData knowing it. */ char &operator [](int j) { assert(j >= 0 && j <= length); return string[j] ; @@ -160,8 +159,7 @@ friend class String_handle; -/// ref. counting for strings -/** +/** ref. counting for strings. handles ref. counting, and provides a very thin interface using char * */ diff --git a/flower/textdb.hh b/flower/textdb.hh index cdc8898539..3586c0d180 100644 --- a/flower/textdb.hh +++ b/flower/textdb.hh @@ -3,8 +3,8 @@ #include "textstr.hh" -/** do "#" comments, read quote enclosed fields */ -/// a "const" Array. Contents can't be changed. +/**a "const" Array. Contents can't be changed. do "#" comments, read quote enclosed fields */ + class Text_record : Array { int line_no; @@ -27,10 +27,10 @@ public: Array::size; }; -/** +/** abstraction for a datafile. add a subrec/fieldsep/record separator */ -/// abstraction for a datafile + class Text_db : private Data_file { void gobble_leading_white(); diff --git a/flower/vsmat.hh b/flower/vsmat.hh index 8765cbfe94..283b1e567b 100644 --- a/flower/vsmat.hh +++ b/flower/vsmat.hh @@ -2,7 +2,17 @@ #define VSMAT_HH #include "varray.hh" #include "real.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 { @@ -15,23 +25,20 @@ public: /// width of matrix virtual int cols() const = 0; - - /// set the size. contents lost - /** + + + /** set the size. contents lost. 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; - /** + + /**set the size to square dimen. contents lost PRE i>=0 */ - /// set the size to i - virtual void resize(int i, int j) = 0; - /** + virtual void set_size(int i) = 0; + /**set the size to i. keep contents. If enlarged contents unspecified @@ -39,25 +46,27 @@ public: i>=0, j>=0 */ - - /// set the size to square dimen. contents kept - virtual void resize(int i) = 0; - /** + virtual void resize(int i, int j) = 0; + + /** + set the size to square dimen. contents kept 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. Generate an errormessage, if this happens 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; @@ -66,53 +75,54 @@ public: virtual Array column(int j) const = 0; #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 void delete_column(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 + at end of matrix?. when doing loop for(i=0; i