MeshLib C++ Docs
Loading...
Searching...
No Matches

Namespaces

namespace  MR::detail

Classes

class  MR::FastInt< nBits >
class  MR::Int128Mul256
class  MR::Int64Mul128
class  MR::VarBigInt

Typedefs

using MR::FastInt256 = FastInt<256>
using MR::FastInt512 = FastInt<512>
using MR::FastInt1024 = FastInt<1024>
using MR::Vector2i128mul = Vector2<Int128Mul256>
 no bindings for the same reason as for Vector3i128fast
using MR::Vector3i128mul = Vector3<Int128Mul256>
using MR::Vector2i128fast = Vector2<FastInt128>
 no bindings since no operator << and no sqrt for FastInt128
using MR::Vector3i128fast = Vector3<FastInt128>
using MR::Vector2i64mul = Vector2<Int64Mul128>
 no bindings for the same reason as for Vector3i128fast
using MR::Vector3i64mul = Vector3<Int64Mul128>

Functions

MR_BIND_IGNORE double MR::toDouble (FastInt128 v) noexcept
template<int nBits>
MR_BIND_IGNORE double MR::toDouble (const FastInt< nBits > &v) noexcept
 the nearest double to the given value, with the same guarantees as toDouble( FastInt128 ) above
template<int nBits, int mBits>
MR_BIND_IGNORE constexpr FastInt< nBits+mBits > MR::operator* (const FastInt< nBits > &a, const FastInt< mBits > &b) noexcept
template<int nBits, typename T>
requires detail::cFitsFastInt128<T>
MR_BIND_IGNORE constexpr FastInt< nBits+detail::cMulBits< T > > MR::operator* (const FastInt< nBits > &a, T b) noexcept
template<int nBits, typename T>
requires detail::cFitsFastInt128<T>
MR_BIND_IGNORE constexpr FastInt< nBits+detail::cMulBits< T > > MR::operator* (T a, const FastInt< nBits > &b) noexcept

Detailed Description

Typedef Documentation

◆ FastInt1024

using MR::FastInt1024 = FastInt<1024>

#include <MRMesh/MRFastInt.h>

◆ FastInt256

using MR::FastInt256 = FastInt<256>

#include <MRMesh/MRFastInt.h>

◆ FastInt512

using MR::FastInt512 = FastInt<512>

#include <MRMesh/MRFastInt.h>

◆ Vector2i128fast

#include <MRMesh/MRHighPrecision.h>

no bindings since no operator << and no sqrt for FastInt128

◆ Vector2i128mul

#include <MRMesh/MRFastInt.h>

no bindings for the same reason as for Vector3i128fast

◆ Vector2i64mul

#include <MRMesh/MRInt64Mul128.h>

no bindings for the same reason as for Vector3i128fast

◆ Vector3i128fast

◆ Vector3i128mul

◆ Vector3i64mul

Function Documentation

◆ operator*() [1/3]

template<int nBits, int mBits>
MR_BIND_IGNORE constexpr FastInt< nBits+mBits > MR::operator* ( const FastInt< nBits > & a,
const FastInt< mBits > & b )
nodiscardconstexprnoexcept

#include <MRMesh/MRFastInt.h>

every product below is exact, because the type of a product is as wide as the sum of the widths of its arguments; a value with a proven bound is brought back to a narrow type by the explicit narrowing constructor above

◆ operator*() [2/3]

template<int nBits, typename T>
requires detail::cFitsFastInt128<T>
MR_BIND_IGNORE constexpr FastInt< nBits+detail::cMulBits< T > > MR::operator* ( const FastInt< nBits > & a,
T b )
nodiscardconstexprnoexcept

#include <MRMesh/MRFastInt.h>

◆ operator*() [3/3]

template<int nBits, typename T>
requires detail::cFitsFastInt128<T>
MR_BIND_IGNORE constexpr FastInt< nBits+detail::cMulBits< T > > MR::operator* ( T a,
const FastInt< nBits > & b )
nodiscardconstexprnoexcept

#include <MRMesh/MRFastInt.h>

◆ toDouble() [1/2]

template<int nBits>
MR_BIND_IGNORE double MR::toDouble ( const FastInt< nBits > & v)
inlinenodiscardnoexcept

#include <MRMesh/MRFastInt.h>

the nearest double to the given value, with the same guarantees as toDouble( FastInt128 ) above

◆ toDouble() [2/2]

MR_BIND_IGNORE double MR::toDouble ( FastInt128 v)
inlinenodiscardnoexcept

#include <MRMesh/MRFastInt.h>

the nearest double to the given value: exact for a magnitude below 2^53, correctly rounded otherwise (so with a relative error below 2^-53), and +-infinity past DBL_MAX. The bound is load-bearing: the pre-filters that reject a case in double before evaluating it exactly are only safe against a stated error of the conversion feeding them

faster than the code below, and correctly rounded as well, which the FastIntToDouble tests check on each platform rather than assume