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

Go to the source code of this file.

Classes

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

Function Documentation

◆ operator!=() [1/5]

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

Definition at line 2324 of file coordinates_ndr.hpp.

2325{
2326 return !(x == y);
2327}

◆ operator!=() [2/5]

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

Definition at line 2298 of file coordinates_ndr.hpp.

2299{
2300 return !(x == y);
2301}

◆ operator!=() [3/5]

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

Definition at line 2272 of file coordinates_ndr.hpp.

2273{
2274 return !(x == y);
2275}

◆ operator!=() [4/5]

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

Definition at line 2337 of file coordinates_ndr.hpp.

2338{
2339 return !(x == init_coordinates_ndr);
2340}

◆ operator!=() [5/5]

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

Definition at line 2350 of file coordinates_ndr.hpp.

2351{
2352 return !(init_coordinates_ndr == x);
2353}

◆ operator+() [1/2]

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

Definition at line 2368 of file coordinates_ndr.hpp.

2369{
2370 return to_string(x) + y;
2371}
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_ndr< T > &  y 
)

Definition at line 2362 of file coordinates_ndr.hpp.

2363{
2364 return x + to_string(y);
2365}

◆ operator+=()

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

Definition at line 2356 of file coordinates_ndr.hpp.

2357{
2358 x += to_string(y);
2359}

◆ operator<<() [1/2]

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

Definition at line 100 of file coordinates_ndr.cpp.

101{
102 return os << scifir::to_string(x);
103}

◆ operator<<() [2/2]

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

Definition at line 2374 of file coordinates_ndr.hpp.

2375{
2376 return os << to_string(x);
2377}

◆ operator==() [1/5]

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

Definition at line 2304 of file coordinates_ndr.hpp.

2305{
2306 if (x.values.size() == y.get_values().size())
2307 {
2308 for (int i = 0 ; i < x.values.size(); i++)
2309 {
2310 if (x.values[i] != y.get_value(i))
2311 {
2312 return false;
2313 }
2314 }
2315 return true;
2316 }
2317 else
2318 {
2319 return false;
2320 }
2321}

◆ operator==() [2/5]

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

Definition at line 2278 of file coordinates_ndr.hpp.

2279{
2280 if (x.get_values().size() == y.values.size())
2281 {
2282 for (int i = 0 ; i < x.get_values().size(); i++)
2283 {
2284 if (x.get_value(i) != y.values[i])
2285 {
2286 return false;
2287 }
2288 }
2289 return true;
2290 }
2291 else
2292 {
2293 return false;
2294 }
2295}

◆ operator==() [3/5]

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

Definition at line 2252 of file coordinates_ndr.hpp.

2253{
2254 for (int i = 0; i < x.get_values().size(); i++)
2255 {
2256 if (x.get_value(i) != y.get_value(i))
2257 {
2258 return false;
2259 }
2260 }
2261 for (int i = 0; i < x.get_angles().size(); i++)
2262 {
2263 if (x.get_angle(i) != y.get_angle(i))
2264 {
2265 return false;
2266 }
2267 }
2268 return true;
2269}

◆ operator==() [4/5]

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

Definition at line 2330 of file coordinates_ndr.hpp.

2331{
2332 scifir::coordinates_ndr<T> y(init_coordinates_ndr);
2333 return (x == y);
2334}

◆ operator==() [5/5]

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

Definition at line 2343 of file coordinates_ndr.hpp.

2344{
2345 scifir::coordinates_ndr<T> y(init_coordinates_ndr);
2346 return (x == y);
2347}

◆ operator>>()

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

Definition at line 2382 of file coordinates_ndr.hpp.

2383{
2384 char a[256];
2385 is.getline(a, 256);
2386 string b(a);
2387 boost::trim(b);
2389 return is;
2390}