blob: e48775f8c594967e1b340fb5712377d13c941325 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/**
* \brief Remove overlaps function
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
*
* Copyright (C) 2005 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#include "constraint.h"
#include <cassert>
Constraint::Constraint(Variable *left, Variable *right, double gap)
: left(left),
right(right),
gap(gap),
timeStamp(0),
active(false),
visited(false)
{
left->out.push_back(this);
right->in.push_back(this);
}
std::ostream& operator <<(std::ostream &os, const Constraint &c)
{
os<<*c.left<<"+"<<c.gap<<"<="<<*c.right<<"("<<c.slack()<<")";
return os;
}
|