Input & Output

Progress Bar

class ProgressBar : public indicators::DynamicProgress<indicators::BlockProgressBar>

Public Functions

inline void SetComplete(int index, std::string prefix)

Set a specific progress bar as completed.

Parameters:
  • index – index of the progress bar in the container

  • prefix – prefix shown in the completed progress bar

File

class File

Subclassed by SBody::CSV, SBody::NumPy

Public Functions

inline virtual ~File()

Destroy the file object.

virtual int Save(const std::vector<double> &data) = 0

Save the data.

Parameters:

data

Returns:

int

virtual int Save(const double data[], uint length) = 0

Save the data.

Parameters:
  • data – Data to be saved

  • length – Length of the data

Returns:

int

NumPy

class NumPy : public SBody::File

Public Functions

inline NumPy(std::string file_name, std::vector<int> dimension)

Construct a new NumPy object.

Parameters:
  • file_name

  • dimension

inline virtual int Save(const std::vector<double> &data)

Save the data.

Parameters:

data

Returns:

int

Comma-Separated Values

class CSV : public SBody::File

Public Functions

inline CSV(std::string file_name, char separator = ',')

Construct a new CSV object.

Parameters:
  • file_name

  • separator – Separator of the file. If separator == \t’`, the file would be a Tab-Separated Values (TSV).

inline virtual int Save(const std::vector<double> &data)

Save the data.

Parameters:

data

Returns:

int