DGtal  0.9.4beta
Public Member Functions | Data Fields
DGtal::SternBrocot< TInteger, TQuotient >::Node Struct Reference

#include <DGtal/arithmetic/SternBrocot.h>

Collaboration diagram for DGtal::SternBrocot< TInteger, TQuotient >::Node:
[legend]

Public Member Functions

 Node (Integer p1, Integer q1, Quotient u1, Quotient k1, Node *ascendant_left1, Node *ascendant_right1, Node *descendant_left1, Node *descendant_right1, Node *inverse1)
 

Data Fields

Integer p
 
Integer q
 
Quotient u
 
Quotient k
 
NodeascendantLeft
 
NodeascendantRight
 
NodedescendantLeft
 
NodedescendantRight
 
Nodeinverse
 

Detailed Description

template<typename TInteger, typename TQuotient = int32_t>
struct DGtal::SternBrocot< TInteger, TQuotient >::Node

Represents a node in the Stern-Brocot. The node stores information on the irreducible fraction itself (p/q, the partial quotient u, the depth k), but also pointers to ascendants, descendants and inverse in the Stern-Brocot tree. Nodes are constructed on demand, when the user ask for descendant or for a specific fraction.

See also
SternBrocot::fraction

Essentially a backport from ImaGene.

Definition at line 101 of file SternBrocot.h.

Constructor & Destructor Documentation

template<typename TInteger, typename TQuotient = int32_t>
DGtal::SternBrocot< TInteger, TQuotient >::Node::Node ( Integer  p1,
Integer  q1,
Quotient  u1,
Quotient  k1,
Node ascendant_left1,
Node ascendant_right1,
Node descendant_left1,
Node descendant_right1,
Node inverse1 
)

Constructor for node.

Parameters
p1the numerator.
q1the denominator.
u1the quotient (last coefficient of its continued fraction).
k1the depth (1+number of coefficients of its continued fraction).
ascendant_left1the node that is the left ascendant.
ascendant_right1the node that is the right ascendant.
descendant_left1the node that is the left descendant or 0 (if none exist).
descendant_right1the node that is the right descendant or 0 (if none exist).
inverse1the node that is its inverse.

Field Documentation

template<typename TInteger, typename TQuotient = int32_t>
Node* DGtal::SternBrocot< TInteger, TQuotient >::Node::ascendantLeft

the node that is the left ascendant.

Definition at line 130 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Node* DGtal::SternBrocot< TInteger, TQuotient >::Node::ascendantRight

the node that is the right ascendant.

Definition at line 132 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Node* DGtal::SternBrocot< TInteger, TQuotient >::Node::descendantLeft

the node that is the left descendant or 0 (if none exist).

Definition at line 134 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Node* DGtal::SternBrocot< TInteger, TQuotient >::Node::descendantRight

the node that is the right descendant or 0 (if none exist).

Definition at line 136 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Node* DGtal::SternBrocot< TInteger, TQuotient >::Node::inverse

the node that is its inverse.

Definition at line 138 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Quotient DGtal::SternBrocot< TInteger, TQuotient >::Node::k

the depth (1+number of coefficients of its continued fraction).

Definition at line 128 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Integer DGtal::SternBrocot< TInteger, TQuotient >::Node::p

the numerator;

Definition at line 122 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Integer DGtal::SternBrocot< TInteger, TQuotient >::Node::q

the denominator;

Definition at line 124 of file SternBrocot.h.

template<typename TInteger, typename TQuotient = int32_t>
Quotient DGtal::SternBrocot< TInteger, TQuotient >::Node::u

the quotient (last coefficient of its continued fraction).

Definition at line 126 of file SternBrocot.h.


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