|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Sparse vector implementation with domain-based indexing. More...
#include <al-vector.H>
Classes | |
| struct | Iterator |
| class | Proxy |
Public Types | |
| using | Domain = AlDomain< T > |
| using | DomainPtr = std::shared_ptr< Domain > |
| using | Map = Aleph::HashMap< T, NumType, MapODhash > |
| using | Item_Type = std::pair< T, NumType > |
| using | Pair = std::pair< T, NumType > |
Public Member Functions | |
| const NumType & | get_epsilon () const noexcept |
| Get the epsilon value used for zero comparisons. | |
| void | set_epsilon (const NumType &e) noexcept |
| Set the epsilon value for zero comparisons. | |
| const Domain & | get_domain () const noexcept |
| Get the domain over which this vector is defined. | |
| const DomainPtr & | get_domain_ptr () const noexcept |
| Return the shared pointer to the domain. | |
| Vector (DomainPtr d, const NumType &zero=default_epsilon) | |
| Construct a vector over a given domain (shared_ptr version) | |
| Vector (const Domain &d, const NumType &zero=default_epsilon) | |
| Construct a vector over a given domain (reference version) | |
| Vector (const Vector &v) | |
| Copy constructor. | |
| Vector (Vector &&v) noexcept | |
| Move constructor. | |
| Vector (DomainPtr d, const DynList< NumType > &l, const NumType &zero=default_epsilon) | |
| Construct vector from domain and list of values (shared_ptr version) | |
| Vector (const Domain &d, const DynList< NumType > &l, const NumType &zero=default_epsilon) | |
| Construct vector from domain and list of values (reference version) | |
| Vector & | operator= (const Vector &v) |
| Copy assignment operator. | |
| Vector & | operator= (Vector &&v) |
| Move assignment operator. | |
| void | set_entry (const T &i, const NumType &value) |
| Set a vector entry at given index. | |
| void | set_entries (std::initializer_list< T > ld, std::initializer_list< NumType > lr) |
| Set multiple entries using initializer lists. | |
| template<template< typename > class Container = DynList> | |
| void | set_entries (const Container< T > &c, std::initializer_list< NumType > lr) |
| Set multiple entries using container and initializer list. | |
| NumType | get_entry (const T &i) |
| Get vector entry at given index (non-const version) | |
| NumType | get_entry (const T &i) const noexcept |
| Get vector entry at given index (const version) | |
| NumType * | search_entry (const T &i) const noexcept |
| Search for an entry and return pointer to its value. | |
| bool | are_equal (const NumType &n1, const NumType &n2) const noexcept |
| Check if two numeric values are equal within epsilon. | |
| bool | equal_to (const Vector &other) const noexcept |
| Check if this vector equals another within epsilon tolerance. | |
| bool | operator== (const Vector &v) const noexcept |
| bool | operator!= (const Vector &v) const noexcept |
| Vector & | operator+= (const Vector &v) |
| Vector & | operator-= (const Vector &v) |
| Vector | operator+ (const Vector &r) const |
| Vector | operator- (const Vector &r) const |
| Vector & | product_by_scalar (const NumType &scalar) noexcept |
| Vector | operator* (const NumType &scalar) const |
| Vector & | divide_by_scalar (const NumType &scalar) |
| Vector | operator/ (const NumType &scalar) const |
| Vector | operator- () const |
| NumType | scalar_product (const Vector &v) const |
| NumType | operator* (const Vector &v) const |
| DynList< NumType > | to_list () const |
| void | print () const |
| std::string | to_str () const |
| Proxy | operator[] (const T &k) const noexcept |
| Proxy | operator[] (const T &k) noexcept |
| Proxy | operator() (const T &k) const noexcept |
| Proxy | operator() (const T &k) noexcept |
| Iterator | get_itor () const noexcept |
| Iterator | get_it () const noexcept |
Public Member Functions inherited from Aleph::TraverseMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| bool | traverse (Operation &operation) const |
| Traverse all elements, applying an operation to each. | |
| bool | traverse (Operation &operation) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | traverse (Operation and operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | traverse (Operation and operation=Operation()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Public Member Functions inherited from Aleph::LocateMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| std::pair< T, NumType > & | nth (const size_t n) const |
| Access the n-th element (bounds-checked). | |
| std::pair< T, NumType > & | nth_ne (const size_t n) const noexcept |
| Access the n-th element (unchecked). | |
| std::pair< T, NumType > * | find_ptr (Operation &operation) |
| Find the first element satisfying a predicate. | |
| std::pair< T, NumType > * | find_ptr (Operation &operation) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::pair< T, NumType > * | find_ptr (Operation and operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::pair< T, NumType > * | find_ptr (Operation and operation=Operation()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::tuple< bool, std::pair< T, NumType > > | find_item (Operation &operation) |
| Find element with success flag. | |
| std::tuple< bool, std::pair< T, NumType > > | find_item (Operation &operation) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::tuple< bool, std::pair< T, NumType > > | find_item (Operation &&operation=Operation()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::tuple< bool, std::pair< T, NumType > > | find_item (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Public Member Functions inherited from Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| auto | for_each (Operation &operation) const -> decltype(self()) |
| Apply an operation to each element (read-only). | |
| auto | for_each (Operation &operation) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | for_each (Operation &&operation=Operation()) const -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | for_each (Operation &&operation=Operation()) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | mutable_for_each (Operation &operation) -> decltype(self()) |
| Apply an operation to each element (mutable). | |
| auto | mutable_for_each (Operation &&operation=Operation()) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | all (Operation &operation) const |
| Test if all elements satisfy a predicate. | |
| bool | all (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | forall (Operation &operation) const |
| Alias for all(). | |
| bool | forall (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | exists (Operation &operation) const |
| Test if any element satisfies a predicate. | |
| bool | exists (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Container< __Type > | maps (Operation &operation) const |
| Transform elements using a mapping function. | |
| Container< __Type > | maps (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| __Type | foldl (const __Type &init, std::function< __Type(const __Type &, const std::pair< T, NumType > &)> operation) const |
| Left fold (reduce) with initial value. | |
| __Type | fold_left (std::function< __Type(const __Type &, const std::pair< T, NumType > &)> operation, const __Type &init) const |
| Left fold with operation first (alternative signature). | |
| std::pair< T, NumType > | fold (const std::pair< T, NumType > &init, Operation &operation) const |
| Simple fold with same type for accumulator and elements. | |
| std::pair< T, NumType > | fold (const std::pair< T, NumType > &init, Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| DynList< std::pair< T, NumType > > | filter (Operation &operation) const |
| Filter elements by a predicate. | |
| DynList< std::pair< T, NumType > > | filter (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| DynList< std::tuple< std::pair< T, NumType >, size_t > > | pfilter (Operation &operation) const |
| Filter with position information. | |
| DynList< std::tuple< std::pair< T, NumType >, size_t > > | pfilter (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::pair< DynList< std::pair< T, NumType > >, DynList< std::pair< T, NumType > > > | partition (Operation &op) const |
| Partition elements by a predicate. | |
| std::pair< DynList< std::pair< T, NumType > >, DynList< std::pair< T, NumType > > > | partition (Operation &&op=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::tuple< DynList< std::pair< T, NumType > >, DynList< std::pair< T, NumType > > > | tpartition (Operation &op) const |
| Partition returning tuple instead of pair. | |
| std::tuple< DynList< std::pair< T, NumType > >, DynList< std::pair< T, NumType > > > | tpartition (Operation &&op=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| size_t | length () const noexcept |
| Count the number of elements. | |
| Container< std::pair< T, NumType > > | rev () const |
| Create a reversed copy. | |
| Container< std::pair< T, NumType > > | take (const size_t n) const |
| Take the first n elements. | |
| Container< std::pair< T, NumType > > | drop (const size_t n) const |
| Skip the first n elements. | |
| std::pair< T, NumType > | sum (const std::pair< T, NumType > &init=std::pair< T, NumType > {}) const |
| Compute the sum of all elements. | |
| std::pair< T, NumType > | product (const std::pair< T, NumType > &init) const |
| Compute the product of all elements. | |
| const std::pair< T, NumType > * | min () const |
| Find the minimum element. | |
| const std::pair< T, NumType > * | max () const |
| Find the maximum element. | |
| const std::pair< T, NumType > * | min_by (Compare cmp) const |
| Find the minimum element using a custom comparator. | |
| const std::pair< T, NumType > * | max_by (Compare cmp) const |
| Find the maximum element using a custom comparator. | |
| bool | has_value (const std::pair< T, NumType > &val) const |
| Check if container has a value. | |
| bool | none (Predicate &pred) const |
| Check if no element satisfies a predicate. | |
| bool | none (Predicate &&pred) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| size_t | count_if (Predicate pred) const |
| Count elements satisfying a predicate. | |
| const std::pair< T, NumType > * | first () const |
| Get the first element. | |
| std::pair< T, NumType > | first_or (const std::pair< T, NumType > &default_val) const |
| Get the first element or a default value. | |
| const std::pair< T, NumType > * | last () const |
| Get the last element. | |
| std::pair< T, NumType > | last_or (const std::pair< T, NumType > &default_val) const |
| Get the last element or a default value. | |
| Container< std::pair< size_t, std::pair< T, NumType > > > | enumerate () const |
| Enumerate elements with their indices. | |
| size_t | find_index (Predicate pred) const |
| Find the index of the first element satisfying a predicate. | |
| size_t | index_of (const std::pair< T, NumType > &val) const |
| Find the index of a specific value. | |
| Container< std::pair< T, NumType > > | unique () const |
| Remove consecutive duplicate elements. | |
| Container< std::pair< T, NumType > > | unique_by (EqPred eq) const |
| Remove consecutive duplicates using a custom equality predicate. | |
| Container< std::pair< T, NumType > > | intersperse (const std::pair< T, NumType > &sep) const |
| Intersperse a separator between elements. | |
| Container< Container< std::pair< T, NumType > > > | chunk (size_t n) const |
| Split into chunks of fixed size. | |
| Container< Container< std::pair< T, NumType > > > | sliding (size_t size, size_t step=1) const |
| Create sliding windows of fixed size. | |
| std::vector< std::pair< T, NumType > > | to_vector () const |
| Convert to std::vector. | |
| DynListType | to_dynlist () const |
| Convert container to DynList. | |
| StringType | join (const StringType &sep=StringType{", "}) const |
| Join elements into a string with separator. | |
| std::string | join_str (const std::string &sep=", ") const |
| Join string elements with separator. | |
| Container< std::pair< std::pair< T, NumType >, typename Other::Item_Type > > | zip_with (const Other &other) const |
| Zip with another container. | |
Private Member Functions | |
| bool | is_zero (const NumType &val) const noexcept |
Static Private Member Functions | |
| static NumType | abs (const NumType &val) noexcept |
| static bool | test_epsilon (const NumType &e) noexcept |
Private Attributes | |
| DomainPtr | domain_ptr = nullptr |
| NumType | epsilon = default_epsilon |
| Map | entries |
Static Private Attributes | |
| static const NumType | default_epsilon = 1e-7 |
Additional Inherited Members | |
Protected Member Functions inherited from Aleph::TraverseMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| const Vector< T, NumType > & | self () const noexcept |
| Access the derived class (const version). | |
| Vector< T, NumType > & | self () noexcept |
| Access the derived class (mutable version). | |
Protected Member Functions inherited from Aleph::LocateMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| const Vector< T, NumType > & | self () const noexcept |
| Vector< T, NumType > & | self () noexcept |
Protected Member Functions inherited from Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > > | |
| const Vector< T, NumType > & | self () const noexcept |
| Vector< T, NumType > & | self () noexcept |
Sparse vector implementation with domain-based indexing.
This class implements a mathematical vector with sparse storage, where only non-zero entries are stored. The vector is defined over a domain of type T, and entries have values of type NumType.
The vector uses epsilon-based comparison for numerical tolerance, automatically removing entries that become close to zero.
| T | Type of domain elements (default: int) |
| NumType | Numeric type for vector entries (default: double) |
Definition at line 84 of file al-vector.H.
Definition at line 89 of file al-vector.H.
| using Aleph::Vector< T, NumType >::DomainPtr = std::shared_ptr<Domain> |
Definition at line 90 of file al-vector.H.
| using Aleph::Vector< T, NumType >::Item_Type = std::pair<T, NumType> |
Definition at line 92 of file al-vector.H.
| using Aleph::Vector< T, NumType >::Map = Aleph::HashMap<T, NumType, MapODhash> |
Definition at line 91 of file al-vector.H.
Definition at line 131 of file al-vector.H.
|
inline |
Construct a vector over a given domain (shared_ptr version)
| d | Shared pointer to domain for the vector indices |
| zero | Epsilon value for zero comparisons (default: 1e-7) |
Definition at line 147 of file al-vector.H.
|
inline |
Construct a vector over a given domain (reference version)
| d | Domain for the vector indices (will be wrapped in shared_ptr) |
| zero | Epsilon value for zero comparisons (default: 1e-7) |
Definition at line 159 of file al-vector.H.
|
inline |
Construct vector from domain and list of values (shared_ptr version)
| d | Shared pointer to domain for the vector indices |
| l | List of values (must match domain size) |
| zero | Epsilon value for zero comparisons (default: 1e-7) |
| ah_length_error | if list size doesn't match domain size |
Definition at line 193 of file al-vector.H.
References ah_length_error_if, Aleph::Vector< T, NumType >::domain_ptr, l, Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), Aleph::Vector< T, NumType >::set_entry(), Aleph::HTList::size(), and Aleph::zip_it().
|
inline |
Construct vector from domain and list of values (reference version)
| d | Domain for the vector indices (will be wrapped in shared_ptr) |
| l | List of values (must match domain size) |
| zero | Epsilon value for zero comparisons (default: 1e-7) |
| ah_length_error | if list size doesn't match domain size |
Definition at line 215 of file al-vector.H.
Definition at line 101 of file al-vector.H.
Referenced by Aleph::Vector< T, NumType >::is_zero().
|
inlinenoexcept |
Check if two numeric values are equal within epsilon.
| n1 | First value |
| n2 | Second value |
Definition at line 395 of file al-vector.H.
References Aleph::Vector< T, NumType >::is_zero().
Referenced by Aleph::Vector< T, NumType >::equal_to(), and TEST_F().
Definition at line 486 of file al-vector.H.
References ah_domain_error_if, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::is_zero(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by Aleph::Vector< T, NumType >::operator/().
|
inlinenoexcept |
Check if this vector equals another within epsilon tolerance.
| other | Vector to compare with (must have same domain) |
Definition at line 405 of file al-vector.H.
References Aleph::Vector< T, NumType >::are_equal(), Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::get_entry(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inlinenoexcept |
Get the domain over which this vector is defined.
Definition at line 137 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr.
Referenced by Aleph::outer_product(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Return the shared pointer to the domain.
Definition at line 140 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr.
Get vector entry at given index (non-const version)
| i | Index (must be in domain) |
Definition at line 340 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::is_zero(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by demo_sparse_vector(), demo_string_indexed_vector(), Aleph::Vector< T, NumType >::equal_to(), Aleph::Vector< T, NumType >::operator+=(), Aleph::Vector< T, NumType >::operator-=(), Aleph::Vector< T, NumType >::scalar_product(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and Aleph::Vector< T, NumType >::to_str().
Get vector entry at given index (const version)
| i | Index (must be in domain) |
Definition at line 362 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inlinenoexcept |
Get the epsilon value used for zero comparisons.
Definition at line 119 of file al-vector.H.
References Aleph::Vector< T, NumType >::epsilon.
Referenced by demo_epsilon(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Definition at line 700 of file al-vector.H.
Referenced by Aleph::Matrix< Trow, Tcol, NumType >::create_by_columns(), demo_epsilon(), demo_sparse_vector(), demo_string_indexed_vector(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Definition at line 699 of file al-vector.H.
Definition at line 106 of file al-vector.H.
References Aleph::Vector< T, NumType >::abs(), Aleph::Vector< T, NumType >::epsilon, and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by Aleph::Vector< T, NumType >::are_equal(), Aleph::Vector< T, NumType >::divide_by_scalar(), Aleph::Vector< T, NumType >::get_entry(), Aleph::Vector< T, NumType >::Proxy::operator=(), Aleph::Vector< T, NumType >::Proxy::operator=(), Aleph::Vector< T, NumType >::product_by_scalar(), and Aleph::Vector< T, NumType >::set_entry().
|
inlinenoexcept |
Definition at line 421 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inlinenoexcept |
Definition at line 684 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inlinenoexcept |
Definition at line 689 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inline |
Definition at line 480 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::product_by_scalar().
|
inline |
Definition at line 533 of file al-vector.H.
References Aleph::Vector< T, NumType >::scalar_product().
|
inline |
Definition at line 448 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inline |
Definition at line 426 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::get_entry(), Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::set_entry().
|
inline |
Definition at line 508 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::product_by_scalar().
|
inline |
Definition at line 455 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inline |
Definition at line 437 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::get_entry(), Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::set_entry().
|
inline |
Definition at line 501 of file al-vector.H.
References Aleph::Vector< T, NumType >::divide_by_scalar(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inline |
Copy assignment operator.
| v | Vector to copy from |
| std::domain_error | if domains are different (not the same object) |
Definition at line 227 of file al-vector.H.
References ah_domain_error_if, Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, and Aleph::Vector< T, NumType >::epsilon.
|
inline |
Move assignment operator.
| v | Vector to move from |
| std::domain_error | if domains are different (not the same object) |
Definition at line 248 of file al-vector.H.
References ah_domain_error_if, Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, and Aleph::Vector< T, NumType >::epsilon.
|
inlinenoexcept |
Definition at line 419 of file al-vector.H.
|
inlinenoexcept |
Definition at line 674 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inlinenoexcept |
Definition at line 679 of file al-vector.H.
References Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Definition at line 546 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Definition at line 462 of file al-vector.H.
References Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::is_zero(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by Aleph::Vector< T, NumType >::operator*(), and Aleph::Vector< T, NumType >::operator-().
Definition at line 514 of file al-vector.H.
References ah_domain_error_if, Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::get_entry(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by Aleph::Vector< T, NumType >::operator*(), and TEST_F().
Search for an entry and return pointer to its value.
| i | Index (must be in domain) |
Definition at line 378 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
|
inline |
Set multiple entries using container and initializer list.
| c | Container of domain indices |
| lr | List of corresponding values |
| ah_range_error | if container and list have different sizes |
| ah_domain_error | if any index not in domain |
Definition at line 318 of file al-vector.H.
References ah_domain_error_if, ah_range_error_if, Aleph::Vector< T, NumType >::domain_ptr, Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::set_entry().
|
inline |
Set multiple entries using initializer lists.
| ld | List of domain indices |
| lr | List of corresponding values |
| ah_range_error | if lists have different sizes |
| ah_domain_error | if any index not in domain |
Definition at line 293 of file al-vector.H.
References ah_domain_error_if, ah_range_error_if, Aleph::Vector< T, NumType >::domain_ptr, Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::Vector< T, NumType >::set_entry().
Set a vector entry at given index.
| i | Index (must be in domain) |
| value | Value to set (automatically removed if within epsilon of zero) |
Definition at line 268 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::entries, Aleph::Vector< T, NumType >::is_zero(), and Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps().
Referenced by Aleph::Vector< T, NumType >::Vector(), demo_epsilon(), demo_linear_system(), demo_matrix_vector_mult(), demo_outer_product(), demo_sparse_vector(), demo_string_indexed_vector(), demo_vector_arithmetic(), Aleph::Vector< T, NumType >::operator+=(), Aleph::Vector< T, NumType >::operator-=(), Aleph::Vector< T, NumType >::set_entries(), Aleph::Vector< T, NumType >::set_entries(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Set the epsilon value for zero comparisons.
| e | New epsilon value (must be >= 0) |
Definition at line 126 of file al-vector.H.
References Aleph::Vector< T, NumType >::epsilon.
Referenced by demo_epsilon(), and TEST_F().
|
inlinestaticprivatenoexcept |
Definition at line 112 of file al-vector.H.
|
inline |
Definition at line 538 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), and Aleph::sort().
Referenced by TEST_F().
|
inline |
Definition at line 556 of file al-vector.H.
References Aleph::Vector< T, NumType >::domain_ptr, Aleph::Vector< T, NumType >::get_entry(), GenericItems< Container, T >::keys(), Aleph::FunctionalMixin< Vector< T, NumType >, std::pair< T, NumType > >::maps(), Aleph::unzip(), and Aleph::zip().
Referenced by TEST_F().
|
staticprivate |
Definition at line 95 of file al-vector.H.
|
private |
Definition at line 97 of file al-vector.H.
Referenced by Aleph::Vector< T, NumType >::Vector(), Aleph::Vector< T, NumType >::equal_to(), Aleph::Vector< T, NumType >::get_domain(), Aleph::Vector< T, NumType >::get_domain_ptr(), Aleph::Vector< T, NumType >::get_entry(), Aleph::Vector< T, NumType >::get_entry(), Aleph::Vector< T, NumType >::operator+=(), Aleph::Vector< T, NumType >::operator-=(), Aleph::Vector< T, NumType >::operator=(), Aleph::Vector< T, NumType >::operator=(), Aleph::Vector< T, NumType >::print(), Aleph::Vector< T, NumType >::scalar_product(), Aleph::Vector< T, NumType >::search_entry(), Aleph::Vector< T, NumType >::set_entries(), Aleph::Vector< T, NumType >::set_entries(), Aleph::Vector< T, NumType >::set_entry(), Aleph::Vector< T, NumType >::to_list(), and Aleph::Vector< T, NumType >::to_str().
Definition at line 99 of file al-vector.H.
Referenced by Aleph::Vector< T, NumType >::Proxy::Proxy(), Aleph::Vector< T, NumType >::divide_by_scalar(), Aleph::Vector< T, NumType >::equal_to(), Aleph::Vector< T, NumType >::get_entry(), Aleph::Vector< T, NumType >::get_entry(), Aleph::Vector< T, NumType >::operator+=(), Aleph::Vector< T, NumType >::operator-=(), Aleph::Vector< T, NumType >::Proxy::operator=(), Aleph::Vector< T, NumType >::Proxy::operator=(), Aleph::Vector< T, NumType >::operator=(), Aleph::Vector< T, NumType >::Proxy::operator=(), Aleph::Vector< T, NumType >::operator=(), Aleph::Vector< T, NumType >::print(), Aleph::Vector< T, NumType >::product_by_scalar(), Aleph::Vector< T, NumType >::scalar_product(), Aleph::Vector< T, NumType >::search_entry(), and Aleph::Vector< T, NumType >::set_entry().
|
private |
Definition at line 98 of file al-vector.H.
Referenced by Aleph::Vector< T, NumType >::get_epsilon(), Aleph::Vector< T, NumType >::is_zero(), Aleph::Vector< T, NumType >::operator=(), Aleph::Vector< T, NumType >::operator=(), and Aleph::Vector< T, NumType >::set_epsilon().