AggregPacking
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
math.hpp
Go to the documentation of this file.
1 /*
2 *
3 * AggregPacking : Generator of random aggregate packings in concrete
4 *
5 * version 0.1 (2014-08-22)
6 *
7 * Copyright (C) 2014 Jan Stransky
8 *
9 * Czech Technical University, Faculty of Civil Engineering,
10 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
11 *
12 * AggregPacking is free software: you can redistribute it and/or modify it
13 * under the terms of the GNU Lesser General Public License as published by the
14 * Free Software Foundation, either version 3 of the License, or (at your
15 * option) any later version.
16 *
17 * AggregPacking is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
20 * for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
31 #ifndef MATH_HPP
32 #define MATH_HPP
33 
34 #include <Eigen/Core>
35 #include <Eigen/Geometry>
36 
37 #include <string>
38 using std::string;
39 #ifdef AGGREGPACKING_SERIALIZATION
40 #include <iostream>
41 #include <fstream>
42 using std::istream;
43 using std::ostream;
44 using std::ifstream;
45 using std::ofstream;
46 #endif
47 
48 namespace aggregpacking {
49 
51 const double PI = 3.141592653589793238463;
52 
54 
57 typedef Eigen::Matrix<double,3,1> Vector3;
58 
60 
63 typedef Eigen::Matrix<double,3,3> Matrix3;
64 
66 
69 typedef Eigen::Quaternion<double> Quaternion;
70 
72 
75 typedef Eigen::AngleAxis<double> AngleAxis;
76 
77 
78 #ifdef AGGREGPACKING_SERIALIZATION
79 ostream& operator<<(ostream &os, const Vector3& v);
81 
83 ostream& operator<<(ostream &os, const Matrix3& m);
84 
86 ostream& operator<<(ostream &os, const Quaternion& q);
87 
89 istream& operator>>(istream& is, Vector3& v);
90 
92 istream& operator>>(istream& is, Matrix3& m);
93 
95 istream& operator>>(istream& is, Quaternion& q);
96 
97 #endif
98 
99 } // namespace
100 #endif
3 component vector of real numbers.
Quaternion - for rotation representation.
3x3 matrix of real numbers
istream & operator>>(istream &is, Sphere &o)
Sphere from istream shift operator.
Definition: aggregate.cpp:126
Another rotation representation.
ostream & operator<<(ostream &os, const Aggregate &o)
Aggregate to ostream shift operator.
Definition: aggregate.cpp:68
const double PI
PI.
Definition: math.hpp:51