All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
actions::Add< T > Class Template Reference
Inheritance diagram for actions::Add< T >:
actions::BaseAction< T >

Public Types

using Base_t = BaseAction< T >
 
typedef TestManagerClass< T > TestClass_t
 
typedef TestClass_t::Data_t Data_t
 type stored More...
 
typedef TestClass_t::Vector_t Vector_t
 type of STL vector More...
 
typedef TestClass_t::SparseVector_t SparseVector_t
 type of sparse vector More...
 
- Public Types inherited from actions::BaseAction< T >
using This_t = BaseAction< T >
 
typedef TestManagerClass< T > TestClass_t
 
typedef TestClass_t::Data_t Data_t
 type stored More...
 
typedef TestClass_t::Vector_t Vector_t
 type of STL vector More...
 
typedef TestClass_t::SparseVector_t SparseVector_t
 type of sparse vector More...
 

Public Member Functions

 data (new_data)
 
 baseline (baseline)
 
- Public Member Functions inherited from actions::BaseAction< T >
 BaseAction ()
 
 BaseAction (int exp_err)
 
virtual ~BaseAction ()
 
This_tset_expected_errors (int exp_err)
 
void describe (TestClass_t &tc, std::ostream &out) const
 Print a description of this action into the specified steam. More...
 
void describe (TestClass_t &tc) const
 Print a description of this action in the test class stream. More...
 
std::string description (TestClass_t &tc) const
 Returns a string with a description of this action. More...
 
void operator() (Vector_t &v) const
 Action performed on a STL vector. More...
 
void operator() (SparseVector_t &v) const
 Action performed on a sparse vector. More...
 

Public Attributes

size_t position
 
Vector_t data
 
Data_t baseline = Data_t(0)
 
 __pad0__: position(pos)
 
- Public Attributes inherited from actions::BaseAction< T >
int expected_errors {0}
 number of errors expected for this action More...
 

Protected Member Functions

virtual void actionOnVector (Vector_t &v) const override
 
virtual void actionOnSparseVector (SparseVector_t &v) const override
 
virtual void doDescribe (TestClass_t &, std::ostream &out) const override
 

Additional Inherited Members

- Protected Types inherited from actions::BaseAction< T >
using v_citer_t = typename Vector_t::const_iterator
 
- Static Protected Member Functions inherited from actions::BaseAction< T >
template<typename ITER >
static ITER skipRange (ITER start, ITER const end)
 
template<typename ITER >
static ITER skipVoid (ITER start, ITER const end)
 
template<typename ITER >
static ITER rangeStart (ITER const begin, ITER last)
 
template<typename ITER >
static ITER voidStart (ITER const begin, ITER last)
 
template<typename Vector >
static auto findRangeBorders (Vector &v, std::size_t pos)
 
template<typename ITER >
static ITER findRangeStart (Vector_t const &v, std::size_t i, ITER start)
 Returns iterator to the first element of the i-th range after start. More...
 
template<typename ITER >
static ITER findRangeStart (Vector_t const &v, std::size_t i)
 
template<typename ITER >
static ITER findVoidStart (Vector_t const &v, std::size_t i, ITER start)
 
static bool isVoid (Data_t value)
 

Detailed Description

template<typename T>
class actions::Add< T >

Definition at line 662 of file sparse_vector_test.cc.

Member Typedef Documentation

template<typename T >
using actions::Add< T >::Base_t = BaseAction<T>

Definition at line 664 of file sparse_vector_test.cc.

template<typename T >
typedef TestClass_t::Data_t actions::BaseAction< T >::Data_t

type stored

Definition at line 278 of file sparse_vector_test.cc.

template<typename T >
typedef TestClass_t::SparseVector_t actions::BaseAction< T >::SparseVector_t

type of sparse vector

Definition at line 280 of file sparse_vector_test.cc.

template<typename T >
typedef TestManagerClass<T> actions::BaseAction< T >::TestClass_t

Definition at line 277 of file sparse_vector_test.cc.

template<typename T >
typedef TestClass_t::Vector_t actions::BaseAction< T >::Vector_t

type of STL vector

Definition at line 279 of file sparse_vector_test.cc.

Member Function Documentation

template<typename T >
virtual void actions::Add< T >::actionOnSparseVector ( SparseVector_t v) const
inlineoverrideprotectedvirtual

Reimplemented from actions::BaseAction< T >.

Definition at line 688 of file sparse_vector_test.cc.

689  { v.combine_range(position, data, std::plus<Data_t>(), baseline); }
template<typename T >
virtual void actions::Add< T >::actionOnVector ( Vector_t v) const
inlineoverrideprotectedvirtual

Reimplemented from actions::BaseAction< T >.

Definition at line 678 of file sparse_vector_test.cc.

679  {
680  size_t max_size = std::max(v.size(), position + data.size());
681  v.resize(max_size, 0);
682  // buggy: we have no way to recognise a void element from a 0 one
683  std::transform(data.cbegin(), data.cend(), v.cbegin() + position,
684  v.begin() + position,
685  [this](auto a, auto b){ return a + ((b == 0)? baseline: b); }
686  );
687  }
static constexpr Sample_t transform(Sample_t sample)
process_name gaushit a
template<typename T >
actions::Add< T >::baseline ( baseline  )
inline

Definition at line 675 of file sparse_vector_test.cc.

675 : position(pos), data(new_data), baseline(baseline) {}
template<typename T >
actions::Add< T >::data ( new_data  )
template<typename T >
virtual void actions::Add< T >::doDescribe ( TestClass_t ,
std::ostream &  out 
) const
inlineoverrideprotectedvirtual

Reimplemented from actions::BaseAction< T >.

Definition at line 691 of file sparse_vector_test.cc.

692  {
693  out << "increment by data in ";
694  PrintVector(data, out);
695  out << " with baseline " << baseline
696  << " starting at position " << position;
697  } // describe()
void PrintVector(std::ostream &out, Array const &v, std::string name="Vector")

Member Data Documentation

template<typename T >
actions::Add< T >::__pad0__

Definition at line 675 of file sparse_vector_test.cc.

template<typename T >
Data_t actions::Add< T >::baseline = Data_t(0)

Definition at line 672 of file sparse_vector_test.cc.

template<typename T >
Vector_t actions::Add< T >::data

Definition at line 671 of file sparse_vector_test.cc.

template<typename T >
size_t actions::Add< T >::position

Definition at line 670 of file sparse_vector_test.cc.


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