common.h File Reference
#include "../Eigen/Core"
#include "../Eigen/Jacobi"
#include <complex>
#include "blas.h"
#include "BandTriangularSolver.h"
#include "GeneralRank1Update.h"
#include "PackedSelfadjointProduct.h"
#include "PackedTriangularMatrixVector.h"
#include "PackedTriangularSolverVector.h"
#include "Rank2Update.h"

Go to the source code of this file.

Macros

#define NOTR   0
 
#define TR   1
 
#define ADJ   2
 
#define LEFT   0
 
#define RIGHT   1
 
#define UP   0
 
#define LO   1
 
#define NUNIT   0
 
#define UNIT   1
 
#define INVALID   0xff
 
#define OP(X)    (((X) == 'N' || (X) == 'n') ? NOTR : ((X) == 'T' || (X) == 't') ? TR : ((X) == 'C' || (X) == 'c') ? ADJ : INVALID)
 
#define SIDE(X)   (((X) == 'L' || (X) == 'l') ? LEFT : ((X) == 'R' || (X) == 'r') ? RIGHT : INVALID)
 
#define UPLO(X)   (((X) == 'U' || (X) == 'u') ? UP : ((X) == 'L' || (X) == 'l') ? LO : INVALID)
 
#define DIAG(X)   (((X) == 'N' || (X) == 'n') ? NUNIT : ((X) == 'U' || (X) == 'u') ? UNIT : INVALID)
 
#define EIGEN_BLAS_FUNC_SUFFIX   _
 
#define EIGEN_BLAS_FUNC_NAME(X)   EIGEN_CAT(SCALAR_SUFFIX, EIGEN_CAT(X, EIGEN_BLAS_FUNC_SUFFIX))
 
#define EIGEN_BLAS_FUNC(X)   extern "C" void EIGEN_BLAS_FUNC_NAME(X)
 

Typedefs

typedef SCALAR Scalar
 
typedef Eigen::NumTraits< Scalar >::Real RealScalar
 
typedef std::complex< RealScalarComplex
 
typedef Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajorPlainMatrixType
 
typedef Eigen::Map< Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > MatrixType
 
typedef Eigen::Map< const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > ConstMatrixType
 
typedef Eigen::Map< Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >, 0, Eigen::InnerStride< Eigen::Dynamic > > StridedVectorType
 
typedef Eigen::Map< Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > > CompactVectorType
 

Enumerations

enum  { IsComplex = Eigen::NumTraits<SCALAR>::IsComplex , Conj = IsComplex }
 

Functions

bool check_op (const char *op)
 
bool check_side (const char *side)
 
bool check_uplo (const char *uplo)
 
template<typename T >
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix (T *data, int rows, int cols, int stride)
 
template<typename T >
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix (const T *data, int rows, int cols, int stride)
 
template<typename T >
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 >, 0, Eigen::InnerStride< Eigen::Dynamic > > make_vector (T *data, int size, int incr)
 
template<typename T >
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 >, 0, Eigen::InnerStride< Eigen::Dynamic > > make_vector (const T *data, int size, int incr)
 
template<typename T >
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 > > make_vector (T *data, int size)
 
template<typename T >
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 > > make_vector (const T *data, int size)
 
template<typename T >
Tget_compact_vector (T *x, int n, int incx)
 
template<typename T >
Tcopy_back (T *x_cpy, T *x, int n, int incx)
 

Macro Definition Documentation

◆ ADJ

#define ADJ   2

◆ DIAG

#define DIAG (   X)    (((X) == 'N' || (X) == 'n') ? NUNIT : ((X) == 'U' || (X) == 'u') ? UNIT : INVALID)

◆ EIGEN_BLAS_FUNC

#define EIGEN_BLAS_FUNC (   X)    extern "C" void EIGEN_BLAS_FUNC_NAME(X)

◆ EIGEN_BLAS_FUNC_NAME

#define EIGEN_BLAS_FUNC_NAME (   X)    EIGEN_CAT(SCALAR_SUFFIX, EIGEN_CAT(X, EIGEN_BLAS_FUNC_SUFFIX))

◆ EIGEN_BLAS_FUNC_SUFFIX

#define EIGEN_BLAS_FUNC_SUFFIX   _

◆ INVALID

#define INVALID   0xff

◆ LEFT

#define LEFT   0

◆ LO

#define LO   1

◆ NOTR

#define NOTR   0

◆ NUNIT

#define NUNIT   0

◆ OP

#define OP (   X)     (((X) == 'N' || (X) == 'n') ? NOTR : ((X) == 'T' || (X) == 't') ? TR : ((X) == 'C' || (X) == 'c') ? ADJ : INVALID)

◆ RIGHT

#define RIGHT   1

◆ SIDE

#define SIDE (   X)    (((X) == 'L' || (X) == 'l') ? LEFT : ((X) == 'R' || (X) == 'r') ? RIGHT : INVALID)

◆ TR

#define TR   1

◆ UNIT

#define UNIT   1

◆ UP

#define UP   0

◆ UPLO

#define UPLO (   X)    (((X) == 'U' || (X) == 'u') ? UP : ((X) == 'L' || (X) == 'l') ? LO : INVALID)

Typedef Documentation

◆ CompactVectorType

◆ Complex

typedef std::complex<RealScalar> Complex

◆ ConstMatrixType

◆ MatrixType

◆ PlainMatrixType

◆ RealScalar

◆ Scalar

typedef SCALAR Scalar

◆ StridedVectorType

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IsComplex 
Conj 
@ IsComplex
Definition: common.h:73
@ Conj
Definition: common.h:73
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217

Function Documentation

◆ check_op()

bool check_op ( const char op)
inline
63 { return OP(*op) != 0xff; }
#define OP(X)
Definition: common.h:54
char char * op
Definition: level2_impl.h:374

References OP, and op.

◆ check_side()

bool check_side ( const char side)
inline
65 { return SIDE(*side) != 0xff; }
#define SIDE(X)
Definition: common.h:57
const char * side
Definition: level3_impl.h:101

References SIDE, and side.

◆ check_uplo()

bool check_uplo ( const char uplo)
inline
67 { return UPLO(*uplo) != 0xff; }
#define UPLO(X)
Definition: common.h:59
const char * uplo
Definition: level2_cplx_impl.h:20

References UPLO, and uplo.

◆ copy_back()

template<typename T >
T* copy_back ( T x_cpy,
T x,
int  n,
int  incx 
)
136  {
137  if (x_cpy == x) return 0;
138 
139  if (incx < 0)
140  make_vector(x, n, -incx).reverse() = make_vector(x_cpy, n);
141  else
143  return x_cpy;
144 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 >, 0, Eigen::InnerStride< Eigen::Dynamic > > make_vector(T *data, int size, int incr)
Definition: common.h:99
RealScalar RealScalar int * incx
Definition: level1_cplx_impl.h:27
Scalar * x_cpy
Definition: level2_cplx_impl.h:177
list x
Definition: plotDoE.py:28

References incx, make_vector(), n, plotDoE::x, and x_cpy.

◆ get_compact_vector()

template<typename T >
T* get_compact_vector ( T x,
int  n,
int  incx 
)
124  {
125  if (incx == 1) return x;
126 
127  std::remove_const_t<T>* ret = new Scalar[n];
128  if (incx < 0)
129  make_vector(ret, n) = make_vector(x, n, -incx).reverse();
130  else
132  return ret;
133 }
SCALAR Scalar
Definition: bench_gemm.cpp:45
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43

References incx, make_vector(), n, ret, and plotDoE::x.

Referenced by her(), hpr(), spr(), tpmv(), and tpsv().

◆ make_vector() [1/4]

template<typename T >
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1> > make_vector ( const T data,
int  size 
)
119  {
121 }
int data[]
Definition: Map_placement_new.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96

References data, and size.

◆ make_vector() [2/4]

template<typename T >
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, 1>, 0, Eigen::InnerStride<Eigen::Dynamic> > make_vector ( const T data,
int  size,
int  incr 
)
108  {
111 }
Convenience specialization of Stride to specify only an inner stride See class Map for some examples.
Definition: Stride.h:93

References data, and size.

◆ make_vector() [3/4]

template<typename T >
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1> > make_vector ( T data,
int  size 
)
114  {
116 }

References data, and size.

◆ make_vector() [4/4]

template<typename T >
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1>, 0, Eigen::InnerStride<Eigen::Dynamic> > make_vector ( T data,
int  size,
int  incr 
)

◆ matrix() [1/2]

template<typename T >
Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>, 0, Eigen::OuterStride<> > matrix ( const T data,
int  rows,
int  cols,
int  stride 
)
93  {
95  data, rows, cols, Eigen::OuterStride<>(stride));
96 }
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:104

References cols, data, and rows.

◆ matrix() [2/2]

template<typename T >
Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>, 0, Eigen::OuterStride<> > matrix ( T data,
int  rows,
int  cols,
int  stride 
)

References cols, data, and rows.

Referenced by Eigen::AccelerateImpl< MatrixType_, UpLo_, Solver_, EnforceSquare_ >::AccelerateImpl(), Camera::activateGL(), Eigen::KLU< MatrixType_ >::analyzePattern(), Eigen::UmfPackLU< MatrixType_ >::analyzePattern(), Eigen::CholmodBase< MatrixType_, UpLo_, Derived >::analyzePattern(), Eigen::PastixLU< MatrixType_, IsStrSym >::analyzePattern(), Eigen::PastixLLT< MatrixType_, UpLo_ >::analyzePattern(), Eigen::PastixLDLT< MatrixType_, UpLo_ >::analyzePattern(), Eigen::SuperLU< MatrixType_ >::analyzePattern(), array_for_matrix(), oomph::Newmark< NSTEPS >::assign_initial_data_values(), oomph::Newmark< NSTEPS >::assign_initial_data_values_stage2(), Eigen::BDCSVD< MatrixType_, Options_ >::BDCSVD(), Eigen::internal::lapacke_helpers::BDCSVD_wrapper(), Eigen::internal::bruteforce_det3_helper(), check_global_interpolation2d(), check_qtvector_transform(), check_solverbase(), check_stddeque_transform(), check_stdlist_transform(), check_stdvector_transform(), Eigen::CholmodBase< MatrixType_, UpLo_, Derived >::CholmodBase(), Eigen::ChordLengths(), cod(), cod_fixedsize(), Eigen::internal::cofactor_4x4(), Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::ColPivHouseholderQR(), RectangularDrivenCavityProblem< ELEMENT >::compare_assembly_strategies(), comparisons(), Eigen::CompleteOrthogonalDecomposition< MatrixType_, PermutationIndex_ >::CompleteOrthogonalDecomposition(), Eigen::ComplexEigenSolver< MatrixType_ >::ComplexEigenSolver(), Eigen::ComplexSchur< MatrixType_ >::ComplexSchur(), Eigen::SelfAdjointEigenSolver< MatrixType_ >::compute(), Eigen::HessenbergDecomposition< MatrixType_ >::compute(), Eigen::Tridiagonalization< MatrixType_ >::compute(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::compute(), Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::compute(), Eigen::ColPivHouseholderQR< MatrixType_, PermutationIndex_ >::compute(), Eigen::CompleteOrthogonalDecomposition< MatrixType_, PermutationIndex_ >::compute(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::compute(), Eigen::HouseholderQR< MatrixType_ >::compute(), Eigen::ComplexEigenSolver< MatrixType_ >::compute(), Eigen::EigenSolver< MatrixType_ >::compute(), Eigen::ComplexSchur< MatrixType_ >::compute(), Eigen::RealSchur< MatrixType_ >::compute(), Eigen::KLU< MatrixType_ >::compute(), Eigen::UmfPackLU< MatrixType_ >::compute(), Eigen::CholmodBase< MatrixType_, UpLo_, Derived >::compute(), Eigen::PastixLU< MatrixType_, IsStrSym >::compute(), Eigen::PastixLLT< MatrixType_, UpLo_ >::compute(), Eigen::PastixLDLT< MatrixType_, UpLo_ >::compute(), Eigen::SimplicialCholeskyBase< Derived >::compute(), Eigen::SimplicialLLT< MatrixType_, UpLo_, Ordering_ >::compute(), Eigen::SimplicialLDLT< MatrixType_, UpLo_, Ordering_ >::compute(), Eigen::SimplicialNonHermitianLLT< MatrixType_, UpLo_, Ordering_ >::compute(), Eigen::SimplicialNonHermitianLDLT< MatrixType_, UpLo_, Ordering_ >::compute(), Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::compute(), Eigen::SparseLU< MatrixType_, OrderingType_ >::compute(), Eigen::SuperLUBase< MatrixType_, Derived >::compute(), Eigen::BDCSVD< MatrixType_, Options_ >::compute(), Eigen::JacobiSVD< MatrixType_, Options_ >::compute(), Eigen::internal::UpperBidiagonalization< MatrixType_ >::compute(), Eigen::SPQR< MatrixType_ >::compute(), Eigen::BDCSVD< MatrixType_, Options_ >::compute_impl(), Eigen::JacobiSVD< MatrixType_, Options_ >::compute_impl(), Eigen::internal::lapacke_helpers::BDCSVD_LAPACKE< MatrixType_, Options >::compute_impl_lapacke(), Eigen::internal::compute_inverse_size2_helper(), Eigen::internal::compute_inverse_size3_helper(), Eigen::SelfAdjointEigenSolver< MatrixType_ >::computeDirect(), Eigen::internal::UpperBidiagonalization< MatrixType_ >::computeUnblocked(), corners(), corners_fixedsize(), Eigen::BDCSVD< MatrixType_, Options_ >::divide(), EIGEN_DECLARE_TEST(), Eigen::EigenSolver< MatrixType_ >::EigenSolver(), Eigen::KLU< MatrixType_ >::factorize(), Eigen::UmfPackLU< MatrixType_ >::factorize(), Eigen::CholmodBase< MatrixType_, UpLo_, Derived >::factorize(), Eigen::PastixLU< MatrixType_, IsStrSym >::factorize(), Eigen::PastixLLT< MatrixType_, UpLo_ >::factorize(), Eigen::PastixLDLT< MatrixType_, UpLo_ >::factorize(), Eigen::SparseLU< MatrixType_, OrderingType_ >::factorize(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::FullPivHouseholderQR(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::FullPivLU(), Eigen::internal::general_det3_helper(), oomph::AssemblyHandler::get_all_vectors_and_matrices(), oomph::ExplicitTimeStepHandler::get_all_vectors_and_matrices(), oomph::EigenProblemHandler::get_all_vectors_and_matrices(), Eigen::PardisoLU< MatrixType >::getMatrix(), Eigen::PardisoLLT< MatrixType, UpLo_ >::getMatrix(), Eigen::PardisoLDLT< MatrixType, Options >::getMatrix(), Eigen::PastixLU< MatrixType_, IsStrSym >::grabMatrix(), Eigen::PastixLLT< MatrixType_, UpLo_ >::grabMatrix(), Eigen::PastixLDLT< MatrixType_, UpLo_ >::grabMatrix(), Eigen::HessenbergDecomposition< MatrixType_ >::HessenbergDecomposition(), Eigen::HouseholderQR< MatrixType_ >::HouseholderQR(), Eigen::IncompleteCholesky< Scalar, UpLo_, OrderingType_ >::IncompleteCholesky(), Eigen::IterScaling< MatrixType_ >::IterScaling(), Eigen::JacobiSVD< MatrixType_, Options_ >::JacobiSVD(), Eigen::KLU< MatrixType_ >::KLU(), Eigen::LDLT< MatrixType_, UpLo_ >::LDLT(), Eigen::LLT< MatrixType_, UpLo_ >::LLT(), main(), Matrix3D::Matrix3D(), non_projective_only(), openglsupport_test_loop(), Eigen::UniformScaling< Scalar_ >::operator*(), Eigen::DiagonalBase< Derived >::operator*(), Eigen::SkewSymmetricBase< Derived >::operator*(), Eigen::operator*(), Eigen::InverseImpl< PermutationType, PermutationStorage >::operator*(), Eigen::Transpose< TranspositionsBase< TranspositionsDerived > >::operator*(), Eigen::internal::sparse_matrix_block_impl< SparseMatrixType, BlockRows, BlockCols >::operator=(), Eigen::PardisoLDLT< MatrixType, Options >::PardisoLDLT(), Eigen::PardisoLLT< MatrixType, UpLo_ >::PardisoLLT(), Eigen::PardisoLU< MatrixType >::PardisoLU(), Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::PartialPivLU(), Eigen::PastixLDLT< MatrixType_, UpLo_ >::PastixLDLT(), Eigen::PastixLLT< MatrixType_, UpLo_ >::PastixLLT(), Eigen::PastixLU< MatrixType_, IsStrSym >::PastixLU(), quaternion(), Eigen::internal::real_2x2_jacobi_svd(), Eigen::RealSchur< MatrixType_ >::RealSchur(), Eigen::internal::complex_schur_reduce_to_hessenberg< MatrixType, IsComplex >::run(), Eigen::internal::complex_schur_reduce_to_hessenberg< MatrixType, false >::run(), Eigen::internal::compute_inverse_size4< Architecture::Target, float, MatrixType, ResultType >::run(), Eigen::internal::compute_inverse_size4< Architecture::Target, double, MatrixType, ResultType >::run(), Eigen::internal::compute_inverse_and_det_with_check< MatrixType, ResultType, 2 >::run(), Eigen::internal::compute_inverse_and_det_with_check< MatrixType, ResultType, 3 >::run(), Eigen::internal::compute_inverse_and_det_with_check< MatrixType, ResultType, 4 >::run(), Eigen::internal::compute_inverse_and_det_with_check< MatrixType, ResultType, 1 >::run(), Eigen::internal::compute_inverse< MatrixType, ResultType, Size >::run(), Eigen::internal::compute_inverse< MatrixType, ResultType, 1 >::run(), Eigen::internal::compute_inverse< MatrixType, ResultType, 2 >::run(), Eigen::internal::compute_inverse< MatrixType, ResultType, 3 >::run(), Eigen::internal::compute_inverse_size4< Arch, Scalar, MatrixType, ResultType >::run(), Eigen::internal::TensorPrinter< Tensor, rank, TensorIOFormatLegacy, std::enable_if_t< rank !=0 > >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, FullPivHouseholderQRPreconditioner, PreconditionIfMoreRowsThanCols, true >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, FullPivHouseholderQRPreconditioner, PreconditionIfMoreColsThanRows, true >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, ColPivHouseholderQRPreconditioner, PreconditionIfMoreRowsThanCols, true >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, ColPivHouseholderQRPreconditioner, PreconditionIfMoreColsThanRows, true >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, HouseholderQRPreconditioner, PreconditionIfMoreRowsThanCols, true >::run(), Eigen::internal::qr_preconditioner_impl< MatrixType, Options, HouseholderQRPreconditioner, PreconditionIfMoreColsThanRows, true >::run(), run_it(), Eigen::SelfAdjointEigenSolver< MatrixType_ >::SelfAdjointEigenSolver(), Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::SimplicialCholesky(), Eigen::SimplicialCholeskyBase< Derived >::SimplicialCholeskyBase(), oomph::HypreSolver::solve(), Eigen::SparseLU< MatrixType_, OrderingType_ >::SparseLU(), Eigen::SPQR< MatrixType_ >::SPQR(), Eigen::SuperLU< MatrixType_ >::SuperLU(), test3dRotation(), test_2D(), test_2D_sycl(), test_composition(), test_gaussian(), test_gaussian_sycl(), transform_products(), transformations(), transformations_no_scale(), Eigen::UmfPackLU< MatrixType_ >::UmfPackLU(), and Eigen::internal::UpperBidiagonalization< MatrixType_ >::UpperBidiagonalization().