if (i->musical) {
assert(j.ok());
for (int n=0; n < i->durations.sz(); n++) {
- Real d = i->durations[n];
+ Moment d = i->durations[n];
Real dist = paper_->duration_to_dist(d);
while (j->when < d + i->when)
j++;
- assert( distance(j->when, d+i->when) < 1e-8);
+ assert( j->when== d+i->when);
connect(i->pcol_, j->pcol_, dist);
if (!j->musical && (j+1).ok()
the last col is breakable, and therefore in use
*/
- Real d = j->when - i->when;
+ Moment d = j->when - i->when;
Real dist = (d) ? paper_->duration_to_dist(d) :
convert_dimen(2,"pt"); // todo
// mtor << "checking solution " << v << '\n';
for (int i=0; i < dim; i++) {
- if (cols[i].fixed&& ABS(cols[i].fixpos - v(i)) > COLFUDGE) {
+ if (cols[i].fixed&& abs(cols[i].fixpos - v(i)) > COLFUDGE) {
return false;
}
if (!i)
Vector Ha = H*a;
Real aHa = a*Ha;
Vector addrow(Ha.dim());
- if (ABS(aHa) > EPS) {
+ if (abs(aHa) > EPS) {
/*
a != 0, so if Ha = O(EPS), then
Ha * aH / aHa = O(EPS^2/EPS)
}
}
Real unbounded_alfa = 1.0;
- Real optimal_step = MIN(minalf, unbounded_alfa);
+ Real optimal_step = min(minalf, unbounded_alfa);
Vector deltax=direction * optimal_step;
x += deltax;
const int STEMLEN=7;
-Stem::Stem(int c, Real len)
+Stem::Stem(int c, Moment len)
{
note_length = len;
beams_left = 0;
top = (dir < 0) ? maxnote : se;
bot = (dir < 0) ? se : minnote;
- flag = dir*ABS(flag);
+ flag = dir*abs(flag);
}
void
int parity=0;
int lastpos = heads[0]->position;
for (int i=1; i < heads.sz(); i ++) {
- if (ABS(lastpos- heads[i]->position) == 1) {
+ if (abs(lastpos- heads[i]->position) == 1) {
if (parity)
heads[i]->x_dir = (stem_xoffset>0) ? 1:-1;
parity = !parity;
Interval
Stem::width()const
{
- if (!print_flag || ABS(flag) <= 4)
+ if (!print_flag || abs(flag) <= 4)
return Interval(0,0); // TODO!
Paperdef*p= paper();
Interval r(p->lookup_->flag(flag).dim.x);
output = new Molecule(Atom(ss));
- if (print_flag&&ABS(flag) > 4){
+ if (print_flag&&abs(flag) > 4){
Symbol fl = p->lookup_->flag(flag);
Molecule m(fl);
if (flag < -4){
static int
slope_index(Real &s)
{
- if (ABS(s) > 0.5) {
+ if (abs(s) > 0.5) {
WARN << "beam steeper than 0.5";
- s = sgn(s) * 0.5;
+ s = sign(s) * 0.5;
}
int i = int(rint(s * 20.0));