]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.1
authorfred <fred>
Sun, 24 Mar 2002 19:52:54 +0000 (19:52 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:52:54 +0000 (19:52 +0000)
flower/include/diagonal-storage.hh
lib/include/moment.hh
lily/include/break.hh
lily/include/gourlay-breaking.hh [new file with mode: 0644]
lily/include/music-list.hh
lily/include/performer.hh
lily/include/score-elem-info.hh
lily/include/spring-spacer.hh

index 517c5cd814999cc464367505a088fdd49495c3de..f4515edfb1fd1317ce50f67fa940a057e294c193 100644 (file)
@@ -12,9 +12,9 @@
 #include "full-storage.hh"
 
 /**
-  Store a single-band matrix;
+  Store a  matrix with a single-band.
 
-  INVARIANT
+  @invariant
   
   Diagonal_storage(i,j) == band_(i, j-i + band_size_i())
   
@@ -58,7 +58,7 @@ public:
     virtual void mult_next(int &i, int &j) const ;
     virtual bool trans_ok(int i, int j) const;
     virtual void trans_next(int &i, int &j) const;
-    VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage);
+    DECLARE_VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage);
     DECLARE_MY_RUNTIME_TYPEINFO;
     virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const *)const;
 };
index 4f44c07fd965c9b92af0aadfe54abba14702a9c6..bbd3388e742fba9c8c8aa6a621a95b6450284476 100644 (file)
@@ -5,10 +5,24 @@
 #ifndef MOMENT_HH
 #define MOMENT_HH
 
+#include <limits.h>
 #include "rational.hh"
+
+/**
+  A really big time-moment.
+
+  Windhoze-suck-suck-suck-suck-suck-thank-you-cygnus
+
+  I get tired of all these incompatibilities.  Let's just assume that
+  INT_MAX is really, really, really big.
+
+  Can't we name this Saint_jut_mom (Sintjuttemis ?)  */
+  
+const infinity_mom = Rational(INT_MAX);
+
 class String;
 typedef Rational Moment;
-void printm(Moment const&);
+
 
 
 #endif // 
index bb37f4aeabff3d7a6ac4c4fcb628319b30a9dfc0..e016a8806afa7ca008952f74edd10f725659445f 100644 (file)
 #include "lily-proto.hh"
 #include "colhpos.hh"
 
+
+/**
+  Statistics for the number of columns calced.
+ */
+struct Col_stats
+{
+    int count_i_;
+    int cols_i_;
+
+    Col_stats(); 
+    void add(Line_of_cols const&l);
+    String str()const;
+};
+
 /** Class representation of an algorithm which decides where to put
   the column, and where to break lines.
   
-  TODO: a decent algorithm, based on dynamic programming or something
-  a like. A "parindent", caching of breakpoints
+  TODO:  A "parindent", caching of breakpoints
   
   */
 class Break_algorithm {
-    Line_spacer* generate_spacing_problem(Line_of_cols)const;
 protected:
+
     PScore *pscore_l_;
     Real linelength;
 
     /// search all pcols which are breakable.
     Line_of_cols find_breaks() const;
 
-     /// helper: solve for the columns in #curline#.
-    Col_hpositions solve_line(Line_of_cols) const;
+    Line_of_cols all_cols() const;
+    Array<int> find_break_indices()const;
+    
+
+    /// helper: solve for the columns in #curline#.
+    void solve_line(Col_hpositions*) const;
+
+    /// helper: approximate the energyv
+    void approximate_solve_line(Col_hpositions*) const;
 
     /// does curline fit on the paper?    
     bool feasible(Line_of_cols)const;
     
 
-    /** generate a solution with no regard to idealspacings or
-      constraints.  should always work */
-    Col_hpositions stupid_solution(Line_of_cols) const;
+    Line_spacer* generate_spacing_problem(Line_of_cols)const;
+
     virtual Array<Col_hpositions> do_solve()const=0;
+    void print_stats()const;
+
+    virtual void do_set_pscore();
 public:
+    Col_stats approx_stats_;
+    Col_stats exact_stats_;
+
     Line_spacer* (*get_line_spacer)();
     
-    Break_algorithm(PScore&);
+    Break_algorithm();
+    void set_pscore(PScore*);
 
     /// check if the spacing/breaking problem is well-stated
     void problem_OK()const;
diff --git a/lily/include/gourlay-breaking.hh b/lily/include/gourlay-breaking.hh
new file mode 100644 (file)
index 0000000..99fa0c9
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+  gourlay-breaking.hh -- declare Gourlay_breaking
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef GOURLAY_BREAKING_HH
+#define GOURLAY_BREAKING_HH
+
+#include "break.hh"
+
+/**
+  A dynamic programming solution to breaking scores into lines
+ */
+struct Gourlay_breaking : public Break_algorithm
+{
+    Real energy_bound_f_ ;
+    
+    /// maximum number of measures in a line
+    int max_measures_i_;
+    void do_set_pscore();
+    Array<Col_hpositions> do_solve()const;
+    Gourlay_breaking();
+};
+#endif // GOURLAY_BREAKING_HH
index 8b26d3ee18f815c1f64f6984055d251b006319a6..bcae7cff83d37dc37ccf52258a6ab1b7ea6a5fff 100644 (file)
@@ -48,6 +48,10 @@ public:
     virtual MInterval time_int()const;
 };
 
+/**
+  The request is a collection of Requests. A note that you enter in mudela is 
+  one Request_chord, one syllable of lyrics is one Request_chord
+ */
 class Request_chord : public Chord {
 public:
     DECLARE_MY_RUNTIME_TYPEINFO;
index 35911605d9b795eddbd992c933246d906aac62a9..353f1f9b133b434b7aa30fcdf95b16e48d5a265a 100644 (file)
 #include "score-elem-info.hh"
 #include "staff-info.hh"
 
+/**
+  Convert a music definition into a audio representation.
+  A baseclass
+ */
 class Performer {
     bool init_b_;
 public:
index 05c1413ddfbeaddd5737d0148f27b63f97d87ddc..4e6b609ff26d43fbb4aa740bb2b0573f332aa0f1 100644 (file)
@@ -14,7 +14,9 @@
 #include "lily-proto.hh"
 #include "varray.hh"
 
-/// data container.
+/**
+  Data container for broadcasts 
+  */
 struct Score_elem_info {
     Score_elem * elem_l_;
     Request*req_l_;
index 55864615a24dbc49d801b91a5eec6d6d4509b680..85b828d2fa257e292de8820c821ba99d18346628 100644 (file)
 #include "line-spacer.hh"
 #include "plist.hh"
 #include "col-info.hh"
+#include "colhpos.hh"
 
-/** the problem, given by the columns (which include constraints) and
-    intercolumn spacing. The problem is:
-
+/** 
+  Determine positions of columns connected by springs and held apart by rods
+  
+  
     Generate a spacing which
     \begin{itemize}
     \item
@@ -24,6 +26,7 @@
     \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
@@ -33,7 +36,7 @@
     The quality is given by the total potential energy in the
     springs. The lower the energy, the better the configuration.
 
-    TODO: make item widths work per pstaff.
+    TODO: make item widths work per Staff.
 
 */
 
@@ -77,22 +80,24 @@ class Spring_spacer : public Line_spacer {
     void add_ideal(Idealspacing const *i);
     Vector try_initial_solution() const;
     void calc_idealspacing();
+    void set_fixed_cols(Mixed_qp&)const;
 
     Score_column* scol_l(int);
     void connect(int i,int j, Real,Real);
+    Line_of_cols error_pcol_l_arr()const;
 public:
     static Line_spacer *constructor();
-    Array<PCol*> error_pcol_l_arr() const;
 
-    virtual   Array<Real> solve() const;
-    virtual  void add_column(PCol  *, bool fixed=false, Real fixpos=0.0);
+    virtual void solve(Col_hpositions*) const;
+    virtual void lower_bound_solution(Col_hpositions*) const;
+    virtual void add_column(PCol  *, bool fixed=false, Real fixpos=0.0);
  
 
     virtual Vector default_solution() const;
-    virtual   bool check_constraints(Vector v) const;
-    virtual    void OK() const;
-    virtual    void print() const;
-    virtual    void prepare();
+    virtual bool check_constraints(Vector v) const;
+    virtual void OK() const;
+    virtual void print() const;
+    virtual void prepare();
     virtual ~Spring_spacer(){}
 };