Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
Catch::Generators::Generators< T > Struct Template Reference

#include <catch.hpp>

Inheritance diagram for Catch::Generators::Generators< T >:
Collaboration diagram for Catch::Generators::Generators< T >:

Public Types

using type = T
 

Public Member Functions

 Generators ()
 
void populate (T &&val)
 
template<typename U >
void populate (U &&val)
 
void populate (Generator< T > &&generator)
 
template<typename U , typename... Gs>
void populate (U &&valueOrGenerator, Gs...moreGenerators)
 
auto operator[] (size_t index) const -> T
 
- Public Member Functions inherited from Catch::Generators::GeneratorBase
 GeneratorBase (size_t size)
 
virtual ~GeneratorBase ()
 
auto size () const -> size_t
 

Public Attributes

std::vector< Generator< T > > m_generators
 

Additional Inherited Members

- Protected Attributes inherited from Catch::Generators::GeneratorBase
size_t m_size = 0
 

Detailed Description

template<typename T>
struct Catch::Generators::Generators< T >

Definition at line 3192 of file catch.hpp.

Member Typedef Documentation

template<typename T >
using Catch::Generators::Generators< T >::type = T

Definition at line 3195 of file catch.hpp.

Constructor & Destructor Documentation

template<typename T >
Catch::Generators::Generators< T >::Generators ( )
inline

Definition at line 3197 of file catch.hpp.

3197 : GeneratorBase( 0 ) {}

Member Function Documentation

template<typename T >
auto Catch::Generators::Generators< T >::operator[] ( size_t  index) const -> T
inline

Definition at line 3218 of file catch.hpp.

References CATCH_INTERNAL_ERROR, and growth_allz::T.

3218  {
3219  size_t sizes = 0;
3220  for( auto const& gen : m_generators ) {
3221  auto localIndex = index-sizes;
3222  sizes += gen.size();
3223  if( index < sizes )
3224  return gen[localIndex];
3225  }
3226  CATCH_INTERNAL_ERROR("Index '" << index << "' is out of range (" << sizes << ')');
3227  }
#define CATCH_INTERNAL_ERROR(msg)
Definition: catch.hpp:3031
std::vector< Generator< T > > m_generators
Definition: catch.hpp:3193
template<typename T >
void Catch::Generators::Generators< T >::populate ( T &&  val)
inline

Definition at line 3199 of file catch.hpp.

References Catch::Generators::value().

3199  {
3200  m_size += 1;
3201  m_generators.emplace_back( value( std::move( val ) ) );
3202  }
std::vector< Generator< T > > m_generators
Definition: catch.hpp:3193
auto value(T const &val) -> Generator< T >
Definition: catch.hpp:3177
template<typename T >
template<typename U >
void Catch::Generators::Generators< T >::populate ( U &&  val)
inline

Definition at line 3204 of file catch.hpp.

References growth_allz::T.

3204  {
3205  populate( T( std::move( val ) ) );
3206  }
template<typename T >
void Catch::Generators::Generators< T >::populate ( Generator< T > &&  generator)
inline

Definition at line 3207 of file catch.hpp.

3207  {
3208  m_size += generator.size();
3209  m_generators.emplace_back( std::move( generator ) );
3210  }
std::vector< Generator< T > > m_generators
Definition: catch.hpp:3193
template<typename T >
template<typename U , typename... Gs>
void Catch::Generators::Generators< T >::populate ( U &&  valueOrGenerator,
Gs...  moreGenerators 
)
inline

Definition at line 3213 of file catch.hpp.

3213  {
3214  populate( std::forward<U>( valueOrGenerator ) );
3215  populate( std::forward<Gs>( moreGenerators )... );
3216  }

Member Data Documentation

template<typename T >
std::vector<Generator<T> > Catch::Generators::Generators< T >::m_generators

Definition at line 3193 of file catch.hpp.


The documentation for this struct was generated from the following file: