// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2016 Gael Guennebaud <gael.guennebaud@inria.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
namespace boost { namespace multiprecision { // to make ADL works as expected: using boost::math::isfinite; using boost::math::isnan; using boost::math::isinf; using boost::math::copysign; using boost::math::hypot;
// The following is needed for std::complex<Real>:
Real fabs(const Real& a) { return abs EIGEN_NOT_A_MACRO (a); }
Real fmax(const Real& a, const Real& b) { using std::max; return max(a,b); }
// some specialization for the unit tests: inlinebool test_isMuchSmallerThan(const Real& a, const Real& b) { return internal::isMuchSmallerThan(a, b, test_precision<Real>());
}
inlinebool test_isApprox(const Real& a, const Real& b) { return internal::isApprox(a, b, test_precision<Real>());
}
inlinebool test_isApproxOrLessThan(const Real& a, const Real& b) { return internal::isApproxOrLessThan(a, b, test_precision<Real>());
}
Real get_test_precision(const Real&) { return test_precision<Real>();
}
Real test_relative_error(const Real &a, const Real &b) { using Eigen::numext::abs2; return sqrt(abs2<Real>(a-b)/Eigen::numext::mini<Real>(abs2(a),abs2(b)));
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.