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_nd.hpp File Reference
#include "../derived_units/physics_units.hpp"
#include "../units/base_units.hpp"
#include "../util/types.hpp"
#include "./coordinates_2d.hpp"
#include "./coordinates_3d.hpp"
#include <iostream>
#include <string>
#include <vector>
Include dependency graph for coordinates_nd.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  scifir::coordinates_nd< T >
 
class  scifir::coordinates_nd< 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_nd< T > &x)
 
string scifir::to_string (const coordinates_nd< float > &x)
 
template<typename T , typename U >
T scifir::distance (const coordinates_nd< T > &x, const coordinates_nd< U > &y)
 
float scifir::distance (const coordinates_nd< float > &x, const coordinates_nd< float > &y)
 
template<typename T , typename U >
bool operator== (const scifir::coordinates_nd< T > &x, const scifir::coordinates_nd< U > &y)
 
template<typename T , typename U >
bool operator!= (const scifir::coordinates_nd< T > &x, const scifir::coordinates_nd< U > &y)
 
template<typename T >
bool operator== (const scifir::coordinates_nd< T > &x, const string &init_coordinates_nd)
 
template<typename T >
bool operator!= (const scifir::coordinates_nd< T > &x, const string &init_coordinates_nd)
 
template<typename T >
bool operator== (const string &init_coordinates_nd, const scifir::coordinates_nd< T > &x)
 
template<typename T >
bool operator!= (const string &init_coordinates_nd, const scifir::coordinates_nd< T > &x)
 
template<typename T >
void operator+= (string &x, const scifir::coordinates_nd< T > &y)
 
template<typename T >
string operator+ (const string &x, const scifir::coordinates_nd< T > &y)
 
template<typename T >
string operator+ (const scifir::coordinates_nd< T > &x, const string &y)
 
template<typename T >
ostream & operator<< (ostream &os, const scifir::coordinates_nd< T > &x)
 
ostream & operator<< (ostream &os, const scifir::coordinates_nd< float > &x)
 
template<typename T >
istream & operator>> (istream &is, scifir::coordinates_nd< T > &x)
 

Function Documentation

◆ operator!=() [1/3]

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

Definition at line 1201 of file coordinates_nd.hpp.

1202{
1203 return !(x == y);
1204}

◆ operator!=() [2/3]

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

Definition at line 1214 of file coordinates_nd.hpp.

1215{
1216 return !(x == init_coordinates_nd);
1217}

◆ operator!=() [3/3]

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

Definition at line 1227 of file coordinates_nd.hpp.

1228{
1229 return !(init_coordinates_nd == x);
1230}

◆ operator+() [1/2]

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

Definition at line 1245 of file coordinates_nd.hpp.

1246{
1247 return to_string(x) + y;
1248}
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_nd< T > &  y 
)

Definition at line 1239 of file coordinates_nd.hpp.

1240{
1241 return x + to_string(y);
1242}

◆ operator+=()

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

Definition at line 1233 of file coordinates_nd.hpp.

1234{
1235 x += to_string(y);
1236}

◆ operator<<() [1/2]

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

Definition at line 48 of file coordinates_nd.cpp.

49{
50 return os << scifir::to_string(x);
51}

◆ operator<<() [2/2]

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

Definition at line 1251 of file coordinates_nd.hpp.

1252{
1253 return os << to_string(x);
1254}

◆ operator==() [1/3]

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

Definition at line 1181 of file coordinates_nd.hpp.

1182{
1183 if (x.values.size() == y.values.size())
1184 {
1185 for (int i = 0; i < x.values.size(); i++)
1186 {
1187 if (x.values[i] != y.values[i])
1188 {
1189 return false;
1190 }
1191 }
1192 return true;
1193 }
1194 else
1195 {
1196 return false;
1197 }
1198}

◆ operator==() [2/3]

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

Definition at line 1207 of file coordinates_nd.hpp.

1208{
1209 scifir::coordinates_nd<T> y(init_coordinates_nd);
1210 return (x == y);
1211}

◆ operator==() [3/3]

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

Definition at line 1220 of file coordinates_nd.hpp.

1221{
1222 scifir::coordinates_nd<T> y(init_coordinates_nd);
1223 return (x == y);
1224}

◆ operator>>()

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

Definition at line 1259 of file coordinates_nd.hpp.

1260{
1261 char a[256];
1262 is.getline(a, 256);
1263 string b(a);
1264 boost::trim(b);
1266 return is;
1267}