![]() |
Ultra 0.9.4
|
#include <fitness.h>
Public Member Functions | |
| constexpr | fitnd (std::initializer_list< double >) |
| fitnd (values_t) | |
| fitnd (with_size, value_type=std::numeric_limits< value_type >::lowest()) | |
| std::size_t | size () const noexcept |
| bool | empty () const noexcept |
| value_type | operator[] (std::size_t) const |
| value_type & | operator[] (std::size_t) |
| iterator | begin () noexcept |
| iterator | end () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| fitnd & | operator+= (const fitnd &) |
| fitnd & | operator-= (const fitnd &) |
| fitnd & | operator*= (const fitnd &) |
| fitnd & | operator/= (const fitnd &) |
| fitnd & | operator*= (value_type) |
| fitnd & | operator/= (value_type) |
Friends | |
| auto | operator<=> (const fitnd &, const fitnd &)=default |
| bool | load (std::istream &, fitnd *) |
| fitnd | combine (const fitnd &, const fitnd &) |
Related Symbols | |
(Note that these are not member symbols.) | |
| bool | load (std::istream &in, fitnd *f) |
| std::ostream & | operator<< (std::ostream &o, const fitnd &f) |
| std::istream & | operator>> (std::istream &in, fitnd &f) |
| fitnd | operator+ (fitnd lhs, const fitnd &rhs) |
| fitnd | operator- (fitnd lhs, const fitnd &rhs) |
| fitnd | operator* (fitnd lhs, const fitnd &rhs) |
| fitnd | operator/ (fitnd lhs, const fitnd &rhs) |
| fitnd | operator/ (fitnd f, fitnd::value_type v) |
| fitnd | operator* (fitnd f, fitnd::value_type v) |
| fitnd | combine (const fitnd &f1, const fitnd &f2) |
A basic multi-dimensional fitness type.
Useful for rapid prototyping. Real use cases may require ad-hoc fitness type.
|
inlineconstexpr |
Builds a fitness from a list of values.
| ultra::fitnd::fitnd | ( | values_t | v | ) |
Builds a fitness from a vector of values.
| ultra::fitnd::fitnd | ( | with_size | s, |
| value_type | v = std::numeric_limits<value_type>::lowest() ) |
Fills the fitness with copies of a given value.
| [in] | s | dimension of the the fitness vector |
| [in] | v | default value |
Both Herb Sutter and Scott Meyers recommend to avoid class designs where a initializer_list constructor overload can cause ambiguities to the programmer. We use a tag to avoid such situations.
The tag also helps to clarify the meaning of the other arguments.
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
| fitnd & ultra::fitnd::operator*= | ( | const fitnd & | f | ) |
| [in] | f | a fitness |
| fitnd & ultra::fitnd::operator*= | ( | fitnd::value_type | v | ) |
| [in] | v | scalar value |
| fitnd & ultra::fitnd::operator+= | ( | const fitnd & | f | ) |
| [in] | f | a fitness |
| fitnd & ultra::fitnd::operator-= | ( | const fitnd & | f | ) |
| [in] | f | a fitness |
| fitnd & ultra::fitnd::operator/= | ( | const fitnd & | f | ) |
| [in] | f | a fitness |
| fitnd & ultra::fitnd::operator/= | ( | fitnd::value_type | v | ) |
| [in] | v | scalar value |
|
nodiscard |
| [in] | i | index of an element |
|
nodiscard |
| [in] | i | index of an element |
|
nodiscardnoexcept |
|
| [in] | f1 | first fitness value |
| [in] | f2 | second fitness value |
|
Deserialises a fitnd value.
| [in] | in | input stream |
| [out] | f | load the fitness here |
|
| [in] | f | a fitness value |
| [in] | v | a scalar |
|
| [in] | lhs | first factor |
| [in] | rhs | second factor |
|
| [in] | lhs | first addend |
| [in] | rhs | second addend |
|
| [in] | lhs | minuend |
| [in] | rhs | subtrahend |
|
| [in] | f | a fitness value |
| [in] | v | a scalar |
|
| [in] | lhs | first factor |
| [in] | rhs | second factor |
|
|
Standard input operator for fitnd.
| [in] | in | a character input stream |
| [out] | f | a fitness to be extracted |