74 avg_distance_(avg_distance),
75 center_index_(center_index)
82 avg_distance_(rhs.avg_distance_),
83 center_index_(rhs.center_index_)
105 if (size_ > rhs.
size_)
return true;
106 if (size_ < rhs.
size_)
return false;
122 return *
this < rhs || rhs < *
this;
128 return !(*
this != rhs);
146 return avg_distance_;
152 return center_index_;
203 void group(
const std::vector<ConsensusMap>& maps,
215 return "unlabeled_kd";
231 template <
typename MapType>
238 void updateClusterProxies_(std::set<ClusterProxyKD>& potential_clusters, std::vector<ClusterProxyKD>& cluster_for_idx,
const std::set<Size>& update_these,
const std::vector<Int>& assigned,
const KDTreeFeatureMaps& kd_data);
Proxy for a (potential) cluster.
Definition: FeatureGroupingAlgorithmKD.h:59
double avg_distance_
Average distance to center.
Definition: FeatureGroupingAlgorithmKD.h:161
~ClusterProxyKD()
Destructor (non-virtual to save memory)
Definition: FeatureGroupingAlgorithmKD.h:88
Size getSize() const
Cluster size.
Definition: FeatureGroupingAlgorithmKD.h:132
Size getCenterIndex() const
Index of center point.
Definition: FeatureGroupingAlgorithmKD.h:150
bool isValid() const
Valid?
Definition: FeatureGroupingAlgorithmKD.h:138
double getAvgDistance() const
Average distance to center.
Definition: FeatureGroupingAlgorithmKD.h:144
ClusterProxyKD(const ClusterProxyKD &rhs)
Copy constructor.
Definition: FeatureGroupingAlgorithmKD.h:80
bool operator!=(const ClusterProxyKD &rhs) const
Inequality operator.
Definition: FeatureGroupingAlgorithmKD.h:120
bool operator==(const ClusterProxyKD &rhs) const
Equality operator.
Definition: FeatureGroupingAlgorithmKD.h:126
ClusterProxyKD()
Default constructor.
Definition: FeatureGroupingAlgorithmKD.h:64
ClusterProxyKD & operator=(const ClusterProxyKD &rhs)
Assignment operator.
Definition: FeatureGroupingAlgorithmKD.h:93
Size size_
Cluster size.
Definition: FeatureGroupingAlgorithmKD.h:158
ClusterProxyKD(Size size, double avg_distance, Size center_index)
Constructor.
Definition: FeatureGroupingAlgorithmKD.h:72
bool operator<(const ClusterProxyKD &rhs) const
Less-than operator for sorting / equality check in std::set. We use the ordering in std::set as a "pr...
Definition: FeatureGroupingAlgorithmKD.h:103
Size center_index_
Index of center point.
Definition: FeatureGroupingAlgorithmKD.h:164
A container for consensus elements.
Definition: ConsensusMap.h:88
A functor class for the calculation of distances between features or consensus features.
Definition: FeatureDistance.h:91
A feature grouping algorithm for unlabeled data.
Definition: FeatureGroupingAlgorithmKD.h:181
double mz_tol_
m/z tolerance
Definition: FeatureGroupingAlgorithmKD.h:253
ClusterProxyKD computeBestClusterForCenter_(Size i, std::vector< Size > &cf_indices, const std::vector< Int > &assigned, const KDTreeFeatureMaps &kd_data) const
Compute the current best cluster with center index i (mutates proxy and cf_indices)
FeatureGroupingAlgorithmKD(const FeatureGroupingAlgorithmKD &)
Copy constructor intentionally not implemented -> private.
FeatureGroupingAlgorithmKD()
Default constructor.
void runClustering_(const KDTreeFeatureMaps &kd_data, ConsensusMap &out)
Run the actual clustering algorithm.
double rt_tol_secs_
RT tolerance.
Definition: FeatureGroupingAlgorithmKD.h:250
static String getProductName()
Returns the product name (for the Factory)
Definition: FeatureGroupingAlgorithmKD.h:213
~FeatureGroupingAlgorithmKD() override
Destructor.
bool mz_ppm_
m/z unit ppm?
Definition: FeatureGroupingAlgorithmKD.h:256
FeatureDistance feature_distance_
Feature distance functor.
Definition: FeatureGroupingAlgorithmKD.h:259
FeatureGroupingAlgorithmKD & operator=(const FeatureGroupingAlgorithmKD &)
Assignment operator intentionally not implemented -> private.
void group(const std::vector< ConsensusMap > &maps, ConsensusMap &out) override
Applies the algorithm to consensus maps.
void group_(const std::vector< MapType > &input_maps, ConsensusMap &out)
Applies the algorithm to feature or consensus maps.
static FeatureGroupingAlgorithm * create()
Creates a new instance of this class (for Factory)
Definition: FeatureGroupingAlgorithmKD.h:207
void updateClusterProxies_(std::set< ClusterProxyKD > &potential_clusters, std::vector< ClusterProxyKD > &cluster_for_idx, const std::set< Size > &update_these, const std::vector< Int > &assigned, const KDTreeFeatureMaps &kd_data)
Update maximum possible sizes of potential consensus features for indices specified in update_these.
SignedSize progress_
Current progress for logging.
Definition: FeatureGroupingAlgorithmKD.h:247
void group(const std::vector< FeatureMap > &maps, ConsensusMap &out) override
Applies the algorithm to feature maps.
void addConsensusFeature_(const std::vector< Size > &indices, const KDTreeFeatureMaps &kd_data, ConsensusMap &out) const
Construct consensus feature and add to out map.
Base class for all feature grouping algorithms.
Definition: FeatureGroupingAlgorithm.h:51
Stores a set of features, together with a 2D tree for fast search.
Definition: KDTreeFeatureMaps.h:50
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
A more convenient string class.
Definition: String.h:61
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47