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
12
struct
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
31
struct
double4
{
32
33
public
:
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
45
private
:
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
57
struct
starprint
{
58
double
m
;
59
double
mhe
;
60
double
rco
;
61
};
62
63
64
#endif
//SEVN_REVISED_TYPES_H
double3
Definition:
types.h:12
double3::isnan
bool isnan() const
Definition:
types.h:18
double3::isinf
bool isinf() const
Definition:
types.h:23
double3::z
double z
Definition:
types.h:16
double3::y
double y
Definition:
types.h:15
double3::x
double x
Definition:
types.h:14
double4
Definition:
types.h:31
double4::double4
double4()
Definition:
types.h:35
double4::mod
double mod()
Definition:
types.h:51
double4::set_z
void set_z(double a)
Definition:
types.h:41
double4::double4
double4(const double3 *a)
Definition:
types.h:36
double4::y
double y
Definition:
types.h:47
double4::z
double z
Definition:
types.h:48
double4::set_y
void set_y(double a)
Definition:
types.h:40
double4::set_x
void set_x(double a)
Definition:
types.h:39
double4::x
double x
Definition:
types.h:46
double4::set_w
void set_w(double a)
Definition:
types.h:42
double4::w
double w
Definition:
types.h:49
starprint
Definition:
types.h:57
starprint::mhe
double mhe
Definition:
types.h:59
starprint::m
double m
Definition:
types.h:58
starprint::rco
double rco
Definition:
types.h:60
src
general
types.h
Generated by
1.9.5