TTK
Loading...
Searching...
No Matches
UncertainDataEstimator.cpp
Go to the documentation of this file.
2
4 this->setDebugMsgPrefix("UncertainDataEstimator");
5}
6
8 const ttk::SimplexId vertexId, std::vector<double> &histogram) const {
9
10 histogram.resize(numberOfBins_);
11 if(vertexId < numberOfVertices_) {
12#ifdef TTK_ENABLE_OPENMP
13#pragma omp parallel for num_threads(threadNumber_) \
14 schedule(static, numberOfBins_ / threadNumber_)
15#endif
16 for(int i = 0; i < (int)numberOfBins_; i++) {
17 if((SimplexId)probability_[i].size() == numberOfVertices_) {
18 histogram[i] = probability_[i][vertexId];
19 } else {
20 histogram[i] = 0.0;
21 }
22 }
23 } else {
24 fill(histogram.begin(), histogram.end(), 0.0);
25 }
26}
27
29 const double normalization = 1.0 / static_cast<double>(numberOfInputs_);
30#ifdef TTK_ENABLE_OPENMP
31#pragma omp parallel for num_threads(threadNumber_) collapse(2) \
32 schedule(static, (numberOfBins_ * numberOfVertices_) / threadNumber_)
33#endif
34 for(int i = 0; i < numberOfBins_; i++) {
35 for(SimplexId j = 0; j < numberOfVertices_; j++) {
36 probability_[i][j] *= normalization;
37 }
38 }
39}
void setDebugMsgPrefix(const std::string &prefix)
Definition: Debug.h:364
void getVertexHistogram(const SimplexId vertexId, std::vector< double > &histogram) const
int SimplexId
Identifier type for simplices of any dimension.
Definition: DataTypes.h:22