1#ifndef SCIFIR_UNITS_SPECIAL_UNITS_SIZE_ND_HPP_INCLUDED
2#define SCIFIR_UNITS_SPECIAL_UNITS_SIZE_ND_HPP_INCLUDED
4#include "../derived_units/space_units.hpp"
5#include "../util/types.hpp"
7#include "boost/algorithm/string.hpp"
16 template<
typename T = length>
59 widths = std::move(x.widths);
82 if (
get_nd() == x.get_nd())
85 for (
unsigned int i = 0;
i <
widths.size();
i++)
101 if (
get_nd() == x.get_nd())
104 for (
unsigned int i = 0;
i <
widths.size();
i++)
120 if (
get_nd() == x.get_nd())
122 for (
unsigned int i = 0;
i <
widths.size();
i++)
132 if (
get_nd() == x.get_nd())
134 for (
unsigned int i = 0;
i <
widths.size();
i++)
145 for (
unsigned int i = 0;
i <
widths.size();
i++)
160 for (
unsigned int i = 1;
i <
widths.size();
i++)
226 widths = std::move(x.widths);
248 if (
get_nd() == x.get_nd())
265 if (
get_nd() == x.get_nd())
282 if (
get_nd() == x.get_nd())
284 for (
unsigned int i = 0;
i <
widths.size();
i++)
293 if (
get_nd() == x.get_nd())
295 for (
unsigned int i = 0;
i <
widths.size();
i++)
305 for (
unsigned int i = 0;
i <
widths.size();
i++)
320 for (
unsigned int i = 1;
i <
widths.size();
i++)
355 string to_string(
const size_nd<float>& x);
361 if (x.get_nd() == y.get_nd())
363 for (
int i = 0; i < x.widths.size(); i++)
365 if (x.widths[i] != y.widths[i])
394 return !(x == init_size_nd);
407 return !(init_size_nd == x);
419 return x + to_string(y);
425 return to_string(x) + y;
431 return os << to_string(x);
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
size_nd(const vector< float > &new_widths)
size_nd(const vector< string > &new_widths)
size_nd(const string &init_size_nd)
void initialize_from_string(const string &init_size_nd)
bool is_nd(unsigned int i) const
size_nd(size_nd< float > &&x)
float get_volume_nd() const
size_nd(const size_nd< float > &x)
size_nd(size_nd< T > &&x)
void operator-=(const size_nd< U > &x)
size_nd(const string &init_size_nd)
size_nd(const vector< string > &new_widths)
size_nd< T > operator-(const size_nd< U > &x) const
size_nd(const size_nd< T > &x)
size_nd< T > operator+(const size_nd< U > &x) const
void operator+=(const size_nd< U > &x)
size_nd< T > & operator=(const size_nd< T > &x)
size_nd(const vector< U > &new_widths)
scalar_unit get_volume_nd() const
void initialize_from_string(const string &init_size_nd)
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
string display_float(const float &value, int number_of_decimals)
vector< dimension > create_dimensions(string init_dimensions)
Creates the dimensions from an initialization string of dimensions.
void operator+=(string &x, const scifir::size_nd< T > &y)
ostream & operator<<(ostream &os, const scifir::size_nd< T > &x)
istream & operator>>(istream &is, scifir::size_nd< T > &x)
string operator+(const string &x, const scifir::size_nd< T > &y)
bool operator==(const scifir::size_nd< T > &x, const scifir::size_nd< T > &y)
bool operator!=(const scifir::size_nd< T > &x, const scifir::size_nd< T > &y)