HighMap library (C++)
Loading...
Searching...
No Matches
statistics.hpp
Go to the documentation of this file.
1/* Copyright (c) 2026 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
10#pragma once
11
12#include "highmap/array.hpp"
13
14namespace hmap
15{
25
41float autocorr_length_scale(const Array &array, float max_lag_fraction = 0.4f);
42
56glm::vec2 autocorr_length_scale_axial(const Array &array,
57 float max_lag_fraction = 0.4f);
58
74Array detrend_reg(const Array &array);
75
96void normalize(Array &array, NormalizationMethod method);
97
110Array normalized(const Array &array, NormalizationMethod method);
111
122float variance(const Array &array, float *p_mean = nullptr);
123
124} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:23
Array detrend_reg(const Array &array)
Apply linear regression for detrending of a 2D array.
Definition detrend.cpp:9
void normalize(Array &array, NormalizationMethod method)
In-place normalization of an array.
Definition normalize.cpp:15
Array normalized(const Array &array, NormalizationMethod method)
Returns a normalized copy of an array.
Definition normalize.cpp:48
float autocorr_length_scale(const Array &array, float max_lag_fraction=0.4f)
Estimate the isotropic dominant length scale of a 2D heightmap.
Definition autocorr_length_scale.cpp:12
glm::vec2 autocorr_length_scale_axial(const Array &array, float max_lag_fraction=0.4f)
Estimate axis-aligned dominant length scales of a 2D heightmap.
Definition autocorr_length_scale.cpp:64
NormalizationMethod
Normalization methods.
Definition statistics.hpp:20
@ NM_MIN_MAX
Definition statistics.hpp:21
@ NM_STANDARDIZE
Definition statistics.hpp:22
@ NM_ROBUST
Definition statistics.hpp:23
float variance(const Array &array, float *p_mean=nullptr)
Compute the population variance of a 2D array.
Definition statistics.cpp:9