#include "paper-score.hh"
#include "paper-def.hh"
#include "simple-spacer.hh"
-
-#include "killing-cons.tcc"
+#include "line-of-score.hh"
/// How often to print operator pacification marks?
const int HAPPY_DOTS_I = 3;
/**
This algorithms is adapted from the OSU Tech report on breaking lines.
+
+ this function is longish, but not very complicated.
+
*/
Array<Column_x_positions>
Gourlay_breaking::do_solve () const
{
Array<Break_node> optimal_paths;
- Link_array<Paper_column> all = pscore_l_->col_l_arr_ ;
+ Link_array<Grob> all =
+ pscore_l_->line_l_->column_l_arr ();
+
Array<int> breaks = find_break_indices ();
optimal_paths.set_size (breaks.size ());
Break_node first_node ;
- first_node.line_config_.energy_f_ = 0;
optimal_paths[0] = first_node;
int break_idx=1;
for (int start_idx = break_idx; start_idx--;)
{
- Link_array<Paper_column> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
+ Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
- line[0] = dynamic_cast<Paper_column*>(line[0]->find_broken_piece (RIGHT));
- line.top () = dynamic_cast<Paper_column*>(line.top ()->find_broken_piece (LEFT));
+ line[0] = dynamic_cast<Item*> (line[0]) ->find_prebroken_piece (RIGHT);
+ line.top () = dynamic_cast<Item*> (line.top ())->find_prebroken_piece (LEFT);
Column_x_positions cp;
cp.cols_ = line;
/* do the last one */
if (break_idx % HAPPY_DOTS_I)
- progress_indication (String ("[") + to_str (break_idx) + "]");
+ progress_indication (String ("[") + to_str (break_idx) + "]");
progress_indication ("\n");
Gourlay_breaking::Gourlay_breaking ()
{
- energy_bound_f_ = infinity_f;
- max_measures_i_ = INT_MAX;
}
-void
-Gourlay_breaking::do_set_pscore ()
-{
- max_measures_i_ =int (rint (pscore_l_->paper_l_->get_var ("gourlay_maxmeasures")));
-}
/*
Column_x_positions const &this_one) const
{
Real break_penalties = 0.0;
- Paper_column * pc = this_one.cols_.top ();
+ Grob * pc = this_one.cols_.top ();
if (pc->original_l_)
{
- SCM pen = pc->get_elt_property ("penalty");
+ SCM pen = pc->get_grob_property ("penalty");
if (gh_number_p (pen))
{
break_penalties += gh_scm2double (pen);