]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/spring-spacer.hh
release: 1.1.1
[lilypond.git] / lily / include / spring-spacer.hh
index f5a40b63da6db4c5f45c9fa79b3d4650cd359b59..33390810ced06f6ccc14a3d4d6facd1edd7ba044 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -16,6 +16,8 @@
 #include "colhpos.hh"
 #include "moment.hh"
 
+
+
 /** 
   Determine positions of columns connected by springs and held apart by rods.
   
 
 class Spring_spacer : public Line_spacer {
   friend class Durations_iter;
-    
+
   Pointer_list<Idealspacing *> ideal_p_list_;
-  Array<Colinfo> cols;
-  Array<Colinfo> loose_col_arr_;
-    
+  Array<Column_info> cols_;
+  Array<Column_info> loose_col_arr_;
+
+  
   /// mark column #i# as being loose.
   void loosen_column (int i);
   /// the index of #c# in #cols#
@@ -56,11 +59,8 @@ class Spring_spacer : public Line_spacer {
   /// generate an (nonoptimal) solution
   Vector find_initial_solution() const;
 
-  /// check if problem is too tight
-  bool check_feasible() const;
-
   /// does #this# contain the column #w#? 
-  bool contains (Paper_column const *w);
+  bool contains_b (Paper_column const *w);
 
   /// make the energy function
   void make_matrices (Matrix &quad, Vector &lin,Real&) const;
@@ -72,14 +72,7 @@ class Spring_spacer : public Line_spacer {
 
   void handle_loose_cols();
   void position_loose_cols (Vector &) const;
-  /**
-    add a idealspacing to the problem.
-      
-    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 (Idealspacing const *i);
+  bool try_initial_solution_and_tell (Vector&)const;
   Vector try_initial_solution() const;
   void calc_idealspacing();
   void set_fixed_cols (Mixed_qp&) const;
@@ -90,9 +83,10 @@ class Spring_spacer : public Line_spacer {
   Real calculate_energy_f (Vector) const;
 public:
   static Line_spacer *constructor();
-
-  virtual void solve (Col_hpositions*) const;
-  virtual void lower_bound_solution (Col_hpositions*) const;
+  Real energy_normalisation_f_;
+  Spring_spacer ();
+  virtual void solve (Column_x_positions*) const;
+  virtual void lower_bound_solution (Column_x_positions*) const;
   virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0);