156 #ifndef CERES_PUBLIC_JET_H_ 157 #define CERES_PUBLIC_JET_H_ 170 template <
typename T,
int N>
200 template<
typename Derived>
248 template<
typename T,
int N>
inline 257 template<
typename T,
int N>
inline 263 template<
typename T,
int N>
inline 270 template<
typename T,
int N>
inline 276 template<
typename T,
int N>
inline 282 template<
typename T,
int N>
inline 289 template<
typename T,
int N>
inline 295 template<
typename T,
int N>
inline 301 template<
typename T,
int N>
inline 308 template<
typename T,
int N>
inline 314 template<
typename T,
int N>
inline 320 template<
typename T,
int N>
inline 330 const T g_a_inverse =
T(1.0) / g.
a;
331 const T f_a_by_g_a = f.
a * g_a_inverse;
332 return Jet<T, N>(f.
a * g_a_inverse, (f.
v - f_a_by_g_a * g.
v) * g_a_inverse);
336 template<
typename T,
int N>
inline 338 const T minus_s_g_a_inverse2 = -s / (g.
a * g.
a);
339 return Jet<T, N>(s / g.
a, g.
v * minus_s_g_a_inverse2);
343 template<
typename T,
int N>
inline 345 const T s_inverse = 1.0 /
s;
346 return Jet<T, N>(f.
a * s_inverse, f.
v * s_inverse);
350 #define CERES_DEFINE_JET_COMPARISON_OPERATOR(op) \ 351 template<typename T, int N> inline \ 352 bool operator op(const Jet<T, N>& f, const Jet<T, N>& g) { \ 355 template<typename T, int N> inline \ 356 bool operator op(const T& s, const Jet<T, N>& g) { \ 359 template<typename T, int N> inline \ 360 bool operator op(const Jet<T, N>& f, const T& s) { \ 369 #undef CERES_DEFINE_JET_COMPARISON_OPERATOR 380 inline double exp (
double x) {
return std::exp(x); }
382 inline double cos (
double x) {
return std::cos(x); }
384 inline double sin (
double x) {
return std::sin(x); }
386 inline double tan (
double x) {
return std::tan(x); }
391 inline double pow (
double x,
double y) {
return std::pow(x, y); }
397 template <
typename T,
int N>
inline 399 return f.
a <
T(0.0) ? -
f :
f;
403 template <
typename T,
int N>
inline 405 const T a_inverse =
T(1.0) / f.
a;
410 template <
typename T,
int N>
inline 412 const T tmp =
exp(f.
a);
417 template <
typename T,
int N>
inline 420 const T two_a_inverse =
T(1.0) / (
T(2.0) * tmp);
425 template <
typename T,
int N>
inline 431 template <
typename T,
int N>
inline 433 const T tmp = -
T(1.0) /
sqrt(
T(1.0) - f.
a * f.
a);
438 template <
typename T,
int N>
inline 444 template <
typename T,
int N>
inline 446 const T tmp =
T(1.0) /
sqrt(
T(1.0) - f.
a * f.
a);
451 template <
typename T,
int N>
inline 453 const T tan_a =
tan(f.
a);
454 const T tmp =
T(1.0) + tan_a * tan_a;
459 template <
typename T,
int N>
inline 461 const T tmp =
T(1.0) / (
T(1.0) + f.
a * f.
a);
466 template <
typename T,
int N>
inline 472 template <
typename T,
int N>
inline 478 template <
typename T,
int N>
inline 480 const T tanh_a =
tanh(f.
a);
481 const T tmp =
T(1.0) - tanh_a * tanh_a;
496 template <
typename T,
int N>
inline 501 for (
int i = 0;
i <
N; ++
i) {
510 template <
typename T,
int N>
inline 515 for (
int i = 0;
i <
N;
i++) {
524 template <
typename T,
int N>
inline 529 for (
int i = 0;
i <
N; ++
i) {
538 template <
typename T,
int N>
inline 543 for (
int i = 0;
i <
N; ++
i) {
555 template <
typename T,
int N>
inline 562 T const tmp =
T(1.0) / (f.
a * f.
a + g.
a * g.
a);
569 template <
typename T,
int N>
inline 571 T const tmp = g *
pow(f.
a, g -
T(1.0));
577 template <
typename T,
int N>
inline 579 T const tmp =
pow(f, g.
a);
586 template <
typename T,
int N>
inline 588 T const tmp1 =
pow(f.
a, g.
a);
589 T const tmp2 = g.
a *
pow(f.
a, g.
a -
T(1.0));
590 T const tmp3 = tmp1 *
log(f.
a);
630 template <
typename T,
int N>
631 inline std::ostream &operator<<(std::ostream &s, const Jet<T, N>&
z) {
632 return s <<
"[" <<
z.a <<
" ; " <<
z.v.transpose() <<
"]";
641 template<
typename T,
int N>
663 HasFloatingPoint = 1,
664 RequireInitialization = 1
670 #endif // CERES_PUBLIC_JET_H_ Jet< T, N > ei_abs2(const Jet< T, N > &x)
Jet< T, N > ei_tan(const Jet< T, N > &x)
Jet< T, N > atan(const Jet< T, N > &f)
Jet< T, N > ei_tanh(const Jet< T, N > &x)
#define EIGEN_STRONG_INLINE
Eigen::Matrix< T, N, 1, Eigen::DontAlign > v
const Jet< T, N > & ei_conj(const Jet< T, N > &x)
Jet< T, N > cos(const Jet< T, N > &f)
Jet< T, N > ei_sinh(const Jet< T, N > &x)
bool IsInfinite(double x)
Jet< T, N > cosh(const Jet< T, N > &f)
Jet< T, N > ei_exp(const Jet< T, N > &x)
CERES_DEFINE_JET_COMPARISON_OPERATOR(<) CERES_DEFINE_JET_COMPARISON_OPERATOR(<
int N Jet< T, N > abs(const Jet< T, N > &f)
Jet< T, N > & operator+=(const Jet< T, N > &y)
Jet< T, N > ei_abs(const Jet< T, N > &x)
Jet< T, N > acos(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
Jet< T, N > sin(const Jet< T, N > &f)
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Jet< T, N > & operator*=(const Jet< T, N > &y)
Jet< T, N > exp(const Jet< T, N > &f)
Jet< T, N > ei_cos(const Jet< T, N > &x)
Base class for all dense matrices, vectors, and arrays.
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
EIGEN_DEVICE_FUNC const LogReturnType log() const
void g(const string &key, int i)
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
Jet< T, N > tan(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
Jet(const T &value, int k)
Jet< T, N > operator/(const Jet< T, N > &f, const Jet< T, N > &g)
const Jet< T, N > & ei_real(const Jet< T, N > &x)
Jet< T, N > ei_log(const Jet< T, N > &x)
Jet< T, N > asin(const Jet< T, N > &f)
EIGEN_STRONG_INLINE Jet(const T &a, const Eigen::DenseBase< Derived > &v)
Jet< T, N > ei_sqrt(const Jet< T, N > &x)
Eigen::Triplet< double > T
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
static ceres::Jet< T, N > dummy_precision()
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Jet< T, N > ei_imag(const Jet< T, N > &)
Jet< T, N > tanh(const Jet< T, N > &f)
Jet< T, N > & operator-=(const Jet< T, N > &y)
Jet< T, N > ei_sin(const Jet< T, N > &x)
Jet< T, N > operator*(const Jet< T, N > &f, const Jet< T, N > &g)
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Jet< T, N > ei_pow(const Jet< T, N > &x, Jet< T, N > y)
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
ceres::Jet< T, N > Nested
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
Jet< T, N > ei_atan(const Jet< T, N > &x)
Jet< T, N > log(const Jet< T, N > &f)
EIGEN_DEVICE_FUNC const TanReturnType tan() const
Jet< T, N > pow(const Jet< T, N > &f, const Jet< T, N > &g)
Jet< T, N > & operator/=(const Jet< T, N > &y)
Jet< T, N > operator-(const Jet< T, N > &f)
ceres::Jet< T, N > NonInteger
Jet< T, N > sqrt(const Jet< T, N > &f)
Jet< T, N > sinh(const Jet< T, N > &f)
Jet< T, N > pow(const Jet< T, N > &f, double g)
The matrix class, also used for vectors and row-vectors.
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
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
EIGEN_DEVICE_FUNC const AsinReturnType asin() const
Jet< T, N > const & operator+(const Jet< T, N > &f)
Jet< T, N > ei_cosh(const Jet< T, N > &x)