\consists "Staff_sym_engraver";
\consists "Collision_engraver";
\consists "Rest_collision_engraver";
+ \consists "Separating_line_group_engraver";
\consists "Line_group_engraver";
+
\accepts "Voice";
}
\translator{
\type "Engraver_group_engraver";
+ \consists "Separating_line_group_engraver";
\consists "Lyric_engraver";
\consists "Line_group_engraver";
\consists "Beam_req_swallow_translator";
if (linelength <= 0)
return true;
- Real l =0;
for (int i=0; i < curline.size (); i++)
{
if (i && i < curline.size () -1
&& ((Score_column*)curline[i])->forced_break_b ())
return false;
-
- l +=curline[i]->width ().length ();
}
- return l < linelength;
+ return true;
}
void
}
IMPLEMENT_IS_TYPE_B(General_script_def);
+
+
+Interval
+General_script_def::width (Paper_def*) const
+{
+ Interval t;
+ return t;
+}
*/
class General_script_def : public Input {
public:
- VIRTUAL_COPY_CONS(General_script_def,General_script_def);
- DECLARE_MY_RUNTIME_TYPEINFO;
- virtual Direction staff_dir() const;
- void print() const;
- virtual Direction rel_stem_dir() const;
- virtual int priority_i() const;
- virtual bool inside_b() const;
- virtual Atom get_atom (Paper_def* p, Direction dir_) const;
- bool equal_b (General_script_def const&) const;
- virtual ~General_script_def() {}
+ VIRTUAL_COPY_CONS(General_script_def,General_script_def);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ virtual Direction staff_dir() const;
+ void print() const;
+ virtual Direction rel_stem_dir() const;
+ virtual int priority_i() const;
+ virtual bool inside_b() const;
+ virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+ bool equal_b (General_script_def const&) const;
+ virtual ~General_script_def() {}
+ virtual Interval width (Paper_def *) const;
protected:
- virtual bool do_equal_b (General_script_def const *) const;
- virtual void do_print() const;
+ virtual bool do_equal_b (General_script_def const *) const;
+ virtual void do_print() const;
};
#endif // GENERAL_SCRIPT_DEF_HH
void handle_loose_cols();
void position_loose_cols (Vector &) const;
+ bool try_initial_solution_and_tell (Vector&)const;
Vector try_initial_solution() const;
void calc_idealspacing();
void set_fixed_cols (Mixed_qp&) const;
class Text_def : public General_script_def
{
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- VIRTUAL_COPY_CONS(Text_def,General_script_def);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ VIRTUAL_COPY_CONS(Text_def,General_script_def);
- /**
- centered , or aligned?
+ /**
+ centered , or aligned?
- -1 = raggedright, 0 = center, 1 = raggedleft
- */
- Direction align_i_;
+ -1 = raggedright, 0 = center, 1 = raggedleft
+ */
+ Direction align_i_;
- String text_str_;
- String style_str_;
+ String text_str_;
+ String style_str_;
- virtual void do_print() const;
- virtual Direction staff_dir() const;
- virtual Atom get_atom (Paper_def* p, Direction dir_) const;
- virtual ~Text_def() {};
- virtual bool do_equal_b (const General_script_def*) const;
- Text_def();
- virtual void print() const;
- Interval width (Paper_def*) const;
+ virtual void do_print() const;
+ virtual Direction staff_dir() const;
+ virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+ virtual ~Text_def() {};
+ virtual bool do_equal_b (const General_script_def*) const;
+ Text_def();
+ virtual void print() const;
+ virtual Interval width (Paper_def*) const;
};
#endif // TEXT_DEF_HH
#include "leastsquares.hh"
+
void
Least_squares::OK() const
{
assert (dx);
}
+
void
Least_squares::minimise (Real &coef, Real &offset)
{
{
Atom a (tdef_p_->get_atom (paper (), dir_));
- /*
- if (fat_b_)
- a.sym.dim.x = tdef_p_->width (paper ());
- */
+
+ if (fat_b_)
+ a.dim_[X_AXIS] = tdef_p_->width (paper ());
Molecule* mol_p = new Molecule (a);
if (dir_<0) // should do something better anyway.
// do another line
line_no_i ++;
Paper_column *post = breakpoints[break_idx_i]->postbreak_l();
+ int start_break_idx = break_idx_i;
current.add (post);
curcol++; // skip the breakable.
break_idx_i++;
}
else
{
-
current.solve_line();
current.print();
}
delete current.spacer_l_;
current.spacer_l_ =0;
- // update minimum, or backup.
+ if (!current.satisfies_constraints_b_ && start_break_idx == break_idx_i - 1)
+ {
+ warning ( _ ("I don't fit. Put me on Montignac"));
+ minimum = current;
+ break;
+ }
+
if (current.energy_f_ < minimum.energy_f_ || current.energy_f_ < 0)
{
minimum = current;