|
| time_duration () |
|
| time_duration (const scalar_unit &) |
|
| time_duration (scalar_unit &&) |
|
| time_duration (float new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| time_duration (double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| time_duration (long double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| time_duration (int new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| time_duration (float new_value, const string &init_dimensions) |
|
| time_duration (double new_value, const string &init_dimensions) |
|
| time_duration (long double new_value, const string &init_dimensions) |
|
| time_duration (int new_value, const string &init_dimensions) |
|
| time_duration (float new_value, const vector< dimension > &new_dimensions) |
|
| time_duration (double new_value, const vector< dimension > &new_dimensions) |
|
| time_duration (long double new_value, const vector< dimension > &new_dimensions) |
|
| time_duration (int new_value, const vector< dimension > &new_dimensions) |
|
| time_duration (const string &init_time) |
|
| operator std::chrono::seconds () const |
|
int | get_years () const |
|
int | get_months () const |
|
int | get_weeks () const |
|
int | get_days () const |
|
int | get_hours () const |
|
int | get_minutes () const |
|
int | get_seconds () const |
|
string | get_finish_date () const |
|
string | display_as_time () const |
|
string | display_years () const |
|
string | display_months () const |
|
string | display_weeks () const |
|
string | display_days () const |
|
string | display_hours () const |
|
string | display_minutes () const |
|
string | display_seconds () const |
|
template<typename T1 , typename T2 > |
scifir::time_duration & | operator+= (chrono::duration< T1, T2 > x) |
|
template<typename T1 , typename T2 > |
scifir::time_duration & | operator-= (chrono::duration< T1, T2 > x) |
|
void | operator+= (scalar_unit x) |
| Addition operator, it adds a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't sums to the value.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator+= (T y) |
| Addition operator, it adds the numeric type to the value, independent of the dimensions.
|
|
void | operator-= (scalar_unit x) |
| Substraction operator, it substracts a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't substracts to the value.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator-= (T y) |
| Substraction operator, it substracts the numeric type to the value, independent of the dimensions.
|
|
| scalar_unit () |
| Default constructor, the value is 0 and the dimensions are empty.
|
|
| scalar_unit (const scalar_unit &x) |
| Copy constructor, copies the value and the dimensions.
|
|
| scalar_unit (scalar_unit &&x) |
| Move constructor, moves the value and the dimensions.
|
|
| scalar_unit (float new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| scalar_unit (double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| scalar_unit (long double new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| scalar_unit (int new_value, dimension::type new_dimension, prefix::type new_prefix, dimension::position new_position=dimension::NUMERATOR) |
|
| scalar_unit (float new_value, const string &init_dimensions) |
| Creates a new scalar_unit with the value and with the dimensions specified in the string.
|
|
| scalar_unit (double new_value, const string &init_dimensions) |
| Creates a new scalar_unit, the double is casted to a float.
|
|
| scalar_unit (long double new_value, const string &init_dimensions) |
| Creates a new scalar_unit, the long double is casted to a float.
|
|
| scalar_unit (int new_value, const string &init_dimensions) |
| Creates a new scalar_unit, the int is casted to a float.
|
|
| scalar_unit (float new_value, const vector< dimension > &new_dimensions) |
| Creates a new scalar_unit with the value given and copying the dimensions.
|
|
| scalar_unit (double new_value, const vector< dimension > &new_dimensions) |
| Creates a new scalar_unit, the double is casted to a float, the dimensions are copied.
|
|
| scalar_unit (long double new_value, const vector< dimension > &new_dimensions) |
| Creates a new scalar_unit, the long double is casted to a float, the dimensions are copied.
|
|
| scalar_unit (int new_value, const vector< dimension > &new_dimensions) |
| Creates a new scalar_unit, the int is casted to a float, the dimensions are copied.
|
|
| scalar_unit (const string &init_scalar) |
| Creates a new scalar_unit, the initialization string specifies both the value and the dimensions.
|
|
scalar_unit & | operator= (const scalar_unit &x) |
| Copy assignment, it assigns a copy of the scalar_unit.
|
|
scalar_unit & | operator= (scalar_unit &&x) |
| Move assignment, it moves the scalar_unit.
|
|
scalar_unit & | operator= (const string &init_scalar) |
| Assignment with an initialization string, the value and the dimensions are both specified.
|
|
| operator float () const |
| Cast the scalar_unit to their float equivalent, it discards the dimensions and copies the value to a float.
|
|
bool | operator== (scalar_unit x) const |
| Comparison operator, two scalar_unit classes are considered equivalent if they have the same value given the same dimensions.
|
|
scalar_unit | operator+ (scalar_unit x) const |
| Addition operator, it sums two scalar_unit classes, their dimensions are changed to be equal first. If the basic dimensions are different, it returns an empty scalar_unit class.
|
|
scalar_unit | operator- (scalar_unit x) const |
| Substraction operator, it substracts one scalar_unit from the other, their dimensions are changed to be equal first. If the basic dimensions are different, it returns an empty scalar_unit class.
|
|
scalar_unit | operator* (scalar_unit x) const |
| Multiplication operator, it multiplies two scalar_unit classes, their dimensions are also multiplied.
|
|
scalar_unit | operator/ (scalar_unit x) const |
| Division operator, it divides one scalar_unit class with the other, their dimensions are also divided.
|
|
scalar_unit | operator^ (const scalar_unit &x) const |
| Power operator, it powers a scalar_unit class with another, if that second scalar_unit class, which is the exponent, as empty dimensions. If the exponent doesn't has empty dimensions it returns an empty scalar_unit class.
|
|
void | operator+= (scalar_unit x) |
| Addition operator, it adds a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't sums to the value.
|
|
void | operator-= (scalar_unit x) |
| Substraction operator, it substracts a scalar_unit class to another, by converting their dimensions to be equal first. If their basic dimensions are different, it doesn't substracts to the value.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
scalar_unit | operator+ (T y) const |
| Addition operator, it sums the numeric type to the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
scalar_unit | operator- (T y) const |
| Substraction operator, it substracts the numeric type to the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
scalar_unit | operator* (T y) const |
| Multiplication operator, it multiplies the numeric type with the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
scalar_unit | operator/ (T y) const |
| Division operator, it divides the value with the numeric type, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<is_integer_number<T>::value>::type> |
scalar_unit | operator^ (T y) const |
| Power operator, it powers the value with the numeric type, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator+= (T y) |
| Addition operator, it adds the numeric type to the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator-= (T y) |
| Substraction operator, it substracts the numeric type to the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator*= (T y) |
| Multiplication operator, it multiplies the numeric type to the value, independent of the dimensions.
|
|
template<typename T , typename = typename enable_if<scifir::is_number<T>::value>::type> |
void | operator/= (T y) |
| Division operator, it divides the numeric type to the value, independent of the dimensions.
|
|
scalar_unit & | operator++ () |
| Increment operator, it increases the value by one.
|
|
scalar_unit & | operator++ (int) |
| Increment operator, it increases the value by one.
|
|
scalar_unit & | operator-- () |
| Decrement operator, it decreases the value by one.
|
|
scalar_unit & | operator-- (int) |
| Decrement operator, it decreases the value by one.
|
|
void | change_dimensions (const string &init_dimensions) |
| Changes the dimensions to the dimensions specified by the initialization string of dimensions.
|
|
void | change_dimensions (const scalar_unit &x) |
| Changes the dimensions to the same dimensions of the scalar_unit.
|
|
bool | has_dimensions (const string &init_dimensions) const |
| Checks if the basic dimensions are the same as the initialization string of dimensions.
|
|
bool | has_dimensions (const vector< dimension > &x_dimensions) const |
| Checks if the basic dimensions are the same as some set of dimensions.
|
|
bool | has_dimensions (const scalar_unit &x) const |
| Checks if the basic dimensions are the same as other scalar_unit.
|
|
bool | has_empty_dimensions () const |
| Checks if there aren't base dimensions.
|
|
bool | is_dimensionless () const |
| Returns true if there aren't dimensions or if all dimensions are dimensionless.
|
|
bool | has_simple_dimensions () const |
| Returns true if there's only a simple dimension.
|
|
bool | has_single_dimensions () const |
| Returns true if there's only one dimension, which can be simple or composite.
|
|
bool | has_composite_dimensions () const |
| Returns true is there's more than one simple dimension.
|
|
string | display_dimensions () const |
| Generates an string of the dimensions of the scalar_unit, with the same format as the initialization string of dimensions.
|
|
dimension::type | get_single_dimension_type () const |
| Returns the dimension::type if there's only one dimension, returns dimension::NONE if there's more than one dimension or if the dimensions are empty.
|
|
vector< dimension > | get_base_dimensions () const |
| Generates a set of the base dimensions of the dimensions of the scalar_unit.
|
|
const vector< dimension > & | get_dimensions () const |
| Read-only getter of the dimensions.
|
|
const float & | get_value () const |
| Read-only getter of the value.
|
|
string | display (int number_of_decimals=2, bool with_brackets=false, bool use_close_prefix=false) const |
| Generates a string representation of the scalar_unit, with the value and the dimensions. The dimensions can be enclosed by brackets, and the value can be set to have the closest prefix.
|
|
string | base_display (int number_of_decimals=2, bool with_brackets=false, bool use_close_prefix=false) const |
| Generates a string representation of the scalar_unit, with its dimensions converted to their base counterpart.
|
|
string | custom_display (const string &init_dimensions, int number_of_decimals=2, bool with_brackets=false) const |
| Generates a string representation of the scalar_unit, with the dimensions changed to any set of dimensions, specified by an initialization string of dimensions.
|
|
string | to_latex (const string &init_dimensions, int number_of_decimals=2, bool with_brackets=false) const |
|