Input & Output

Progress Bar

class ProgressBar

Public Static Functions

static 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

Public Static Attributes

static bool display_

Display of progress bars.

static indicators::DynamicProgress<indicators::BlockProgressBar> bars_

Progress bar container object.

File

class File

Subclassed by SBody::CSV, SBody::NumPy

Public Functions

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

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

Construct a new NumPy object.

Parameters:
  • file_name

  • dimension

~NumPy()

Destroy the NumPy object.

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

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).

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

Save the data.

Parameters:

data

Returns:

int