|
2 Dimensional Ising Model
Simulate the change in energy and magnetization in a ferro magnet
|
Implementation of the utils. More...
#include "utils.hpp"Go to the source code of this file.
Functions | |
| std::string | utils::scientific_format (double d, int width=20, int prec=10) |
| Turns a double into a string written in scientific format. | |
| std::string | utils::scientific_format (const std::vector< double > &v, int width=20, int prec=10) |
| Turns a vector of doubles into a string written in scientific format. | |
| bool | utils::mkpath (std::string path, int mode=0777) |
| Make path given. | |
| std::string | utils::dirname (const std::string &path) |
| Get the directory name of the path. | |
| std::string utils::dirname | ( | const std::string & | path | ) |
| bool utils::mkpath | ( | std::string | path, |
| int | mode = 0777 |
||
| ) |
| std::string utils::scientific_format | ( | const std::vector< double > & | v, |
| int | width = 20, |
||
| int | prec = 10 |
||
| ) |
Turns a vector of doubles into a string written in scientific format.
The code is stolen from https://github.com/anderkve/FYS3150.
| v | The vector to stringify |
| width | The reserved width of the string |
| prec | The precision of the stringified number |
| std::string utils::scientific_format | ( | double | d, |
| int | width = 20, |
||
| int | prec = 10 |
||
| ) |
Turns a double into a string written in scientific format.
The code is stolen from https://github.com/anderkve/FYS3150.
| d | The number to stringify |
| width | The reserved width of the string |
| prec | The precision of the stringified number |