|
BioDynaMo
v1.05.125-2619fe54
|
#include <math_array.h>
Public Member Functions | |
| MathArray () | |
| Default constructor. More... | |
| constexpr | MathArray (std::initializer_list< T > l) |
| const T * | data () const |
| const size_t | size () const |
| const bool | empty () const |
| T & | operator[] (size_t idx) |
| const T & | operator[] (size_t idx) const |
| T & | at (size_t idx) noexcept(false) |
| const T * | begin () const |
| const T * | end () const |
| T * | begin () |
| T * | end () |
| T & | front () |
| T & | back () |
| MathArray & | operator= (const MathArray &other) |
| bool | operator== (const MathArray &other) const |
| bool | operator!= (const MathArray &other) const |
| MathArray & | operator++ () |
| MathArray | operator++ (int) |
| MathArray & | operator-- () |
| MathArray | operator-- (int) |
| MathArray & | operator+= (const MathArray &rhs) |
| MathArray | operator+ (const MathArray &rhs) |
| const MathArray | operator+ (const MathArray &rhs) const |
| MathArray & | operator+= (const T &rhs) |
| MathArray | operator+ (const T &rhs) |
| MathArray & | operator-= (const MathArray &rhs) |
| MathArray | operator- (const MathArray &rhs) |
| const MathArray | operator- (const MathArray &rhs) const |
| MathArray & | operator-= (const T &rhs) |
| MathArray | operator- (const T &rhs) |
| T & | operator*= (const MathArray &rhs)=delete |
| T | operator* (const MathArray &rhs) |
| const T | operator* (const MathArray &rhs) const |
| MathArray & | operator*= (const T &k) |
| MathArray | operator* (const T &k) |
| const MathArray | operator* (const T &k) const |
| MathArray & | operator/= (const T &k) |
| MathArray | operator/ (const T &k) |
| MathArray & | fill (const T &k) |
| T | Sum () const |
| bool | IsZero () const |
| Checks if vector is a zero vector, e.g. if all entries are zero. More... | |
| T | Norm () const |
| void | Normalize () |
| Normalize the array in-place. More... | |
| void | Normalize (T norm) |
| MathArray | GetNormalizedArray () const |
| Get a nomalized copy of the MathArray. More... | |
| MathArray | EntryWiseProduct (const MathArray &rhs) const |
Private Member Functions | |
| BDM_CLASS_DEF_NV (MathArray, 1) | |
Private Attributes | |
| T | data_ [N] |
Array with a fixed number of elements. It implements the same behaviour of the standard std::array<T, N> container. However, it provides also several custom mathematical operations (e.g. Sum(), Norm() etc.).
Definition at line 36 of file math_array.h.
|
inline |
Default constructor.
Definition at line 39 of file math_array.h.
|
inlineconstexpr |
Constructor which accepts an std::initializer_list to set the array's content.
| l | an initializer list |
Definition at line 49 of file math_array.h.
|
inlinenoexcept |
Returns the element at the given position. It will throw an std::out_of_range exception if the given index is out of the array's boundaries.
| idx | the index of the element. |
Definition at line 88 of file math_array.h.
|
inline |
Return the element at the end of the array.
Definition at line 109 of file math_array.h.
|
private |
|
inline |
Definition at line 99 of file math_array.h.
|
inline |
Definition at line 95 of file math_array.h.
|
inline |
Return a pointer to the underlying data.
Definition at line 62 of file math_array.h.
|
inline |
Check if the array is empty.
Definition at line 70 of file math_array.h.
|
inline |
Definition at line 101 of file math_array.h.
|
inline |
Definition at line 97 of file math_array.h.
|
inline |
Compute the entry wise product given another array of the same size.
| rhs | the other array |
Definition at line 396 of file math_array.h.
|
inline |
Fill the MathArray with a constant value.
| k | the constant value |
Definition at line 331 of file math_array.h.
|
inline |
Returns the element at the beginning of the array.
Definition at line 105 of file math_array.h.
|
inline |
Get a nomalized copy of the MathArray.
Definition at line 386 of file math_array.h.
|
inline |
Checks if vector is a zero vector, e.g. if all entries are zero.
Definition at line 341 of file math_array.h.
|
inline |
Compute the norm of the array's content.
Definition at line 352 of file math_array.h.
|
inline |
Normalize the array in-place.
Definition at line 364 of file math_array.h.
|
inline |
Normalize the array in-place.
If the calling code has already calculated the norm, this function signature ensures that the norm calculation is not duplicated.
Definition at line 373 of file math_array.h.
|
inline |
Definition at line 141 of file math_array.h.
|
inline |
Definition at line 265 of file math_array.h.
|
inline |
Definition at line 275 of file math_array.h.
|
inline |
Definition at line 293 of file math_array.h.
|
inline |
Definition at line 302 of file math_array.h.
|
delete |
|
inline |
Definition at line 285 of file math_array.h.
|
inline |
Definition at line 180 of file math_array.h.
|
inline |
Definition at line 190 of file math_array.h.
|
inline |
Definition at line 208 of file math_array.h.
|
inline |
Definition at line 143 of file math_array.h.
|
inline |
Definition at line 151 of file math_array.h.
|
inline |
Definition at line 171 of file math_array.h.
|
inline |
Definition at line 200 of file math_array.h.
|
inline |
Definition at line 226 of file math_array.h.
|
inline |
Definition at line 236 of file math_array.h.
|
inline |
Definition at line 254 of file math_array.h.
|
inline |
Definition at line 157 of file math_array.h.
|
inline |
Definition at line 165 of file math_array.h.
|
inline |
Definition at line 217 of file math_array.h.
|
inline |
Definition at line 246 of file math_array.h.
|
inline |
Definition at line 319 of file math_array.h.
|
inline |
Definition at line 311 of file math_array.h.
|
inline |
Assignment operator.
| other | the other MathArray instance. |
Definition at line 118 of file math_array.h.
|
inline |
Equality operator.
| other | a MathArray instance. |
Definition at line 129 of file math_array.h.
|
inline |
Overloaded array subscript operator. It does not perform any boundary checks.
| idx | element's index. |
Definition at line 76 of file math_array.h.
|
inline |
Const overloaded array subscript operator.
| idx | element's index. |
Definition at line 81 of file math_array.h.
|
inline |
Return the size of the array.
Definition at line 66 of file math_array.h.
|
inline |
Return the sum of all the array's elements.
Definition at line 338 of file math_array.h.
|
private |
Definition at line 407 of file math_array.h.
1.8.17