Generator container whose value for the element at an index is the application of a functor on the index itself. More...
Public Member Functions | |
| functor_container (size_type size, Func const &func) | |
| Create the container by initializing the functor and providing a size. More... | |
| distribution_type & | distribution () |
| value_type | get_element (gid_type const &i) const |
| Retrieve the value associated with a particular index. More... | |
| template<typename F > | |
| value_type | apply_get (gid_type const &idx, F const &f) |
| Apply an arbitrary functor to the computed value at a particular index. More... | |
| reference | operator[] (gid_type const &i) const |
| Construct a reference to the value of a particular index. More... | |
| reference | make_reference (gid_type const &i) const |
| Construct a reference to the value of a particular index. More... | |
| size_type | size (void) const |
| Return the size of this container. | |
| domain_type | domain (void) const |
| Create a linear domain of the GIDs in this container. | |
| locality_info | locality (gid_type const &) const |
Public Types | |
| typedef Func::index_type | gid_type |
| typedef Func::result_type | value_type |
| typedef boost::result_of< Func(gid_type)>::type | reference |
| typedef reference | const_reference |
| typedef functor_container_domain_type< n >::type | domain_type |
| typedef std::integral_constant< int, n > | dimension_type |
| typedef domain_type::size_type | size_type |
| typedef size_t | cid_type |
| TODO: cid_type should be changed based on the coarsening method. | |
| typedef view_impl::functor_container_distribution< domain_type, Func, n > | distribution_type |
| typedef metadata::generator_extractor< functor_container > | loc_dist_metadata |
Generator container whose value for the element at an index is the application of a functor on the index itself.
If we have a functor_container c, then c[i] == f(i) must be true. Note that the functor must publicly export a nested trait for the index_type (which is the input to the functor) and a nested trait for the result_type (which is the result of applying the functor on the index_type). In addition, the functor's operator must be declared const.
| Func | Function object |
| stapl::functor_container< Func, n >::functor_container | ( | size_type | size, |
| Func const & | func | ||
| ) |
Create the container by initializing the functor and providing a size.
| size | Size of this container |
| func | The functor to be applied |
| value_type stapl::functor_container< Func, n >::get_element | ( | gid_type const & | i | ) | const |
Retrieve the value associated with a particular index.
| i | Index of the value to compute |
| value_type stapl::functor_container< Func, n >::apply_get | ( | gid_type const & | idx, |
| F const & | f | ||
| ) |
Apply an arbitrary functor to the computed value at a particular index.
| idx | Index of the value to compute |
| f | A functor to apply to the value at index idx. Note that f's function operator must be declared const. |
| reference stapl::functor_container< Func, n >::operator[] | ( | gid_type const & | i | ) | const |
Construct a reference to the value of a particular index.
| i | Index of the value to retrieve |
| reference stapl::functor_container< Func, n >::make_reference | ( | gid_type const & | i | ) | const |
Construct a reference to the value of a particular index.
| i | Index of the value to retrieve |
1.8.13