198#define GECKO_FLOAT_EPSILON std::numeric_limits<Float>::epsilon()
199#define GECKO_FLOAT_MAX std::numeric_limits<Float>::max()
207#if GECKO_WITH_DOUBLE_PRECISION
265 s.weight +=
t.weight;
271 return s.value <
t.value;
296 Float x = v[0].value;
297 Float min = GECKO_FLOAT_MAX;
306 if (v[1].weight > v[0].weight)
312 for (std::vector<WeightedValue>::const_iterator
p = v.begin();
p != v.end();
316 for (std::vector<WeightedValue>::const_iterator q = v.begin(); q != v.end();
319 Float l = std::fabs(
p->value - q->value);
348 return s.value -
s.weight >
t.value -
t.weight;
440 Float min = GECKO_FLOAT_MAX;
441 for (std::vector<WeightedValue>::const_iterator
p = v.begin();
p != v.end();
446 for (std::vector<WeightedValue>::const_iterator q = v.begin(); q != v.end();
448 if (q->value <
p->value)
452 else if (q->value >
p->value)
467 x = std::min(x,
p->value);
468 y = std::max(y,
p->value);
497 for (std::vector<WeightedValue>::const_iterator
p = v.begin();
p != v.end();
501 s.weight +=
p->weight;
503 return s.value /
s.weight;
519 s.value = std::max(
s.value,
t.value);
532 Float min = v[0].value;
533 Float max = v[0].value;
534 for (std::vector<WeightedValue>::const_iterator
p = v.begin() + 1;
p != v.end();
541 else if (
p->value > max)
546 return (min + max) / 2;
572 virtual bool quit()
const {
return false; }
587 typedef std::vector<Index>::const_iterator
ConstPtr;
596 typedef std::vector<Node>::const_iterator
ConstPtr;
681 friend class Subgraph;
709 void place(
bool sort =
false);
734 std::vector<Node::Index>
adj;
std::vector< Index >::const_iterator ConstPtr
Float bond(Float w, Float l, uint k) const
Float optimum(const std::vector< WeightedValue > &v) const
Float mean(const WeightedSum &sum) const
WeightedSum sum(const WeightedValue &term) const
Float optimum(const std::vector< WeightedValue > &v) const
Float bond(Float w, Float l, uint k) const
WeightedSum sum(const WeightedValue &term) const
Float mean(const WeightedSum &sum) const
WeightedSum sum(const WeightedValue &term) const
bool less(const WeightedSum &s, const WeightedSum &t) const
Float optimum(const std::vector< WeightedValue > &v) const
Float bond(Float w, Float l, uint k) const
Float mean(const WeightedSum &sum) const
Float mean(const WeightedSum &sum) const
Float optimum(const std::vector< WeightedValue > &v) const
void accumulate(WeightedSum &s, const WeightedSum &t) const
Float bond(Float, Float, uint) const
WeightedSum sum(const WeightedValue &term) const
Float optimum(const std::vector< WeightedValue > &v, Float lmin) const
WeightedSum sum(const WeightedValue &term) const
Float optimum(const std::vector< WeightedValue > &v) const
Float mean(const WeightedSum &sum) const
Float bond(Float w, Float, uint) const
Float mean(const WeightedSum &sum) const
WeightedSum sum(const WeightedValue &term) const
Float optimum(const std::vector< WeightedValue > &v) const
Float bond(Float w, Float l, uint k) const
virtual bool less(const WeightedSum &s, const WeightedSum &t) const
virtual Float optimum(const std::vector< WeightedValue > &v) const =0
virtual WeightedSum sum(const WeightedSum &s, const WeightedSum &t) const
virtual WeightedSum sum(const WeightedValue &term) const =0
virtual void accumulate(WeightedSum &s, const WeightedValue &t) const
virtual Float bond(Float w, Float l, uint k) const =0
virtual WeightedSum sum(const WeightedSum &s, const WeightedValue &t) const
virtual Float mean(const WeightedSum &sum) const =0
virtual void accumulate(WeightedSum &s, const WeightedSum &t) const
void vcycle(uint n, uint work=0)
bool placed(Node::Index i) const
void order(Functional *functional, uint iterations=1, uint window=2, uint period=2, uint seed=0, Progress *progress=0)
Arc::Index node_begin(Node::Index i) const
Node::Index arc_target(Arc::Index a) const
const std::vector< Node::Index > & permutation() const
Float length(Arc::Index a) const
Arc::Index reverse_arc(Arc::Index a) const
Arc::Index node_end(Node::Index i) const
Float arc_weight(Arc::Index a) const
Arc::Index directed() const
std::vector< Node::Index > perm
uint node_degree(Node::Index i) const
Arc::Index arc_index(Node::Index i, Node::Index j) const
Node::Index insert_node(Float length=1)
std::vector< Float > weight
bool persistent(Node::Index i) const
void refine(const Graph *graph)
bool remove_arc(Arc::Index a)
std::vector< Float > bond
bool remove_edge(Node::Index i, Node::Index j)
Arc::Index insert_arc(Node::Index i, Node::Index j, Float w=1, Float b=1)
std::vector< Node::Index > adj
Node::Index permutation(uint rank) const
void relax(bool compatible, uint m=1)
std::vector< Node::Index > node_neighbors(Node::Index i) const
uint rank(Node::Index i) const
void place(bool sort=false)
Node::Index arc_source(Arc::Index a) const
void shuffle(uint seed=0)
Float length(Node::Index i, Node::Index j) const
Graph(uint nodes, uint level)
bool operator()(uint k, uint l) const
Comparator(ConstPtr node_)
std::vector< Node >::const_iterator ConstPtr
Node(Float pos=-1, Float length=1, Arc::Index arc=Arc::null, Node::Index parent=Node::null)
virtual void beginorder(const Graph *, Float) const
virtual bool quit() const
virtual void endorder(const Graph *, Float) const
virtual void beginiter(const Graph *, uint, uint, uint) const
virtual void endphase(const Graph *, bool) const
virtual void beginphase(const Graph *, std::string) const
virtual void enditer(const Graph *, Float, Float) const
WeightedSum(Float value=0, Float weight=0)
WeightedValue(Float value, Float weight)
real_t f(const Vector &p)
real_t p(const Vector &x, real_t t)