Blender V4.3
BLI_math_statistics.h File Reference

Go to the source code of this file.

Functions

Covariance Matrices
void BLI_covariance_m_vn_ex (int n, const float *cos_vn, int cos_vn_num, const float *center, bool use_sample_correction, float *r_covmat)
 Compute the covariance matrix of given set of nD coordinates.
 
void BLI_covariance_m3_v3n (const float(*cos_v3)[3], int cos_v3_num, bool use_sample_correction, float r_covmat[3][3], float r_center[3])
 Compute the covariance matrix of given set of 3D coordinates.
 

Function Documentation

◆ BLI_covariance_m3_v3n()

void BLI_covariance_m3_v3n ( const float(*) cos_v3[3],
int cos_v3_num,
bool use_sample_correction,
float r_covmat[3][3],
float r_center[3] )

Compute the covariance matrix of given set of 3D coordinates.

Parameters
cos_v3the 3D points to compute covariance from.
cos_v3_numthe number of 3D coordinates in cos_v3.
Returns
r_covmat the computed covariance matrix.
r_center the computed center (mean) of 3D points (may be NULL).

Definition at line 105 of file math_statistics.c.

References BLI_covariance_m_vn_ex(), copy_v3_v3(), float, madd_v3_v3fl(), and zero_v3().

Referenced by mesh_calc_eigen_matrix().

◆ BLI_covariance_m_vn_ex()

void BLI_covariance_m_vn_ex ( int n,
const float * cos_vn,
int cos_vn_num,
const float * center,
bool use_sample_correction,
float * r_covmat )

Compute the covariance matrix of given set of nD coordinates.

Parameters
nthe dimension of the vectors (and hence, of the covariance matrix to compute).
cos_vnthe nD points to compute covariance from.
cos_vn_numthe number of nD coordinates in cos_vn.
centerthe center (or mean point) of cos_vn. If NULL, it is assumed cos_vn is already centered.
use_sample_correctionwhether to apply sample correction (i.e. get 'sample variance' instead of 'population variance').
Returns
r_covmat the computed covariance matrix.

Definition at line 76 of file math_statistics.c.

References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), CovarianceData::cos_vn, covariance_m_vn_ex_task_cb(), and float.

Referenced by BLI_covariance_m3_v3n().