oomph::Vector< _Tp > Class Template Reference

#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)
 
 Vector (size_type __n, const _Tp &__value)
 
 Vector (std::initializer_list< _Tp > init)
 
 Vector (const Vector< _Tp > &__x)
 Copy constructor. More...
 
void initialise (const _Tp &__value)
 Iterate over all values and set to the desired value. More...
 

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!

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.

◆ reference

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

Typedef to make the constructors look a bit cleaner.

◆ size_type

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

Typedef to make the constructors look a bit cleaner.

◆ value_type

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

Typedef to make the constructors look a bit cleaner.

Constructor & Destructor Documentation

◆ Vector() [1/5]

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

Construct an empty vector.

141 : std::vector<_Tp>() {}

◆ 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

145 : std::vector<_Tp>(__n) {}

◆ 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

149  : std::vector<_Tp>(__n, __value)
150  {
151  }

◆ 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);

158 : std::vector<_Tp>(init) {}
Definition: TutorialInplaceLU.cpp:2

◆ Vector() [5/5]

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

Copy constructor.

161 : std::vector<_Tp>(__x) {}

Member Function Documentation

◆ initialise()

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

Iterate over all values and set to the desired value.

168  {
169  for (typename std::vector<_Tp>::iterator it = std::vector<_Tp>::begin();
170  it != std::vector<_Tp>::end();
171  it++)
172  {
173  *it = __value;
174  }
175  }
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79

References Eigen::placeholders::end.

Referenced by oomph::PeriodicOrbitTemporalMesh< ELEMENT >::assemble_residuals(), oomph::PeriodicOrbitTemporalMesh< ELEMENT >::assemble_residuals_and_jacobian(), 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::GeneralisedElement::get_inner_products(), oomph::ElasticallySupportedRingElement::get_jacobian(), ElasticFishBackElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian(), oomph::GeneralisedElement::get_jacobian_and_mass_matrix(), oomph::GeneralisedElement::get_mass_matrix(), oomph::SCoupledElement< ELEMENT >::get_momentum_and_energy(), oomph::VolumeCoupledElement< ELEMENT >::get_momentum_and_energy(), 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::ElasticallySupportedRingElement::get_residuals(), ElasticFishBackElement::get_residuals(), oomph::GeneralisedElement::get_residuals(), oomph::SolidFiniteElement::get_residuals_for_solid_ic(), oomph::PseudoBucklingRingElement::get_residuals_generic(), SolidProblem< ELEMENT_TYPE >::getMassMomentumEnergy(), oomph::GMRESBlockPreconditioner::preconditioner_solve(), oomph::HelmholtzMGPreconditioner< DIM >::residual_norm(), and oomph::VorticitySmootherElement< ELEMENT >::vorticity_error_squared().


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