SpECTRE  v2024.09.29
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
CustomStaticSizeVector Class Reference

Public Types

using BaseType = VectorImpl< double, CustomStaticSizeVector, static_size >
 
- Public Types inherited from VectorImpl< double, CustomStaticSizeVector, 3 >
using value_type = double
 
using size_type = size_t
 
using difference_type = std::ptrdiff_t
 
using BaseType = blaze::CustomVector< double, blaze::AlignmentFlag::unaligned, blaze::PaddingFlag::unpadded, blaze::defaultTransposeFlag, blaze::GroupTag< 0 >, CustomStaticSizeVector >
 
using ElementType = double
 
using TransposeType = VectorImpl< double, CustomStaticSizeVector, StaticSize >
 
using CompositeType = const VectorImpl< double, CustomStaticSizeVector, StaticSize > &
 
using iterator = typename BaseType::Iterator
 
using const_iterator = typename BaseType::ConstIterator
 

Public Member Functions

 CustomStaticSizeVector (const CustomStaticSizeVector &)=default
 
 CustomStaticSizeVector (CustomStaticSizeVector &&)=default
 
CustomStaticSizeVectoroperator= (const CustomStaticSizeVector &)=default
 
CustomStaticSizeVectoroperator= (CustomStaticSizeVector &&)=default
 
VectorImploperator= (const T &rhs)
 
 VectorImpl (size_t set_size)
 Create with the given size. In debug mode, the vector is initialized to 'NaN' by default. If not initialized to 'NaN', the memory is allocated but not initialized. More...
 
 VectorImpl (size_t set_size, T value)
 Create with the given size and value. More...
 
template<typename Container , Requires< std::is_same_v< typename Container::value_type, T > > = nullptr>
 VectorImpl (const Container &container)
 Create from a copy of the given container. More...
 
 VectorImpl (T *start, size_t set_size)
 Create a non-owning VectorImpl that points to start
 
template<class U , Requires< std::is_same_v< U, T > > = nullptr>
 VectorImpl (std::initializer_list< U > list)
 Create from an initializer list of T.
 
 VectorImpl ()=default
 Empty VectorImpl.
 
- Public Member Functions inherited from VectorImpl< double, CustomStaticSizeVector, 3 >
 VectorImpl (size_t set_size)
 Create with the given size. In debug mode, the vector is initialized to 'NaN' by default. If not initialized to 'NaN', the memory is allocated but not initialized. More...
 
 VectorImpl (size_t set_size, double value)
 Create with the given size and value. More...
 
 VectorImpl (const Container &container)
 Create from a copy of the given container. More...
 
 VectorImpl (double *start, size_t set_size)
 Create a non-owning VectorImpl that points to start
 
 VectorImpl (std::initializer_list< U > list)
 Create from an initializer list of T.
 
 VectorImpl ()=default
 Empty VectorImpl.
 
VectorImploperator= (const double &rhs)
 
decltype(auto) operator[] (const size_t index)
 
decltype(auto) operator[] (const size_t index) const
 
void destructive_resize (const size_t new_size)
 A common operation for checking the size and resizing a memory buffer if needed to ensure that it has the desired size. This operation is not permitted on a non-owning vector. More...
 
bool is_owning () const
 Returns true if the class owns the data.
 
void clear ()
 Put the class in the default-constructed state.
 
void pup (PUP::er &p)
 Serialization for Charm++.
 
const BaseType & operator* () const
 Upcast to BaseType More...
 
BaseType & operator* ()
 Upcast to BaseType More...
 
void set_data_ref (gsl::not_null< CustomStaticSizeVector * > rhs)
 Set the VectorImpl to be a reference to another VectorImpl object.
 
void set_data_ref (double *const start, const size_t set_size)
 Set the VectorImpl to be a reference to another VectorImpl object.
 

Additional Inherited Members

- Static Public Attributes inherited from VectorImpl< double, CustomStaticSizeVector, 3 >
static constexpr bool transpose_flag
 
static constexpr size_t static_size
 
- Protected Member Functions inherited from VectorImpl< double, CustomStaticSizeVector, 3 >
void reset_pointer_vector (const size_t set_size)
 
std::unique_ptr< value_type[]> heap_alloc_if_necessary (const size_t set_size)
 
- Protected Attributes inherited from VectorImpl< double, CustomStaticSizeVector, 3 >
std::unique_ptr< value_type[]> owned_data_
 
std::array< double, StaticSize > static_owned_data_
 
bool owning_
 

Member Function Documentation

◆ VectorImpl() [1/3]

template<typename Container , Requires< std::is_same_v< typename Container::value_type, T > > = nullptr>
VectorImpl< T, VectorType, StaticSize >::VectorImpl ( const Container &  container)
inlineexplicit

Create from a copy of the given container.

Parameters
containerA container with a value_type that is the same as T. Currently restricted to std::vector<T> and std::array<T>.

◆ VectorImpl() [2/3]

VectorImpl< T, VectorType, StaticSize >::VectorImpl ( size_t  set_size)
inlineexplicit

Create with the given size. In debug mode, the vector is initialized to 'NaN' by default. If not initialized to 'NaN', the memory is allocated but not initialized.

  • set_size number of values

◆ VectorImpl() [3/3]

VectorImpl< T, VectorType, StaticSize >::VectorImpl ( size_t  set_size,
value 
)
inline

Create with the given size and value.

  • set_size number of values
  • value the value to initialize each element

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