18#include "../settings/settings.hpp"
32constexpr inline auto abs_sqrt(
auto x) {
return std::sqrt(std::abs(x)); }
34constexpr inline auto sqr(
auto x) {
return x * x; }
35constexpr inline auto cube(
auto x) {
return x * x * x; }
41 std::ofstream out_file(save_path, std::ios_base::out);
43 for (
const auto &state : vec) {
44 for (
size_t i{ 0 }; i < state.size(); i++) {
45 if (i != 0) out_file <<
',';
60std::vector<double>
linstep(
double x_min,
double x_step,
int Nstep);
61std::vector<double>
logstep(
double x_min,
double x_step,
int Nstep);
69constexpr std::array<double, N>
linspace(
double x1,
double x2)
71 std::array<double, N>
out;
77 dx = (x2 - x1) /
static_cast<double>(N - 1);
79 for (
size_t n{ 0 }; n < N; n++) {
80 out[N - 1 - n] = x2 - n * dx;
92 int Nstep =
static_cast<int>((x_max - x_min) / x_step) + 1;
103 auto fun = [](
double x_min,
double x_step,
int i) {
return x_min * std::pow(x_step, i); };
115 return FixedData(x1, (x2 - x1) /
static_cast<double>(N - 1), N);
118inline std::vector<double>
linspace(
double x1,
double x2,
int N)
121 std::vector<double>
out(N);
127 dx = (x2 - x1) /
static_cast<double>(N - 1);
129 for (
int n{ 0 }; n < N; n++) {
130 out[N - 1 - n] = x2 - n * dx;
Definition: FixedData.hpp:92
Definition: predicate_functions.hpp:12
Slide namespace contains all the types, classes, and functions for the simulation framework.
Definition: Cell.hpp:27
constexpr std::array< double, N > linspace(double x1, double x2)
Definition: util.hpp:69
FixedData< double > linspace_fix(double x1, double x2, int N)
Definition: util.hpp:108
std::vector< double > logstep(double x_min, double x_step, int Nstep)
FixedData< double > linstep_fix(double x_min, double x_step, int Nstep)
Definition: util.hpp:96
std::vector< double > linstep(double x_min, double x_step, int Nstep)
constexpr auto cube(auto x)
Definition: util.hpp:35
void output_printer(const std::vector< T > &vec, const auto &save_path)
Definition: util.hpp:39
constexpr auto abs_sqrt(auto x)
Definition: util.hpp:32
constexpr auto sqr(auto x)
Definition: util.hpp:34
FixedData< double > range_fix(double x_min, double x_max, double x_step)
Definition: util.hpp:90
FixedData< double > logstep_fix(double x_min, double x_step, int Nstep)
Definition: util.hpp:101
out
Definition: run_test.m:22