TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::Geometry Class Reference

Contains geometric information about a Model. More...

#include <Geometry.h>

Inheritance diagram for TBTK::Geometry:
TBTK::Serializable

Public Member Functions

 Geometry ()
 
 Geometry (const std::string &serialization, Mode mode)
 
virtual ~Geometry ()
 
void setCoordinate (const Index &index, const std::vector< double > &coordinate)
 
const std::vector< double > & getCoordinate (const Index &index) const
 
int getDimensions () const
 
void translate (const std::vector< double > &translation)
 
std::string serialize (Mode mode) const
 
- Public Member Functions inherited from TBTK::Serializable
template<>
std::string serialize (const bool &data, Mode mode)
 
template<>
std::string serialize (const double &data, Mode mode)
 
template<>
std::string serialize (const std::complex< double > &data, Mode mode)
 
template<>
std::string serialize (const int &data, Mode mode)
 
template<>
std::string serialize (const unsigned int &data, Mode mode)
 
template<>
std::string serialize (const SpinMatrix &data, Mode mode)
 
template<>
std::string serialize (const Statistics &data, Mode mode)
 
template<>
std::string serialize (const std::vector< std::complex< double >> &data, Mode mode)
 
template<>
int deserialize (const std::string &serialization, Mode mode)
 

Friends

class FileReader
 

Additional Inherited Members

- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 
- Static Public Member Functions inherited from TBTK::Serializable
static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 
static std::string extractComponent (const std::string &serialization, const std::string &containerID, const std::string &componentID, const std::string &componentName, Mode mode)
 
- Static Protected Member Functions inherited from TBTK::Serializable
static bool validate (const std::string &serialization, const std::string &id, Mode mode)
 
static std::string getContent (const std::string &serialization, Mode mode)
 
static std::vector< std::string > split (const std::string &content, Mode mode)
 
template<typename DataType >
static std::enable_if<!std::is_pointer< DataType >::value, std::string >::type serialize (const DataType &data, Mode mode)
 
template<typename DataType >
static std::enable_if< std::is_pointer< DataType >::value, std::string >::type serialize (const DataType &data, Mode mode)
 
template<typename DataType >
static DataType deserialize (const std::string &serialization, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Detailed Description

Contains geometric information about a Model.

Constructor & Destructor Documentation

◆ Geometry() [1/2]

TBTK::Geometry::Geometry ( )

Constructs a Geomerty.

◆ Geometry() [2/2]

TBTK::Geometry::Geometry ( const std::string &  serialization,
Mode  mode 
)

Constructs a Geometry from a serialization string.

Parameters
serializationSerialization string from which to construct the Geometry.
modeMode with which the string has been serialized.

◆ ~Geometry()

virtual TBTK::Geometry::~Geometry ( )
virtual

Destructor.

Member Function Documentation

◆ getCoordinate()

const std::vector< double > & TBTK::Geometry::getCoordinate ( const Index index) const
inline

Get the coordinate for a given Index.

Parameters
indexThe Index to get the coordinate for.
Returns
The coordinate for the given Index.

◆ getDimensions()

int TBTK::Geometry::getDimensions ( ) const
inline

Get the number of dimensions of the space. If no coordinate has been set yet, the returned value is -1.

Returns
The number of dimensions.

◆ serialize()

std::string TBTK::Geometry::serialize ( Mode  mode) const
virtual

◆ setCoordinate()

void TBTK::Geometry::setCoordinate ( const Index index,
const std::vector< double > &  coordinate 
)
inline

Set a coordinate for an index. The first added coordinate can have arbitrary number of dimensions, while the rest has to agree with the number of dimensions of the first.

Parameters
indexThe Index for which to set the coordinate.
coordinateThe coordinate.

◆ translate()

void TBTK::Geometry::translate ( const std::vector< double > &  translation)

Translate all coordinates.

Parameters
translationThe translation to be applied.

Friends And Related Function Documentation

◆ FileReader

friend class FileReader
friend

FileReader is a friend class to allow it to write Geometry data.


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