#include <seaDBSCAN.h>
|
| seaDBSCAN (double in_eps, int in_minpts) |
| constructor More...
|
|
| ~seaDBSCAN () |
| Default destructor. More...
|
|
std::vector< int > | Scan2D (std::vector< std::vector< double >> &pts) |
|
std::vector< std::vector
< double > > | GetNeighbours (size_t i, std::vector< std::vector< double >> &pts, bool) |
|
int | UnionSets (std::vector< std::vector< double >> &seed, std::vector< std::vector< double >> &pts) |
|
double | SimpleDist (double w1, double t1, double w2, double t2) |
|
Definition at line 23 of file seaDBSCAN.h.
seaview::seaDBSCAN::seaDBSCAN |
( |
double |
in_eps, |
|
|
int |
in_minpts |
|
) |
| |
|
inline |
seaview::seaDBSCAN::~seaDBSCAN |
( |
| ) |
|
|
inline |
std::vector< std::vector< double > > seaview::seaDBSCAN::GetNeighbours |
( |
size_t |
i, |
|
|
std::vector< std::vector< double >> & |
pts, |
|
|
bool |
include_self |
|
) |
| |
Definition at line 58 of file seaDBSCAN.cxx.
59 std::vector<std::vector<double>> neighbours;
60 std::vector<double> point = pts[ipoint];
65 for(
size_t ip=0; ip<pts.size(); ip++){
66 std::vector<double>
p = pts[ip];
72 std::vector<double> tp = {p[0],p[1],(double)ip};
73 neighbours.push_back(tp);
76 if(dist <=
m_eps && p != point ){
77 std::vector<double> tp = {p[0],p[1],(double)ip};
78 neighbours.push_back(tp);
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
double SimpleDist(double w1, double t1, double w2, double t2)
std::vector< int > seaview::seaDBSCAN::Scan2D |
( |
std::vector< std::vector< double >> & |
pts | ) |
|
Definition at line 5 of file seaDBSCAN.cxx.
11 std::vector<int> label(N,l_undef);
13 for(
size_t i=0; i<
N; i++){
14 if(label[i]!=l_undef)
continue;
15 std::vector<std::vector<double>> neighbours = this->
GetNeighbours(i,pts,
false);
18 if((
int)neighbours.size()+1 <
m_minpts){
25 label[i] = cluster_count;
28 std::vector<std::vector<double>> seed_set = neighbours;
29 for(
size_t q=0;
q<seed_set.size();
q++){
30 size_t iq = (size_t)seed_set[
q][2];
32 if(label[iq]==l_noise){
33 label[iq] = cluster_count;
36 if(label[iq]!=l_undef){
41 label[iq]=cluster_count;
43 std::vector<std::vector<double>> new_neighbours = this->
GetNeighbours(iq,pts,
true);
45 if((
int)new_neighbours.size() >=
m_minpts ){
48 this->
UnionSets(seed_set, new_neighbours);
std::vector< std::vector< double > > GetNeighbours(size_t i, std::vector< std::vector< double >> &pts, bool)
int UnionSets(std::vector< std::vector< double >> &seed, std::vector< std::vector< double >> &pts)
process_name largeant stream1 can override from command line with o or output physics producers generator N
double seaview::seaDBSCAN::SimpleDist |
( |
double |
w1, |
|
|
double |
t1, |
|
|
double |
w2, |
|
|
double |
t2 |
|
) |
| |
Definition at line 110 of file seaDBSCAN.cxx.
112 double wire_con = 0.3;
113 double tick_con = 1.0/25.0;
115 return sqrt(pow(w1*wire_con-w2*wire_con,2)+pow(t1*tick_con-t2*tick_con,2));
int seaview::seaDBSCAN::UnionSets |
( |
std::vector< std::vector< double >> & |
seed, |
|
|
std::vector< std::vector< double >> & |
pts |
|
) |
| |
Definition at line 86 of file seaDBSCAN.cxx.
then echo File list $list not found else cat $list while read file do echo $file sed s
double seaview::seaDBSCAN::m_eps |
int seaview::seaDBSCAN::m_minpts |
The documentation for this class was generated from the following files: