Helios++
Helios software for LiDAR simulations
SAHKDTreeComputeLossNodesSubTask Class Reference

Shared sub-task to compute loss nodes when finding the split position during SAH KDTree building. It is meant to be used at geometry-level parallelization context and only for right child nodes. More...

#include <SAHKDTreeComputeLossNodesSubTask.h>

Inheritance diagram for SAHKDTreeComputeLossNodesSubTask:
Collaboration diagram for SAHKDTreeComputeLossNodesSubTask:

Public Member Functions

 SAHKDTreeComputeLossNodesSubTask (std::shared_ptr< SharedTaskSequencer > ch, vector< Primitive * > const &primitives, double const start, double const step, int const splitAxis, double const minBound, double const boundLength, size_t const startNode, size_t const endNode, double &partialLoss, double &partialSplitPos, std::function< double(vector< Primitive * > const &primitives, int const splitAxis, double const splitPos, double const r)> splitLoss)
 Main constructor for SAH KDTree compute loss nodes sub-task.
 
void run () override
 Implementation of the compute loss nodes method. More...
 
- Public Member Functions inherited from SharedSubTask
 SharedSubTask (std::shared_ptr< SharedSubTaskCompletionHandler > ch)
 Default constructor for shared sub-task. More...
 
virtual void operator() ()
 The functor that will be called by any thread. It calls the SharedSubTask::run method to solve/compute the sub-task. Also, once the task has been computed, it delegates upon the task completion handler. More...
 
virtual void postProcess ()
 Post-processing to be applied after shared sub-task has finished. By default it is a void function which does nothing, but it can be overridden.
 
virtual size_t getKey ()
 Obtain the key of the shared sub-task inside the shared task sequencer context. More...
 
virtual void setKey (size_t const key)
 Set the key of the shared sub-task inside the shared task sequencer context. More...
 
virtual std::shared_ptr< boost::thread > getThread ()
 Get the thread associated to the shared sub-task. More...
 
virtual void setThread (std::shared_ptr< boost::thread > thread)
 Set the thread associated to the shared sub-task. More...
 

Protected Attributes

vector< Primitive * > const & primitives
 Primitives being splitted to compute corresponding loss function.
 
double const start
 Start split position.
 
double const step
 Step size between consecutive split positions.
 
int const splitAxis
 Split axis for current partition case.
 
double const minBound
 Min coordinate of boundary.
 
double const boundLength
 Boundary length.
 
size_t const startNode
 Start node (inclusive) for the iterative workload that must be computed by this sub-task.
 
size_t const endNode
 End node (exclusive) for the iterative workload that must be computed by this sub-task.
 
double & partialLoss
 Where the best loss must be stored.
 
double & partialSplitPos
 Where the split position associated to best loss must be stored.
 
std::function< double(vector< Primitive * > const &primitives, int const splitAxis, double const splitPos, double const r)> splitLoss
 Function to colculate the loss itself for a given split. More...
 
- Protected Attributes inherited from SharedSubTask
std::shared_ptr< SharedSubTaskCompletionHandlerch
 The shared sub-task completion handler that handles what must be done after a shared sub-task execution has been finished. The most paradigmatic case of a valid task completion handler is the shared task sequencer. More...
 
size_t key = 0
 The key identifying the shared sub task inside the shared task sequencer context. More...
 
std::shared_ptr< boost::thread > thread = nullptr
 The thread associated with the shared sub-tasks. It is nullptr until the shared sub-task has been started by its corresponding shared task sequencer.
 

Detailed Description

Shared sub-task to compute loss nodes when finding the split position during SAH KDTree building. It is meant to be used at geometry-level parallelization context and only for right child nodes.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
SharedSubTask
SAHKDTreeFactory
SAHKDTreeFactory::findSplitPositionBySAH
MultiThreadKDTreeFactory

Member Function Documentation

◆ run()

void SAHKDTreeComputeLossNodesSubTask::run ( )
inlineoverridevirtual

Implementation of the compute loss nodes method.

See also
SharedSubTask::run
SAHKDTreeFactory::findSplitPositionBySAH

Implements SharedSubTask.

Member Data Documentation

◆ splitLoss

std::function<double( vector<Primitive *> const &primitives, int const splitAxis, double const splitPos, double const r )> SAHKDTreeComputeLossNodesSubTask::splitLoss
protected

Function to colculate the loss itself for a given split.

See also
SAHKDTreeFactory::splitLoss

The documentation for this class was generated from the following file: