HighMap library (C++)
Loading...
Searching...
No Matches
array.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 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{
16
23Array abs(const Array &array);
24
39Array abs_smooth(const Array &array, float mu, const Array &vshift);
40Array abs_smooth(const Array &array, float mu, float vshift);
41Array abs_smooth(const Array &array, float mu);
42
52Array almost_unit_identity(const Array &array);
53
62Array almost_unit_identity_c2(const Array &array);
63
70Array atan(const Array &array);
71
81Array atan2(const Array &y, const Array &array);
82
89Array cos(const Array &array);
90
97Array exp(const Array &array);
98
112Array gaussian_decay(const Array &array, float sigma);
113
123Array hypot(const Array &array1, const Array &array2);
124
132Array is_equal(const Array &array, float value);
133
140Array is_non_zero(const Array &array);
141
148Array is_zero(const Array &array);
149
158Array lerp(const Array &array1, const Array &array2, const Array &t);
159Array lerp(const Array &array1, const Array &array2, float t);
160
167Array log10(const Array &array);
168
176Array pow(const Array &array, float exp);
177
200Array sigmoid(const Array &array,
201 float width = 1.f,
202 float vmin = 0.f,
203 float vmax = 1.f,
204 float x0 = 0.f);
205
212Array sin(const Array &array);
213
228Array smoothstep3(const Array &array, float vmin = 0.f, float vmax = 1.f);
229
236Array smoothstep3_lower(const Array &array);
237
244Array smoothstep3_upper(const Array &array);
245
260Array smoothstep5(const Array &array, float vmin = 0.f, float vmax = 1.f);
261Array smoothstep5(const Array &array, const Array &vmin, const Array &vmax);
262
269Array smoothstep5_lower(const Array &array);
270
277Array smoothstep5_upper(const Array &array);
278
285Array smoothstep7(const Array &array);
286
293Array sqrt(const Array &array);
294
303Array sqrt_safe(const Array &array);
304
313Array threshold(const Array &array, float x0, float x1);
314
323Array threshold_smooth(const Array &array, float x0, float x1);
324
325} // namespace hmap
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:23
Array smoothstep3_upper(const Array &array)
Cubic smoothstep (zero derivative at 1 only).
Definition math.cpp:289
Array sin(const Array &array)
Sine.
Definition math.cpp:247
Array sigmoid(const Array &array, float width=1.f, float vmin=0.f, float vmax=1.f, float x0=0.f)
Sigmoid function.
Definition math.cpp:236
Array pow(const Array &array, float exp)
Power function.
Definition math.cpp:218
Array smoothstep7(const Array &array)
Seventh-order smoothstep.
Definition math.cpp:370
Array smoothstep5_upper(const Array &array)
Quintic smoothstep (zero derivative at 1 only).
Definition math.cpp:360
Array almost_unit_identity(const Array &array)
Almost unit identity function.
Definition math.cpp:68
Array threshold(const Array &array, float x0, float x1)
Linear threshold.
Definition math.cpp:400
Array sqrt_safe(const Array &array)
Safe square root.
Definition math.cpp:390
Array is_non_zero(const Array &array)
Binary mask of non-zero elements.
Definition math.cpp:163
Array is_zero(const Array &array)
Binary mask of zero elements.
Definition math.cpp:173
Array smoothstep3(const Array &array, float vmin=0.f, float vmax=1.f)
Cubic smoothstep.
Definition math.cpp:257
Array threshold_smooth(const Array &array, float x0, float x1)
Smooth threshold.
Definition math.cpp:410
Array cos(const Array &array)
Cosine.
Definition math.cpp:110
Array abs(const Array &array)
Absolute value.
Definition math.cpp:16
Array sqrt(const Array &array)
Square root.
Definition math.cpp:380
Array log10(const Array &array)
Base-10 logarithm.
Definition math.cpp:208
Array smoothstep3_lower(const Array &array)
Cubic smoothstep (zero derivative at 0 only).
Definition math.cpp:279
Array gaussian_decay(const Array &array, float sigma)
Gaussian decay.
Definition math.cpp:130
Array smoothstep5_lower(const Array &array)
Quintic smoothstep (zero derivative at 0 only).
Definition math.cpp:350
Array smoothstep5(const Array &array, float vmin=0.f, float vmax=1.f)
Quintic smoothstep.
Definition math.cpp:299
Array abs_smooth(const Array &array, float mu, const Array &vshift)
Smooth absolute value.
Definition math.cpp:52
Array exp(const Array &array)
Exponential.
Definition math.cpp:120
Array almost_unit_identity_c2(const Array &array)
Almost unit identity function (C2 variant).
Definition math.cpp:78
Array atan2(const Array &y, const Array &array)
Element-wise arctangent with quadrant handling.
Definition math.cpp:98
Array is_equal(const Array &array, float value)
Binary mask of elements equal to a value.
Definition math.cpp:153
Array atan(const Array &array)
Arctangent.
Definition math.cpp:88
Point lerp(const Point &p1, const Point &p2, float t)
Linearly interpolates between two points.
Definition points.cpp:219
Array hypot(const Array &array1, const Array &array2)
Hypotenuse.
Definition math.cpp:142