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
188Array r_min(const Array &array1, const Array &array2, float alpha = 0.f);
189
200Array r_max(const Array &array1, const Array &array2, float alpha = 0.f);
201
224Array sigmoid(const Array &array,
225 float width = 1.f,
226 float vmin = 0.f,
227 float vmax = 1.f,
228 float x0 = 0.f);
229
236Array sin(const Array &array);
237
252Array smoothstep3(const Array &array, float vmin = 0.f, float vmax = 1.f);
253
260Array smoothstep3_lower(const Array &array);
261
268Array smoothstep3_upper(const Array &array);
269
284Array smoothstep5(const Array &array, float vmin = 0.f, float vmax = 1.f);
285Array smoothstep5(const Array &array, const Array &vmin, const Array &vmax);
286
293Array smoothstep5_lower(const Array &array);
294
301Array smoothstep5_upper(const Array &array);
302
309Array smoothstep7(const Array &array);
310
317Array sqrt(const Array &array);
318
327Array sqrt_safe(const Array &array);
328
337Array threshold(const Array &array, float x0, float x1);
338
347Array threshold_smooth(const Array &array, float x0, float x1);
348
349} // 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:369
Array sin(const Array &array)
Sine.
Definition math.cpp:321
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:308
Array pow(const Array &array, float exp)
Power function.
Definition math.cpp:260
Array smoothstep7(const Array &array)
Seventh-order smoothstep.
Definition math.cpp:462
Array smoothstep5_upper(const Array &array)
Quintic smoothstep (zero derivative at 1 only).
Definition math.cpp:450
Array almost_unit_identity(const Array &array)
Almost unit identity function.
Definition math.cpp:78
Array threshold(const Array &array, float x0, float x1)
Linear threshold.
Definition math.cpp:498
Array sqrt_safe(const Array &array)
Safe square root.
Definition math.cpp:486
Array is_non_zero(const Array &array)
Binary mask of non-zero elements.
Definition math.cpp:192
Array is_zero(const Array &array)
Binary mask of zero elements.
Definition math.cpp:204
Array smoothstep3(const Array &array, float vmin=0.f, float vmax=1.f)
Cubic smoothstep.
Definition math.cpp:333
Array threshold_smooth(const Array &array, float x0, float x1)
Smooth threshold.
Definition math.cpp:510
Array cos(const Array &array)
Cosine.
Definition math.cpp:128
Array abs(const Array &array)
Absolute value.
Definition math.cpp:17
Array sqrt(const Array &array)
Square root.
Definition math.cpp:474
Array log10(const Array &array)
Base-10 logarithm.
Definition math.cpp:248
Array smoothstep3_lower(const Array &array)
Cubic smoothstep (zero derivative at 0 only).
Definition math.cpp:357
Array gaussian_decay(const Array &array, float sigma)
Gaussian decay.
Definition math.cpp:152
Array smoothstep5_lower(const Array &array)
Quintic smoothstep (zero derivative at 0 only).
Definition math.cpp:438
Array smoothstep5(const Array &array, float vmin=0.f, float vmax=1.f)
Quintic smoothstep.
Definition math.cpp:381
Array r_max(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth maximum / union (exact zero-set).
Definition math.cpp:294
Array abs_smooth(const Array &array, float mu, const Array &vshift)
Smooth absolute value.
Definition math.cpp:59
Array exp(const Array &array)
Exponential.
Definition math.cpp:140
Array almost_unit_identity_c2(const Array &array)
Almost unit identity function (C2 variant).
Definition math.cpp:90
Array atan2(const Array &y, const Array &array)
Element-wise arctangent with quadrant handling.
Definition math.cpp:114
Array is_equal(const Array &array, float value)
Binary mask of elements equal to a value.
Definition math.cpp:180
Array atan(const Array &array)
Arctangent.
Definition math.cpp:102
Point lerp(const Point &p1, const Point &p2, float t)
Linearly interpolates between two points.
Definition points.cpp:225
Array hypot(const Array &array1, const Array &array2)
Hypotenuse.
Definition math.cpp:166
Array r_min(const Array &array1, const Array &array2, float alpha=0.f)
Generalized Rvachev R-function for smooth minimum / intersection (exact zero-set).
Definition math.cpp:280