Class IndexFactory

Class Documentation

class IndexFactory

Generates temporary indices.

Public Functions

IndexFactory() = default
template<typename IndexValidator>
inline explicit IndexFactory(IndexValidator validator, size_t min_index = Index::min_tmp_index())
Template Parameters:

IndexValidator – IndexValidator(const Index&) -> bool is valid and returns true generated index is valid

Parameters:
  • validator – a validator for the generated indices

  • min_index – start indexing indices for each space with this value; must be greater than 0; the default is to use Index::min_tmp_index()

inline Index make(const IndexBasis &basis)

creates a temporary index in basis basis . The label of the resulting index = basis().base_key() + ‘_’ + temporary counter. Each call increments the current tmp counter (see next_tmp_index() ) .

Parameters:

basis – the IndexBasis

Returns:

a unique temporary index in basis basis

inline Index make(const Index &idx)

creates a temporary index that inherits the space, basis instance and protoindices (and whether they are symmetric) of idx . The label of the resulting index = basis().base_key() + ‘_’ + temporary counter. Each call increments the current tmp counter (see next_tmp_index() ) .

Parameters:

idx – an Index object

Returns:

a unique temporary index in space space with same protoindices as idx