bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl_types.h
Go to the documentation of this file.
1#ifndef RLENVS_TYPES_V2_H
2#define RLENVS_TYPES_V2_H
3
9//#include "bitrl/bitrl_config.h"
10#include "Eigen/Core"
11
12#include <cstddef>
13#include <ostream>
14#include <string>
15#include <vector>
16
17namespace bitrl
18{
19
23typedef double real_t;
24
28typedef float float_t;
29
33typedef int int_t;
34
38typedef long int lint_t;
39
43typedef std::size_t uint_t;
44
49template <typename T> using DynMat = Eigen::MatrixX<T>;
50
54template <typename T, uint_t N> using SquareMat = Eigen::Matrix<T, N, N>;
55
59template <typename T, uint_t N, uint_t M> using Mat = Eigen::Matrix<T, N, M>;
60
64using RealMat3d = Eigen::Matrix3<real_t>;
65
69using FloatMat3d = Eigen::Matrix3<float_t>;
70
74template <typename T> using DynVec = Eigen::RowVectorX<T>;
75
80
85
89using STD_FloatVec = std::vector<float_t>;
90
94using STD_RealVec = std::vector<real_t>;
95
100template <typename T> using ColVec = Eigen::VectorX<T>;
101
106
111
115using RealColVec3d = Eigen::Vector3d;
116
120using FloatColVec3d = Eigen::Vector3f;
121
127template <uint_t s, uint_t e> struct IntegralRange
128{
130 static constexpr uint_t S = s;
131 static constexpr uint_t E = e;
132 static constexpr uint_t size = e - s;
133};
134
139template <real_t s, real_t e> struct RealRange
140{
142 static constexpr real_t S = s;
143 static constexpr real_t E = e;
144 static constexpr real_t size = e - s;
145};
146
151struct Null
152{
153};
154
158enum class DeviceType
159{
160 INVALID_TYPE = 0,
161 CPU = 1,
162 GPU = 2
163};
164
165inline std::ostream &operator<<(std::ostream &out, const Null &)
166{
167
168 out << "null";
169 return out;
170}
171
172} // namespace bitrl
173
174#endif // TYPES_H
Definition bitrl_consts.h:14
int int_t
integer type
Definition bitrl_types.h:33
ColVec< float_t > FoatColVec
Dynamically sized column vector.
Definition bitrl_types.h:110
Eigen::Matrix3< real_t > RealMat3d
DynamicĂ—3 matrix of type double.
Definition bitrl_types.h:64
Eigen::Matrix3< float_t > FloatMat3d
DynamicĂ—3 matrix of type float.
Definition bitrl_types.h:69
std::vector< float_t > STD_FloatVec
single precision std::vector
Definition bitrl_types.h:89
std::ostream & operator<<(std::ostream &out, const Null &)
Definition bitrl_types.h:165
long int lint_t
long int type
Definition bitrl_types.h:38
double real_t
real_t
Definition bitrl_types.h:23
ColVec< real_t > RealColVec
Dynamically sized column vector.
Definition bitrl_types.h:105
Eigen::RowVectorX< T > DynVec
Dynamically sized row vector.
Definition bitrl_types.h:74
Eigen::Vector3f FloatColVec3d
3D column vectpr
Definition bitrl_types.h:120
Eigen::Vector3d RealColVec3d
3D column vector
Definition bitrl_types.h:115
std::size_t uint_t
uint_t
Definition bitrl_types.h:43
DynVec< real_t > RealVec
double precision floating point vector
Definition bitrl_types.h:84
Eigen::Matrix< T, N, M > Mat
General fixed size matrix.
Definition bitrl_types.h:59
DeviceType
Enumeration of various device types.
Definition bitrl_types.h:159
float float_t
float
Definition bitrl_types.h:28
std::vector< real_t > STD_RealVec
double precision std::vector
Definition bitrl_types.h:94
Eigen::MatrixX< T > DynMat
Dynamically sized matrix to use around the library.
Definition bitrl_types.h:49
DynVec< float_t > FloatVec
single precision floating point vector
Definition bitrl_types.h:79
Eigen::VectorX< T > ColVec
Column vector. Some maths operations are easier using column vectors rather than DynVec.
Definition bitrl_types.h:100
Eigen::Matrix< T, N, N > SquareMat
Square matrix with elements of type T.
Definition bitrl_types.h:54
A range of integer values in [s, e].
Definition bitrl_types.h:128
static constexpr uint_t size
Definition bitrl_types.h:132
static constexpr uint_t E
Definition bitrl_types.h:131
static constexpr uint_t S
Definition bitrl_types.h:130
uint_t value_type
Definition bitrl_types.h:129
Null placeholder.
Definition bitrl_types.h:152
A range of double precision floating point values.
Definition bitrl_types.h:140
static constexpr real_t size
Definition bitrl_types.h:144
real_t value_type
Definition bitrl_types.h:141
static constexpr real_t S
Definition bitrl_types.h:142
static constexpr real_t E
Definition bitrl_types.h:143