Rcpp Version 1.1.2
Loading...
Searching...
No Matches
Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T > Class Template Reference

#include <diff.h>

Inheritance diagram for Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >:
Collaboration diagram for Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >:

Public Types

typedef Rcpp::VectorBase< RTYPE, LHS_NA, LHS_T > LHS_TYPE
typedef Rcpp::traits::storage_type< RTYPE >::type STORAGE
Public Types inherited from Rcpp::VectorBase< RTYPE, LHS_NA, Diff< RTYPE, LHS_NA, LHS_T > >
typedef traits::storage_type< RTYPE >::type stored_type
typedef traits::storage_type< RTYPE >::type elem_type
typedef iter_base< iter_traits > iterator
typedef iter_base< const_iter_traits > const_iterator

Public Member Functions

 Diff (const LHS_TYPE &lhs_)
STORAGE operator[] (R_xlen_t i) const
void set_previous (R_xlen_t i, STORAGE value) const
R_xlen_t size () const
Public Member Functions inherited from Rcpp::VectorBase< RTYPE, LHS_NA, Diff< RTYPE, LHS_NA, LHS_T > >
Diff< RTYPE, LHS_NA, LHS_T > & get_ref ()
stored_type operator[] (R_xlen_t i) const
R_xlen_t size () const
const_iterator begin () const
const_iterator end () const
const_iterator cbegin () const
const_iterator cend () const

Private Attributes

const LHS_TYPElhs
STORAGE previous
R_xlen_t previous_index
bool was_na

Detailed Description

template<int RTYPE, bool LHS_NA, typename LHS_T>
class Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >

Definition at line 33 of file diff.h.

Member Typedef Documentation

◆ LHS_TYPE

template<int RTYPE, bool LHS_NA, typename LHS_T>
typedef Rcpp::VectorBase<RTYPE,LHS_NA,LHS_T> Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::LHS_TYPE

Definition at line 35 of file diff.h.

◆ STORAGE

template<int RTYPE, bool LHS_NA, typename LHS_T>
typedef Rcpp::traits::storage_type<RTYPE>::type Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::STORAGE

Definition at line 36 of file diff.h.

Constructor & Destructor Documentation

◆ Diff()

template<int RTYPE, bool LHS_NA, typename LHS_T>
Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::Diff ( const LHS_TYPE & lhs_)
inline

Definition at line 38 of file diff.h.

References Rcpp::is_na(), lhs, previous, previous_index, and was_na.

Here is the call graph for this function:

Member Function Documentation

◆ operator[]()

template<int RTYPE, bool LHS_NA, typename LHS_T>
STORAGE Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::operator[] ( R_xlen_t i) const
inline

Definition at line 45 of file diff.h.

References Rcpp::traits::get_na(), Rcpp::traits::is_na(), lhs, previous, previous_index, RCPP_SAFE_SUB, set_previous(), and was_na.

Here is the call graph for this function:

◆ set_previous()

template<int RTYPE, bool LHS_NA, typename LHS_T>
void Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::set_previous ( R_xlen_t i,
STORAGE value ) const
inline

Definition at line 60 of file diff.h.

References Rcpp::traits::is_na(), previous, previous_index, and was_na.

Referenced by operator[]().

Here is the call graph for this function:

◆ size()

template<int RTYPE, bool LHS_NA, typename LHS_T>
R_xlen_t Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::size ( ) const
inline

Definition at line 66 of file diff.h.

References lhs.

Member Data Documentation

◆ lhs

template<int RTYPE, bool LHS_NA, typename LHS_T>
const LHS_TYPE& Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::lhs
private

Definition at line 69 of file diff.h.

Referenced by Diff(), operator[](), and size().

◆ previous

template<int RTYPE, bool LHS_NA, typename LHS_T>
STORAGE Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::previous
mutableprivate

Definition at line 70 of file diff.h.

Referenced by Diff(), operator[](), and set_previous().

◆ previous_index

template<int RTYPE, bool LHS_NA, typename LHS_T>
R_xlen_t Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::previous_index
mutableprivate

Definition at line 71 of file diff.h.

Referenced by Diff(), operator[](), and set_previous().

◆ was_na

template<int RTYPE, bool LHS_NA, typename LHS_T>
bool Rcpp::sugar::Diff< RTYPE, LHS_NA, LHS_T >::was_na
mutableprivate

Definition at line 72 of file diff.h.

Referenced by Diff(), operator[](), and set_previous().


The documentation for this class was generated from the following file:
  • inst/include/Rcpp/sugar/functions/diff.h