MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Series.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file Series.hpp
5 * @brief Ordered sequences of positive numbers.
6 *
7 * Each function returns a sequence relative to a base value, 1 by default, so
8 * the result reads as ratios and scales to any unit by that base. They are
9 * plain number producers: what the numbers are used for is not part of them.
10 */
11
13
14/**
15 * @brief base * 1, base * 2, ... base * count.
16 */
17[[nodiscard]] MAYAFLUX_API std::vector<double> harmonic_series(size_t count, double base = 1.0);
18
19/**
20 * @brief Integers pulled outward with order: base * n * sqrt(1 + stretch * n^2).
21 * @param count Number of terms, n running from 1
22 * @param stretch Zero gives the harmonic series; positive values spread the upper terms
23 * @param base Value of the first term when stretch is zero
24 */
25[[nodiscard]] MAYAFLUX_API std::vector<double> stretched_series(
26 size_t count, double stretch, double base = 1.0);
27
28/**
29 * @brief Ratios of the transverse modes of a uniform free-free beam.
30 * @param count Number of terms
31 * @param base Value of the first term
32 *
33 * The squares of the roots of cos(x) cosh(x) = 1, scaled so the first is
34 * one: 1, 2.756, 5.404, 8.933, 13.344, and so on, found to machine
35 * precision rather than from a table.
36 */
37[[nodiscard]] MAYAFLUX_API std::vector<double> free_bar_series(size_t count, double base = 1.0);
38
39/**
40 * @brief Geometric steps: base * ratio^(k * step) for k = 1 .. count.
41 * @param count Number of terms
42 * @param ratio The number raised to the power; the golden ratio gives a
43 * quasi-periodic spacing
44 * @param step Exponent increment per term
45 * @param base Scale
46 */
47[[nodiscard]] MAYAFLUX_API std::vector<double> power_series(
48 size_t count, double ratio, double step, double base = 1.0);
49
50/**
51 * @brief Each value replaced by a close pair, v * (1 - spread) and v * (1 + spread).
52 * @param values Sequence to split; the result has twice as many terms, each
53 * pair adjacent and ascending
54 * @param spread Relative separation, for example 0.001 for a thousandth
55 */
56[[nodiscard]] MAYAFLUX_API std::vector<double> split_pairs(
57 std::span<const double> values, double spread);
58
59} // namespace MayaFlux::Kinesis::Discrete
std::vector< std::byte > values
Definition VDBWriter.cpp:26
size_t count
std::vector< double > power_series(size_t count, double ratio, double step, double base)
Geometric steps: base * ratio^(k * step) for k = 1 .
Definition Series.cpp:56
std::vector< double > harmonic_series(size_t count, double base)
base * 1, base * 2, ... base * count.
Definition Series.cpp:24
std::vector< double > stretched_series(size_t count, double stretch, double base)
Integers pulled outward with order: base * n * sqrt(1 + stretch * n^2).
Definition Series.cpp:32
std::vector< double > free_bar_series(size_t count, double base)
Ratios of the transverse modes of a uniform free-free beam.
Definition Series.cpp:42
std::vector< double > split_pairs(std::span< const double > values, double spread)
Each value replaced by a close pair, v * (1 - spread) and v * (1 + spread).
Definition Series.cpp:64