/
definitions.h
92 lines (74 loc) · 1.99 KB
/
definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* This file is part of the SPLINTER library.
* Copyright (C) 2012 Bjarne Grimstad (bjarne.grimstad@gmail.com).
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef SPLINTER_DEFINITIONS_H
#define SPLINTER_DEFINITIONS_H
#ifndef SPLINTER_API
# ifdef _MSC_VER
# define SPLINTER_API //__stdcall//__declspec(dllexport)
# else
# define SPLINTER_API
# endif
#endif
# ifndef NDEBUG
# include <iostream>
# include <iomanip>
# endif // NDEBUG
# include <exception>
# include <stdexcept>
# include <vector>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
// #pragma GCC diagnostic ignored "-Wignored-attributes"
#endif
#include <Eigen/Core>
#include <Eigen/LU>
#include <Eigen/Cholesky>
#include <Eigen/QR>
#include <Eigen/SVD>
#include <Eigen/Geometry>
#include <Eigen/Eigenvalues>
//# include <Eigen/Sparse>
#include <Eigen/SparseCore>
#include <Eigen/OrderingMethods>
#include <Eigen/SparseCholesky>
#include <Eigen/SparseLU>
#include <Eigen/SparseQR>
#include <Eigen/IterativeLinearSolvers>
#include <vector>
#include <map>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
namespace SPLINTER
{
// Eigen vectors
typedef Eigen::VectorXd DenseVector;
typedef Eigen::SparseVector<double> SparseVector;
// Eigen matrices
typedef Eigen::MatrixXd DenseMatrix;
typedef Eigen::SparseMatrix<double> SparseMatrix; // declares a column-major sparse matrix type of double
class Exception : public std::exception
{
private:
std::string __what;
public:
Exception(const std::string& what)
: __what(what)
{
}
const char* what() const throw()
{
return this->__what.c_str();
}
};
} // namespace SPLINTER
#endif // SPLINTER_DEFINITIONS_H