Rcpp Version 1.0.9
Subsetter.h File Reference
#include <limits>
Include dependency graph for Subsetter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Rcpp::SubsetProxy< RTYPE, StoragePolicy, RHS_RTYPE, RHS_NA, RHS_T >
 

Namespaces

 Rcpp
 Rcpp API.
 

Macros

#define RCPP_GENERATE_SUBSET_PROXY_OPERATOR(__OPERATOR__)
 

Macro Definition Documentation

◆ RCPP_GENERATE_SUBSET_PROXY_OPERATOR

#define RCPP_GENERATE_SUBSET_PROXY_OPERATOR (   __OPERATOR__)
Value:
template <int RTYPE_OTHER, template <class> class StoragePolicyOther, \
int RHS_RTYPE_OTHER, bool RHS_NA_OTHER, typename RHS_T_OTHER> \
Vector<RTYPE, StoragePolicy> operator __OPERATOR__ ( \
const SubsetProxy<RTYPE_OTHER, StoragePolicyOther, RHS_RTYPE_OTHER, \
RHS_NA_OTHER, RHS_T_OTHER>& other) { \
Vector<RTYPE, StoragePolicy> result(indices_n); \
if (other.indices_n == 1) { \
for (R_xlen_t i = 0; i < indices_n; ++i) \
result[i] = lhs[indices[i]] __OPERATOR__ other.lhs[other.indices[0]]; \
} else if (indices_n == other.indices_n) { \
for (R_xlen_t i = 0; i < indices_n; ++i) \
result[i] = lhs[indices[i]] __OPERATOR__ other.lhs[other.indices[i]]; \
} else { \
stop("index error"); \
} \
return result; \
}

Definition at line 237 of file Subsetter.h.