DGtal  0.9.2
DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency > Struct Template Reference

#include <DGtal/geometry/curves/ArithmeticalDSLKernel.h>

## Public Types

typedef SpaceND< 2, TCoordinate > Space

typedef Space::Vector Vector

typedef std::pair< Vector, VectorSteps

## Static Public Member Functions

template<typename TInteger >
static Vector shift (const TInteger &a, const TInteger &b)

template<typename TInteger >
static Steps steps (const TInteger &a, const TInteger &b)

template<typename TInteger >
static TInteger norm (const TInteger &a, const TInteger &b)

## Detailed Description

### template<typename TCoordinate, unsigned short adjacency = 8> struct DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >

Aim: Small class that contains the code that depends on the arithmetical thickness (either naive or standard) of a digital straight line (DSL). It provides mainly two static methods:

• ArithmeticalDSLKernel::shift that returns the shift vector of a DSL from its slope parameters $$a$$ and $$b$$. ie. the vector $$s$$ translating a point of remainder $$r$$ to a point of remainder $$r + \omega$$
• ArithmeticalDSLKernel::steps that returns the step vectors of a DSL ie. the couple of vectors $$v$$ and $$w$$ used to iterate over the points of a DSL in an orientation given by the DSL parameters $$a$$ and $$b$$. Obviously, these two vectors are equal to 0 if $$\omega = 0$$ (not valid DSL). Moreover, the first vector ( $$v$$) is equal to the direction vector, while the second one ( $$w$$) is equal to 0, if $$\omega = 1$$, ie. if the lower leaning line and the upper leaning line are counfounded. Though, in the general case, the first vector ( $$v$$) translates any point $$p$$ of remainder $$r$$ to its unique neighbor point $$q$$ of remainder greater than or equal to $$r$$, while the second one ( $$w$$) is such that $$v - w = s$$.

These methods are specialized with respect to the chosen adjacency 8 (default) or 4.

Digital straight lines and segments

Template Parameters
 TCoordinate a model of integer for the DGtal point coordinates adjacency integer equal to 8 (default) for naive (simply 8-connected) DSL, and 4 for standard (simply 4-connected) DSL.
ArithmeticalDSL
exampleArithmeticalDSL.cpp

Definition at line 91 of file ArithmeticalDSLKernel.h.

## Member Typedef Documentation

template<typename TCoordinate, unsigned short adjacency = 8>
 typedef SpaceND<2, TCoordinate> DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Space

Type of the digital plane.

Definition at line 99 of file ArithmeticalDSLKernel.h.

template<typename TCoordinate, unsigned short adjacency = 8>
 typedef std::pair DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Steps

Type of the step vectors, defined as a STL pair of Vector

Definition at line 107 of file ArithmeticalDSLKernel.h.

template<typename TCoordinate, unsigned short adjacency = 8>
 typedef Space::Vector DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::Vector

Type of the shift vector.

Definition at line 103 of file ArithmeticalDSLKernel.h.

## Member Function Documentation

template<typename TCoordinate, unsigned short adjacency = 8>
 DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::BOOST_STATIC_CONSTANT ( unsigned short, ForegroundAdjacency = 8 )

template<typename TCoordinate, unsigned short adjacency = 8>
 DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::BOOST_STATIC_CONSTANT ( unsigned short, BackgroundAdjacency = 4 )

template<typename TCoordinate, unsigned short adjacency = 8>
template<typename TInteger >
 static TInteger DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::norm ( const TInteger & a, const TInteger & b )
static

Returns the $$L_{\infty}$$ (for the 8-adjacency) or the $$L_1$$ norm (for the 4-adjacency) of two integers a and b,

Parameters
 a a-parameter b b-parameter
Template Parameters
 TInteger a model of integer for the parameters a and b
Returns
the norm
template<typename TCoordinate, unsigned short adjacency = 8>
template<typename TInteger >
 static Vector DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::shift ( const TInteger & a, const TInteger & b )
static

Given parameters a and b, this method computes the shift vector translating a point of remainder $$r$$ to a point of remainder $$r + \omega$$

NB: The shift vector is set to (0,0) if $$\omega = 0$$, ie. a and b are both null.

NB: If ( a , b ) lies between two octants (resp. quadrants) (eg. b > 0 and a = 0), the shift vector of the next octant (resp. quadrant) is chosen with respect to the counter-clockwise orientation.

Parameters
 a a-parameter b b-parameter
Template Parameters
 TInteger a model of integer for the parameters a and b
Returns
the shift vector
exampleArithmeticalDSL.cpp
template<typename TCoordinate, unsigned short adjacency = 8>
template<typename TInteger >
 static Steps DGtal::ArithmeticalDSLKernel< TCoordinate, adjacency >::steps ( const TInteger & a, const TInteger & b )
static

Given parameters a and b, this method returns the two step vectors, ie. the vectors that are used to iterate over the points of a DSL of slope a / b.

In the general case, the first vector $$v$$ translates any point $$p$$ of remainder $$r$$ to its unique neighbor point $$q$$ of remainder greater than or equal to $$r$$, while the second one $$w$$ is such that $$v - w = s$$.

NB: The two vectors are set to (0,0) if $$\omega = 0$$, ie. a and b are both null.

NB: The second vector is set to (0,0) if $$\omega = 1$$, ie. if either a or b is null, if either a == b or either a == - b in the naive case.

Parameters
 a a-parameter b b-parameter
Template Parameters
 TInteger a model of integer for the parameters a and b
Returns
the the pair of steps
{"ft_lang_label":"__label__en","ft_lang_prob":0.6076792,"math_prob":0.99590504,"size":3540,"snap":"2020-45-2020-50","text_gpt3_token_len":959,"char_repetition_ratio":0.1402715,"word_repetition_ratio":0.21223022,"special_character_ratio":0.26525423,"punctuation_ratio":0.15070644,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9998304,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-22T06:33:43Z\",\"WARC-Record-ID\":\"<urn:uuid:3e8a8688-9eb3-41f4-9487-96738948f19a>\",\"Content-Length\":\"26116\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:936343c4-39d0-425b-9250-3ef839c0fec7>\",\"WARC-Concurrent-To\":\"<urn:uuid:9ab0b11c-3b4d-4d66-8241-e4ac060aa4ea>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"https://dgtal.org/doc/0.9.2/structDGtal_1_1ArithmeticalDSLKernel.html\",\"WARC-Payload-Digest\":\"sha1:E53QXYCUJYVGDTSWOPXE7WCVOZG653CV\",\"WARC-Block-Digest\":\"sha1:NSALDW6DHHND5ZRTANNNGUYAC6VVA2XY\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107878921.41_warc_CC-MAIN-20201022053410-20201022083410-00203.warc.gz\"}"}