From: fred Date: Tue, 26 Mar 2002 22:23:38 +0000 (+0000) Subject: lilypond-1.1.59 X-Git-Tag: release/1.5.59~2267 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=25fdb94c19af061fde60df558d0d5302cea0cbdc;p=lilypond.git lilypond-1.1.59 --- diff --git a/BUGS b/BUGS index 59f9f827ab..5fe9ab69ee 100644 --- a/BUGS +++ b/BUGS @@ -31,6 +31,17 @@ Lilypond 1.1.35-1.1.51,...: Wierd errors in guile scm_gc_mark () Some bugs may be captured in input/bugs/*y +[Linux i386, RedHat 5.2 with updates to 6.0] + +Compiling with + + configure --disable-checking --enable-printing --disable-optimise --disable-debugging + +results in core dumps, during parsing of init files. Cause unknown. +Solution: use + + --enable-checking and --enable-optimize + [Linux libg++ 2.7] LilyPond occasionally crashes while parsing the initialisation files. diff --git a/input/test/collisions.ly b/input/test/collisions.ly index 1e8796cc5f..370ce9463f 100644 --- a/input/test/collisions.ly +++ b/input/test/collisions.ly @@ -24,14 +24,21 @@ threevoice = \context Staff \notes < \context Voice=iii { \stemdown c4 d e d c d es } > +chordstest = \context Staff \notes < + \context Voice = i \relative c { + \stemup e4 dis c f g f a b b + } + \context Voice = ii \relative c { + \stemdown + } +> + \score{ \notes \transpose c'' { \twovoice \twovoicesteminvert - \threevoice - + \threevoice + \break \chordstest } - - % \midi { \tempo 4:80 } } diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 5f5079dad5..12aa5e08a0 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -108,13 +108,16 @@ Break_align_item::do_pre_processing() Real pre_space = elems[0]->extent (X_AXIS)[LEFT]; Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT]; + Real stretch_distance =0.; if (SCM_CAR (symbol_list) == extra_space_scm_sym) { spring_len += dists.top (); + stretch_distance = dists.top (); } else if (SCM_CAR (symbol_list) == minimum_space_scm_sym) { spring_len = spring_len >? dists.top (); + stretch_distance = spring_len; } @@ -124,6 +127,10 @@ Break_align_item::do_pre_processing() column_l ()->set_elt_property (extra_space_scm_sym, scm_cons (gh_double2scm (pre_space), gh_double2scm (spring_len))); + + column_l ()->set_elt_property (stretch_distance_scm_sym, + gh_double2scm (stretch_distance)); + } diff --git a/lily/col-info.cc b/lily/col-info.cc index 47d9c69c33..2ebfd15d4f 100644 --- a/lily/col-info.cc +++ b/lily/col-info.cc @@ -33,7 +33,6 @@ Column_info::Column_info (Paper_column *col_l, Real const *fixed_C) { if (fixed_C) fixpos_p_.set_l (fixed_C); - ugh_b_ = false; pcol_l_ = col_l; width_ = pcol_l_->extent(X_AXIS); if (width_.empty_b()) @@ -43,7 +42,6 @@ Column_info::Column_info (Paper_column *col_l, Real const *fixed_C) Column_info::Column_info() { - ugh_b_ = false; pcol_l_ =0; } diff --git a/lily/colhpos.cc b/lily/colhpos.cc index 1e0a971a12..8d82c2c06d 100644 --- a/lily/colhpos.cc +++ b/lily/colhpos.cc @@ -15,7 +15,6 @@ Column_x_positions::Column_x_positions() { energy_f_ = infinity_f; - ugh_b_ = false; satisfies_constraints_b_ = false; spacer_l_ =0; } @@ -28,7 +27,7 @@ Column_x_positions::~Column_x_positions() void Column_x_positions::add_paper_column (Paper_column*c) { - cols.push (c); + cols_.push (c); } void @@ -36,8 +35,8 @@ Column_x_positions::print() const { #ifndef NPRINT DOUT << "energy : " << energy_f_ << '\n'; - DOUT << "line of " << config.size() << " cols\n"; - Vector v (config); + DOUT << "line of " << config_.size() << " cols\n"; + Vector v (config_); DOUT << v; #endif } @@ -54,8 +53,7 @@ void Column_x_positions::set_stupid_solution(Vector v) { energy_f_ = infinity_f; - ugh_b_ = true; - config = v; + config_ = v; } void diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 284f1e83b3..cc494cfa88 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -90,13 +90,13 @@ Gourlay_breaking::do_solve () const break; Column_x_positions approx; - approx.cols = line; + approx.cols_ = line; approx.spacer_l_ = generate_spacing_problem (line, pscore_l_->paper_l_->line_dimensions_int (optimal_paths[start_idx].line_i_)); spacer_p_list.append (new Killing_cons (approx.spacer_l_,0)); - ( (Break_algorithm*)this)->approx_stats_.add (approx.cols); + ( (Break_algorithm*)this)->approx_stats_.add (approx.cols_); approx.approximate_solve_line (); if (approx.energy_f_ > energy_bound_f_) @@ -124,7 +124,7 @@ Gourlay_breaking::do_solve () const if (!candidate_lines[j].satisfies_constraints_b_) { candidate_lines[j].solve_line (); - ( (Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols); + ( (Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols_); } Real this_energy @@ -171,7 +171,7 @@ Gourlay_breaking::do_solve () const assert (i > optimal_paths[i].prev_break_i_); // there was no "feasible path" - if (!optimal_paths[i].line_config_.config.size ()) { + if (!optimal_paths[i].line_config_.config_.size ()) { final_breaks.set_size (0); break; } diff --git a/lily/include/col-info.hh b/lily/include/col-info.hh index d63c92b9ab..8aea10dbc4 100644 --- a/lily/include/col-info.hh +++ b/lily/include/col-info.hh @@ -39,7 +39,7 @@ struct Column_info { bool ugh_b_; Drul_array< Array > rods_; - Drul_array< Array > springs_; + // Drul_array< Array > springs_; Column_info(); Column_info (Paper_column *,Real const *); diff --git a/lily/include/colhpos.hh b/lily/include/colhpos.hh index 8b9d34b614..98b808a5bb 100644 --- a/lily/include/colhpos.hh +++ b/lily/include/colhpos.hh @@ -14,10 +14,9 @@ typedef Link_array Line_of_cols; struct Column_x_positions { Line_spacer * spacer_l_; - bool ugh_b_; - Line_of_cols error_col_l_arr_; - Line_of_cols cols; - Array config; + Line_of_cols cols_; + Array config_; + Real energy_f_; bool satisfies_constraints_b_; diff --git a/lily/include/ly-symbols.hh b/lily/include/ly-symbols.hh index 25a2b8b38b..28d10c7745 100644 --- a/lily/include/ly-symbols.hh +++ b/lily/include/ly-symbols.hh @@ -64,6 +64,7 @@ DECLARE_LY_SYMBOL(rulesym); DECLARE_LY_SYMBOL(rulethickness); DECLARE_LY_SYMBOL(script_priority); DECLARE_LY_SYMBOL(staffheight); +DECLARE_LY_SYMBOL(stretch_distance); DECLARE_LY_SYMBOL(style); DECLARE_LY_SYMBOL(text); DECLARE_LY_SYMBOL(transparent); diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh index de2d4b4aee..354b664fb6 100644 --- a/lily/include/spring-spacer.hh +++ b/lily/include/spring-spacer.hh @@ -51,11 +51,8 @@ private: Spring_spacer (Spring_spacer const&s); Cons *ideal_p_list_; Array cols_; - Array loose_col_arr_; - /// mark column #i# as being loose. - void loosen_column (int i); /// the index of #c# in #cols# int col_id (Paper_column const *c) const; @@ -74,7 +71,6 @@ private: void handle_loose_cols(); - void position_loose_cols (Vector &) const; bool try_initial_solution_and_tell (Vector&)const; Vector try_initial_solution() const; @@ -82,7 +78,6 @@ private: Score_column* scol_l (int); void connect (int i,int j, Real,Real); - Line_of_cols error_pcol_l_arr() const; Real calculate_energy_f (Vector) const; public: static Line_spacer *constructor(); diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index be7a5e8dac..c53a33a9e8 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -28,8 +28,8 @@ Line_of_score::contains_b (Paper_column const* c) const Line_of_score* Line_of_score::set_breaking (Array const &breaking, int j) const { - const Link_array &curline (breaking[j].cols); - const Array &config (breaking[j].config); + const Link_array &curline (breaking[j].cols_); + const Array &config (breaking[j].config_); Line_of_score *line_l=0; line_l = dynamic_cast (clone()); diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 79ec147d69..9c1f6881d6 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -54,8 +54,6 @@ Spring_spacer::OK() const #ifndef NDEBUG for (int i = 1; i < cols_.size(); i++) assert (cols_[i].rank_i_ > cols_[i-1].rank_i_); - for (int i = 1; i < loose_col_arr_.size(); i++) - assert (loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_); #endif } @@ -78,72 +76,17 @@ Spring_spacer::handle_loose_cols() for (int i=1; i < fixed.size(); i++) connected.connect (fixed[i-1], fixed[i]); + /* + connect unconnected columns with distances of 1.0; + */ for (int i = cols_.size(); i--;) { if (! connected.equiv (fixed[0], i)) { - warning (_f ("unconnected column: %d", i)); - loosen_column (i); + connected.connect (i-1, i); + connect (i-1, i, 1.0, 1.0); } } - OK(); -} - - -/** - Guess a stupid position for loose columns. Put loose columns at - regular distances from enclosing calced columns - */ -void -Spring_spacer::position_loose_cols (Vector &sol_vec) const -{ - if (!loose_col_arr_.size()) - return ; - assert (sol_vec.dim()); - Array fix_b_arr; - fix_b_arr.set_size (cols_.size() + loose_col_arr_.size ()); - Real utter_right_f=-infinity_f; - Real utter_left_f =infinity_f; - for (int i=0; i < loose_col_arr_.size(); i++) - { - fix_b_arr[loose_col_arr_[i].rank_i_] = false; - } - for (int i=0; i < cols_.size(); i++) - { - int r= cols_[i].rank_i_; - fix_b_arr[r] = true; - utter_right_f = utter_right_f >? sol_vec (i); - utter_left_f = utter_left_f 0) ?sol_vec (j-1) : utter_left_f; - Real right_pos_f = - (j < sol_vec.dim()) ? sol_vec (j) : utter_right_f; - int left_rank = (j>0) ? cols_[j-1].rank_i_ : 0; - int right_rank = (j left_rank && r < right_rank); - - v (i) = (r - left_rank)*left_pos_f/ d_r + - (right_rank - r) *right_pos_f /d_r; - } - } - sol_vec = v; } bool @@ -318,7 +261,7 @@ Spring_spacer::lower_bound_solution (Column_x_positions*positions) const DOUT << "Lower bound sol: " << solution_vec; positions->energy_f_ = calculate_energy_f (solution_vec); - positions->config = solution_vec; + positions->config_ = solution_vec; positions->satisfies_constraints_b_ = check_constraints (solution_vec); } @@ -350,10 +293,8 @@ Spring_spacer::solve (Column_x_positions*positions) const { WARN << _ ("solution doesn't satisfy constraints") << '\n' ; } - position_loose_cols (solution_vec); positions->energy_f_ = calculate_energy_f (solution_vec); - positions->config = solution_vec; - positions->error_col_l_arr_ = error_pcol_l_arr(); + positions->config_ = solution_vec; } else { @@ -402,68 +343,13 @@ Spring_spacer::add_column (Paper_column *col, bool fixed, Real fixpos) continue; if (cols_[idx].pcol_l_ != cr.other_l_) - continue; - - Real d = cr.distance_f_; - if (fabs (d) < EPS) - { - connect (idx, this_rank, cr.distance_f_, cr.strength_f_); // large strength. - } - else - connect (idx, this_rank, cr.distance_f_, - cr.strength_f_ / cr.distance_f_); + continue; + connect (idx, this_rank, cr.distance_f_, cr.strength_f_); } cols_.push (c); } -Line_of_cols -Spring_spacer::error_pcol_l_arr() const -{ - Link_array retval; - for (int i=0; i< cols_.size(); i++) - if (cols_[i].ugh_b_) - retval.push (cols_[i].pcol_l_); - for (int i=0; i < loose_col_arr_.size(); i++) - { - retval.push (loose_col_arr_[i].pcol_l_); - } - return retval; -} - -/* - Ugh. Should junk this. - */ -void -Spring_spacer::loosen_column (int idx) -{ - Column_info c=cols_.get (idx); - - Cons **pp = &ideal_p_list_; - - while (*pp) - { - Idealspacing *j = (*pp)->car_; - if (j->cols_drul_[LEFT] == idx|| j->cols_drul_[RIGHT] == idx) - { - delete remove_cons (pp); - } - else - { - pp = &(*pp)->next_; - } - } - c.ugh_b_ = true; - - int j=0; - for (; j < loose_col_arr_.size(); j++) - { - if (loose_col_arr_[j].rank_i_ > c.rank_i_) - break; - } - loose_col_arr_.insert (c,j); -} - void Spring_spacer::print() const diff --git a/lily/word-wrap.cc b/lily/word-wrap.cc index f9c7ea8dfa..81a407450e 100644 --- a/lily/word-wrap.cc +++ b/lily/word-wrap.cc @@ -66,13 +66,13 @@ Word_wrap::do_solve () const Paper_column* precol = dynamic_cast(pre); current.add_paper_column (precol); - current.spacer_l_ = generate_spacing_problem (current.cols, + current.spacer_l_ = generate_spacing_problem (current.cols_, pscore_l_->paper_l_->line_dimensions_int (line_no)); // try to solve - if (!feasible (current.cols)) + if (!feasible (current.cols_)) { - if (!minimum.cols.size ()) + if (!minimum.cols_.size ()) { warning (_ ("ugh, this measure is too long") + ", " + _f ("breakpoint: %d", break_idx) @@ -116,7 +116,7 @@ Word_wrap::do_solve () const // add nobreak version of breakable column - current.cols.top ()=breakpoints[break_idx]; + current.cols_.top ()=breakpoints[break_idx]; curcol_idx ++; break_idx++; }