OpenMS
Loading...
Searching...
No Matches
KDTreeFeatureNode Class Reference

Lightweight kd-tree entry: a back-pointer to a KDTreeFeatureMaps and the index of one feature in it. More...

#include <OpenMS/ANALYSIS/QUANTITATION/KDTreeFeatureNode.h>

Collaboration diagram for KDTreeFeatureNode:
[legend]

Public Types

typedef double value_type
 libkdtree++ requires this typedef on the value type
 

Public Member Functions

 KDTreeFeatureNode (KDTreeFeatureMaps *data, Size idx)
 Create a node referencing one feature inside data.
 
 KDTreeFeatureNode (const KDTreeFeatureNode &rhs)
 Copy constructor - copies the back-pointer; the wrapped data object is shared.
 
KDTreeFeatureNodeoperator= (KDTreeFeatureNode const &rhs)
 Assignment operator - copies the back-pointer; the wrapped data object is shared.
 
virtual ~KDTreeFeatureNode ()
 Destructor (does not delete the wrapped data)
 
value_type operator[] (Size i) const
 2D coordinate accessor used by libkdtree++: [0] returns RT, [1] returns m/z (both forwarded to the parent KDTreeFeatureMaps)
 
Size getIndex () const
 Global index of the referenced feature inside the parent KDTreeFeatureMaps.
 

Protected Attributes

KDTreeFeatureMapsdata_
 Pointer to the actual data.
 
Size idx_
 Index of this feature.
 

Private Member Functions

 KDTreeFeatureNode ()
 Default constructor is not supposed to be called.
 

Detailed Description

Lightweight kd-tree entry: a back-pointer to a KDTreeFeatureMaps and the index of one feature in it.

Used as the value type of the 2D kd-tree maintained by KDTreeFeatureMaps. The node itself carries no feature data; instead, operator[]() forwards coordinate lookups (RT for axis 0, m/z for axis 1) to the parent KDTreeFeatureMaps using the stored index. This keeps the kd-tree payload small and avoids duplicating per-feature attributes.

Copy and assignment intentionally only copy the back-pointer; the wrapped data object is shared.

Member Typedef Documentation

◆ value_type

typedef double value_type

libkdtree++ requires this typedef on the value type

Constructor & Destructor Documentation

◆ KDTreeFeatureNode() [1/3]

KDTreeFeatureNode ( KDTreeFeatureMaps data,
Size  idx 
)

Create a node referencing one feature inside data.

Parameters
[in]dataBack-pointer to the KDTreeFeatureMaps holding the feature; must outlive this node.
[in]idxGlobal index of the referenced feature inside data.

◆ KDTreeFeatureNode() [2/3]

Copy constructor - copies the back-pointer; the wrapped data object is shared.

◆ ~KDTreeFeatureNode()

virtual ~KDTreeFeatureNode ( )
virtual

Destructor (does not delete the wrapped data)

◆ KDTreeFeatureNode() [3/3]

KDTreeFeatureNode ( )
private

Default constructor is not supposed to be called.

Member Function Documentation

◆ getIndex()

Size getIndex ( ) const

Global index of the referenced feature inside the parent KDTreeFeatureMaps.

◆ operator=()

KDTreeFeatureNode & operator= ( KDTreeFeatureNode const &  rhs)

Assignment operator - copies the back-pointer; the wrapped data object is shared.

◆ operator[]()

value_type operator[] ( Size  i) const

2D coordinate accessor used by libkdtree++: [0] returns RT, [1] returns m/z (both forwarded to the parent KDTreeFeatureMaps)

Member Data Documentation

◆ data_

KDTreeFeatureMaps* data_
protected

Pointer to the actual data.

◆ idx_

Size idx_
protected

Index of this feature.