class Spring_spacer : public Line_spacer

Determine positions of columns connected by springs and held apart by rods

Inheritance:


Public Methods

void Spring_spacer::add_column(Paper_column *col, bool fixed, Real fixpos)
add one column to the problem
void Spring_spacer::calc_idealspacing()
generate springs between columns
void Spring_spacer::get_ruling_durations(Array<Moment> &shortest_playing_arr, Array<Moment> &context_shortest_arr)
get the shortest_playing running note at a time
void Spring_spacer::handle_loose_cols()
Make sure no unconnected columns happen
void Spring_spacer::position_loose_cols(Vector &sol_vec)
Guess a stupid position for loose columns
Vector Spring_spacer::try_initial_solution()
try to generate a solution which obeys the min distances and fixed positions

Private Methods

int col_id(Paper_column const *c)
the index of c in cols
bool contains_b(Paper_column const *w)
does this contain the column w?
Vector find_initial_solution()
generate an (nonoptimal) solution
void loosen_column(int i)
mark column i as being loose.
void make_constraints(Mixed_qp& lp)
generate the LP constraints
void make_matrices(Matrix &quad, Vector &lin, Real&)
make the energy function

Inherited from Line_spacer:

Public Methods

virtual void add_column(Paper_column *, bool fixed=false, Real fixpos=0.0)
virtual bool check_constraints(Vector v)
virtual Vector default_solution()
virtual void lower_bound_solution(Column_x_positions *)
virtual void prepare()
virtual void solve(Column_x_positions *)

Documentation

Determine positions of columns connected by springs and held apart by rods.

Generate a spacing which

This is converted by regarding idealspacing as "springs" attached to columns. The equilibrium of one spring is the ideal distance. The columns have a size, this imposes "hard" constraints on the distances. This transforms the problem into a quadratic programming problem with linear constraints.

The quality is given by the total potential energy in the springs. The lower the energy, the better the configuration.

TODO: make item widths work per Staff.

void loosen_column(int i)
mark column i as being loose.

int col_id(Paper_column const *c)
the index of c in cols

Vector find_initial_solution()
generate an (nonoptimal) solution

bool contains_b(Paper_column const *w)
does this contain the column w?

void make_matrices(Matrix &quad, Vector &lin, Real&)
make the energy function

void make_constraints(Mixed_qp& lp)
generate the LP constraints

void Spring_spacer::add_column(Paper_column *col, bool fixed, Real fixpos)
add one column to the problem

void Spring_spacer::calc_idealspacing()
generate springs between columns.

TODO: This needs rethinking.

Spacing should take optical effects into account

Should be decentralised

The algorithm is taken from :

John S. Gourlay. ``Spacing a Line of Music,'' Technical Report OSU-CISRC-10/87-TR35, Department of Computer and Information Science, The Ohio State University, 1987.

void Spring_spacer::get_ruling_durations(Array<Moment> &shortest_playing_arr, Array<Moment> &context_shortest_arr)
get the shortest_playing running note at a time

void Spring_spacer::handle_loose_cols()
Make sure no unconnected columns happen

void Spring_spacer::position_loose_cols(Vector &sol_vec)
Guess a stupid position for loose columns. Put loose columns at regular distances from enclosing calced columns

Vector Spring_spacer::try_initial_solution()
try to generate a solution which obeys the min distances and fixed positions


This class has no child classes.

alphabetic index hierarchy of classes


This program documentation comes from lilypond-1.0.0.tar.gz. It was generated by <janneke@gnu.org> on Fri Jul 31 15:42:17 CEST 1998