9#ifndef SPATIAL_GAUSSIAN_FIELD_H
10#define SPATIAL_GAUSSIAN_FIELD_H
12#include "ns3/vector.h"
67 std::array<double, WINDOW_CELLS>
wx{};
68 std::array<double, WINDOW_CELLS>
wy{};
103 static Window
ComputeWindow(
const Vector& position,
double corrDist);
113 double SampleWindow(uint64_t fieldKey,
const Window& window)
const;
126 double Sample(uint64_t fieldKey,
const Vector& position,
double corrDist)
const;
138 double SampleUniform(uint64_t fieldKey,
const Vector& position,
double corrDist)
const;
155 uint64_t
Prefix(uint64_t fieldKey)
const;
165 double CellFromPrefix(uint64_t prefix, int64_t ix, int64_t iy)
const;
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
double SampleWindowFromPrefix(uint64_t prefix, const Window &window) const
Sample the field through a precomputed filter window.
double SampleUniform(uint64_t fieldKey, const Vector &position, double corrDist) const
Sample the field at a position and map it to a U(0,1) variate through the standard normal CDF,...
uint64_t Prefix(uint64_t fieldKey) const
Hash prefix of one field, mixing the global RNG seed and run, the salt and the field key once for all...
static uint64_t SplitMix64(uint64_t x)
SplitMix64 mixing round.
uint64_t m_salt
class-specific salt
CellGenerator
Per-cell N(0,1) generator of the white-noise background.
@ IrwinHall
Standardized sum of the four 16-bit chunks of the hashed state (Irwin-Hall), cheaper than Box-Muller;...
@ BoxMuller
Box-Muller transform of two 53-bit uniforms.
double CellFromPrefix(uint64_t prefix, int64_t ix, int64_t iy) const
Deterministic N(0,1) value of one cell of the field.
double Sample(uint64_t fieldKey, const Vector &position, double corrDist) const
Sample the spatially-correlated field at a position; a non-positive correlation distance degrades to ...
static constexpr std::size_t WINDOW_CELLS
Number of grid cells per dimension of a filter window.
SpatialGaussianField(Salt salt, CellGenerator generator=CellGenerator::BoxMuller)
Construct a field.
static Window ComputeWindow(const Vector &position, double corrDist)
Compute the filter window of a sampling position.
double SampleWindow(uint64_t fieldKey, const Window &window) const
Sample the field through a precomputed filter window.
CellGenerator m_generator
per-cell N(0,1) generator
Salt
Salts of the fields of every model sampling a SpatialGaussianField.
@ SHADOW_FADING
Shadow fading, ThreeGppPropagationLossModel.
@ O2I_STATE
Indoor state and building type, ThreeGppChannelConditionModel.
@ LOS_NLOS_STATE
LOS/NLOS state, ThreeGppChannelConditionModel.
@ CHANNEL_PARAMETERS
LSP, cluster and ray variables, ThreeGppChannelModel.
@ O2I_PENETRATION
Indoor distance and penetration loss, ThreeGppPropagationLossModel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Filter window of one sampling position (grid origin, separable weights and their L2 normalization),...
int64_t ix
grid x-coordinate of the first window cell
std::array< double, WINDOW_CELLS > wx
separable filter weights along x
int64_t iy
grid y-coordinate of the first window cell
double invL2Norm
reciprocal L2 norm of the 2D weights
std::array< double, WINDOW_CELLS > wy
separable filter weights along y