calc namespace
Contents
- Reference
Documentation for hub
Functions
-
template<typename... Args>auto add(Args && ... args) -> auto constexpr
- Calculate the sum of variables.
-
template<typename... Args>auto mul(Args && ... args) -> auto constexpr
- Calculate the product of variables.
-
template<typename... Args>auto any(Args... args) -> auto constexpr
- Calculate the logical or of variables.
-
template<typename... Args>auto all(Args... args) -> auto constexpr
- Calculate the logical and of variables.
-
template<typename Array>void array_set_zero(Array& array)
- Set all elements of a std::ranges(Container) to 0.
-
template<typename... Args>void set_arrays_zero(Args&... args)
- Set all elements of std::ranges(Containers) to 0.
-
template<typename Array, typename Array2, typename... Args>auto array_dot(Array const& a, Array2 const& b, Args const&... args) -> auto
- Calculate the (general)dot product of arrays.
-
template<typename Array, typename... Args>void array_add(Array& dst, Args const&... args)
- Element wise addition of arrays.
-
template<typename Array1, typename Array2, typename Scalar>void array_scale(Array1& dst, Array2 const& a, Scalar scale)
- Element wise scale.
-
template<typename Array, typename... Args>void array_mul(Array& dst, Args const&... args)
- Element wise multiplication of arrays.
-
template<typename ScalarArray, typename VectorArray>auto calc_fall_free_time(ScalarArray const& mass, VectorArray const& position) -> auto
- Calculate the minimal fall free time of two particles.
-
template<typename Particles>auto calc_step_scale(Particles const& particles) -> auto
Function documentation
#include <src/core-computation.hpp>
template<typename... Args>
auto hub:: calc:: add(Args && ... args) constexpr
Calculate the sum of variables.
| Template parameters | |
|---|---|
| Args | The types of variables |
| Parameters | |
| args in | Variables. |
| Returns | constexpr auto The sum. |
#include <src/core-computation.hpp>
template<typename... Args>
auto hub:: calc:: mul(Args && ... args) constexpr
Calculate the product of variables.
| Template parameters | |
|---|---|
| Args | The types of variables. |
| Parameters | |
| args in | Variables. |
| Returns | constexpr auto The product. |
#include <src/core-computation.hpp>
template<typename... Args>
auto hub:: calc:: any(Args... args) constexpr
Calculate the logical or of variables.
| Template parameters | |
|---|---|
| Args | The types of variables. |
| Parameters | |
| args in | Variables. |
| Returns | constexpr auto The result. |
#include <src/core-computation.hpp>
template<typename... Args>
auto hub:: calc:: all(Args... args) constexpr
Calculate the logical and of variables.
| Template parameters | |
|---|---|
| Args | The types of variables. |
| Parameters | |
| args in | Variables. |
| Returns | constexpr auto The results. |
#include <src/core-computation.hpp>
template<typename Array>
void hub:: calc:: array_set_zero(Array& array)
Set all elements of a std::ranges(Container) to 0.
| Template parameters | |
|---|---|
| Array | Type of container. |
| Parameters | |
| array in/out | Container. |
#include <src/core-computation.hpp>
template<typename... Args>
void hub:: calc:: set_arrays_zero(Args&... args)
Set all elements of std::ranges(Containers) to 0.
| Template parameters | |
|---|---|
| Args | The types of containers |
| Parameters | |
| args in/out | Containers. |
#include <src/core-computation.hpp>
template<typename Array, typename Array2, typename... Args>
auto hub:: calc:: array_dot(Array const& a,
Array2 const& b,
Args const&... args)
Calculate the (general)dot product of arrays.
| Template parameters | |
|---|---|
| Array | The type of the first two arrays. |
| Array2 | |
| Args | The types of the arrays. |
| Parameters | |
| a in | The first array. |
| b in | The second array. |
| args in | The rest arrays. |
| Returns | auto The dot product. |
#include <src/core-computation.hpp>
template<typename Array, typename... Args>
void hub:: calc:: array_add(Array& dst,
Args const&... args)
Element wise addition of arrays.
| Template parameters | |
|---|---|
| Array | The type of the first array. |
| Args | The type of the arrays. |
| Parameters | |
| dst out | The destination array to store the result. |
| args in | The rest arrays. |
#include <src/core-computation.hpp>
template<typename Array1, typename Array2, typename Scalar>
void hub:: calc:: array_scale(Array1& dst,
Array2 const& a,
Scalar scale)
Element wise scale.
| Template parameters | |
|---|---|
| Array1 | |
| Array2 | |
| Scalar | The type of the scale factor. |
| Parameters | |
| dst out | The destination array to store the result. |
| a in | The input array. |
| scale in | Scale factor. |
#include <src/core-computation.hpp>
template<typename Array, typename... Args>
void hub:: calc:: array_mul(Array& dst,
Args const&... args)
Element wise multiplication of arrays.
| Template parameters | |
|---|---|
| Array | The type of the first array. |
| Args | The type of the arrays. |
| Parameters | |
| dst out | The destination array to store the result. |
| args in | The rest arrays. |
#include <src/core-computation.hpp>
template<typename ScalarArray, typename VectorArray>
auto hub:: calc:: calc_fall_free_time(ScalarArray const& mass,
VectorArray const& position)
Calculate the minimal fall free time of two particles.
| Parameters | |
|---|---|
| mass | mass array of particle. |
| position | position array of particle. |
| Returns | The minimal fall free time of the two particles |
#include <src/core-computation.hpp>
template<typename Particles>
auto hub:: calc:: calc_step_scale(Particles const& particles)
| Template parameters | |
|---|---|
| Particles | |
| Parameters | |
| particles | |