votca 2024-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
votca::tools::Table Class Reference

class to store tables like rdfs, tabulated potentials, etc More...

#include <table.h>

Collaboration diagram for votca::tools::Table:
Collaboration graph
[legend]

Public Member Functions

void clear ()
 
void GenerateGridSpacing (double min, double max, double spacing)
 
void resize (Index N)
 
Index size () const
 
double & x (Index i)
 
double & y (Index i)
 
const double & x (Index i) const
 
const double & y (Index i) const
 
char & flags (Index i)
 
double & yerr (Index i)
 
void set (const Index &i, const double &x, const double &y)
 
void set (const Index &i, const double &x, const double &y, const char &flags)
 
void set (const Index &i, const double &x, const double &y, const char &flags, const double &yerr)
 
void set_comment (const std::string comment)
 
void Load (std::string filename)
 
void Save (std::string filename) const
 
void Smooth (Index Nsmooth)
 
bool GetHasYErr ()
 
void SetHasYErr (bool has_yerr)
 
double getMaxY () const
 Gets the maximum value in the y column.
 
double getMinY () const
 Gets the minimum value in the y column.
 
double getMaxX () const
 Gets the maximum value in the x column.
 
double getMinX () const
 Gets the minimum value in the x column.
 
Eigen::VectorXd & x ()
 
Eigen::VectorXd & y ()
 
std::vector< char > & flags ()
 
Eigen::VectorXd & yerr ()
 
void push_back (double x, double y, char flags=' ')
 
const std::string & getErrorDetails ()
 
void setErrorDetails (std::string str)
 

Private Attributes

Eigen::VectorXd x_
 
Eigen::VectorXd y_
 
std::vector< char > flags_
 
Eigen::VectorXd yerr_
 
std::string error_details_ = ""
 
bool has_yerr_ = false
 
bool has_comment_ = false
 
std::string comment_line_
 

Friends

std::ostream & operator<< (std::ostream &out, const Table &t)
 
std::istream & operator>> (std::istream &in, Table &t)
 

Detailed Description

class to store tables like rdfs, tabulated potentials, etc

Definition at line 36 of file table.h.

Member Function Documentation

◆ clear()

void votca::tools::Table::clear ( void  )

Definition at line 77 of file table.cc.

◆ flags() [1/2]

std::vector< char > & votca::tools::Table::flags ( )
inline

Definition at line 106 of file table.h.

◆ flags() [2/2]

char & votca::tools::Table::flags ( Index  i)
inline

Definition at line 49 of file table.h.

◆ GenerateGridSpacing()

void votca::tools::Table::GenerateGridSpacing ( double  min,
double  max,
double  spacing 
)

Definition at line 180 of file table.cc.

◆ getErrorDetails()

const std::string & votca::tools::Table::getErrorDetails ( )
inline

Definition at line 111 of file table.h.

◆ GetHasYErr()

bool votca::tools::Table::GetHasYErr ( )
inline

Definition at line 80 of file table.h.

◆ getMaxX()

double votca::tools::Table::getMaxX ( ) const

Gets the maximum value in the x column.

Returns
- max value

Definition at line 88 of file table.cc.

◆ getMaxY()

double votca::tools::Table::getMaxY ( ) const

Gets the maximum value in the y column.

Returns
- max value

Definition at line 84 of file table.cc.

◆ getMinX()

double votca::tools::Table::getMinX ( ) const

Gets the minimum value in the x column.

Returns
- min value

Definition at line 90 of file table.cc.

◆ getMinY()

double votca::tools::Table::getMinY ( ) const

Gets the minimum value in the y column.

Returns
- min value

Definition at line 86 of file table.cc.

◆ Load()

void votca::tools::Table::Load ( std::string  filename)

Definition at line 47 of file table.cc.

◆ push_back()

void votca::tools::Table::push_back ( double  x,
double  y,
char  flags = ' ' 
)

Definition at line 235 of file table.cc.

◆ resize()

void votca::tools::Table::resize ( Index  N)

Definition at line 38 of file table.cc.

◆ Save()

void votca::tools::Table::Save ( std::string  filename) const

Definition at line 59 of file table.cc.

◆ set() [1/3]

void votca::tools::Table::set ( const Index i,
const double &  x,
const double &  y 
)
inline

Definition at line 52 of file table.h.

◆ set() [2/3]

void votca::tools::Table::set ( const Index i,
const double &  x,
const double &  y,
const char &  flags 
)
inline

Definition at line 56 of file table.h.

◆ set() [3/3]

void votca::tools::Table::set ( const Index i,
const double &  x,
const double &  y,
const char &  flags,
const double &  yerr 
)
inline

Definition at line 62 of file table.h.

◆ set_comment()

void votca::tools::Table::set_comment ( const std::string  comment)
inline

Definition at line 70 of file table.h.

◆ setErrorDetails()

void votca::tools::Table::setErrorDetails ( std::string  str)
inline

Definition at line 113 of file table.h.

◆ SetHasYErr()

void votca::tools::Table::SetHasYErr ( bool  has_yerr)
inline

Definition at line 81 of file table.h.

◆ size()

Index votca::tools::Table::size ( ) const
inline

Definition at line 42 of file table.h.

◆ Smooth()

void votca::tools::Table::Smooth ( Index  Nsmooth)

Definition at line 194 of file table.cc.

◆ x() [1/3]

Eigen::VectorXd & votca::tools::Table::x ( )
inline

Definition at line 104 of file table.h.

◆ x() [2/3]

double & votca::tools::Table::x ( Index  i)
inline

Definition at line 44 of file table.h.

◆ x() [3/3]

const double & votca::tools::Table::x ( Index  i) const
inline

Definition at line 47 of file table.h.

◆ y() [1/3]

Eigen::VectorXd & votca::tools::Table::y ( )
inline

Definition at line 105 of file table.h.

◆ y() [2/3]

double & votca::tools::Table::y ( Index  i)
inline

Definition at line 45 of file table.h.

◆ y() [3/3]

const double & votca::tools::Table::y ( Index  i) const
inline

Definition at line 48 of file table.h.

◆ yerr() [1/2]

Eigen::VectorXd & votca::tools::Table::yerr ( )
inline

Definition at line 107 of file table.h.

◆ yerr() [2/2]

double & votca::tools::Table::yerr ( Index  i)
inline

Definition at line 50 of file table.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const Table t 
)
friend

Definition at line 207 of file table.cc.

◆ operator>>

std::istream & operator>> ( std::istream &  in,
Table t 
)
friend

Definition at line 94 of file table.cc.

Member Data Documentation

◆ comment_line_

std::string votca::tools::Table::comment_line_
private

Definition at line 128 of file table.h.

◆ error_details_

std::string votca::tools::Table::error_details_ = ""
private

Definition at line 120 of file table.h.

◆ flags_

std::vector<char> votca::tools::Table::flags_
private

Definition at line 118 of file table.h.

◆ has_comment_

bool votca::tools::Table::has_comment_ = false
private

Definition at line 123 of file table.h.

◆ has_yerr_

bool votca::tools::Table::has_yerr_ = false
private

Definition at line 122 of file table.h.

◆ x_

Eigen::VectorXd votca::tools::Table::x_
private

Definition at line 116 of file table.h.

◆ y_

Eigen::VectorXd votca::tools::Table::y_
private

Definition at line 117 of file table.h.

◆ yerr_

Eigen::VectorXd votca::tools::Table::yerr_
private

Definition at line 119 of file table.h.


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