SEVN
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1//
2// Created by mario on 07/11/18.
3//
4
5#ifndef SEVN_REVISED_TYPES_H
6#define SEVN_REVISED_TYPES_H
7
8#include <iostream>
9#include <cmath>
10#include <vector>
11
12struct double3 {
13
14 double x;
15 double y;
16 double z;
17
18 inline bool isnan() const{
19 if(std::isnan(x) || std::isnan(y) || std::isnan(z)) return true;
20 else return false;
21 }
22
23 inline bool isinf() const{
24 if(std::isinf(x) || std::isinf(y) || std::isinf(z)) return true;
25 else return false;
26 }
27
28};
29
30
31struct double4{
32
33public:
34
35 double4(){ x = y = z = w = 0.0;}
36 explicit double4(const double3 *a) {x = a->x; y = a->y; z = a->z; w = mod();}
37
38
39 inline void set_x(double a) {x = a; mod();}
40 inline void set_y(double a) {y = a; mod();}
41 inline void set_z(double a) {z = a; mod();}
42 inline void set_w(double a) {w = a;}
43
44
45private:
46 double x;
47 double y;
48 double z;
49 double w;
50
51 inline double mod(){
52 return std::sqrt(x*x + y*y + z*z);
53 }
54
55};
56
57struct starprint{
58 double m;
59 double mhe;
60 double rco;
61};
62
63
64#endif //SEVN_REVISED_TYPES_H
Definition: types.h:12
bool isnan() const
Definition: types.h:18
bool isinf() const
Definition: types.h:23
double z
Definition: types.h:16
double y
Definition: types.h:15
double x
Definition: types.h:14
Definition: types.h:31
double4()
Definition: types.h:35
double mod()
Definition: types.h:51
void set_z(double a)
Definition: types.h:41
double4(const double3 *a)
Definition: types.h:36
double y
Definition: types.h:47
double z
Definition: types.h:48
void set_y(double a)
Definition: types.h:40
void set_x(double a)
Definition: types.h:39
double x
Definition: types.h:46
void set_w(double a)
Definition: types.h:42
double w
Definition: types.h:49
Definition: types.h:57
double mhe
Definition: types.h:59
double m
Definition: types.h:58
double rco
Definition: types.h:60