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::int64_t > Struct Template Reference

#include <DGtal/kernel/IntegerConverter.h>

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

Public Types

typedef DGtal::int64_t Integer

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

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

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 int64_t.

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 185 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 229 of file IntegerConverter.h.

230 {
233 if ( tmp != i )
234 trace.warning() << "Bad integer conversion: " << i << " -> " << r
235 << std::endl;
236 return r;
237 }
----------— INTEGER/POINT CONVERSION SERVICES -----------------—
static DGtal::int64_t castToInt64_t(const T &aT)

References DGtal::NumberTraitsImpl< std::decay< T >::type >::castToInt64_t(), and DGtal::trace.

◆ cast() [2/6]

Parameters
iany integer
Returns
the same integer

Definition at line 190 of file IntegerConverter.h.

191 {
192 return i;
193 }

◆ cast() [3/6]

Parameters
iany integer
Returns
the same integer

Definition at line 211 of file IntegerConverter.h.

212 {
213 return i;
214 }

◆ cast() [4/6]

Conversion of a lattice point.

Parameters
pany point
Returns
the same point

Definition at line 245 of file IntegerConverter.h.

246 {
248 for ( DGtal::Dimension i = 0; i < dim; i++ )
249 q[ i ] = cast( p[ i ] );
250 return q;
251 }
static DGtal::int64_t cast(DGtal::int32_t i)

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

◆ cast() [5/6]

Conversion of a lattice point.

Parameters
pany point
Returns
the same point

Definition at line 201 of file IntegerConverter.h.

202 {
204 for ( DGtal::Dimension i = 0; i < dim; i++ )
205 q[ i ] = cast( p[ i ] );
206 return q;
207 }

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 222 of file IntegerConverter.h.

223 {
224 return p;
225 }

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