oomph::Vector< bool > Class Reference

#include <Vector.h>

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

Public Types

typedef bool 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 (const double &dont_call_this_constructor)
 

Private Member Functions

 Vector ()
 Construct an empty vector. More...
 
 Vector (size_type __n)
 
 Vector (size_type __n, const bool &__value)
 
 Vector (std::initializer_list< bool > init)
 
 Vector (const Vector< bool > &__x)
 Copy constructor. More...
 
void initialise (const bool &__value)
 Iterate over all values and set to the desired value. More...
 

Detailed Description

A Vector of bools cannot be created because the is no compiler-independent implementation of the bit manipulators. Making all the constructors private should lead to compile-time errors.

Member Typedef Documentation

◆ const_reference

Typedef to make the constructors look a bit cleaner.

◆ reference

Typedef to make the constructors look a bit cleaner.

◆ size_type

typedef size_t oomph::Vector< bool >::size_type

Typedef to make the constructors look a bit cleaner.

◆ value_type

Typedef to make the constructors look a bit cleaner.

Constructor & Destructor Documentation

◆ Vector() [1/6]

oomph::Vector< bool >::Vector ( const double dont_call_this_constructor)
inline

Dummy constructor to avoid compiler from warning about only-private constructors

219  {
220  // Throw an Oomph-lib error
221  throw OomphLibError("Please use vector<bool> instead of Vector<bool>",
224  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ Vector() [2/6]

oomph::Vector< bool >::Vector ( )
inlineprivate

Construct an empty vector.

230 : std::vector<bool>() {}

◆ Vector() [3/6]

oomph::Vector< bool >::Vector ( size_type  __n)
inlineexplicitprivate

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

234 : std::vector<bool>(__n) {}

◆ Vector() [4/6]

oomph::Vector< bool >::Vector ( size_type  __n,
const bool __value 
)
inlineprivate

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

238  : std::vector<bool>(__n, __value)
239  {
240  }

◆ Vector() [5/6]

oomph::Vector< bool >::Vector ( std::initializer_list< bool init)
inlineprivate

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

247 : std::vector<bool>(init) {}
Definition: TutorialInplaceLU.cpp:2

◆ Vector() [6/6]

oomph::Vector< bool >::Vector ( const Vector< bool > &  __x)
inlineprivate

Copy constructor.

250 : std::vector<bool>(__x) {}

Member Function Documentation

◆ initialise()

void oomph::Vector< bool >::initialise ( const bool __value)
inlineprivate

Iterate over all values and set to the desired value.

254  {
255  for (std::vector<bool>::iterator it = std::vector<bool>::begin();
256  it != std::vector<bool>::end();
257  it++)
258  {
259  *it = __value;
260  }
261  }
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79

References Eigen::placeholders::end.


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