lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
NDArrayGenerators.hh File Reference

Declares templates that fill an NDArray with a constant, uniform random integers or normal random values. More...

#include <algorithm>
#include <random>
#include <cstdlib>
#include "psalg/calib/NDArray.hh"

Namespaces

namespace  psalg
 Usage.
 

Functions

template<typename T >
void psalg::fill_ndarray_const (NDArray< T > &a, const T &c)
 Set every element of a to c.
 
template<typename T >
void psalg::fill_ndarray_random (NDArray< T > &a, int range=100)
 Set every element of a to std::rand() % range, cast to T.
 
template<typename T >
void psalg::fill_ndarray_normal (NDArray< T > &a, double mean=0, double stddev=1)
 Set every element of a to a sample from a normal distribution with the given mean and stddev, cast to T.
 

Detailed Description

Declares templates that fill an NDArray with a constant, uniform random integers or normal random values.