mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 15:54:13 +08:00
Merge with upstream eigen/default
This commit is contained in:
commit
55bb7e7935
@ -538,6 +538,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
|
||||
|
||||
# Imported target support
|
||||
add_library (eigen INTERFACE)
|
||||
add_library (Eigen3::Eigen ALIAS eigen)
|
||||
|
||||
target_compile_definitions (eigen INTERFACE ${EIGEN_DEFINITIONS})
|
||||
target_include_directories (eigen INTERFACE
|
||||
|
@ -10,14 +10,14 @@
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "Cholesky"
|
||||
#include "Jacobi"
|
||||
#include "Householder"
|
||||
#include "LU"
|
||||
#include "Geometry"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup Eigenvalues_Module Eigenvalues module
|
||||
*
|
||||
*
|
||||
|
@ -10,12 +10,12 @@
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "SVD"
|
||||
#include "LU"
|
||||
#include <limits>
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup Geometry_Module Geometry module
|
||||
*
|
||||
* This module provides support for:
|
||||
|
4
Eigen/QR
4
Eigen/QR
@ -10,12 +10,12 @@
|
||||
|
||||
#include "Core"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "Cholesky"
|
||||
#include "Jacobi"
|
||||
#include "Householder"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
/** \defgroup QR_Module QR module
|
||||
*
|
||||
*
|
||||
|
@ -23,6 +23,8 @@
|
||||
// Ordering interface
|
||||
#include "OrderingMethods"
|
||||
|
||||
#include "src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "src/SparseLU/SparseLU_gemm_kernel.h"
|
||||
|
||||
#include "src/SparseLU/SparseLU_Structs.h"
|
||||
@ -43,4 +45,6 @@
|
||||
#include "src/SparseLU/SparseLU_Utils.h"
|
||||
#include "src/SparseLU/SparseLU.h"
|
||||
|
||||
#include "src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SPARSELU_MODULE_H
|
||||
|
@ -28,7 +28,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "OrderingMethods"
|
||||
#include "src/SparseCore/SparseColEtree.h"
|
||||
#include "src/SparseQR/SparseQR.h"
|
||||
|
||||
|
@ -100,7 +100,7 @@ template<typename _MatrixType, int _UpLo> class LLT
|
||||
compute(matrix.derived());
|
||||
}
|
||||
|
||||
/** \brief Constructs a LDLT factorization from a given matrix
|
||||
/** \brief Constructs a LLT factorization from a given matrix
|
||||
*
|
||||
* This overloaded constructor is provided for \link InplaceDecomposition inplace decomposition \endlink when
|
||||
* \c MatrixType is a Eigen::Ref.
|
||||
@ -200,7 +200,7 @@ template<typename _MatrixType, int _UpLo> class LLT
|
||||
inline Index cols() const { return m_matrix.cols(); }
|
||||
|
||||
template<typename VectorType>
|
||||
LLT rankUpdate(const VectorType& vec, const RealScalar& sigma = 1);
|
||||
LLT & rankUpdate(const VectorType& vec, const RealScalar& sigma = 1);
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
template<typename RhsType, typename DstType>
|
||||
@ -458,7 +458,7 @@ LLT<MatrixType,_UpLo>& LLT<MatrixType,_UpLo>::compute(const EigenBase<InputType>
|
||||
*/
|
||||
template<typename _MatrixType, int _UpLo>
|
||||
template<typename VectorType>
|
||||
LLT<_MatrixType,_UpLo> LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma)
|
||||
LLT<_MatrixType,_UpLo> & LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType);
|
||||
eigen_assert(v.size()==m_matrix.cols());
|
||||
|
@ -684,20 +684,27 @@ struct random_default_impl<Scalar, false, true>
|
||||
{
|
||||
static inline Scalar run(const Scalar& x, const Scalar& y)
|
||||
{
|
||||
typedef typename conditional<NumTraits<Scalar>::IsSigned,std::ptrdiff_t,std::size_t>::type ScalarX;
|
||||
if(y<x)
|
||||
if (y <= x)
|
||||
return x;
|
||||
// the following difference might overflow on a 32 bits system,
|
||||
// but since y>=x the result converted to an unsigned long is still correct.
|
||||
std::size_t range = ScalarX(y)-ScalarX(x);
|
||||
std::size_t offset = 0;
|
||||
// rejection sampling
|
||||
std::size_t divisor = 1;
|
||||
std::size_t multiplier = 1;
|
||||
if(range<RAND_MAX) divisor = (std::size_t(RAND_MAX)+1)/(range+1);
|
||||
else multiplier = 1 + range/(std::size_t(RAND_MAX)+1);
|
||||
// ScalarU is the unsigned counterpart of Scalar, possibly Scalar itself.
|
||||
typedef typename make_unsigned<Scalar>::type ScalarU;
|
||||
// ScalarX is the widest of ScalarU and unsigned int.
|
||||
// We'll deal only with ScalarX and unsigned int below thus avoiding signed
|
||||
// types and arithmetic and signed overflows (which are undefined behavior).
|
||||
typedef typename conditional<(ScalarU(-1) > unsigned(-1)), ScalarU, unsigned>::type ScalarX;
|
||||
// The following difference doesn't overflow, provided our integer types are two's
|
||||
// complement and have the same number of padding bits in signed and unsigned variants.
|
||||
// This is the case in most modern implementations of C++.
|
||||
ScalarX range = ScalarX(y) - ScalarX(x);
|
||||
ScalarX offset = 0;
|
||||
ScalarX divisor = 1;
|
||||
ScalarX multiplier = 1;
|
||||
const unsigned rand_max = RAND_MAX;
|
||||
if (range <= rand_max) divisor = (rand_max + 1) / (range + 1);
|
||||
else multiplier = 1 + range / (rand_max + 1);
|
||||
// Rejection sampling.
|
||||
do {
|
||||
offset = (std::size_t(std::rand()) * multiplier) / divisor;
|
||||
offset = (unsigned(std::rand()) * multiplier) / divisor;
|
||||
} while (offset > range);
|
||||
return Scalar(ScalarX(x) + offset);
|
||||
}
|
||||
@ -869,7 +876,7 @@ template<typename T> T generic_fast_tanh_float(const T& a_x);
|
||||
|
||||
namespace numext {
|
||||
|
||||
#if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC)) && !defined(__SYCL_DEVICE_ONLY__)
|
||||
#if (!defined(EIGEN_GPUCC) || defined(EIGEN_CONSTEXPR_ARE_DEVICE_FUNC))
|
||||
template<typename T>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
|
||||
@ -885,80 +892,6 @@ EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
|
||||
EIGEN_USING_STD_MATH(max);
|
||||
return max EIGEN_NOT_A_MACRO (x,y);
|
||||
}
|
||||
|
||||
#elif defined(__SYCL_DEVICE_ONLY__)
|
||||
template<typename T>
|
||||
EIGEN_ALWAYS_INLINE T mini(const T& x, const T& y)
|
||||
{
|
||||
return y < x ? y : x;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
EIGEN_ALWAYS_INLINE T maxi(const T& x, const T& y)
|
||||
{
|
||||
return x < y ? y : x;
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE int mini(const int& x, const int& y)
|
||||
{
|
||||
return cl::sycl::min(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE int maxi(const int& x, const int& y)
|
||||
{
|
||||
return cl::sycl::max(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE unsigned int mini(const unsigned int& x, const unsigned int& y)
|
||||
{
|
||||
return cl::sycl::min(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE unsigned int maxi(const unsigned int& x, const unsigned int& y)
|
||||
{
|
||||
return cl::sycl::max(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE long mini(const long & x, const long & y)
|
||||
{
|
||||
return cl::sycl::min(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE long maxi(const long & x, const long & y)
|
||||
{
|
||||
return cl::sycl::max(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE unsigned long mini(const unsigned long& x, const unsigned long& y)
|
||||
{
|
||||
return cl::sycl::min(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE unsigned long maxi(const unsigned long& x, const unsigned long& y)
|
||||
{
|
||||
return cl::sycl::max(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE float mini(const float& x, const float& y)
|
||||
{
|
||||
return cl::sycl::fmin(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE float maxi(const float& x, const float& y)
|
||||
{
|
||||
return cl::sycl::fmax(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE double mini(const double& x, const double& y)
|
||||
{
|
||||
return cl::sycl::fmin(x,y);
|
||||
}
|
||||
|
||||
EIGEN_ALWAYS_INLINE double maxi(const double& x, const double& y)
|
||||
{
|
||||
return cl::sycl::fmax(x,y);
|
||||
}
|
||||
|
||||
#else
|
||||
template<typename T>
|
||||
EIGEN_DEVICE_FUNC
|
||||
@ -1021,6 +954,75 @@ EIGEN_ALWAYS_INLINE long double maxi(const long double& x, const long double& y)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
|
||||
#define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
|
||||
#define SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_char) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_short) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_int) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
|
||||
#define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
|
||||
#define SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ushort) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_uint) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_ulong)
|
||||
#define SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC)
|
||||
#define SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY(NAME, FUNC)
|
||||
#define SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
|
||||
SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
|
||||
#define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(NAME, FUNC) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, cl::sycl::cl_float) \
|
||||
SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC,cl::sycl::cl_double)
|
||||
#define SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(NAME, FUNC, RET_TYPE) \
|
||||
SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_float) \
|
||||
SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, cl::sycl::cl_double)
|
||||
|
||||
#define SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
|
||||
template<> \
|
||||
EIGEN_DEVICE_FUNC \
|
||||
EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE& x) { \
|
||||
return cl::sycl::FUNC(x); \
|
||||
}
|
||||
|
||||
#define SYCL_SPECIALIZE_UNARY_FUNC(NAME, FUNC, TYPE) \
|
||||
SYCL_SPECIALIZE_GEN_UNARY_FUNC(NAME, FUNC, TYPE, TYPE)
|
||||
|
||||
#define SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \
|
||||
template<> \
|
||||
EIGEN_DEVICE_FUNC \
|
||||
EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
|
||||
return cl::sycl::FUNC(x, y); \
|
||||
}
|
||||
|
||||
#define SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE) \
|
||||
SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
|
||||
|
||||
#define SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, TYPE) \
|
||||
SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
|
||||
|
||||
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(mini, fmin)
|
||||
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(maxi, max)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(maxi, fmax)
|
||||
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
|
||||
template<typename Scalar>
|
||||
EIGEN_DEVICE_FUNC
|
||||
@ -1102,6 +1104,10 @@ inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar&
|
||||
return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y);
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(hypot, hypot)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
template<typename Scalar>
|
||||
EIGEN_DEVICE_FUNC
|
||||
inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x)
|
||||
@ -1110,9 +1116,8 @@ inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float log1p(float x) { return cl::sycl::log1p(x); }
|
||||
EIGEN_ALWAYS_INLINE double log1p(double x) { return cl::sycl::log1p(x); }
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log1p, log1p)
|
||||
#endif //defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||
@ -1130,8 +1135,7 @@ inline typename internal::pow_impl<ScalarX,ScalarY>::result_type pow(const Scala
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float pow(float x, float y) { return cl::sycl::pow(x, y); }
|
||||
EIGEN_ALWAYS_INLINE double pow(double x, double y) { return cl::sycl::pow(x, y); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(pow, pow)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
template<typename T> EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); }
|
||||
@ -1139,12 +1143,9 @@ template<typename T> EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return inte
|
||||
template<typename T> EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); }
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float isnan(float x) { return cl::sycl::isnan(x); }
|
||||
EIGEN_ALWAYS_INLINE double isnan(double x) { return cl::sycl::isnan(x); }
|
||||
EIGEN_ALWAYS_INLINE float isinf(float x) { return cl::sycl::isinf(x); }
|
||||
EIGEN_ALWAYS_INLINE double isinf(double x) { return cl::sycl::isinf(x); }
|
||||
EIGEN_ALWAYS_INLINE float isfinite(float x) { return cl::sycl::isfinite(x); }
|
||||
EIGEN_ALWAYS_INLINE double isfinite(double x) { return cl::sycl::isfinite(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isnan, isnan, bool)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isinf, isinf, bool)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE(isfinite, isfinite, bool)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
template<typename Scalar>
|
||||
@ -1155,8 +1156,7 @@ inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float round(float x) { return cl::sycl::round(x); }
|
||||
EIGEN_ALWAYS_INLINE double round(double x) { return cl::sycl::round(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(round, round)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
template<typename T>
|
||||
@ -1168,8 +1168,7 @@ T (floor)(const T& x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float floor(float x) { return cl::sycl::floor(x); }
|
||||
EIGEN_ALWAYS_INLINE double floor(double x) { return cl::sycl::floor(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(floor, floor)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1189,8 +1188,7 @@ T (ceil)(const T& x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float ceil(float x) { return cl::sycl::ceil(x); }
|
||||
EIGEN_ALWAYS_INLINE double ceil(double x) { return cl::sycl::ceil(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(ceil, ceil)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1234,8 +1232,7 @@ T sqrt(const T &x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float sqrt(float x) { return cl::sycl::sqrt(x); }
|
||||
EIGEN_ALWAYS_INLINE double sqrt(double x) { return cl::sycl::sqrt(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sqrt, sqrt)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
template<typename T>
|
||||
@ -1246,8 +1243,7 @@ T log(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float log(float x) { return cl::sycl::log(x); }
|
||||
EIGEN_ALWAYS_INLINE double log(double x) { return cl::sycl::log(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(log, log)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
|
||||
@ -1275,8 +1271,8 @@ abs(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float abs(float x) { return cl::sycl::fabs(x); }
|
||||
EIGEN_ALWAYS_INLINE double abs(double x) { return cl::sycl::fabs(x); }
|
||||
SYCL_SPECIALIZE_INTEGER_TYPES_UNARY(abs, abs)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(abs, fabs)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1305,8 +1301,7 @@ T exp(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float exp(float x) { return cl::sycl::exp(x); }
|
||||
EIGEN_ALWAYS_INLINE double exp(double x) { return cl::sycl::exp(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(exp, exp)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1341,8 +1336,7 @@ inline EIGEN_MATHFUNC_RETVAL(expm1, Scalar) expm1(const Scalar& x)
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float expm1(float x) { return cl::sycl::expm1(x); }
|
||||
EIGEN_ALWAYS_INLINE double expm1(double x) { return cl::sycl::expm1(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(expm1, expm1)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1361,8 +1355,7 @@ T cos(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float cos(float x) { return cl::sycl::cos(x); }
|
||||
EIGEN_ALWAYS_INLINE double cos(double x) { return cl::sycl::cos(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cos,cos)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1381,8 +1374,7 @@ T sin(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float sin(float x) { return cl::sycl::sin(x); }
|
||||
EIGEN_ALWAYS_INLINE double sin(double x) { return cl::sycl::sin(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sin, sin)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1401,8 +1393,7 @@ T tan(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float tan(float x) { return cl::sycl::tan(x); }
|
||||
EIGEN_ALWAYS_INLINE double tan(double x) { return cl::sycl::tan(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tan, tan)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1430,10 +1421,8 @@ T acosh(const T &x) {
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float acos(float x) { return cl::sycl::acos(x); }
|
||||
EIGEN_ALWAYS_INLINE double acos(double x) { return cl::sycl::acos(x); }
|
||||
EIGEN_ALWAYS_INLINE float acosh(float x) { return cl::sycl::acosh(x); }
|
||||
EIGEN_ALWAYS_INLINE double acosh(double x) { return cl::sycl::acosh(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acos, acos)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(acosh, acosh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1461,10 +1450,8 @@ T asinh(const T &x) {
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float asin(float x) { return cl::sycl::asin(x); }
|
||||
EIGEN_ALWAYS_INLINE double asin(double x) { return cl::sycl::asin(x); }
|
||||
EIGEN_ALWAYS_INLINE float asinh(float x) { return cl::sycl::asinh(x); }
|
||||
EIGEN_ALWAYS_INLINE double asinh(double x) { return cl::sycl::asinh(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asin, asin)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(asinh, asinh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1492,10 +1479,8 @@ T atanh(const T &x) {
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float atan(float x) { return cl::sycl::atan(x); }
|
||||
EIGEN_ALWAYS_INLINE double atan(double x) { return cl::sycl::atan(x); }
|
||||
EIGEN_ALWAYS_INLINE float atanh(float x) { return cl::sycl::atanh(x); }
|
||||
EIGEN_ALWAYS_INLINE double atanh(double x) { return cl::sycl::atanh(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atan, atan)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(atanh, atanh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1515,8 +1500,7 @@ T cosh(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float cosh(float x) { return cl::sycl::cosh(x); }
|
||||
EIGEN_ALWAYS_INLINE double cosh(double x) { return cl::sycl::cosh(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(cosh, cosh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1535,8 +1519,7 @@ T sinh(const T &x) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float sinh(float x) { return cl::sycl::sinh(x); }
|
||||
EIGEN_ALWAYS_INLINE double sinh(double x) { return cl::sycl::sinh(x); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(sinh, sinh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1554,14 +1537,15 @@ T tanh(const T &x) {
|
||||
return tanh(x);
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float tanh(float x) { return cl::sycl::tanh(x); }
|
||||
EIGEN_ALWAYS_INLINE double tanh(double x) { return cl::sycl::tanh(x); }
|
||||
#elif (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH
|
||||
#if (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH && (!defined(__SYCL_DEVICE_ONLY__))
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||
float tanh(float x) { return internal::generic_fast_tanh_float(x); }
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(tanh, tanh)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||
float tanh(const float &x) { return ::tanhf(x); }
|
||||
@ -1578,8 +1562,7 @@ T fmod(const T& a, const T& b) {
|
||||
}
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
EIGEN_ALWAYS_INLINE float fmod(float x, float y) { return cl::sycl::fmod(x, y); }
|
||||
EIGEN_ALWAYS_INLINE double fmod(double x, double y) { return cl::sycl::fmod(x, y); }
|
||||
SYCL_SPECIALIZE_FLOATING_TYPES_BINARY(fmod, fmod)
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
#if defined(EIGEN_GPUCC)
|
||||
@ -1596,6 +1579,23 @@ double fmod(const double& a, const double& b) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__SYCL_DEVICE_ONLY__)
|
||||
#undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY
|
||||
#undef SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_UNARY
|
||||
#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY
|
||||
#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
|
||||
#undef SYCL_SPECIALIZE_INTEGER_TYPES_BINARY
|
||||
#undef SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_UNARY
|
||||
#undef SYCL_SPECIALIZE_FLOATING_TYPES_BINARY
|
||||
#undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY
|
||||
#undef SYCL_SPECIALIZE_FLOATING_TYPES_UNARY_FUNC_RET_TYPE
|
||||
#undef SYCL_SPECIALIZE_GEN_UNARY_FUNC
|
||||
#undef SYCL_SPECIALIZE_UNARY_FUNC
|
||||
#undef SYCL_SPECIALIZE_GEN1_BINARY_FUNC
|
||||
#undef SYCL_SPECIALIZE_GEN2_BINARY_FUNC
|
||||
#undef SYCL_SPECIALIZE_BINARY_FUNC
|
||||
#endif // defined(__SYCL_DEVICE_ONLY__)
|
||||
|
||||
} // end namespace numext
|
||||
|
||||
namespace internal {
|
||||
|
@ -20,7 +20,7 @@ namespace internal {
|
||||
/** \internal
|
||||
* Evaluator of a product expression.
|
||||
* Since products require special treatments to handle all possible cases,
|
||||
* we simply deffer the evaluation logic to a product_evaluator class
|
||||
* we simply defer the evaluation logic to a product_evaluator class
|
||||
* which offers more partial specialization possibilities.
|
||||
*
|
||||
* \sa class product_evaluator
|
||||
@ -128,7 +128,7 @@ protected:
|
||||
PlainObject m_result;
|
||||
};
|
||||
|
||||
// The following three shortcuts are enabled only if the scalar types match excatly.
|
||||
// The following three shortcuts are enabled only if the scalar types match exactly.
|
||||
// TODO: we could enable them for different scalar types when the product is not vectorized.
|
||||
|
||||
// Dense = Product
|
||||
|
@ -60,7 +60,7 @@ struct __half_raw {
|
||||
#if defined(EIGEN_HAS_OLD_HIP_FP16)
|
||||
// Make a __half_raw definition that is
|
||||
// ++ compatible with that of Eigen and
|
||||
// ++ add a implcit conversion to the native __half of the old HIP implementation.
|
||||
// ++ add an implicit conversion to the native __half of the old HIP implementation.
|
||||
//
|
||||
// Keeping ".x" as "unsigned short" keeps the interface the same between the Eigen and HIP implementation.
|
||||
//
|
||||
@ -272,7 +272,11 @@ namespace half_impl {
|
||||
// conversion steps back and forth.
|
||||
|
||||
EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) {
|
||||
#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000
|
||||
return __hadd(::__half(a), ::__half(b));
|
||||
#else
|
||||
return __hadd(a, b);
|
||||
#endif
|
||||
}
|
||||
EIGEN_STRONG_INLINE __device__ half operator * (const half& a, const half& b) {
|
||||
return __hmul(a, b);
|
||||
@ -281,9 +285,13 @@ EIGEN_STRONG_INLINE __device__ half operator - (const half& a, const half& b) {
|
||||
return __hsub(a, b);
|
||||
}
|
||||
EIGEN_STRONG_INLINE __device__ half operator / (const half& a, const half& b) {
|
||||
#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000
|
||||
return __hdiv(a, b);
|
||||
#else
|
||||
float num = __half2float(a);
|
||||
float denom = __half2float(b);
|
||||
return __float2half(num / denom);
|
||||
#endif
|
||||
}
|
||||
EIGEN_STRONG_INLINE __device__ half operator - (const half& a) {
|
||||
return __hneg(a);
|
||||
@ -399,7 +407,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __half_raw raw_uint16_to_half(unsigned sho
|
||||
return h;
|
||||
}
|
||||
|
||||
union FP32 {
|
||||
union float32_bits {
|
||||
unsigned int u;
|
||||
float f;
|
||||
};
|
||||
@ -416,11 +424,11 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __half_raw float_to_half_rtne(float ff) {
|
||||
return h;
|
||||
|
||||
#else
|
||||
FP32 f; f.f = ff;
|
||||
float32_bits f; f.f = ff;
|
||||
|
||||
const FP32 f32infty = { 255 << 23 };
|
||||
const FP32 f16max = { (127 + 16) << 23 };
|
||||
const FP32 denorm_magic = { ((127 - 15) + (23 - 10) + 1) << 23 };
|
||||
const float32_bits f32infty = { 255 << 23 };
|
||||
const float32_bits f16max = { (127 + 16) << 23 };
|
||||
const float32_bits denorm_magic = { ((127 - 15) + (23 - 10) + 1) << 23 };
|
||||
unsigned int sign_mask = 0x80000000u;
|
||||
__half_raw o;
|
||||
o.x = static_cast<unsigned short>(0x0u);
|
||||
@ -470,9 +478,9 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC float half_to_float(__half_raw h) {
|
||||
return _cvtsh_ss(h.x);
|
||||
|
||||
#else
|
||||
const FP32 magic = { 113 << 23 };
|
||||
const float32_bits magic = { 113 << 23 };
|
||||
const unsigned int shifted_exp = 0x7c00 << 13; // exponent mask after shift
|
||||
FP32 o;
|
||||
float32_bits o;
|
||||
|
||||
o.u = (h.x & 0x7fff) << 13; // exponent/mantissa bits
|
||||
unsigned int exp = shifted_exp & o.u; // just the exponent
|
||||
|
@ -1178,7 +1178,7 @@ EIGEN_STRONG_INLINE double predux_min<Packet2d>(const Packet2d& a) {
|
||||
return v[0];
|
||||
#else
|
||||
double a0 = a[0], a1 = a[1];
|
||||
return ((std::isnan)(a0) || a0 < a1) ? a0 : a1;
|
||||
return ((numext::isnan)(a0) || a0 < a1) ? a0 : a1;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1193,7 +1193,7 @@ EIGEN_STRONG_INLINE double predux_max<Packet2d>(const Packet2d& a) {
|
||||
return v[0];
|
||||
#else
|
||||
double a0 = a[0], a1 = a[1];
|
||||
return ((std::isnan)(a0) || a0 > a1) ? a0 : a1;
|
||||
return ((numext::isnan)(a0) || a0 > a1) ? a0 : a1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -80,4 +80,12 @@
|
||||
#pragma diag_suppress 2739
|
||||
#endif
|
||||
|
||||
#else
|
||||
// warnings already disabled:
|
||||
# ifndef EIGEN_WARNINGS_DISABLED_2
|
||||
# define EIGEN_WARNINGS_DISABLED_2
|
||||
# elif defined(EIGEN_INTERNAL_DEBUGGING)
|
||||
# error "Do not include \"DisableStupidWarnings.h\" recursively more than twice!"
|
||||
# endif
|
||||
|
||||
#endif // not EIGEN_WARNINGS_DISABLED
|
||||
|
@ -177,7 +177,7 @@ EIGEN_DEVICE_FUNC inline void* aligned_malloc(std::size_t size)
|
||||
#endif
|
||||
|
||||
#if EIGEN_DEFAULT_ALIGN_BYTES==16
|
||||
eigen_assert((size<16 || (std::size_t(result)%16)==0) && "System's malloc returned an unaligned pointer. Compile with EIGEN_MALLOC_ALREADY_ALIGNED=0 to fallback to handmade alignd memory allocator.");
|
||||
eigen_assert((size<16 || (std::size_t(result)%16)==0) && "System's malloc returned an unaligned pointer. Compile with EIGEN_MALLOC_ALREADY_ALIGNED=0 to fallback to handmade aligned memory allocator.");
|
||||
#endif
|
||||
#else
|
||||
result = handmade_aligned_malloc(size);
|
||||
|
@ -128,6 +128,27 @@ template<> struct is_integral<unsigned __int64> { enum { value = true }; }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if EIGEN_HAS_CXX11
|
||||
using std::make_unsigned;
|
||||
#else
|
||||
// TODO: Possibly improve this implementation of make_unsigned.
|
||||
// It is currently used only by
|
||||
// template<typename Scalar> struct random_default_impl<Scalar, false, true>.
|
||||
template<typename> struct make_unsigned;
|
||||
template<> struct make_unsigned<char> { typedef unsigned char type; };
|
||||
template<> struct make_unsigned<signed char> { typedef unsigned char type; };
|
||||
template<> struct make_unsigned<unsigned char> { typedef unsigned char type; };
|
||||
template<> struct make_unsigned<signed short> { typedef unsigned short type; };
|
||||
template<> struct make_unsigned<unsigned short> { typedef unsigned short type; };
|
||||
template<> struct make_unsigned<signed int> { typedef unsigned int type; };
|
||||
template<> struct make_unsigned<unsigned int> { typedef unsigned int type; };
|
||||
template<> struct make_unsigned<signed long> { typedef unsigned long type; };
|
||||
template<> struct make_unsigned<unsigned long> { typedef unsigned long type; };
|
||||
#if EIGEN_COMP_MSVC
|
||||
template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 type; };
|
||||
template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template <typename T> struct add_const { typedef const T type; };
|
||||
template <typename T> struct add_const<T&> { typedef T& type; };
|
||||
|
@ -1,4 +1,8 @@
|
||||
#ifdef EIGEN_WARNINGS_DISABLED
|
||||
#ifdef EIGEN_WARNINGS_DISABLED_2
|
||||
// "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet!
|
||||
# undef EIGEN_WARNINGS_DISABLED_2
|
||||
|
||||
#elif defined(EIGEN_WARNINGS_DISABLED)
|
||||
#undef EIGEN_WARNINGS_DISABLED
|
||||
|
||||
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
* If the dimension of the ambient space is greater than 2, then there isn't uniqueness,
|
||||
* so an arbitrary choice is made.
|
||||
*/
|
||||
// FIXME to be consitent with the rest this could be implemented as a static Through function ??
|
||||
// FIXME to be consistent with the rest this could be implemented as a static Through function ??
|
||||
EIGEN_DEVICE_FUNC explicit Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized)
|
||||
{
|
||||
normal() = parametrized.direction().unitOrthogonal();
|
||||
|
@ -115,7 +115,7 @@ template<int Mode> struct transform_make_affine;
|
||||
* \end{array} \right) \f$
|
||||
*
|
||||
* Note that for a projective transformation the last row can be anything,
|
||||
* and then the interpretation of different parts might be sightly different.
|
||||
* and then the interpretation of different parts might be slightly different.
|
||||
*
|
||||
* However, unlike a plain matrix, the Transform class provides many features
|
||||
* simplifying both its assembly and usage. In particular, it can be composed
|
||||
|
@ -70,18 +70,18 @@ public:
|
||||
/** Constructs and initialize the translation transformation from a vector of translation coefficients */
|
||||
EIGEN_DEVICE_FUNC explicit inline Translation(const VectorType& vector) : m_coeffs(vector) {}
|
||||
|
||||
/** \brief Retruns the x-translation by value. **/
|
||||
/** \brief Returns the x-translation by value. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar x() const { return m_coeffs.x(); }
|
||||
/** \brief Retruns the y-translation by value. **/
|
||||
/** \brief Returns the y-translation by value. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar y() const { return m_coeffs.y(); }
|
||||
/** \brief Retruns the z-translation by value. **/
|
||||
/** \brief Returns the z-translation by value. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar z() const { return m_coeffs.z(); }
|
||||
|
||||
/** \brief Retruns the x-translation as a reference. **/
|
||||
/** \brief Returns the x-translation as a reference. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar& x() { return m_coeffs.x(); }
|
||||
/** \brief Retruns the y-translation as a reference. **/
|
||||
/** \brief Returns the y-translation as a reference. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar& y() { return m_coeffs.y(); }
|
||||
/** \brief Retruns the z-translation as a reference. **/
|
||||
/** \brief Returns the z-translation as a reference. **/
|
||||
EIGEN_DEVICE_FUNC inline Scalar& z() { return m_coeffs.z(); }
|
||||
|
||||
EIGEN_DEVICE_FUNC const VectorType& vector() const { return m_coeffs; }
|
||||
|
@ -73,13 +73,13 @@ template<typename Scalar> class JacobiRotation
|
||||
bool makeJacobi(const RealScalar& x, const Scalar& y, const RealScalar& z);
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* z=0);
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* r=0);
|
||||
|
||||
protected:
|
||||
EIGEN_DEVICE_FUNC
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::true_type);
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::true_type);
|
||||
EIGEN_DEVICE_FUNC
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* z, internal::false_type);
|
||||
void makeGivens(const Scalar& p, const Scalar& q, Scalar* r, internal::false_type);
|
||||
|
||||
Scalar m_c, m_s;
|
||||
};
|
||||
@ -145,7 +145,7 @@ inline bool JacobiRotation<Scalar>::makeJacobi(const MatrixBase<Derived>& m, Ind
|
||||
* \f$ V = \left ( \begin{array}{c} p \\ q \end{array} \right )\f$ yields:
|
||||
* \f$ G^* V = \left ( \begin{array}{c} r \\ 0 \end{array} \right )\f$.
|
||||
*
|
||||
* The value of \a z is returned if \a z is not null (the default is null).
|
||||
* The value of \a r is returned if \a r is not null (the default is null).
|
||||
* Also note that G is built such that the cosine is always real.
|
||||
*
|
||||
* Example: \include Jacobi_makeGivens.cpp
|
||||
@ -159,9 +159,9 @@ inline bool JacobiRotation<Scalar>::makeJacobi(const MatrixBase<Derived>& m, Ind
|
||||
*/
|
||||
template<typename Scalar>
|
||||
EIGEN_DEVICE_FUNC
|
||||
void JacobiRotation<Scalar>::makeGivens(const Scalar& p, const Scalar& q, Scalar* z)
|
||||
void JacobiRotation<Scalar>::makeGivens(const Scalar& p, const Scalar& q, Scalar* r)
|
||||
{
|
||||
makeGivens(p, q, z, typename internal::conditional<NumTraits<Scalar>::IsComplex, internal::true_type, internal::false_type>::type());
|
||||
makeGivens(p, q, r, typename internal::conditional<NumTraits<Scalar>::IsComplex, internal::true_type, internal::false_type>::type());
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace std \
|
||||
deque(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : deque_base(first, last, a) {} \
|
||||
deque(const deque& c) : deque_base(c) {} \
|
||||
explicit deque(size_type num, const value_type& val = value_type()) : deque_base(num, val) {} \
|
||||
deque(iterator start, iterator end) : deque_base(start, end) {} \
|
||||
deque(iterator start_, iterator end_) : deque_base(start_, end_) {} \
|
||||
deque& operator=(const deque& x) { \
|
||||
deque_base::operator=(x); \
|
||||
return *this; \
|
||||
@ -62,7 +62,7 @@ namespace std {
|
||||
: deque_base(first, last, a) {} \
|
||||
deque(const deque& c) : deque_base(c) {} \
|
||||
explicit deque(size_type num, const value_type& val = value_type()) : deque_base(num, val) {} \
|
||||
deque(iterator start, iterator end) : deque_base(start, end) {} \
|
||||
deque(iterator start_, iterator end_) : deque_base(start_, end_) {} \
|
||||
deque& operator=(const deque& x) { \
|
||||
deque_base::operator=(x); \
|
||||
return *this; \
|
||||
|
@ -35,7 +35,7 @@ namespace std \
|
||||
list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : list_base(first, last, a) {} \
|
||||
list(const list& c) : list_base(c) {} \
|
||||
explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
|
||||
list(iterator start, iterator end) : list_base(start, end) {} \
|
||||
list(iterator start_, iterator end_) : list_base(start_, end_) {} \
|
||||
list& operator=(const list& x) { \
|
||||
list_base::operator=(x); \
|
||||
return *this; \
|
||||
@ -62,7 +62,7 @@ namespace std
|
||||
: list_base(first, last, a) {} \
|
||||
list(const list& c) : list_base(c) {} \
|
||||
explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
|
||||
list(iterator start, iterator end) : list_base(start, end) {} \
|
||||
list(iterator start_, iterator end_) : list_base(start_, end_) {} \
|
||||
list& operator=(const list& x) { \
|
||||
list_base::operator=(x); \
|
||||
return *this; \
|
||||
|
@ -36,7 +36,7 @@ namespace std \
|
||||
vector(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : vector_base(first, last, a) {} \
|
||||
vector(const vector& c) : vector_base(c) {} \
|
||||
explicit vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \
|
||||
vector(iterator start, iterator end) : vector_base(start, end) {} \
|
||||
vector(iterator start_, iterator end_) : vector_base(start_, end_) {} \
|
||||
vector& operator=(const vector& x) { \
|
||||
vector_base::operator=(x); \
|
||||
return *this; \
|
||||
@ -62,7 +62,7 @@ namespace std {
|
||||
: vector_base(first, last, a) {} \
|
||||
vector(const vector& c) : vector_base(c) {} \
|
||||
explicit vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \
|
||||
vector(iterator start, iterator end) : vector_base(start, end) {} \
|
||||
vector(iterator start_, iterator end_) : vector_base(start_, end_) {} \
|
||||
vector& operator=(const vector& x) { \
|
||||
vector_base::operator=(x); \
|
||||
return *this; \
|
||||
|
@ -10,6 +10,14 @@
|
||||
#ifndef EIGEN_BLAS_COMMON_H
|
||||
#define EIGEN_BLAS_COMMON_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if __GNUC__<5
|
||||
// GCC < 5.0 does not like the global Scalar typedef
|
||||
// we just keep shadow-warnings disabled permanently
|
||||
# define EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "../Eigen/Core"
|
||||
#include "../Eigen/Jacobi"
|
||||
|
||||
|
@ -3,7 +3,9 @@
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")
|
||||
if (NOT TARGET eigen)
|
||||
include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")
|
||||
endif ()
|
||||
|
||||
# Legacy variables, do *not* use. May be removed in the future.
|
||||
|
||||
|
@ -66,7 +66,7 @@ functions by defining EIGEN_HAS_C99_MATH=1.
|
||||
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
|
||||
- \b EIGEN_HAS_CXX11_MATH - controls the implementation of some functions such as round, logp1, isinf, isnan, etc.
|
||||
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
|
||||
- \b EIGEN_HAS_RVALUE_REFERENCES - defines whetehr rvalue references are supported
|
||||
- \b EIGEN_HAS_RVALUE_REFERENCES - defines whether rvalue references are supported
|
||||
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
|
||||
- \b EIGEN_HAS_STD_RESULT_OF - defines whether std::result_of is supported
|
||||
Automatic detection disabled if EIGEN_MAX_CPP_VER<11.
|
||||
|
@ -111,7 +111,7 @@ rot3 = rot1.slerp(alpha,rot2);\endcode</td></tr>
|
||||
|
||||
|
||||
<a href="#" class="top">top</a>\section TutorialGeoTransform Affine transformations
|
||||
Generic affine transformations are represented by the Transform class which internaly
|
||||
Generic affine transformations are represented by the Transform class which internally
|
||||
is a (Dim+1)^2 matrix. In Eigen we have chosen to not distinghish between points and
|
||||
vectors such that all points are actually represented by displacement vectors from the
|
||||
origin ( \f$ \mathbf{p} \equiv \mathbf{p}-0 \f$ ). With that in mind, real points and
|
||||
|
@ -156,7 +156,7 @@ EIGEN_DECLARE_TEST(boostmultiprec)
|
||||
std::cout << "NumTraits<Real>::highest() = " << NumTraits<Real>::highest() << std::endl;
|
||||
std::cout << "NumTraits<Real>::digits10() = " << NumTraits<Real>::digits10() << std::endl;
|
||||
|
||||
// chekc stream output
|
||||
// check stream output
|
||||
{
|
||||
Mat A(10,10);
|
||||
A.setRandom();
|
||||
|
@ -77,6 +77,9 @@ is_same_seq_type(const T1& a, const T2& b)
|
||||
|
||||
#define VERIFY_EQ_INT(A,B) VERIFY_IS_APPROX(int(A),int(B))
|
||||
|
||||
// C++03 does not allow local or unnamed enums as index
|
||||
enum DummyEnum { XX=0, YY=1 };
|
||||
|
||||
void check_indexed_view()
|
||||
{
|
||||
using Eigen::placeholders::all;
|
||||
@ -375,9 +378,16 @@ void check_indexed_view()
|
||||
}
|
||||
|
||||
// Check compilation of enums as index type:
|
||||
a(XX) = 1;
|
||||
A(XX,YY) = 1;
|
||||
// Anonymous enums only work with C++11
|
||||
#if EIGEN_HAS_CXX11
|
||||
enum { X=0, Y=1 };
|
||||
a(X) = 1;
|
||||
A(X,Y) = 1;
|
||||
A(XX,Y) = 1;
|
||||
A(X,YY) = 1;
|
||||
#endif
|
||||
|
||||
// Check compilation of varying integer types as index types:
|
||||
Index i = n/2;
|
||||
|
@ -134,8 +134,8 @@ template<typename MatrixType> void integer_type_tests(const MatrixType& m)
|
||||
template<int>
|
||||
void integer_types_extra()
|
||||
{
|
||||
VERIFY_IS_EQUAL(internal::scalar_div_cost<int>::value, 8);
|
||||
VERIFY_IS_EQUAL(internal::scalar_div_cost<unsigned int>::value, 8);
|
||||
VERIFY_IS_EQUAL(int(internal::scalar_div_cost<int>::value), 8);
|
||||
VERIFY_IS_EQUAL(int(internal::scalar_div_cost<unsigned int>::value), 8);
|
||||
if(sizeof(long)>sizeof(int)) {
|
||||
VERIFY(int(internal::scalar_div_cost<long>::value) > int(internal::scalar_div_cost<int>::value));
|
||||
VERIFY(int(internal::scalar_div_cost<unsigned long>::value) > int(internal::scalar_div_cost<int>::value));
|
||||
|
@ -9,8 +9,12 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
// GCC<=4.8 has spurious shadow warnings, because `ptr` re-appears inside template instantiations
|
||||
// workaround: put these in an anonymous namespace
|
||||
namespace {
|
||||
float *ptr;
|
||||
const float *const_ptr;
|
||||
}
|
||||
|
||||
template<typename PlainObjectType,
|
||||
bool IsDynamicSize = PlainObjectType::SizeAtCompileTime == Dynamic,
|
||||
|
@ -68,7 +68,7 @@ template<typename MatrixType> void triangular_square(const MatrixType& m)
|
||||
while (numext::abs2(m1(i,i))<RealScalar(1e-1)) m1(i,i) = internal::random<Scalar>();
|
||||
|
||||
Transpose<MatrixType> trm4(m4);
|
||||
// test back and forward subsitution with a vector as the rhs
|
||||
// test back and forward substitution with a vector as the rhs
|
||||
m3 = m1.template triangularView<Upper>();
|
||||
VERIFY(v2.isApprox(m3.adjoint() * (m1.adjoint().template triangularView<Lower>().solve(v2)), largerEps));
|
||||
m3 = m1.template triangularView<Lower>();
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
#include <Eigen/Geometry>
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
/**
|
||||
@ -221,4 +223,6 @@ struct evaluator<AlignedVector3<Scalar> >
|
||||
|
||||
}
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_ALIGNED_VECTOR3
|
||||
|
@ -11,8 +11,6 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
|
||||
/** \defgroup ArpackSupport_Module Arpack support module
|
||||
*
|
||||
* This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition.
|
||||
@ -23,6 +21,8 @@
|
||||
*/
|
||||
|
||||
#include <Eigen/SparseCholesky>
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
#include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h"
|
||||
|
||||
#include <Eigen/src/Core/util/ReenableStupidWarnings.h>
|
||||
|
@ -28,11 +28,17 @@ namespace Eigen {
|
||||
//@{
|
||||
|
||||
}
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
|
||||
#include "src/AutoDiff/AutoDiffScalar.h"
|
||||
// #include "src/AutoDiff/AutoDiffVector.h"
|
||||
#include "src/AutoDiff/AutoDiffJacobian.h"
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
|
||||
|
||||
namespace Eigen {
|
||||
//@}
|
||||
}
|
||||
|
@ -26,9 +26,9 @@
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
|
||||
#include "../SpecialFunctions"
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
#include "src/util/CXX11Meta.h"
|
||||
#include "src/util/MaxSizeVector.h"
|
||||
|
||||
|
@ -79,7 +79,7 @@ struct TensorOpResourceRequirements {
|
||||
};
|
||||
|
||||
// Tries to merge multiple resource requirements.
|
||||
EIGEN_STRONG_INLINE void MergeResourceRequirements(
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void MergeResourceRequirements(
|
||||
const std::vector<TensorOpResourceRequirements>& resources,
|
||||
TensorBlockShapeType* block_shape, Index* block_total_size) {
|
||||
if (resources.empty()) {
|
||||
|
@ -194,7 +194,7 @@ template <std::ptrdiff_t V1=0, std::ptrdiff_t V2=0, std::ptrdiff_t V3=0, std::pt
|
||||
}
|
||||
#endif
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex operator[] (const int index) const {
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index operator[] (const Index index) const {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return internal::get<0, Base>::value;
|
||||
@ -208,7 +208,7 @@ template <std::ptrdiff_t V1=0, std::ptrdiff_t V2=0, std::ptrdiff_t V3=0, std::pt
|
||||
return internal::get<4, Base>::value;
|
||||
default:
|
||||
eigen_assert(false && "index overflow");
|
||||
return static_cast<DenseIndex>(-1);
|
||||
return static_cast<Index>(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE t array_prod(const array<t, n>& a) {
|
||||
}
|
||||
template<typename t>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE t array_prod(const array<t, 0>& /*a*/) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
template<typename t>
|
||||
|
@ -68,6 +68,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#ifdef EIGEN_FFTW_DEFAULT
|
||||
// FFTW: faster, GPL -- incompatible with Eigen in LGPL form, bigger code size
|
||||
# include <fftw3.h>
|
||||
@ -415,5 +417,8 @@ void fft_inv_proxy<T_SrcMat,T_FftIfc>::evalTo(T_DestMat& dst) const
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif
|
||||
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
|
||||
|
@ -11,6 +11,8 @@
|
||||
#define EIGEN_ITERATIVE_SOLVERS_MODULE_H
|
||||
|
||||
#include <Eigen/Sparse>
|
||||
#include "../../Eigen/Jacobi"
|
||||
#include "../../Eigen/Householder"
|
||||
|
||||
/**
|
||||
* \defgroup IterativeSolvers_Module Iterative solvers module
|
||||
@ -24,19 +26,21 @@
|
||||
*/
|
||||
//@{
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#ifndef EIGEN_MPL2_ONLY
|
||||
#include "src/IterativeSolvers/IterationController.h"
|
||||
#include "src/IterativeSolvers/ConstrainedConjGrad.h"
|
||||
#endif
|
||||
|
||||
#include "src/IterativeSolvers/IncompleteLU.h"
|
||||
#include "../../Eigen/Jacobi"
|
||||
#include "../../Eigen/Householder"
|
||||
#include "src/IterativeSolvers/GMRES.h"
|
||||
#include "src/IterativeSolvers/DGMRES.h"
|
||||
//#include "src/IterativeSolvers/SSORPreconditioner.h"
|
||||
#include "src/IterativeSolvers/MINRES.h"
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
//@}
|
||||
|
||||
#endif // EIGEN_ITERATIVE_SOLVERS_MODULE_H
|
||||
|
@ -30,6 +30,9 @@
|
||||
*/
|
||||
|
||||
#include "Eigen/SparseCore"
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
#include "src/LevenbergMarquardt/LMqrsolv.h"
|
||||
@ -41,5 +44,6 @@
|
||||
#include "src/LevenbergMarquardt/LevenbergMarquardt.h"
|
||||
#include "src/LevenbergMarquardt/LMonestep.h"
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_LEVENBERGMARQUARDT_MODULE
|
||||
|
@ -53,12 +53,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "src/MatrixFunctions/MatrixExponential.h"
|
||||
#include "src/MatrixFunctions/MatrixFunction.h"
|
||||
#include "src/MatrixFunctions/MatrixSquareRoot.h"
|
||||
#include "src/MatrixFunctions/MatrixLogarithm.h"
|
||||
#include "src/MatrixFunctions/MatrixPower.h"
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
|
||||
/**
|
||||
\page matrixbaseextra_page
|
||||
|
@ -11,10 +11,10 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
|
||||
#include <Eigen/Eigenvalues>
|
||||
|
||||
#include <Eigen/src/Core/util/DisableStupidWarnings.h>
|
||||
|
||||
// Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module
|
||||
#if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2)
|
||||
#ifndef EIGEN_HIDE_HEAVY_CODE
|
||||
|
@ -24,8 +24,12 @@ namespace Eigen
|
||||
*/
|
||||
}
|
||||
|
||||
#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
|
||||
|
||||
#include "src/Splines/SplineFwd.h"
|
||||
#include "src/Splines/Spline.h"
|
||||
#include "src/Splines/SplineFitting.h"
|
||||
|
||||
#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
|
||||
|
||||
#endif // EIGEN_SPLINES_MODULE_H
|
||||
|
@ -173,15 +173,14 @@ namespace Eigen
|
||||
EIGEN_EULER_ANGLES_CLASS_STATIC_ASSERT((unsigned)BetaAxisAbs != (unsigned)GammaAxisAbs,
|
||||
BETA_AXIS_CANT_BE_EQUAL_TO_GAMMA_AXIS);
|
||||
|
||||
enum
|
||||
{
|
||||
static const int
|
||||
// I, J, K are the pivot indexes permutation for the rotation matrix, that match this Euler system.
|
||||
// They are used in this class converters.
|
||||
// They are always different from each other, and their possible values are: 0, 1, or 2.
|
||||
I = AlphaAxisAbs - 1,
|
||||
J = (AlphaAxisAbs - 1 + 1 + IsOdd)%3,
|
||||
K = (AlphaAxisAbs - 1 + 2 - IsOdd)%3
|
||||
};
|
||||
;
|
||||
|
||||
// TODO: Get @mat parameter in form that avoids double evaluation.
|
||||
template <typename Derived>
|
||||
|
@ -234,12 +234,13 @@ struct matrix_exp_computeUV<MatrixType, float>
|
||||
template <typename MatrixType>
|
||||
struct matrix_exp_computeUV<MatrixType, double>
|
||||
{
|
||||
typedef typename NumTraits<typename traits<MatrixType>::Scalar>::Real RealScalar;
|
||||
template <typename ArgType>
|
||||
static void run(const ArgType& arg, MatrixType& U, MatrixType& V, int& squarings)
|
||||
{
|
||||
using std::frexp;
|
||||
using std::pow;
|
||||
const double l1norm = arg.cwiseAbs().colwise().sum().maxCoeff();
|
||||
const RealScalar l1norm = arg.cwiseAbs().colwise().sum().maxCoeff();
|
||||
squarings = 0;
|
||||
if (l1norm < 1.495585217958292e-002) {
|
||||
matrix_exp_pade3(arg, U, V);
|
||||
@ -250,10 +251,10 @@ struct matrix_exp_computeUV<MatrixType, double>
|
||||
} else if (l1norm < 2.097847961257068e+000) {
|
||||
matrix_exp_pade9(arg, U, V);
|
||||
} else {
|
||||
const double maxnorm = 5.371920351148152;
|
||||
const RealScalar maxnorm = 5.371920351148152;
|
||||
frexp(l1norm / maxnorm, &squarings);
|
||||
if (squarings < 0) squarings = 0;
|
||||
MatrixType A = arg.unaryExpr(MatrixExponentialScalingOp<double>(squarings));
|
||||
MatrixType A = arg.unaryExpr(MatrixExponentialScalingOp<RealScalar>(squarings));
|
||||
matrix_exp_pade13(A, U, V);
|
||||
}
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ void testLmdif1()
|
||||
|
||||
// do the computation
|
||||
lmdif_functor functor;
|
||||
DenseIndex nfev;
|
||||
DenseIndex nfev = -1; // initialize to avoid maybe-uninitialized warning
|
||||
info = LevenbergMarquardt<lmdif_functor>::lmdif1(functor, x, &nfev);
|
||||
|
||||
// check return value
|
||||
|
@ -24,7 +24,7 @@ struct Functor
|
||||
int m_inputs, m_values;
|
||||
|
||||
Functor() : m_inputs(InputsAtCompileTime), m_values(ValuesAtCompileTime) {}
|
||||
Functor(int inputs, int values) : m_inputs(inputs), m_values(values) {}
|
||||
Functor(int inputs_, int values_) : m_inputs(inputs_), m_values(values_) {}
|
||||
|
||||
int inputs() const { return m_inputs; }
|
||||
int values() const { return m_values; }
|
||||
|
@ -44,7 +44,7 @@ struct TestFunc1
|
||||
int m_inputs, m_values;
|
||||
|
||||
TestFunc1() : m_inputs(InputsAtCompileTime), m_values(ValuesAtCompileTime) {}
|
||||
TestFunc1(int inputs, int values) : m_inputs(inputs), m_values(values) {}
|
||||
TestFunc1(int inputs_, int values_) : m_inputs(inputs_), m_values(values_) {}
|
||||
|
||||
int inputs() const { return m_inputs; }
|
||||
int values() const { return m_values; }
|
||||
|
@ -9,7 +9,7 @@
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include "../../test/sparse_solver.h"
|
||||
#include <Eigen/src/IterativeSolvers/DGMRES.h>
|
||||
#include <unsupported/Eigen/IterativeSolvers>
|
||||
|
||||
template<typename T> void test_dgmres_T()
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ struct TestFunc1
|
||||
int m_inputs, m_values;
|
||||
|
||||
TestFunc1() : m_inputs(InputsAtCompileTime), m_values(ValuesAtCompileTime) {}
|
||||
TestFunc1(int inputs, int values) : m_inputs(inputs), m_values(values) {}
|
||||
TestFunc1(int inputs_, int values_) : m_inputs(inputs_), m_values(values_) {}
|
||||
|
||||
int inputs() const { return m_inputs; }
|
||||
int values() const { return m_values; }
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
// import basic and product tests for deprecated DynamicSparseMatrix
|
||||
#define EIGEN_NO_DEPRECATED_WARNING
|
||||
#include "sparse_basic.cpp"
|
||||
#include "sparse_product.cpp"
|
||||
#include "sparse_basic.cpp"
|
||||
#include <Eigen/SparseExtra>
|
||||
|
||||
template<typename SetterType,typename DenseType, typename Scalar, int Options>
|
||||
|
Loading…
x
Reference in New Issue
Block a user