Compute Library  18.05
Distribution1D Class Reference

Basic implementation of the 1D distribution interface. More...

#include <Distribution1D.h>

Collaboration diagram for Distribution1D:
[legend]

Public Member Functions

 Distribution1D (size_t num_bins, int32_t offset, uint32_t range)
 Constructor: Creates a 1D Distribution of a consecutive interval [offset, offset + range - 1] defined by a start offset and valid range, divided equally into num_bins parts. More...
 
uint32_t * buffer () const override
 Returns a pointer to the start of the distribution. More...
 
- Public Member Functions inherited from IDistribution1D
 IDistribution1D (size_t num_bins, int32_t offset, uint32_t range)
 Constructor: Creates a 1D Distribution of a consecutive interval [offset, offset + range - 1] defined by a start offset and valid range, divided equally into num_bins parts. More...
 
size_t num_bins () const
 Returns the number of bins that the distribution has. More...
 
int32_t offset () const
 Returns the offset of the distribution. More...
 
uint32_t range () const
 Returns the range of the distribution. More...
 
uint32_t window () const
 Returns the window of the distribution, which is the range divided by the number of bins. More...
 
void set_range (uint32_t range)
 Sets the range of the distribution. More...
 
size_t size () const override
 Returns the total size in bytes of the distribution. More...
 
size_t dimensions () const override
 Returns the dimensions of the distribution. More...
 
- Public Member Functions inherited from IDistribution
virtual ~IDistribution ()=default
 Default virtual destructor. More...
 
void clear () const
 Clears the distribution by setting every element to zero. More...
 

Detailed Description

Basic implementation of the 1D distribution interface.

Definition at line 36 of file Distribution1D.h.

Constructor & Destructor Documentation

Distribution1D ( size_t  num_bins,
int32_t  offset,
uint32_t  range 
)

Constructor: Creates a 1D Distribution of a consecutive interval [offset, offset + range - 1] defined by a start offset and valid range, divided equally into num_bins parts.

Parameters
[in]num_binsThe number of bins the distribution is divided in.
[in]offsetThe start of the values to use.
[in]rangeThe total number of the consecutive values of the distribution interval.

Member Function Documentation

uint32_t* buffer ( ) const
overridevirtual

Returns a pointer to the start of the distribution.

Other elements of the array can be accessed using buffer()[idx] for 0 <= idx < num_bins()

Returns
Pointer to the start of the distribution.

Implements IDistribution.


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