prrng 1.12.1
Loading...
Searching...
No Matches
prrng::alignment Struct Reference

Structure to assemble the alignment parameters. More...

#include <prrng.h>

Public Member Functions

 alignment (ptrdiff_t buffer=0, ptrdiff_t margin=0, ptrdiff_t min_margin=0, bool strict=false)
 

Public Attributes

ptrdiff_t buffer = 0
 If positive, only change the chunk if target is in chunk[:buffer] or chunk[-buffer:].
 
ptrdiff_t margin = 0
 Index of the chunk to place the target.
 
ptrdiff_t min_margin = 0
 Minimal index to accept if strict = false.
 
bool strict = false
 If true, margin is respected strictly: argmin(target > chunk) == margin.
 

Detailed Description

Structure to assemble the alignment parameters.

These parameters are used when the chunk is aligned with a position, see prrng::pcg32_cumsum::align(), prrng::pcg32_arrayBase_cumsum::align().

Definition at line 3433 of file prrng.h.

Constructor & Destructor Documentation

◆ alignment()

prrng::alignment::alignment ( ptrdiff_t  buffer = 0,
ptrdiff_t  margin = 0,
ptrdiff_t  min_margin = 0,
bool  strict = false 
)
inline
Parameters
bufferIf positive, only change the chunk if target is in chunk[:buffer] or chunk[-buffer:]
marginIndex of the chunk to place the target.
min_marginMinimal index to accept if strict = false.
strictIf true, margin is respected strictly: argmin(target > chunk) == margin. If false min_margin <= argmin(target > chunk) <= margin, whereby argmin(target > chunk) < margin if moving backwards is required to respect margin.

Definition at line 3449 of file prrng.h.

Member Data Documentation

◆ buffer

ptrdiff_t prrng::alignment::buffer = 0

If positive, only change the chunk if target is in chunk[:buffer] or chunk[-buffer:].

Definition at line 3465 of file prrng.h.

◆ margin

ptrdiff_t prrng::alignment::margin = 0

Index of the chunk to place the target.

Definition at line 3470 of file prrng.h.

◆ min_margin

ptrdiff_t prrng::alignment::min_margin = 0

Minimal index to accept if strict = false.

Definition at line 3475 of file prrng.h.

◆ strict

bool prrng::alignment::strict = false

If true, margin is respected strictly: argmin(target > chunk) == margin.

If false, min_margin <= argmin(target > chunk) <= margin, whereby argmin(target > chunk) < margin if moving backwards is required to respect margin.

Definition at line 3482 of file prrng.h.


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