Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
variable.h
Go to the documentation of this file.
1
16#pragma once
17
18#include <vector>
19#include <iostream>
20class Block;
21struct Constraint;
22#include <vpsc/block.h>
23
24typedef std::vector<Constraint*> Constraints;
26{
27 friend std::ostream& operator <<(std::ostream &os, const Variable &v);
28public:
29 const int id; // useful in log files
31 const double weight;
32 double offset;
33 Block *block = nullptr;
34 bool visited;
37 char *toString();
38 Variable(const int id_, const double desiredPos_, const double weight_)
39 : id(id_)
40 , desiredPosition(desiredPos_)
41 , weight(weight_)
42 , offset(0)
43 , visited(false)
44 {
45 }
46 double position() const {
47 return block->posn+offset;
48 }
49};
Definition block.h:28
A constraint determines a minimum or exact spacing required between two variables.
Definition constraint.h:25
double desiredPosition
Definition variable.h:30
Constraints out
Definition variable.h:36
const double weight
Definition variable.h:31
const int id
Definition variable.h:29
double offset
Definition variable.h:32
friend std::ostream & operator<<(std::ostream &os, const Variable &v)
Definition variable.cpp:17
Variable(const int id_, const double desiredPos_, const double weight_)
Definition variable.h:38
Constraints in
Definition variable.h:35
bool visited
Definition variable.h:34
double position() const
Definition variable.h:46
char * toString()
Definition block.h:26
std::vector< Constraint * > Constraints
Definition variable.h:24