ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtReconstruction
AtPatternRecognition
triplclust
src
triplet.h
Go to the documentation of this file.
1
//
2
// triplet.h
3
// Classes and functions for triplets of three points and
4
// computing their dissimilarity.
5
//
6
// Author: Jens Wilberg, Lukas Aymans, Christoph Dalitz
7
// Date: 2018-08-30
8
// License: see ../LICENSE
9
//
10
11
#ifndef TRIPLET_H
12
#define TRIPLET_H
13
14
#include "
pointcloud.h
"
15
16
#include <cstddef>
17
#include <vector>
18
19
// triplet of three points
20
struct
triplet
{
21
size_t
point_index_a
;
22
size_t
point_index_b
;
23
size_t
point_index_c
;
24
Point
center
;
25
Point
direction
;
26
double
error
;
27
friend
bool
operator<
(
const
triplet
&t1,
const
triplet
&t2) {
return
(t1.
error
< t2.
error
); };
28
};
29
30
// dissimilarity for triplets.
31
// scale is an external scale factor.
32
class
ScaleTripletMetric
{
33
private
:
34
double
scale;
35
36
public
:
37
ScaleTripletMetric
(
double
s);
38
double
operator()
(
const
triplet
&lhs,
const
triplet
&rhs);
39
};
40
41
// generates triplets from PointCloud
42
void
generate_triplets
(
const
PointCloud
&cloud, std::vector<triplet> &triplets,
size_t
k,
size_t
n,
double
a);
43
#endif
ScaleTripletMetric::operator()
double operator()(const triplet &lhs, const triplet &rhs)
Definition:
triplet.cxx:116
triplet::point_index_c
size_t point_index_c
Definition:
triplet.h:23
triplet
Definition:
triplet.h:20
triplet::point_index_b
size_t point_index_b
Definition:
triplet.h:22
Point
Definition:
main.cpp:71
pointcloud.h
triplet::operator<
friend bool operator<(const triplet &t1, const triplet &t2)
Definition:
triplet.h:27
triplet::point_index_a
size_t point_index_a
Definition:
triplet.h:21
PointCloud
Definition:
pointcloud.h:60
ScaleTripletMetric::ScaleTripletMetric
ScaleTripletMetric(double s)
Definition:
triplet.cxx:110
ScaleTripletMetric
Definition:
triplet.h:32
triplet::error
double error
Definition:
triplet.h:26
triplet::direction
Point direction
Definition:
triplet.h:25
triplet::center
Point center
Definition:
triplet.h:24
generate_triplets
void generate_triplets(const PointCloud &cloud, std::vector< triplet > &triplets, size_t k, size_t n, double a)
Definition:
triplet.cxx:27
Generated on Sat Nov 11 2023 15:30:38 for ATTPCROOT by
1.8.18