Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Attributes | Friends
drawer::Graph Class Reference

Public Member Functions

 Graph (size_t N)
 
 Graph (size_t N, std::vector< std::pair< int, int >> const &init)
 
 Graph (Graph const &other)=default
 
 Graph (Graph &&other)=default
 
Graphoperator= (Graph const &other)=default
 
Graphoperator= (Graph &&other)=default
 
void reinit ()
 
void clear ()
 
size_t size () const
 
double & getPosition (size_t pos)
 
double getPosition (size_t pos) const
 
std::vector< Point > & getNodes ()
 
std::vector< Point > const & getNodes () const
 
Matrix< int > & getAdjacency ()
 
Matrix< int > const & getAdjacency () const
 
bool isSame (drawer::Graph const &other) const
 
bool isSame (drawer::Graph const &other, std::map< size_t, size_t > &mapping) const
 
void addEdge (int left, int right)
 
void setSide (int pos, int t_side)
 
double xMin () const
 
double xMax () const
 
double yMin () const
 
double yMax () const
 
double zMin () const
 
double zMax () const
 
double computeEnergy (bool verbose=false)
 
int minimize (int mode=0)
 
int minimize2D ()
 
void project (bool only2DRotation=false, bool keepExternal=false)
 
void center ()
 
void centerMargin ()
 
void flip (int axis=-1)
 
void tryFlip ()
 
void scale (double s)
 
void rotate (double theta)
 
void move (double x, double y)
 
Point getCenter () const
 
void placeTopLeft ()
 
void write (std::string const &fileName) const
 
void addNode (double x, double y)
 
void deleteNode (size_t i)
 
 Graph (size_t N)
 
 Graph (size_t N, std::vector< std::pair< int, int >> const &init)
 
 Graph (Graph const &other)=default
 
 Graph (Graph &&other)=default
 
Graphoperator= (Graph const &other)=default
 
Graphoperator= (Graph &&other)=default
 
void reinit ()
 
void clear ()
 
size_t size () const
 
double & getPosition (size_t pos)
 
double getPosition (size_t pos) const
 
std::vector< Point > & getNodes ()
 
std::vector< Point > const & getNodes () const
 
Matrix< int > & getAdjacency ()
 
Matrix< int > const & getAdjacency () const
 
bool isSame (drawer::Graph const &other) const
 
bool isSame (drawer::Graph const &other, std::map< size_t, size_t > &mapping) const
 
void addEdge (int left, int right)
 
void setSide (int pos, int t_side)
 
double xMin () const
 
double xMax () const
 
double yMin () const
 
double yMax () const
 
double zMin () const
 
double zMax () const
 
double computeEnergy (bool verbose=false)
 
int minimize (int mode=0)
 
int minimize2D ()
 
void project (bool only2DRotation=false, bool keepExternal=false)
 
void center ()
 
void centerMargin ()
 
void flip (int axis=-1)
 
void tryFlip ()
 
void scale (double s)
 
void rotate (double theta)
 
void move (double x, double y)
 
Point getCenter () const
 
void placeTopLeft ()
 
void write (std::string const &fileName) const
 
void addNode (double x, double y)
 
void deleteNode (size_t i)
 

Static Public Attributes

static bool writeResToFile = false
 
static std::string fileNameBegin = "graph/begin"
 
static std::string fileName3DRes = "graph/3D"
 
static std::string fileNameProject = "graph/project"
 
static std::string fileName2DRes = "graph/2D"
 
static constexpr double externalLegSizeRation = 0.70
 
static constexpr double absAngleMultiple = 4
 
static constexpr double decouplingDistance = -1
 
static constexpr double defaultNodeSizeFactor = 16.50
 
static constexpr double defaultAngleFactor = 6.50
 
static constexpr double defaultExternalLayout = 0.95
 
static constexpr double defaultExternalRepulsion = 2.00
 
static constexpr double defaultLegsRepulsion = 4.00
 
static constexpr double defaultNodeLegsRepulsion = 3.00
 
static constexpr double defaultExtensionFactor = 1.00
 
static constexpr double defaultAbsAngleFactor = 0.00
 
static constexpr double default_3DFactor = 0.10
 
static constexpr double defaultCrossEnergyValue = 1.00
 
static constexpr double defaultSpecialAnglesValue = 6.50
 
static bool enable3D = true
 
static double nodeSizeFactor = defaultNodeSizeFactor
 
static double angleFactor = defaultAngleFactor
 
static double externalRepulsion = defaultExternalRepulsion
 
static double externalLayout = defaultExternalLayout
 
static double legsRepulsion = defaultLegsRepulsion
 
static double nodeLegsRepulsion = defaultNodeLegsRepulsion
 
static double extensionFactor = defaultExtensionFactor
 
static double absAngleFactor = 0
 
static double _3DFactor = default_3DFactor
 
static double specialAnglesValue = 0
 

Protected Member Functions

gsl_vector * allocGslVector ()
 
size_t getNVar ()
 
void fillGslVector (gsl_vector *x)
 
void readGslVector (gsl_vector const *x)
 
void initExternalDistance ()
 
void gatherExternalNodes ()
 
bool tryPermutation (int order=1, double energy=-1)
 
void initEnergies ()
 
gsl_vector * allocGslVector ()
 
size_t getNVar ()
 
void fillGslVector (gsl_vector *x)
 
void readGslVector (gsl_vector const *x)
 
void initExternalDistance ()
 
void gatherExternalNodes ()
 
bool tryPermutation (int order=1, double energy=-1)
 
void initEnergies ()
 

Static Protected Member Functions

static void initPoint (Point &p, size_t N)
 
static void initPoint (Point &p, size_t N)
 

Private Attributes

size_t nInsertions
 
std::vector< Pointnodes
 
std::vector< int > loop
 
std::vector< int > external
 
std::vector< int > side
 
Matrix< int > adjacency
 
std::vector< Energyenergies
 

Friends

class LatexLinker
 
std::ostream & operator<< (std::ostream &out, Graph const &graph)
 
std::ostream & operator<< (std::ostream &out, Graph const &graph)
 

The documentation for this class was generated from the following files: