Deterministic Gaussian Sampling
Loading...
Searching...
No Matches
GMToDiracEvenBinfOptimizationParams Struct Reference

optimization parameters for the bMax-free closed-form even-N Gaussian-to-Dirac approximation More...

#include <gm_to_dirac_even_binf_optimization_params.h>

Inheritance diagram for GMToDiracEvenBinfOptimizationParams:
GslMinimizerOptimizationParams

Public Member Functions

 GMToDiracEvenBinfOptimizationParams (const gsl_vector *wX, size_t N, size_t L)
 Construct a new GMToDiracEvenBinfOptimizationParams object.
 
 ~GMToDiracEvenBinfOptimizationParams ()
 Destroy the GMToDiracEvenBinfOptimizationParams object.
 
void update (const gsl_vector *t)
 project t onto the zero-mean manifold and refresh the caches
 
bool hasDegenerateSample () const
 true if any projected sample sits exactly on the origin
 
double sample (size_t i, size_t d) const
 cached projected sample coordinate s_{i,d}
 
double distanceSq (size_t i, size_t j) const
 cached squared distance T_ij between projected samples i and j
 
- Public Member Functions inherited from GslMinimizerOptimizationParams
 GslMinimizerOptimizationParams (size_t L, size_t N)
 

Data Fields

const gsl_vector * wX
 
const size_t k
 N / 2.
 
const double constant
 K_k, see lcd_binf_constant()
 
std::vector< double > sProjected
 s = t - 1 * (w^T t), size L * N
 
std::vector< double > cSqrdNorm
 c_i = ||s_i||^2, size L
 
SquaredEuclideanDistanceUtilsLL * squaredEuclideanDistanceUtilLL = nullptr
 
- Data Fields inherited from GslMinimizerOptimizationParams
size_t L
 
size_t N
 

Detailed Description

optimization parameters for the bMax-free closed-form even-N Gaussian-to-Dirac approximation

Mirrors GMToDiracEvenOptimizationParams minus bMax and everything derived from it: there is no reportedOffset and no objectiveOffset, because the bMax-free objective carries its only constant, lcd_binf_constant(k), directly.

It holds one thing the finite-bMax struct does not: the PROJECTED sample buffer. The minimizer's variable is t, but the distance is a function of

s_i = t_i - sum_j w_j t_j

so c_i and T_ij must be computed from s, never from t. update() performs that projection and then refreshes both caches from the result.

Constructor & Destructor Documentation

◆ GMToDiracEvenBinfOptimizationParams()

GMToDiracEvenBinfOptimizationParams::GMToDiracEvenBinfOptimizationParams ( const gsl_vector *  wX,
size_t  N,
size_t  L 
)
inline

Construct a new GMToDiracEvenBinfOptimizationParams object.

Parameters
wXweights of the Dirac mixture, must be non-null and of size L
Ndimension of the data, must be even and >= 2
Lnumber of Dirac components, must be >= 1

Member Function Documentation

◆ distanceSq()

double GMToDiracEvenBinfOptimizationParams::distanceSq ( size_t  i,
size_t  j 
) const
inline

cached squared distance T_ij between projected samples i and j

The projection is a common translation of every sample, so T_ij is the same for t and for s; it is computed from s regardless, to keep one source of truth.

Parameters
iindex of the first sample
jindex of the second sample
Returns
||s_i - s_j||^2

◆ hasDegenerateSample()

bool GMToDiracEvenBinfOptimizationParams::hasDegenerateSample ( ) const
inline

true if any projected sample sits exactly on the origin

c_i == 0 is outside the domain of lcd_binf_phi(): it reaches lcd_ei(0), which aborts through GSL's default error handler.

Reads the cache, so update() must have run.

Returns
true if the closed form cannot be evaluated for this sample set

◆ sample()

double GMToDiracEvenBinfOptimizationParams::sample ( size_t  i,
size_t  d 
) const
inline

cached projected sample coordinate s_{i,d}

Parameters
iindex of the sample
dindex of the dimension
Returns
s_{i,d}

◆ update()

void GMToDiracEvenBinfOptimizationParams::update ( const gsl_vector *  t)
inline

project t onto the zero-mean manifold and refresh the caches

Writes s_i = t_i - sum_j w_j t_j into sProjected, then fills cSqrdNorm and the pairwise distances from s. Must be called whenever t changes, before reading sample(), cSqrdNorm or distanceSq().

Parameters
toptimizer variable, L * N

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