scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
coordinates_1d.hpp File Reference
#include "../units/base_units.hpp"
#include "../derived_units/physics_units.hpp"
#include "../util/types.hpp"
#include <cmath>
#include <iostream>
#include <string>
Include dependency graph for coordinates_1d.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::coordinates_1d< T >
 
class  scifir::coordinates_1d< float >
 

Namespaces

namespace  scifir
 The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
 

Functions

template<typename T >
string scifir::to_string (const coordinates_1d< T > &x)
 
string scifir::to_string (const coordinates_1d< float > &x)
 
template<typename T , typename U >
T scifir::distance (const coordinates_1d< T > &x, const coordinates_1d< U > &y)
 
float scifir::distance (const coordinates_1d< float > &x, const coordinates_1d< float > &y)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_1d< T > &x, const scifir::coordinates_1d< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_1d< T > &x, const scifir::coordinates_1d< U > &y)
 
template<typename T >
bool operator== (const scifir::coordinates_1d< T > &x, const string &init_coordinates_1d)
 
template<typename T >
bool operator!= (const scifir::coordinates_1d< T > &x, const string &init_coordinates_1d)
 
template<typename T >
bool operator== (const string &init_coordinates_1d, const scifir::coordinates_1d< T > &x)
 
template<typename T >
bool operator!= (const string &init_coordinates_1d, const scifir::coordinates_1d< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::coordinates_1d< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::coordinates_1d< T > &y)
 
template<typename T >
string operator+ (const scifir::coordinates_1d< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::coordinates_1d< T > &x)
 
ostream & operator<< (ostream &os, const scifir::coordinates_1d< float > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::coordinates_1d< T > &x)
 

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename U >
bool operator!= ( const scifir::coordinates_1d< T > &  x,
const scifir::coordinates_1d< U > &  y 
)

Definition at line 213 of file coordinates_1d.hpp.

214{
215 return !(x == y);
216}

◆ operator!=() [2/3]

template<typename T >
bool operator!= ( const scifir::coordinates_1d< T > &  x,
const string &  init_coordinates_1d 
)

Definition at line 226 of file coordinates_1d.hpp.

227{
228 return !(x == init_coordinates_1d);
229}

◆ operator!=() [3/3]

template<typename T >
bool operator!= ( const string &  init_coordinates_1d,
const scifir::coordinates_1d< T > &  x 
)

Definition at line 239 of file coordinates_1d.hpp.

240{
241 return !(init_coordinates_1d == x);
242}

◆ operator+() [1/2]

template<typename T >
string operator+ ( const scifir::coordinates_1d< T > &  x,
const string &  y 
)

Definition at line 257 of file coordinates_1d.hpp.

258{
259 return to_string(x) + y;
260}
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
Definition aid.cpp:582

◆ operator+() [2/2]

template<typename T >
string operator+ ( const string &  x,
const scifir::coordinates_1d< T > &  y 
)

Definition at line 251 of file coordinates_1d.hpp.

252{
253 return x + to_string(y);
254}

◆ operator+=()

template<typename T >
void operator+= ( string &  x,
const scifir::coordinates_1d< T > &  y 
)

Definition at line 245 of file coordinates_1d.hpp.

246{
247 x += to_string(y);
248}

◆ operator<<() [1/2]

ostream & operator<< ( ostream &  os,
const scifir::coordinates_1d< float > &  x 
)

Definition at line 19 of file coordinates_1d.cpp.

20{
21 return os << scifir::to_string(x);
22}

◆ operator<<() [2/2]

template<typename T >
ostream & operator<< ( ostream &  os,
const scifir::coordinates_1d< T > &  x 
)

Definition at line 263 of file coordinates_1d.hpp.

264{
265 return os << to_string(x);
266}

◆ operator==() [1/3]

template<typename T , typename U >
bool operator== ( const scifir::coordinates_1d< T > &  x,
const scifir::coordinates_1d< U > &  y 
)

Definition at line 200 of file coordinates_1d.hpp.

201{
202 if (x.x == y.x)
203 {
204 return true;
205 }
206 else
207 {
208 return false;
209 }
210}

◆ operator==() [2/3]

template<typename T >
bool operator== ( const scifir::coordinates_1d< T > &  x,
const string &  init_coordinates_1d 
)

Definition at line 219 of file coordinates_1d.hpp.

220{
221 scifir::coordinates_1d<T> y(init_coordinates_1d);
222 return (x == y);
223}

◆ operator==() [3/3]

template<typename T >
bool operator== ( const string &  init_coordinates_1d,
const scifir::coordinates_1d< T > &  x 
)

Definition at line 232 of file coordinates_1d.hpp.

233{
234 scifir::coordinates_1d<T> y(init_coordinates_1d);
235 return (x == y);
236}

◆ operator>>()

template<typename T >
istream & operator>> ( istream &  is,
scifir::coordinates_1d< T > &  x 
)

Definition at line 271 of file coordinates_1d.hpp.

272{
273 char a[256];
274 is.getline(a, 256);
275 string b(a);
276 boost::trim(b);
278 return is;
279}