]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.14
authorfred <fred>
Sun, 24 Mar 2002 19:56:24 +0000 (19:56 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:56:24 +0000 (19:56 +0000)
lily/gourlay-breaking.cc
lily/include/break.hh

index 740899418b133a2f71c053397ecc3d16f31f98ed..9806130d140f79d2502223e44505bf889bc6d9c8 100644 (file)
@@ -14,7 +14,6 @@
 #include "p-score.hh"
 #include "paper-def.hh"
 
-
 const HAPPY_DOTS_I = 3;
 
 /**
@@ -41,7 +40,6 @@ struct Break_node {
 Array<Col_hpositions>
 Gourlay_breaking::do_solve() const
 {
-
   Array<Break_node> optimal_paths;
   Line_of_cols all = all_cols();
   Array<int> breaks = find_break_indices();
@@ -170,20 +168,9 @@ Gourlay_breaking::do_solve() const
       i = optimal_paths[i].prev_break_i_;
     }
 
-  print_stats();
-  /*
-    TODO print variation in energy
-   */
-  if (max_energy_f) 
-    {
-      ;
-    }
-  
-  
 
   for (int i= final_breaks.size(); i--;) 
     lines.push (optimal_paths[final_breaks[i]].line_config_);
-
   
   return lines;
 }
index b77414482e8a4ee6abd8619728ea4ea87e52b259..851aa726cfd7543752fe4b1fc31a1efe150ffb46 100644 (file)
  */
 struct Col_stats
 {
-    int count_i_;
-    int cols_i_;
+  int count_i_;
+  int cols_i_;
 
-    Col_stats(); 
-    void add (Line_of_cols const&l);
-    String str() const;
+  Col_stats(); 
+  void add (Line_of_cols const&l);
+  String str() const;
 };
 
 /** Class representation of an algorithm which decides where to put
@@ -36,45 +36,43 @@ struct Col_stats
 class Break_algorithm {
 protected:
 
-    Paper_score *pscore_l_;
-    Real linelength;
+  Paper_score *pscore_l_;
+  Real linelength;
 
-    /// search all pcols which are breakable.
-    Line_of_cols find_breaks() const;
+  /// search all pcols which are breakable.
+  Line_of_cols find_breaks() const;
 
-    Line_of_cols all_cols() const;
-    Array<int> find_break_indices() 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: solve for the columns in #curline#.
+  void solve_line (Col_hpositions*) const;
 
-    /// helper: approximate the energyv
-    void approximate_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;
+  /// does curline fit on the paper?    
+  bool feasible (Line_of_cols) const;
     
 
-    Line_spacer* generate_spacing_problem (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();
+  virtual Array<Col_hpositions> do_solve() const=0;
+   virtual void do_set_pscore();
 public:
-    Col_stats approx_stats_;
-    Col_stats exact_stats_;
-
-    Line_spacer* (*get_line_spacer)();
+  Col_stats approx_stats_;
+  Col_stats exact_stats_;
+  
+  Line_spacer* (*get_line_spacer)();
     
-    Break_algorithm();
-    void set_pscore (Paper_score*);
+  Break_algorithm();
+  void set_pscore (Paper_score*);
 
-    /// check if the spacing/breaking problem is well-stated
-    void problem_OK() const;
-    void OK() const;
-    Array<Col_hpositions> solve() const;
+  /// check if the spacing/breaking problem is well-stated
+  void problem_OK() const;
+  void OK() const;
+  Array<Col_hpositions> solve() const;
 };
 
 #endif // BREAK_HH