Public Types | Public Member Functions | Private Member Functions | List of all members
oomph::Vector< _Tp > Class Template Reference

A slight extension to the standard template vector class so that we can include "graceful" array range checks if the RANGE_CHECKING flag is set. The generalisation to general allocators is NOT handled here, mainly because we never use it, but also because the intel and gnu compilers have different names for the internal classes, which makes writing code that works for both a pain! More...

#include <Vector.h>

+ Inheritance diagram for oomph::Vector< _Tp >:

Public Types

typedef _Tp value_type
 Typedef to make the constructors look a bit cleaner. More...
 
typedef value_typereference
 Typedef to make the constructors look a bit cleaner. More...
 
typedef const value_typeconst_reference
 Typedef to make the constructors look a bit cleaner. More...
 
typedef size_t size_type
 Typedef to make the constructors look a bit cleaner. More...
 

Public Member Functions

 Vector ()
 Construct an empty vector. More...
 
 Vector (size_type __n)
 A constructor that creates a vector of size __n. Note the use of explicit for "strong" type checking. More...
 
 Vector (size_type __n, const _Tp &__value)
 A constructor that creates a vector of size __n and initialises every entry to __value. More...
 
 Vector (std::initializer_list< _Tp > init)
 A constructor that creates a vector with entries set by the values in the input initialiser_list Example: Vector<int> arr{0, 20, 100, 150); Vector<int> arr = {0, 20, 100, 150);. More...
 
 Vector (const Vector< _Tp > &__x)
 Copy constructor. More...
 
void initialise (const _Tp &__value)
 Iterate over all values and set to the desired value. More...
 
reference operator[] (size_type __n)
 Overload the bracket access operator to include array-range checking if the RANGE_CHECKING flag is set. More...
 
const_reference operator[] (size_type __n) const
 Overloaded, range-checking, bracket access operator (const version) More...
 

Private Member Functions

reference error_checked_access (size_type __n)
 
const_reference error_checked_access (size_type __n) const
 

Detailed Description

template<class _Tp>
class oomph::Vector< _Tp >

A slight extension to the standard template vector class so that we can include "graceful" array range checks if the RANGE_CHECKING flag is set. The generalisation to general allocators is NOT handled here, mainly because we never use it, but also because the intel and gnu compilers have different names for the internal classes, which makes writing code that works for both a pain!

Definition at line 57 of file Vector.h.

Member Typedef Documentation

◆ const_reference

template<class _Tp >
typedef const value_type& oomph::Vector< _Tp >::const_reference

Typedef to make the constructors look a bit cleaner.

Definition at line 67 of file Vector.h.

◆ reference

template<class _Tp >
typedef value_type& oomph::Vector< _Tp >::reference

Typedef to make the constructors look a bit cleaner.

Definition at line 64 of file Vector.h.

◆ size_type

template<class _Tp >
typedef size_t oomph::Vector< _Tp >::size_type

Typedef to make the constructors look a bit cleaner.

Definition at line 70 of file Vector.h.

◆ value_type

template<class _Tp >
typedef _Tp oomph::Vector< _Tp >::value_type

Typedef to make the constructors look a bit cleaner.

Definition at line 61 of file Vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/5]

template<class _Tp >
oomph::Vector< _Tp >::Vector ( )
inline

Construct an empty vector.

Definition at line 141 of file Vector.h.

◆ Vector() [2/5]

template<class _Tp >
oomph::Vector< _Tp >::Vector ( size_type  __n)
inlineexplicit

A constructor that creates a vector of size __n. Note the use of explicit for "strong" type checking.

Definition at line 145 of file Vector.h.

◆ Vector() [3/5]

template<class _Tp >
oomph::Vector< _Tp >::Vector ( size_type  __n,
const _Tp &  __value 
)
inline

A constructor that creates a vector of size __n and initialises every entry to __value.

Definition at line 149 of file Vector.h.

◆ Vector() [4/5]

template<class _Tp >
oomph::Vector< _Tp >::Vector ( std::initializer_list< _Tp >  init)
inline

A constructor that creates a vector with entries set by the values in the input initialiser_list Example: Vector<int> arr{0, 20, 100, 150); Vector<int> arr = {0, 20, 100, 150);.

Definition at line 158 of file Vector.h.

◆ Vector() [5/5]

template<class _Tp >
oomph::Vector< _Tp >::Vector ( const Vector< _Tp > &  __x)
inline

Copy constructor.

Definition at line 161 of file Vector.h.

Member Function Documentation

◆ error_checked_access() [1/2]

template<class _Tp >
reference oomph::Vector< _Tp >::error_checked_access ( size_type  __n)
inlineprivate

Definition at line 77 of file Vector.h.

Referenced by oomph::Vector< _Tp >::operator[]().

◆ error_checked_access() [2/2]

template<class _Tp >
const_reference oomph::Vector< _Tp >::error_checked_access ( size_type  __n) const
inlineprivate

Definition at line 111 of file Vector.h.

◆ initialise()

template<class _Tp >
void oomph::Vector< _Tp >::initialise ( const _Tp &  __value)
inline

Iterate over all values and set to the desired value.

Definition at line 167 of file Vector.h.

Referenced by oomph::PeriodicOrbitTemporalMesh< ELEMENT >::assemble_residuals(), oomph::PeriodicOrbitTemporalMesh< ELEMENT >::assemble_residuals_and_jacobian(), oomph::ComplexGMRES< MATRIX >::complex_solve_helper(), oomph::Mesh::compute_error(), oomph::Mesh::compute_norm(), oomph::SpaceTimeNavierStokesEquations< DIM >::get_body_force_nst(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::get_body_force_nst(), oomph::GeneralisedElement::get_djacobian_and_dmass_matrix_dparameter(), oomph::GeneralisedElement::get_djacobian_dparameter(), oomph::GeneralisedElement::get_dresiduals_dparameter(), oomph::Problem::get_hessian_vector_products(), oomph::GeneralisedElement::get_inner_products(), oomph::GeneralisedElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian_and_mass_matrix(), oomph::GeneralisedElement::get_mass_matrix(), oomph::VorticitySmootherElement< ELEMENT >::get_raw_velocity_deriv(), oomph::VorticitySmootherElement< ELEMENT >::get_raw_vorticity_deriv(), oomph::VorticitySmootherElement< ELEMENT >::get_raw_vorticity_second_deriv(), oomph::VorticitySmootherElement< ELEMENT >::get_raw_vorticity_third_deriv(), oomph::GeneralisedElement::get_residuals(), oomph::SolidFiniteElement::get_residuals_for_solid_ic(), oomph::PseudoBucklingRingElement::get_residuals_generic(), oomph::DGEulerFaceElement< ELEMENT >::numerical_flux(), oomph::GMRESBlockPreconditioner::preconditioner_solve(), oomph::HelmholtzMGPreconditioner< DIM >::residual_norm(), and oomph::VorticitySmootherElement< ELEMENT >::vorticity_error_squared().

◆ operator[]() [1/2]

template<class _Tp >
reference oomph::Vector< _Tp >::operator[] ( size_type  __n)
inline

Overload the bracket access operator to include array-range checking if the RANGE_CHECKING flag is set.

Definition at line 180 of file Vector.h.

References oomph::Vector< _Tp >::error_checked_access().

◆ operator[]() [2/2]

template<class _Tp >
const_reference oomph::Vector< _Tp >::operator[] ( size_type  __n) const
inline

Overloaded, range-checking, bracket access operator (const version)

Definition at line 186 of file Vector.h.

References oomph::Vector< _Tp >::error_checked_access().


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