Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
Data_Vec< T, N > Class Template Reference

declaration in params.hpp More...

#include <core_power.h>

Public Member Functions

 Data_Vec ()=default
 
 Data_Vec (size_t size)
 
std::vector< T > & operator[] (size_t i)
 
const std::vector< T > & operator[] (size_t i) const
 
size_t dim () const noexcept
 
size_t size () const noexcept
 
void resize (size_t n)
 
void resize (size_t n, T val)
 
void reserve (size_t n)
 
void erase (size_t index)
 
void fill (T val)
 

Public Attributes

std::array< std::vector< T >, N > data
 

Detailed Description

template<typename T, size_t N>
class Data_Vec< T, N >

declaration in params.hpp

: class containing data [x, y,...]

Definition at line 19 of file core_power.h.

Constructor & Destructor Documentation

template<typename T, size_t N>
Data_Vec< T, N >::Data_Vec ( )
default
template<typename T, size_t N>
Data_Vec< T, N >::Data_Vec ( size_t  size)
inline

Definition at line 23 of file class_data_vec.hpp.

23 { data.fill(std::vector<T>(size)); }
std::array< std::vector< T >, N > data
size_t size() const noexcept

Member Function Documentation

template<typename T, size_t N>
size_t Data_Vec< T, N >::dim ( ) const
inlinenoexcept

Definition at line 33 of file class_data_vec.hpp.

Referenced by App_Var< T >::Impl< T >::alloc_bin_corr(), and App_Var< T >::Impl< T >::alloc_bin_spec().

33 { return data.size(); }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
void Data_Vec< T, N >::erase ( size_t  index)
inline

Definition at line 44 of file class_data_vec.hpp.

Referenced by gen_cqty_binned().

44  {
45  for (auto &vec : data) vec.erase(vec.begin() + index);
46  }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
void Data_Vec< T, N >::fill ( val)
inline

Definition at line 48 of file class_data_vec.hpp.

Referenced by gen_cqty_binned().

48  {
49  for (auto &vec : data) std::fill(vec.begin(), vec.end(), val);
50  }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
std::vector<T>& Data_Vec< T, N >::operator[] ( size_t  i)
inline

Definition at line 29 of file class_data_vec.hpp.

29 { return data[i]; }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
const std::vector<T>& Data_Vec< T, N >::operator[] ( size_t  i) const
inline

Definition at line 30 of file class_data_vec.hpp.

30 { return data[i]; }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
void Data_Vec< T, N >::reserve ( size_t  n)
inline

Definition at line 41 of file class_data_vec.hpp.

Referenced by App_Var< T >::Impl< T >::alloc_bin_corr(), and App_Var< T >::Impl< T >::alloc_bin_spec().

41  {
42  for (auto &vec : data) vec.reserve(n);
43  }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
void Data_Vec< T, N >::resize ( size_t  n)
inline

Definition at line 35 of file class_data_vec.hpp.

Referenced by gen_cqty_binned(), anonymous_namespace{core_power.cpp}::gen_fce_r_binned_gsl(), and gen_pow_spec_binned_from_extrap().

35  {
36  for (auto &vec : data) vec.resize(n);
37  }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
void Data_Vec< T, N >::resize ( size_t  n,
val 
)
inline

Definition at line 38 of file class_data_vec.hpp.

38  {
39  for (auto &vec : data) vec.resize(n, val);
40  }
std::array< std::vector< T >, N > data
template<typename T, size_t N>
size_t Data_Vec< T, N >::size ( ) const
inlinenoexcept

Member Data Documentation

template<typename T, size_t N>
std::array<std::vector<T>, N> Data_Vec< T, N >::data

Definition at line 26 of file class_data_vec.hpp.

Referenced by Data_Vec< double, 2 >::Data_Vec().


The documentation for this class was generated from the following files: