45#ifndef JIXIE_SVD_TOOLS_H
46#define JIXIE_SVD_TOOLS_H
48#pragma GCC diagnostic push
49#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
53#pragma GCC diagnostic pop
55#if !defined(__APPLE__) || defined(__i386__) || defined(__x86_64__)
67template <
bool B,
class T =
void>
81#if !defined(__APPLE__) || defined(__i386__) || defined(__x86_64__)
82 return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(a)));
84 return vgetq_lane_f32(vrsqrteq_f32(vld1q_dup_f32(&a)), 0);
94 return (
float)1.0f / std::sqrt(a);
115template <
class T,
class Enable =
void>
117 using type =
typename T::Scalar;
128template <
class MatrixType>
131 return MatrixType::RowsAtCompileTime == m && MatrixType::ColsAtCompileTime == n;
float approx_rsqrt(float a)
Approximate inverse square root.
float rsqrt(float a)
Inverse square root computed from approx_rsqrt and one newton step.
Copyright (c) 2016 Theodore Gast, Chuyuan Fu, Chenfanfu Jiang, Joseph Teran.
typename std::enable_if< B, T >::type enable_if_t
typename INTERNAL::ScalarTypeHelper< T >::type ScalarType
constexpr bool isSize(int m, int n)