File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::IntegerConverter< dim, DGtal::BigInteger > Struct Template Reference

#include <DGtal/kernel/IntegerConverter.h>

Inheritance diagram for DGtal::IntegerConverter< dim, DGtal::BigInteger >:
[legend]

Public Types

typedef DGtal::BigInteger Integer

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CInteger< DGtal::BigInteger >))

Static Public Member Functions

static DGtal::BigInteger cast (DGtal::int32_t i)
static PointVector< dim, DGtal::BigIntegercast (PointVector< dim, DGtal::int32_t > p)
static DGtal::BigInteger cast (DGtal::int64_t i)
static PointVector< dim, DGtal::BigIntegercast (PointVector< dim, DGtal::int64_t > p)
static DGtal::BigInteger cast (DGtal::BigInteger i)
static PointVector< dim, DGtal::BigIntegercast (PointVector< dim, DGtal::BigInteger > p)

Detailed Description

template<DGtal::Dimension dim>
struct DGtal::IntegerConverter< dim, DGtal::BigInteger >

Allows seamless conversion of integral types and lattice points, while checking for errors when going from a more precise to a less precise type.

Specialized version for BigInteger

Template Parameters
dimstatic constant of type DGtal::Dimension that specifies the static dimension of the space and thus the number of elements of the Point or Vector.

Definition at line 264 of file IntegerConverter.h.

Member Typedef Documentation

◆ Integer

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

◆ cast() [1/6]

Parameters
iany integer
Returns
the same integer

Definition at line 312 of file IntegerConverter.h.

313 {
314 return i;
315 }
----------— INTEGER/POINT CONVERSION SERVICES -----------------—

◆ cast() [2/6]

Parameters
iany integer
Returns
the same integer

Definition at line 269 of file IntegerConverter.h.

270 {
271 return DGtal::BigInteger( i );
272 }
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>, boost::multiprecision::et_off > BigInteger
Definition BasicTypes.h:75

◆ cast() [3/6]

Parameters
iany integer
Returns
the same integer

Definition at line 290 of file IntegerConverter.h.

291 {
293 return tmp;
294 }

◆ cast() [4/6]

Conversion of a lattice point.

Parameters
pany point
Returns
the same point

Definition at line 323 of file IntegerConverter.h.

324 {
325 return p;
326 }

◆ cast() [5/6]

Conversion of a lattice point.

Parameters
pany point
Returns
the same point

Definition at line 280 of file IntegerConverter.h.

281 {
283 for ( DGtal::Dimension i = 0; i < dim; i++ )
284 q[ i ] = cast( p[ i ] );
285 return q;
286 }
static DGtal::BigInteger cast(DGtal::int32_t i)

References DGtal::IntegerConverter< dim, TInteger >::cast(), and dim.

◆ cast() [6/6]

Conversion of a lattice point.

Parameters
pany point
Returns
the same point

Definition at line 302 of file IntegerConverter.h.

303 {
305 for ( DGtal::Dimension i = 0; i < dim; i++ )
306 q[ i ] = cast( p[ i ] );
307 return q;
308 }

References DGtal::IntegerConverter< dim, TInteger >::cast(), and dim.


The documentation for this struct was generated from the following file: