gtsam/3rdparty/Eigen/blas/common.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2009-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_BLAS_COMMON_H
11 #define EIGEN_BLAS_COMMON_H
12 
13 #ifdef __GNUC__
14 # if __GNUC__<5
15 // GCC < 5.0 does not like the global Scalar typedef
16 // we just keep shadow-warnings disabled permanently
17 # define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
18 # endif
19 #endif
20 
21 #include "../Eigen/Core"
22 #include "../Eigen/Jacobi"
23 
24 #include <complex>
25 
26 #ifndef SCALAR
27 #error the token SCALAR must be defined to compile this file
28 #endif
29 
30 #include "../Eigen/src/misc/blas.h"
31 
32 #define NOTR 0
33 #define TR 1
34 #define ADJ 2
35 
36 #define LEFT 0
37 #define RIGHT 1
38 
39 #define UP 0
40 #define LO 1
41 
42 #define NUNIT 0
43 #define UNIT 1
44 
45 #define INVALID 0xff
46 
47 #define OP(X) ( ((X)=='N' || (X)=='n') ? NOTR \
48  : ((X)=='T' || (X)=='t') ? TR \
49  : ((X)=='C' || (X)=='c') ? ADJ \
50  : INVALID)
51 
52 #define SIDE(X) ( ((X)=='L' || (X)=='l') ? LEFT \
53  : ((X)=='R' || (X)=='r') ? RIGHT \
54  : INVALID)
55 
56 #define UPLO(X) ( ((X)=='U' || (X)=='u') ? UP \
57  : ((X)=='L' || (X)=='l') ? LO \
58  : INVALID)
59 
60 #define DIAG(X) ( ((X)=='N' || (X)=='n') ? NUNIT \
61  : ((X)=='U' || (X)=='u') ? UNIT \
62  : INVALID)
63 
64 
65 inline bool check_op(const char* op)
66 {
67  return OP(*op)!=0xff;
68 }
69 
70 inline bool check_side(const char* side)
71 {
72  return SIDE(*side)!=0xff;
73 }
74 
75 inline bool check_uplo(const char* uplo)
76 {
77  return UPLO(*uplo)!=0xff;
78 }
79 
80 
81 namespace Eigen {
82 #include "BandTriangularSolver.h"
83 #include "GeneralRank1Update.h"
87 #include "Rank2Update.h"
88 }
89 
90 using namespace Eigen;
91 
92 typedef SCALAR Scalar;
94 typedef std::complex<RealScalar> Complex;
95 
96 enum
97 {
100 };
101 
107 
108 template<typename T>
110 matrix(T* data, int rows, int cols, int stride)
111 {
113 }
114 
115 template<typename T>
117 matrix(const T* data, int rows, int cols, int stride)
118 {
120 }
121 
122 template<typename T>
124 {
126 }
127 
128 template<typename T>
130 {
132 }
133 
134 template<typename T>
136 {
137  return Map<Matrix<T,Dynamic,1> >(data, size);
138 }
139 
140 template<typename T>
142 {
144 }
145 
146 template<typename T>
147 T* get_compact_vector(T* x, int n, int incx)
148 {
149  if(incx==1)
150  return x;
151 
153  if(incx<0) make_vector(ret,n) = make_vector(x,n,-incx).reverse();
154  else make_vector(ret,n) = make_vector(x,n, incx);
155  return ret;
156 }
157 
158 template<typename T>
159 T* copy_back(T* x_cpy, T* x, int n, int incx)
160 {
161  if(x_cpy==x)
162  return 0;
163 
164  if(incx<0) make_vector(x,n,-incx).reverse() = make_vector(x_cpy,n);
165  else make_vector(x,n, incx) = make_vector(x_cpy,n);
166  return x_cpy;
167 }
168 
169 #ifndef EIGEN_BLAS_FUNC_SUFFIX
170 #define EIGEN_BLAS_FUNC_SUFFIX _
171 #endif
172 
173 #define EIGEN_BLAS_FUNC(X) EIGEN_CAT(SCALAR_SUFFIX, EIGEN_CAT(X, EIGEN_BLAS_FUNC_SUFFIX))
174 
175 #endif // EIGEN_BLAS_COMMON_H
Complex
std::complex< RealScalar > Complex
Definition: gtsam/3rdparty/Eigen/blas/common.h:94
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
UPLO
#define UPLO(X)
Definition: gtsam/3rdparty/Eigen/blas/common.h:56
RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: gtsam/3rdparty/Eigen/blas/common.h:93
PackedTriangularMatrixVector.h
Eigen::InnerStride
Convenience specialization of Stride to specify only an inner stride See class Map for some examples.
Definition: Stride.h:95
ConstMatrixType
Map< const Matrix< Scalar, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > ConstMatrixType
Definition: gtsam/3rdparty/Eigen/blas/common.h:104
Scalar
SCALAR Scalar
Definition: gtsam/3rdparty/Eigen/blas/common.h:92
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
Rank2Update.h
ret
DenseIndex ret
Definition: level1_cplx_impl.h:44
PackedSelfadjointProduct.h
make_vector
Map< Matrix< T, Dynamic, 1 >, 0, InnerStride< Dynamic > > make_vector(T *data, int size, int incr)
Definition: gtsam/3rdparty/Eigen/blas/common.h:123
get_compact_vector
T * get_compact_vector(T *x, int n, int incx)
Definition: gtsam/3rdparty/Eigen/blas/common.h:147
CompactVectorType
Map< Matrix< Scalar, Dynamic, 1 > > CompactVectorType
Definition: gtsam/3rdparty/Eigen/blas/common.h:106
check_side
bool check_side(const char *side)
Definition: gtsam/3rdparty/Eigen/blas/common.h:70
MatrixType
Map< Matrix< Scalar, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > MatrixType
Definition: gtsam/3rdparty/Eigen/blas/common.h:103
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
IsComplex
@ IsComplex
Definition: gtsam/3rdparty/Eigen/blas/common.h:98
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
PlainMatrixType
Matrix< Scalar, Dynamic, Dynamic, ColMajor > PlainMatrixType
Definition: gtsam/3rdparty/Eigen/blas/common.h:102
n
int n
Definition: BiCGSTAB_simple.cpp:1
GeneralRank1Update.h
StridedVectorType
Map< Matrix< Scalar, Dynamic, 1 >, 0, InnerStride< Dynamic > > StridedVectorType
Definition: gtsam/3rdparty/Eigen/blas/common.h:105
data
int data[]
Definition: Map_placement_new.cpp:1
incx
RealScalar RealScalar int * incx
Definition: level1_cplx_impl.h:29
check_op
bool check_op(const char *op)
Definition: gtsam/3rdparty/Eigen/blas/common.h:65
Eigen::OuterStride
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:106
Eigen::Triplet< double >
Eigen::Map
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:94
check_uplo
bool check_uplo(const char *uplo)
Definition: gtsam/3rdparty/Eigen/blas/common.h:75
matrix
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: gtsam/3rdparty/Eigen/blas/common.h:110
SIDE
#define SIDE(X)
Definition: gtsam/3rdparty/Eigen/blas/common.h:52
PackedTriangularSolverVector.h
SCALAR
#define SCALAR
Definition: bench_gemm.cpp:23
OP
#define OP(X)
Definition: gtsam/3rdparty/Eigen/blas/common.h:47
BandTriangularSolver.h
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
copy_back
T * copy_back(T *x_cpy, T *x, int n, int incx)
Definition: gtsam/3rdparty/Eigen/blas/common.h:159
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
Conj
@ Conj
Definition: gtsam/3rdparty/Eigen/blas/common.h:99
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:59