Input & Output

Progress Bar

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

Public Functions

void setProgress(int index, double progress)

Set the Progress object.

Parameters:
  • index –

  • progress –

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

NumPy

class NumPy : public sbody::Writer

Public Functions

NumPy(std::filesystem::path file_path, std::vector<std::size_t> dimension)

Construct a new NumPy object.

Parameters:
  • file_path –

  • dimension –

virtual void save(const double data[], uint length)

Save the data.

Parameters:
  • data – Data to be saved

  • length – Length of the data

virtual void save(double datum)

Save the data.

Parameters:

datum – Data to be saved

Comma-Separated Values

class CSV : public sbody::Writer

Public Functions

CSV(std::filesystem::path file_path, char separator = ',')

Construct a new CSV object.

Parameters:
  • file_path –

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

virtual void save(const double data[], uint length) override

Save the data.

Parameters:
  • data – Data to be saved

  • length – Length of the data

virtual void save(const double datum) override

Save the data.

Parameters:

datum – Data to be saved