From: fred Date: Sun, 24 Mar 2002 19:30:54 +0000 (+0000) Subject: lilypond-0.0.30 X-Git-Tag: release/1.5.59~5440 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c196771677a93b6b005dbe7e9500539721df98de;p=lilypond.git lilypond-0.0.30 --- diff --git a/hdr/beam.hh b/hdr/beam.hh index 68a9f49cff..68f5087f45 100644 --- a/hdr/beam.hh +++ b/hdr/beam.hh @@ -10,14 +10,16 @@ #include "directionalspanner.hh" #include "plist.hh" -/// a beam connects multiple stems +/** a beam connects multiple stems Beam adjusts the stems its owns to +make sure that they reach the beam and that point in the correct +direction */ struct Beam: public Directional_spanner { PointerList stems; Real slope; Real left_pos; - /// dir: -1 below heads, +1 above heads. + - /****************/ + /* *************** */ const char * name() const; virtual Interval width()const; @@ -41,8 +43,6 @@ private: void solve_slope(); Molecule*brew_molecule_p()const; }; -/** Beam adjusts the stems its owns to make sure that they reach the - beam and that point in the correct direction */ #endif // BEAM_HH diff --git a/hdr/break.hh b/hdr/break.hh index 9ecb484e5b..7d17470228 100644 --- a/hdr/break.hh +++ b/hdr/break.hh @@ -14,7 +14,7 @@ struct Break_algorithm { PScore &pscore_; Real linelength; - /****************/ + /* *************** */ Break_algorithm(PScore&); diff --git a/hdr/clefitem.hh b/hdr/clefitem.hh index c07087e073..b7ea93caaa 100644 --- a/hdr/clefitem.hh +++ b/hdr/clefitem.hh @@ -17,7 +17,7 @@ struct Clef_item : Item { bool change; - /****************/ + /* *************** */ Clef_item(); void read(Clef); diff --git a/hdr/grouping.hh b/hdr/grouping.hh index aea2fd393f..70d95ef55d 100644 --- a/hdr/grouping.hh +++ b/hdr/grouping.hh @@ -13,12 +13,13 @@ typedef Interval_t MInterval; -/// data structure which represents rhythmic units +/** data structure which represents rhythmic units this is a tree. It groupes notes according to rules + */ struct Rhythmic_grouping { Array children; MInterval *interval_; - /****************/ + /* *************** */ Array intervals(); MInterval interval()const; @@ -51,9 +52,4 @@ private: void junk(); void copy(Rhythmic_grouping const&); }; -/** - this is a tree. It groupes notes according to rules - - */ - #endif diff --git a/hdr/inputcommands.hh b/hdr/inputcommands.hh index bd6054f6e9..d40885407a 100644 --- a/hdr/inputcommands.hh +++ b/hdr/inputcommands.hh @@ -16,7 +16,7 @@ struct Commands_at : public IPointerList { Time_description tdescription_; - /****************/ + /* *************** */ Moment when(); void parse(Staff_commands_at*); @@ -30,7 +30,7 @@ struct Commands_at : public IPointerList { struct Input_cursor : public PCursor { - /****************/ + /* *************** */ Input_cursor(PCursor); Moment when()const; void find_moment(Moment w); @@ -42,7 +42,7 @@ struct Input_cursor : public PCursor struct Input_commands : public IPointerList { Input_cursor ptr; - /****************/ + /* *************** */ void find_moment(Moment); void add(Input_command c,Assoc &marks_assoc_r); diff --git a/hdr/inputmusic.hh b/hdr/inputmusic.hh index 7d0dd618ba..0a1d95cfc6 100644 --- a/hdr/inputmusic.hh +++ b/hdr/inputmusic.hh @@ -16,7 +16,18 @@ struct Voice_list : public PointerList { void translate_time(Moment dt); }; -/// ABC for input structures +/** + + Input_music is anything that can simply be regarded as/converted to + a set of voices "cooperating" or independant. It has some basic + characteristics that real music has too: + + - it is rhythmic (it has a length, and can be translated horizontally) + - a pitch (it can be transposed) + + */ + + struct Input_music { virtual Voice_list convert()const=0; virtual Moment length()const=0; @@ -30,23 +41,12 @@ struct Input_music { virtual Input_music *clone() const = 0; virtual Simple_music *simple() { return 0; } }; -/** - - Input_music is anything that can simply be regarded as/converted to - a set of voices "cooperating" or independant. It has some basic - characteristics that real music has too: - - - it is rhythmic (it has a length, and can be translated horizontally) - - a pitch (it can be transposed) - - */ - /// Simple music consists of one voice struct Simple_music : Input_music { Voice voice_; - /****/ + /* *** */ virtual Simple_music*simple() { return this; } void add(Voice_element*); virtual void set_default_group(String g) { voice_.set_default_group(g); } @@ -63,7 +63,7 @@ struct Simple_music : Input_music { /// Complex_music consists of multiple voices struct Complex_music : Input_music { IPointerList elts; - /****************/ + /* *************** */ virtual void set_default_group(String g); void add(Input_music*); Complex_music(); @@ -73,11 +73,19 @@ struct Complex_music : Input_music { }; -/// multiple stuff after each other + +/** + voice like. + + different music forms which start after each other ( concatenated, + stacked "horizontally ) + + */ + struct Music_voice : Complex_music { - /****************/ + /* *************** */ Moment length()const; virtual void translate_time(Moment dt); virtual Voice_list convert()const; @@ -87,19 +95,18 @@ struct Music_voice : Complex_music { } virtual void print() const ; }; -/** - voice like. - different music forms which start after each other ( concatenated, - stacked "horizontally ) - - */ +/** + Multiple musicstuff stacked on top of each other + chord like : -/// Multiple musicstuff stacked on top of each other + - different music forms which start at the same time ( stacked "vertically" ) + + */ struct Music_general_chord : Complex_music { - /****************/ + /* *************** */ virtual Moment length()const; virtual Voice_list convert()const; @@ -111,12 +118,6 @@ struct Music_general_chord : Complex_music { virtual void print() const ; }; -/** - chord like : - - - different music forms which start at the same time ( stacked "vertically" ) - - */ struct Multi_voice_chord : Music_general_chord { void set_default_group(String); diff --git a/hdr/inputscore.hh b/hdr/inputscore.hh index 94ff045814..ef0d9d6a88 100644 --- a/hdr/inputscore.hh +++ b/hdr/inputscore.hh @@ -17,7 +17,7 @@ struct Input_score { IPointerList staffs_; IPointerList commands_; - /****************************************************************/ + /* *************************************************************** */ Input_score(); Input_score(Input_score const&); void add(Array &s); @@ -28,7 +28,5 @@ struct Input_score { void print() const; Score*parse(); }; -/** - - */ + #endif diff --git a/hdr/inputstaff.hh b/hdr/inputstaff.hh index 647ffaf8a5..c1252ad01d 100644 --- a/hdr/inputstaff.hh +++ b/hdr/inputstaff.hh @@ -20,7 +20,7 @@ struct Input_staff { IPointerList commands_; IPointerList music_; - /****************/ + /* *************** */ void add(Input_music*m); Input_staff(Input_staff const&); diff --git a/hdr/item.hh b/hdr/item.hh index 68f1402c5b..e934f279f7 100644 --- a/hdr/item.hh +++ b/hdr/item.hh @@ -6,24 +6,27 @@ #include "string.hh" #include "staffelem.hh" -/// a horizontally fixed size element of the score +/** + a horizontally fixed size element of the score + + Item is the datastructure for printables whose width is known + before the spacing is calculated + + NB. This doesn't mean an Item has to initialize the output field before + spacing calculation. + +*/ + struct Item : Staff_elem { /// indirection to the column it is in PCol * pcol_l_; - /****************/ + /* *************** */ virtual Item *item() { return this; } Item(); void do_print()const; const char*name()const; }; -/** Item is the datastructure for printables whose width is known - before the spacing is calculated - - NB. This doesn't mean an Item has to initialize the output field before - spacing calculation. - -*/ #endif diff --git a/hdr/key.hh b/hdr/key.hh index a0ea3e833d..fa41082fd8 100644 --- a/hdr/key.hh +++ b/hdr/key.hh @@ -13,7 +13,7 @@ class Key { Array accidentals; - /****************/ + /* *************** */ public: Array read(Array ); diff --git a/hdr/keyitem.hh b/hdr/keyitem.hh index 71a7dba2b1..1d1d2e37f0 100644 --- a/hdr/keyitem.hh +++ b/hdr/keyitem.hh @@ -12,7 +12,7 @@ struct Clef; -/// +/// An item which places accidentals at the start of the line struct Keyitem : Item { const char * name() const; Array pitch; @@ -20,7 +20,7 @@ struct Keyitem : Item { int c_position; - /****************/ + /* *************** */ Keyitem(int cposition); void add(int pitch, int acc); @@ -31,8 +31,5 @@ struct Keyitem : Item { Molecule* brew_molecule_p()const; }; -/** - An item which places accidentals at the start of the line - */ #endif // KEYITEM_HH diff --git a/hdr/lexer.hh b/hdr/lexer.hh index 9e5cf1b303..e2909d8879 100644 --- a/hdr/lexer.hh +++ b/hdr/lexer.hh @@ -33,7 +33,7 @@ struct My_flex_lexer : yyFlexLexer { Notename_tab * defaulttab; char const* data_ch_c_l_m; int errorlevel_i_; - /****************/ + /* *************** */ int ret_notename(int *p, String text, int octave_mod); char const* here_ch_c_l(); void set(Notename_tab *n); diff --git a/hdr/linespace.hh b/hdr/linespace.hh index e23d334ca6..b9027754ce 100644 --- a/hdr/linespace.hh +++ b/hdr/linespace.hh @@ -13,7 +13,7 @@ struct Colinfo { const Real* fixpos; Interval width; - /****************/ + /* *************** */ Colinfo(); void operator=(Colinfo const&); Colinfo(Colinfo const&); @@ -27,7 +27,25 @@ struct Colinfo { }; -/// spacing for one line. +/** the problem, given by the columns (which include constraints) and + intercolumn spacing. The problem is: + + Generate a spacing which + \begin{itemize} + \item + Satisfies spacing constraints (notes can't be printed through each other) + \item + Looks good, ie tries to conform to an ideal spacing as much as possible. + \end{itemize} + This is converted by regarding idealspacing as "springs" attached + to columns. The equilibrium of one spring is the ideal + distance. The columns have a size, this imposes "hard" constraints + on the distances. This transforms the problem into a quadratic + programming problem with linear constraints. + + The quality is given by the total potential energy in the + springs. The lower the energy, the better the configuration. +*/ class Spacing_problem { Array ideals; Array cols; @@ -51,26 +69,28 @@ class Spacing_problem { void make_constraints(Mixed_qp& lp) const; public: - /// solve the spacing problem + /** solve the spacing problem + return the column positions, and the energy (last element) + */ Array solve() const; - /** - return the column positions, and the energy (last element) - */ + /// add a idealspacing to the problem. - void add_ideal(const Idealspacing *i); - /** + + One pair of columns can have no, one or more idealspacings, since they can be "summed" if the columns to which #i# refers are not in this problem, the spacing is ignored. */ + void add_ideal(const Idealspacing *i); /// add a col to the problem - void add_column(const PCol *, bool fixed=false, Real fixpos=0.0); - /** columns have to be added left to right. The column contains + /** columns have to be added left to right. The column contains info on it's minimum width. */ + void add_column(const PCol *, bool fixed=false, Real fixpos=0.0); + bool check_constraints(Vector v) const; @@ -82,23 +102,4 @@ public: }; -/** the problem, given by the columns (which include constraints) and - intercolumn spacing. The problem is: - - Generate a spacing which - \begin{itemize} - \item - Satisfies spacing constraints (notes can't be printed through each other) - \item - Looks good, ie tries to conform to an ideal spacing as much as possible. - \end{itemize} - This is converted by regarding idealspacing as "springs" attached - to columns. The equilibrium of one spring is the ideal - distance. The columns have a size, this imposes "hard" constraints - on the distances. This transforms the problem into a quadratic - programming problem with linear constraints. - - The quality is given by the total potential energy in the - springs. The lower the energy, the better the configuration. -*/ #endif diff --git a/hdr/localkeyitem.hh b/hdr/localkeyitem.hh index 0da7e06858..492a23f345 100644 --- a/hdr/localkeyitem.hh +++ b/hdr/localkeyitem.hh @@ -20,7 +20,7 @@ struct Local_key_item : Item { Array group; int c0_position; // move into walker - /****************/ + /* *************** */ Local_key_item(int c0position); void add(Item*); diff --git a/hdr/lyricitem.hh b/hdr/lyricitem.hh index 7fda46142e..5dcd90c889 100644 --- a/hdr/lyricitem.hh +++ b/hdr/lyricitem.hh @@ -9,7 +9,7 @@ #include "textitem.hh" struct Lyric_item : Text_item { - /****************/ + /* *************** */ Lyric_item(Lyric_req* lreq_l, int voice_count_i); virtual void do_pre_processing(); }; diff --git a/hdr/lyricwalker.hh b/hdr/lyricwalker.hh index 870efbb040..fcf0c9186b 100644 --- a/hdr/lyricwalker.hh +++ b/hdr/lyricwalker.hh @@ -16,7 +16,7 @@ struct Lyric_item; // put into proto struct Lyric_walker: Staff_walker { Array litem_l_array_; - /****************/ + /* *************** */ virtual void do_TYPESET_command(Command*); virtual void do_INTERPRET_command(Command*); diff --git a/hdr/meter.hh b/hdr/meter.hh index 835b661bae..22a256c93c 100644 --- a/hdr/meter.hh +++ b/hdr/meter.hh @@ -12,7 +12,7 @@ struct Meter: Item { const char * name() const; Array args; - /****************/ + /* *************** */ Meter(Array args) ; Molecule*brew_molecule_p() const; diff --git a/hdr/molecule.hh b/hdr/molecule.hh index 9f20458fef..084321ce4e 100644 --- a/hdr/molecule.hh +++ b/hdr/molecule.hh @@ -11,7 +11,7 @@ struct Atom { Offset off; Symbol sym; - /****************/ + /* *************** */ void translate(Offset o) { off += o; @@ -26,11 +26,13 @@ struct Atom { String TeXstring() const; }; -/// a group of #Atom#s + +/** a group of individually translated symbols. You can add molecules + to the top, to the right, etc. */ struct Molecule { IPointerList ats; // change to List? - /****************/ + /* *************** */ Molecule() { } Molecule(Atom a) { add(a) ; } @@ -52,6 +54,4 @@ struct Molecule { private: void operator=(const Molecule&); }; -/** a group of individually translated symbols. You can add molecules - to the top, to the right, etc. */ #endif diff --git a/hdr/notehead.hh b/hdr/notehead.hh index 66bed0360e..b3b7d3ad23 100644 --- a/hdr/notehead.hh +++ b/hdr/notehead.hh @@ -8,7 +8,15 @@ #define NOTEHEAD_HH #include "item.hh" -/// ball at the end of the stem +/** + ball at the end of the stem +takes care of: + + * help lines + * proper placing of dots + + */ + struct Notehead : Item { const char * name() const; const char* defined_ch_c_l_m; //sorry, trying to find error in martien.ly @@ -21,24 +29,17 @@ struct Notehead : Item { int balltype; int x_dir; - /****************/ + /* *************** */ void set_rhythmic(Rhythmic_req *); - Notehead(int staff_size); + /** position of top line (5 linestaff: 8) */ - + Notehead(int staff_size); void do_print()const; static int compare(Notehead*&a, Notehead*&b) ; Molecule* brew_molecule_p()const; }; -/** - takes care of: - - * help lines - * proper placing of dots - - */ #endif // NOTEHEAD_HH diff --git a/hdr/paper.hh b/hdr/paper.hh index 6da51df33e..da9ebd12ed 100644 --- a/hdr/paper.hh +++ b/hdr/paper.hh @@ -3,7 +3,15 @@ #include "string.hh" #include "moment.hh" -/// symbols, dimensions and constants + +/** symbols, dimensions and constants + + This struct takes care of all kinds of symbols, dimensions and + constants. Most of them are related to the point-size of the fonts, + so therefore, the lookup table for symbols is also in here. + + see TODO + */ struct Paperdef { Lookup *lookup_p_; String outfile; @@ -16,7 +24,7 @@ struct Paperdef { /// ideal = geometric_ ^ log2(duration) Real geometric_; - /****************/ + /* *************** */ void reinit(); Paperdef(Lookup*); void set(Lookup*); @@ -30,9 +38,4 @@ struct Paperdef { void print() const; Real duration_to_dist(Moment); }; -/** This struct takes care of all kinds of symbols, dimensions and - constants. Most of them are related to the point-size of the fonts, - so therefore, the lookup table for symbols is also in here. - see TODO - */ diff --git a/hdr/pcol.hh b/hdr/pcol.hh index 1d3ff34ca8..0e8ed3e677 100644 --- a/hdr/pcol.hh +++ b/hdr/pcol.hh @@ -7,26 +7,34 @@ #include "item.hh" /// stuff grouped vertically. -struct PCol { +/** + This is a class to address items vertically. It contains the data for: + \begin{itemize} + \item + unbroken score + \item + broken score + \item + the linespacing problem + \end{itemize} + */struct PCol { PointerList its; PointerList stoppers, starters; /// prebreak is put before end of line. - PCol *prebreak_p_; /** if broken here, then (*this) column is discarded, and prebreak is put at end of line, owned by Col */ + PCol *prebreak_p_; /// postbreak at beginning of the new line PCol *postbreak_p_; - /** \See{prebreak} - */ - PCol *daddy_l_; /** if this column is pre or postbreak, then this field points to the parent. */ + PCol *daddy_l_; /// if lines are broken then this column is in #line# const Line_of_score *line_l_; @@ -36,7 +44,7 @@ struct PCol { PScore * pscore_l_; - /****************/ + /* *************** */ /// which one (left =0) int rank() const; @@ -53,12 +61,12 @@ struct PCol { PCol(PCol * parent); /// which col comes first? - static int compare(const PCol &c1, const PCol &c2); /** signed compare on columns. return < 0 if c1 < c2. - */ + */static int compare(const PCol &c1, const PCol &c2); + void OK() const; void set_breakable(); @@ -66,17 +74,7 @@ struct PCol { private: PCol(PCol const&){} }; -/** - This is a class to address items vertically. It contains the data for: - \begin{itemize} - \item - unbroken score - \item - broken score - \item - the linespacing problem - \end{itemize} - */ + #include "compare.hh" instantiate_compare(PCol &, PCol::compare); diff --git a/hdr/qlp.hh b/hdr/qlp.hh index db5438499d..6e82aa9c40 100644 --- a/hdr/qlp.hh +++ b/hdr/qlp.hh @@ -14,20 +14,19 @@ public: Vector lin; Real const_term; - /// - void assert_solution(Vector sol) const; + /** use a KKT method to assert optimality of sol */ - /// solve the problem using a projected gradient method + void assert_solution(Vector sol) const; + /// solve the problem using a projected gradient method Vector solve(Vector start) const; + /** return the number of variables in the problem */ int dim() const{ return lin.dim(); } - /** return the number of variables in the problem */ - /// - void add_inequality_cons(Vector c, double r); + /** add a constraint @@ -38,14 +37,15 @@ public: c.dim() == dim(); */ - /// - Ineq_constrained_qp(int novars); + void add_inequality_cons(Vector c, double r); + /** set up matrices to go with the problem. */ - - Real eval(Vector v); + Ineq_constrained_qp(int novars); + /** evaluate the quadratic function for input #v# */ + Real eval(Vector v); void eliminate_var(int idx, Real value); void OK()const; @@ -54,6 +54,15 @@ public: }; /// Quadratic programming with mixed linear constraints +/** + problem definition of a quadratic optimisation problem with linear + inequality and equality constraints + + + x^T QUAD x /2 + b^T x +*/ + + class Mixed_qp :public Ineq_constrained_qp { Array eq_cons; Array eq_consrhs; @@ -65,8 +74,7 @@ public: Vector solve(Vector start) const; void add_fixed_var(int i , Real value); - /// - void add_equality_cons(Vector c, double r); + /** add a constraint, @@ -75,15 +83,6 @@ public: PRE c.dim()==dim(); */ - + void add_equality_cons(Vector c, double r); }; -/** - problem definition of a quadratic optimisation problem with linear - inequality and equality constraints - - - x^T QUAD x /2 + b^T x -*/ - - #endif diff --git a/hdr/qlpsolve.hh b/hdr/qlpsolve.hh index b9789bfc4a..aefcc767e7 100644 --- a/hdr/qlpsolve.hh +++ b/hdr/qlpsolve.hh @@ -2,6 +2,18 @@ #include "matrix.hh" +/** + This class represents the set of active (binding) constraints + which can be active while the QLP algorithm is in a feasible + point. The active constraints are numbered. + If the constraints are of the form + + A^T*x >= b + + then the binding constraints are those where the >= is equality. + + */ + class Active_constraints { friend class Inactive_iter; @@ -18,23 +30,23 @@ public: Real rhs(int k) const { return opt->consrhs[k]; } /// drop constraint - void drop (int k); /** drop constraint k from the active set. k is the index of the constraint in #active# */ + void drop (int k); /// add constraint j - void add(int j); /** add constraint j to the active set j is the index of the constraint in #inactive# */ + void add(int j); /// exchange in and out. void exchange(int in, int out) { add(in); drop (out); } - /// + Vector find_active_optimum(Vector g); /// get lagrange multipliers. @@ -48,19 +60,10 @@ public: void OK(); }; -/** - This class represents the set of active (binding) constraints - which can be active while the QLP algorithm is in a feasible - point. The active constraints are numbered. - If the constraints are of the form - - A^T*x >= b - then the binding constraints are those where the >= is equality. - +/** + loop through the inactive constraints. */ - -/// class Inactive_iter { int j; Active_constraints const* ac; @@ -73,6 +76,3 @@ public: Real rhs() const { return ac->rhs(constraint_id()); } bool ok() const { return j < ac->inactive.size(); } }; -/** - loop through the inactive constraints. - */ diff --git a/hdr/request.hh b/hdr/request.hh index 44d42e5301..d07bbd3469 100644 --- a/hdr/request.hh +++ b/hdr/request.hh @@ -7,11 +7,16 @@ #include "moment.hh" /// Hungarian postfix: req +/** + a voice element wants something printed. +see lilygut page + */ + struct Request { Voice_element*elt_l_; char const* defined_ch_c_l_m; - /****************/ + /* *************** */ Request(); Request(Request const&); virtual ~Request(){} @@ -47,11 +52,6 @@ struct Request { protected: virtual void do_print()const ; }; -/** - a voice element wants something printed. -see lilygut page - */ - #define REQUESTMETHODS(T,accessor) \ virtual T * accessor() { return this;}\ @@ -83,7 +83,7 @@ struct Rhythmic_req : virtual Request { int balltype; int dots; Moment plet_factor; - /****************/ + /* *************** */ static int compare(const Rhythmic_req &, const Rhythmic_req &); Moment duration() const; Rhythmic_req(); @@ -95,7 +95,7 @@ struct Spacing_req :virtual Request { Moment next; Real distance; Real strength; - /****************/ + /* *************** */ Spacing_req(); REQUESTMETHODS(Spacing_req, spacing); }; @@ -109,7 +109,7 @@ struct Blank_req : Spacing_req, Rhythmic_req { struct Text_req : virtual Request { int dir_i_; Text_def *tdef_p_; - /****************/ + /* *************** */ Text_req(int d, Text_def*); ~Text_req(); Text_req(Text_req const&); @@ -152,25 +152,29 @@ struct Note_req : Rhythmic_req, virtual Melodic_req { ///Put a rest on the staff. +/** +Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded. +*/ + struct Rest_req : Rhythmic_req { REQUESTMETHODS(Rest_req,rest); }; +/// attach a stem to the noteball /** -Why a request? It might be a good idea to not typeset the rest, if the paper is too crowded. -*/ + Rhythmic_req parent needed to determine if it will fit inside a beam. + */ -/// attach a stem to the noteball struct Stem_req : Rhythmic_req { int dir_i_; Stem_req(int s, int dots); REQUESTMETHODS(Stem_req,stem); }; -/** - Rhythmic_req parent needed to determine if it will fit inside a beam. - */ /// requests to start or stop something. +/** + This type of request typically results in the creation of a #Spanner# +*/ struct Span_req : Request { /// should the spanner start or stop, or is it unwanted? enum { @@ -182,25 +186,22 @@ struct Span_req : Request { Span_req(); }; -/** - This type of request typically results in the creation of a #Spanner# -*/ ///Start / stop a beam at this note. + +/** if #nplet# is set, the staff will try to put an +appropriate number over the beam + */ struct Beam_req : Span_req { int nplet; - /****************/ + /* *************** */ REQUESTMETHODS(Beam_req,beam); Beam_req(); }; -/** if #nplet# is set, the staff will try to put an -appropriate number over the beam - */ - /// a slur struct Slur_req : Span_req { REQUESTMETHODS(Slur_req,slur); @@ -209,32 +210,32 @@ struct Slur_req : Span_req { ///Put a script above or below this ``note'' +/** eg upbow, downbow. Why a request? These symbols may conflict with +slurs and brackets, so this also a request */ struct Script_req : Request { int dir_i_; Script_def *scriptdef_p_; - /****************/ + /* *************** */ static int compare(const Script_req &, const Script_req &); Script_req(int d, Script_def*); REQUESTMETHODS(Script_req,script); ~Script_req(); Script_req(Script_req const&); }; -/** eg upbow, downbow. Why a request? These symbols may conflict with -slurs and brackets, so this also a request */ /// designate this spot with a name. struct Mark_req : Request { String mark_str_; - /****************/ + /* *************** */ Mark_req(String); REQUESTMETHODS(Mark_req,mark); }; struct Staff_command_req : Request { Input_command * com_p_; - /****************/ + /* *************** */ Staff_command_req(Staff_command_req const&); ~Staff_command_req(); Staff_command_req(Input_command*); @@ -280,9 +281,6 @@ struct Subtle_req { }; /// helper in the hierarchy -struct Dynamic:Subtle_req { - -}; /** Each dynamic is bound to one note ( a crescendo spanning multiple notes is thought to be made of two "dynamics": a start and a stop). Dynamic changes can occur in a smaller time than the length of its @@ -295,6 +293,9 @@ struct Dynamic:Subtle_req { Dynamic should have been derived from request, but I don't want to fuss with virtual baseclasses. */ +struct Dynamic:Subtle_req { + +}; /// do a crescendo struct Cresc_req : Span_req, Dynamic { diff --git a/hdr/rest.hh b/hdr/rest.hh index 02c6e0bff6..d03bd0c96f 100644 --- a/hdr/rest.hh +++ b/hdr/rest.hh @@ -8,13 +8,12 @@ #define REST_HH #include "item.hh" -/// ball at the end of the stem struct Rest : Item { int dots; int balltype; - /****************/ + /* *************** */ Rest(int dur,int dots); @@ -22,12 +21,5 @@ struct Rest : Item { const char * name() const; Molecule* brew_molecule_p()const; }; -/** - takes care of: - - * help lines - * proper placing of dots - - */ #endif diff --git a/hdr/sccol.hh b/hdr/sccol.hh index 75f1bcd89b..1d2f4022bb 100644 --- a/hdr/sccol.hh +++ b/hdr/sccol.hh @@ -11,6 +11,16 @@ #include "moment.hh" +/** + + When typesetting hasn't started on PScore yet, the columns which + contain data have a rhythmical position. Score_column is the type + with a rhythmical time attached to it. The calculation of + idealspacing is done with data in these columns. (notably: the + #durations# field) + + */ + struct Score_column { /// indirection to column @@ -19,10 +29,10 @@ struct Score_column { /// length of notes/rests in this column Array durations; - /// + bool musical_; - /****************/ + /* *************** */ Moment when() { return when_; } Score_column(Moment when); static int compare(Score_column & c1, Score_column &c2); @@ -35,15 +45,6 @@ struct Score_column { private: Moment when_; }; -/** - - When typesetting hasn't started on PScore yet, the columns which - contain data have a rhythmical position. Score_column is the type - with a rhythmical time attached to it. The calculation of - idealspacing is done with data in these columns. (notably: the - #durations# field) - - */ instantiate_compare(Score_column&, Score_column::compare); diff --git a/hdr/scoreline.hh b/hdr/scoreline.hh index 3c6ee0de04..f4e1987033 100644 --- a/hdr/scoreline.hh +++ b/hdr/scoreline.hh @@ -19,7 +19,7 @@ Line_of_score { IPointerList staffs; PScore * pscore_l_; // needed to generate staffs - /****************/ + /* *************** */ void process() ; Line_of_score(Array sv, PScore *); diff --git a/hdr/script.hh b/hdr/script.hh index 2a10e7d49e..9c48c75e24 100644 --- a/hdr/script.hh +++ b/hdr/script.hh @@ -19,7 +19,7 @@ struct Script : Item { Stem *stem_l_; Array support; - /****************/ + /* *************** */ const char * name() const; Molecule* brew_molecule_p()const; virtual void do_post_processing(); diff --git a/hdr/scriptdef.hh b/hdr/scriptdef.hh index 423860a895..3c22681d23 100644 --- a/hdr/scriptdef.hh +++ b/hdr/scriptdef.hh @@ -14,7 +14,7 @@ struct Script_def{ bool invertsym; String symidx; - /****************/ + /* *************** */ int compare(Script_def const &); void print() const; Script_def(String, int, int ,bool); diff --git a/hdr/sourcefile.hh b/hdr/sourcefile.hh index 1e1e2a8692..38a420248b 100644 --- a/hdr/sourcefile.hh +++ b/hdr/sourcefile.hh @@ -9,11 +9,10 @@ class Source_file { public: - /// - Source_file( String &filename_str ); /** RETURN path to opened file. */ + Source_file( String &filename_str ); ~Source_file(); char const* ch_c_l(); String error_str( char const* pos_ch_c_l ); diff --git a/hdr/spanner.hh b/hdr/spanner.hh index 144b110e29..097a592cd6 100644 --- a/hdr/spanner.hh +++ b/hdr/spanner.hh @@ -11,11 +11,29 @@ #include "staffelem.hh" /// a symbol which is attached between two columns. +/** A spanner is a symbol which spans across several columns, so its + final appearance can only be calculated after the breaking problem + is solved. + + Examples + + - (de)crescendo + - slur + - beam + - bracket + + + Spanner should know about the items which it should consider: + e.g. slurs should be steep enough to "enclose" all those items. This + is absolutely necessary for beams, since they have to adjust the + length of stems of notes they encompass. + + */ struct Spanner:Staff_elem { PCol *left, *right; - /****************/ + /* *************** */ Spanner(); virtual Interval width()const; @@ -25,29 +43,11 @@ struct Spanner:Staff_elem { virtual Spanner* spanner() { return this; } protected: /// clone a piece of this spanner. - virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0; /** PRE c1 >= start, c2 <= stop */ + virtual Spanner *do_break_at( PCol *c1, PCol *c2) const=0; }; -/** A spanner is a symbol which spans across several columns, so its - final appearance can only be calculated after the breaking problem - is solved. - - Examples - - - (de)crescendo - - slur - - beam - - bracket - - - Spanner should know about the items which it should consider: - e.g. slurs should be steep enough to "enclose" all those items. This - is absolutely necessary for beams, since they have to adjust the - length of stems of notes they encompass. - - */ #endif diff --git a/hdr/staffcommands.hh b/hdr/staffcommands.hh index 1a25b9bdb4..1caead811e 100644 --- a/hdr/staffcommands.hh +++ b/hdr/staffcommands.hh @@ -14,7 +14,7 @@ struct Staff_commands_at : public IPointerList { Time_description tdescription_; - /****************/ + /* *************** */ bool is_breakable(); Moment when(); diff --git a/hdr/staffelem.hh b/hdr/staffelem.hh index ba3df695bf..3928c994e9 100644 --- a/hdr/staffelem.hh +++ b/hdr/staffelem.hh @@ -11,6 +11,12 @@ #include "offset.hh" #include "molecule.hh" +/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend + on other Staff_elem's, eg, Beam needs to know and set direction of + Stem. So the Beam has to be calculated *before* Stem. This is + accomplished with the dependencies field of struct Staff_elem. + + */ struct Staff_elem { enum Status { ORPHAN, // not yet added to pstaff @@ -25,7 +31,7 @@ struct Staff_elem { /// the pstaff it is in PStaff *pstaff_l_; - /****************/ + /* *************** */ Staff_elem(Staff_elem const&); String TeXstring () const ; virtual void print() const; @@ -65,21 +71,14 @@ private: /// member: the symbols Molecule *output; // should scrap, and use temp var? - /// - Offset offset_; + /** This is needed, because #output# may still be NULL. */ + Offset offset_; Array dependencies; }; -/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend - on other Staff_elem's, eg, Beam needs to know and set direction of - Stem. So the Beam has to be calculated *before* Stem. This is - accomplished with the dependencies field of struct Staff_elem. - - */ - #define NAME_METHOD(c) const char *c::name()const{ return #c; } struct c #endif // STAFFELEM_HH diff --git a/hdr/staffline.hh b/hdr/staffline.hh index f44754a5d2..9fbe3ec917 100644 --- a/hdr/staffline.hh +++ b/hdr/staffline.hh @@ -20,7 +20,7 @@ struct Line_of_staff { Line_of_score * line_of_score_l_; PStaff *pstaff_l_; - /****************/ + /* *************** */ String TeXstring() const; Line_of_staff(Line_of_score*, PStaff *); diff --git a/hdr/staffwalker.hh b/hdr/staffwalker.hh index efac63e7b0..3b78c29c6b 100644 --- a/hdr/staffwalker.hh +++ b/hdr/staffwalker.hh @@ -10,13 +10,17 @@ #include "staff.hh" +/** + manage run-time info when walking staffcolumns such as: key, + meter, pending beams & slurs + */ struct Staff_walker : public PCursor { Staff * staff_l_; PScore * pscore_l_; int break_status; - /****************/ + /* *************** */ int priority() const; // Command Moment when() const; @@ -26,9 +30,9 @@ struct Staff_walker : public PCursor { void process_command(Command *); void operator++(int); - /**************** + /* *************** VIRTUAL - ****************/ + *************** */ /// every time ++ is called virtual void do_pre_move(){} @@ -39,10 +43,6 @@ struct Staff_walker : public PCursor { private: Staff_walker(Staff_walker const&); }; -/** - manage run-time info when walking staffcolumns such as: key, - meter, pending beams & slurs - */ #endif // STAFFWALKER_HH diff --git a/hdr/stem.hh b/hdr/stem.hh index e4c3794a8c..962d1f4ba3 100644 --- a/hdr/stem.hh +++ b/hdr/stem.hh @@ -11,6 +11,16 @@ #include "moment.hh" /// the rule attached to the ball +/** + takes care of: + + \begin{itemize} + \item the rule + \item the flag + \item up/down position. + \end{itemize} + */ + struct Stem : Item { /* /// rhythmical length @@ -29,27 +39,27 @@ struct Stem : Item { int staff_center; // extent of the stem (positions) - Real bot, top; /** fractional, since Beam has to adapt them. */ + Real bot, top; Real stemlen; /// flagtype? 4 none, 8 8th flag, 0 = beam. int flag; ///geen gedonder, jij gaat onder - int dir; /** -1 stem points down, +1: stem points up */ + int dir; Real stem_xoffset; Array heads; - /****************/ + /* *************** */ Stem(int center); //, Moment duration); /// ensure that this Stem also encompasses the Notehead #n# @@ -70,14 +80,4 @@ struct Stem : Item { Molecule* brew_molecule_p() const; }; -/** - takes care of: - - \begin{itemize} - \item the rule - \item the flag - \item up/down position. - \end{itemize} - */ - #endif diff --git a/hdr/textdef.hh b/hdr/textdef.hh index 4e95c93a6e..8100ed45d8 100644 --- a/hdr/textdef.hh +++ b/hdr/textdef.hh @@ -17,7 +17,7 @@ struct Text_def { char const* defined_ch_c_l_m; - /*****************/ + /* ****************/ virtual ~Text_def() {}; bool compare(const Text_def&); Text_def(); diff --git a/hdr/textitem.hh b/hdr/textitem.hh index c563fc80ca..c7df9069d9 100644 --- a/hdr/textitem.hh +++ b/hdr/textitem.hh @@ -16,7 +16,7 @@ struct Text_item : Item { int dir_i_; Text_def* tdef_l_; - /****************/ + /* ***************/ const char * name() const; virtual void set_default_pos(); Molecule* brew_molecule_p() const; diff --git a/hdr/timedescription.hh b/hdr/timedescription.hh index 5fb7749793..4eb5db1194 100644 --- a/hdr/timedescription.hh +++ b/hdr/timedescription.hh @@ -29,7 +29,7 @@ struct Time_description { /// idem int bars; - /****************/ + /* *************** */ void set_cadenza(bool); void OK() const; Time_description(Moment, const Time_description*); diff --git a/hdr/voice.hh b/hdr/voice.hh index 03ea55b9ee..20538ae861 100644 --- a/hdr/voice.hh +++ b/hdr/voice.hh @@ -6,11 +6,18 @@ #include "moment.hh" /// class for horizontal stuff. +/** + + Voice is a ordered row of Voice_elements. It is strictly horizontal: + you cannot have two rhythmic elements running parallel in a Voice + + */ + struct Voice { IPointerList elts; Moment start; - /****************/ + /* *************** */ Moment when(const Voice_element*)const; Moment last() const; Voice(); @@ -19,21 +26,16 @@ struct Voice { void print() const; void set_default_group(String id); }; -/** - - Voice is a ordered row of Voice_elements. It is strictly horizontal: - you cannot have two rhythmic elements running parallel in a Voice - - */ - /// one horizontal bit. +/** Apart from being a container for the requests, Voice_element is nothing + */ struct Voice_element { Moment duration; char const* defined_ch_c_l_m; const Voice *voice_l_; IPointerList reqs; - /****************/ + /* *************** */ void add(Request*); Voice_element(); @@ -41,6 +43,4 @@ struct Voice_element { void print ()const; void set_default_group(String id); }; -/** Apart from being a container for the requests, Voice_element is nothing - */ #endif diff --git a/src/molecule.cc b/src/molecule.cc index 1e09658fee..c52fdc7b32 100644 --- a/src/molecule.cc +++ b/src/molecule.cc @@ -39,7 +39,7 @@ Atom::TeXstring() const return substitute_args(s, a); } -/****************/ +/* *************** */ String Molecule::TeXstring() const diff --git a/src/notename.cc b/src/notename.cc index f22f44d7b9..e6d62644b2 100644 --- a/src/notename.cc +++ b/src/notename.cc @@ -28,7 +28,7 @@ Notename_tab::set(int l, int s, String n) assert(l < 8 && s <= 2 && s >= -2 && l >=0); notetab[l * 5 + s +2] = n; } -/****************/ +/* *************** */ void My_flex_lexer::set(Notename_tab *n) { diff --git a/src/qlp.cc b/src/qlp.cc index 280f0db4cc..1e3e2f67d4 100644 --- a/src/qlp.cc +++ b/src/qlp.cc @@ -116,7 +116,7 @@ Ineq_constrained_qp::print() const #endif } -/****************/ +/* *************** */ /* eliminate appropriate variables, until we have a Ineq_constrained_qp diff --git a/src/qlpsolve.cc b/src/qlpsolve.cc index dd9c4043a2..ed49c2a02f 100644 --- a/src/qlpsolve.cc +++ b/src/qlpsolve.cc @@ -142,7 +142,7 @@ Active_constraints::find_active_optimum(Vector g) return H*g; } -/****************************************************************/ +/* *************************************************************** */ int min_elt_index(Vector v) @@ -159,6 +159,19 @@ min_elt_index(Vector v) } ///the numerical solving +/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976) + Prentice Hall. + + Section 13.3 + + This is a "projected gradient" algorithm. Starting from a point x + the next point is found in a direction determined by projecting + the gradient onto the active constraints. (well, not really the + gradient. The optimal solution obeying the active constraints is + tried. This is why H = Q^-1 in initialisation) ) + + + */ Vector Ineq_constrained_qp::solve(Vector start) const { @@ -248,17 +261,4 @@ Ineq_constrained_qp::solve(Vector start) const return x; } -/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976) - Prentice Hall. - - Section 13.3 - - This is a "projected gradient" algorithm. Starting from a point x - the next point is found in a direction determined by projecting - the gradient onto the active constraints. (well, not really the - gradient. The optimal solution obeying the active constraints is - tried. This is why H = Q^-1 in initialisation) ) - - - */ diff --git a/src/tstream.cc b/src/tstream.cc index 05e2e9c93e..d56c58a3c4 100644 --- a/src/tstream.cc +++ b/src/tstream.cc @@ -72,4 +72,4 @@ Tex_stream::operator<<(String s) } -/****************************************************************/ +/* *************************************************************** */ diff --git a/src/voice.cc b/src/voice.cc index 2e7b0b5111..8bccb12d8d 100644 --- a/src/voice.cc +++ b/src/voice.cc @@ -49,7 +49,7 @@ Voice::last() const l += i->duration; return l; } -/****************************************************************/ +/* *************************************************************** */ void Voice_element::print() const {