OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::RandomSampler Class Reference

#include <otbRandomSampler.h>

+ Inheritance diagram for otb::RandomSampler:
+ Collaboration diagram for otb::RandomSampler:

Classes

struct  Parameter
 

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef struct otb::RandomSampler::Parameter ParameterType
 
typedef itk::SmartPointer< SelfPointer
 
typedef RandomSampler Self
 
typedef SamplerBase Superclass
 
- Public Types inherited from otb::SamplerBase
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef SamplerBase Self
 
typedef itk::Object Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
- Public Member Functions inherited from otb::SamplerBase
virtual unsigned long GetChosenElements ()
 
virtual unsigned long GetNeededElements ()
 
virtual unsigned long GetProcessedElements ()
 
virtual double GetRate ()
 
virtual unsigned long GetTotalElements ()
 
void SetNumberOfElements (unsigned long needed, unsigned long total)
 
void SetRate (double rate, unsigned long total=0UL)
 

Static Public Member Functions

static Pointer New ()
 
ParameterType m_Parameters
 
std::vector< unsigned long > m_Positions
 
std::vector< unsigned long >::iterator m_CurrentPosition
 
void SetParameters (const ParameterType &param)
 
ParameterType GetParameters ()
 
void Reset (void) override
 
bool TakeSample (void)
 
 RandomSampler ()
 
 ~RandomSampler () override
 
 RandomSampler (const Self &)
 
void operator= (const Self &)
 

Additional Inherited Members

- Protected Member Functions inherited from otb::SamplerBase
 SamplerBase ()
 
 ~SamplerBase () override
 
- Protected Attributes inherited from otb::SamplerBase
unsigned long m_ChosenElements
 
unsigned long m_ProcessedElements
 

Detailed Description

Random sampler for iteration loops.

This class allows doing random sampling during an iteration loop. It uses the MersenneTwisterRandomGenerator.

Definition at line 39 of file otbRandomSampler.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::RandomSampler::ConstPointer

Definition at line 45 of file otbRandomSampler.h.

◆ ParameterType

Internal parameters, only contains an offset to shift the periodic sampling

◆ Pointer

typedef itk::SmartPointer<Self> otb::RandomSampler::Pointer

Definition at line 44 of file otbRandomSampler.h.

◆ Self

Definition at line 42 of file otbRandomSampler.h.

◆ Superclass

Definition at line 43 of file otbRandomSampler.h.

Constructor & Destructor Documentation

◆ RandomSampler() [1/2]

otb::RandomSampler::RandomSampler ( )
protected

Constructor

◆ ~RandomSampler()

otb::RandomSampler::~RandomSampler ( )
inlineoverrideprotected

Destructor

Definition at line 98 of file otbRandomSampler.h.

◆ RandomSampler() [2/2]

otb::RandomSampler::RandomSampler ( const Self )
private

Internal parameters for the sampler

Member Function Documentation

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::RandomSampler::CreateAnother ( void  ) const

◆ GetNameOfClass()

virtual const char* otb::RandomSampler::GetNameOfClass ( ) const
virtual

Runtime information support.

Reimplemented from otb::SamplerBase.

◆ GetParameters()

ParameterType otb::RandomSampler::GetParameters ( )
inline

Getter for internal parameters

Definition at line 77 of file otbRandomSampler.h.

◆ New()

static Pointer otb::RandomSampler::New ( )
static

Method for creation through the object factory.

◆ operator=()

void otb::RandomSampler::operator= ( const Self )
private

Internal parameters for the sampler

◆ Reset()

void otb::RandomSampler::Reset ( void  )
overridevirtual

Reset internal counter (to be called before starting iteration)

Reimplemented from otb::SamplerBase.

◆ SetParameters()

void otb::RandomSampler::SetParameters ( const ParameterType param)
inline

Setter for internal parameters

Definition at line 66 of file otbRandomSampler.h.

◆ TakeSample()

bool otb::RandomSampler::TakeSample ( void  )

Method to call during iteration, returns true if the sample is selected, and false otherwise.

Member Data Documentation

◆ m_CurrentPosition

std::vector<unsigned long>::iterator otb::RandomSampler::m_CurrentPosition
private

Internal current position

Definition at line 114 of file otbRandomSampler.h.

◆ m_Parameters

ParameterType otb::RandomSampler::m_Parameters
private

Internal parameters for the sampler

Definition at line 108 of file otbRandomSampler.h.

◆ m_Positions

std::vector<unsigned long> otb::RandomSampler::m_Positions
private

Internal list of positions to select

Definition at line 111 of file otbRandomSampler.h.


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