21 #ifndef Rcpp__vector__Vector_h
22 #define Rcpp__vector__Vector_h
28 template <
int RTYPE,
template <
class>
class StoragePolicy = PreserveStorage >
30 public StoragePolicy< Vector<RTYPE,StoragePolicy> >,
35 public VectorBase< RTYPE, true, Vector<RTYPE,StoragePolicy> >
57 Storage::set__( Rf_allocVector(RTYPE, 0 ) );
65 Storage::copy__(other) ;
69 return Storage::copy__(rhs) ;
74 Storage::set__( r_cast<RTYPE>(safe) ) ;
77 template <
typename Proxy>
80 Storage::set__( r_cast<RTYPE>(safe) ) ;
84 Storage::set__( Rf_allocVector( RTYPE, obj.
get() ) ) ;
90 RCPP_DEBUG_2(
"Vector<%d>( const T& size = %d, const stored_type& u )", RTYPE,
size)
91 Storage::set__( Rf_allocVector( RTYPE,
size) ) ;
96 RCPP_DEBUG_2(
"Vector<%d>( const int& size = %d, const stored_type& u )", RTYPE,
size)
97 Storage::set__( Rf_allocVector( RTYPE,
size) ) ;
103 RCPP_DEBUG_2(
"Vector<%d>( const std::string& = %s )", RTYPE, st.c_str() )
104 Storage::set__( internal::vector_from_string<RTYPE>(st) ) ;
109 RCPP_DEBUG_2(
"Vector<%d>( const char* = %s )", RTYPE, st )
110 Storage::set__(internal::vector_from_string<RTYPE>(st) ) ;
116 RCPP_DEBUG_2(
"Vector<%d>( const int& siz = %s, stored_type (*gen)(void) )", RTYPE, siz )
117 Storage::set__( Rf_allocVector( RTYPE, siz) ) ;
118 std::generate(
begin(),
end(), gen );
122 template <
typename T>
125 Storage::set__( Rf_allocVector( RTYPE,
size) ) ;
130 Storage::set__( Rf_allocVector( RTYPE,
size) ) ;
135 Storage::set__( Rf_allocVector( RTYPE,
dims.prod() ) ) ;
137 if(
dims.size() > 1 ){
145 template <
typename T>
148 Storage::set__(Rf_allocVector(RTYPE, 1));
152 template <
typename U>
154 RCPP_DEBUG_2(
"Vector<%d>( const Dimension& (%d), const U& )", RTYPE,
dims.size() )
155 Storage::set__( Rf_allocVector( RTYPE,
dims.prod() ) ) ;
157 if(
dims.size() > 1 ){
162 template <
bool NA,
typename VEC>
164 RCPP_DEBUG_2(
"Vector<%d>( const VectorBase<RTYPE,NA,VEC>& ) [VEC = %s]", RTYPE,
DEMANGLE(VEC) )
168 template <
typename T,
typename U>
172 Storage::set__( Rf_allocVector( RTYPE,
size) ) ;
176 template <
bool NA,
typename T>
179 Storage::set__( r_cast<RTYPE>(safe) ) ;
180 RCPP_DEBUG_2(
"Vector<%d>( const sugar::SingleLogicalResult<NA,T>& ) [T = %s]", RTYPE,
DEMANGLE(T) )
183 template <
typename T,
typename U1>
186 Storage::set__( Rf_allocVector( RTYPE, siz) ) ;
187 RCPP_DEBUG_2(
"const T& siz, stored_type (*gen)(U1), const U1& u1 )", RTYPE, siz )
189 while( first != last ) *first++ = gen(u1) ;
192 template <
typename T,
typename U1,
typename U2>
195 Storage::set__( Rf_allocVector( RTYPE, siz) ) ;
196 RCPP_DEBUG_2(
"const T& siz, stored_type (*gen)(U1,U2), const U1& u1, const U2& u2)", RTYPE, siz )
198 while( first != last ) *first++ = gen(u1,u2) ;
201 template <
typename T,
typename U1,
typename U2,
typename U3>
204 Storage::set__( Rf_allocVector( RTYPE, siz) ) ;
205 RCPP_DEBUG_2(
"const T& siz, stored_type (*gen)(U1,U2,U3), const U1& u1, const U2& u2, const U3& u3)", RTYPE, siz )
207 while( first != last ) *first++ = gen(u1,u2,u3) ;
210 template <
typename InputIterator>
211 Vector( InputIterator first, InputIterator last){
212 RCPP_DEBUG_1(
"Vector<%d>( InputIterator first, InputIterator last", RTYPE )
213 Storage::set__( Rf_allocVector(RTYPE, std::distance(first, last) ) ) ;
214 std::copy( first, last,
begin() ) ;
217 template <
typename InputIterator,
typename T>
218 Vector( InputIterator first, InputIterator last, T n,
220 Storage::set__(Rf_allocVector(RTYPE, n)) ;
221 RCPP_DEBUG_2(
"Vector<%d>( InputIterator first, InputIterator last, T n = %d)", RTYPE, n )
222 std::copy( first, last,
begin() ) ;
225 template <
typename InputIterator,
typename Func>
226 Vector( InputIterator first, InputIterator last, Func func) {
227 Storage::set__( Rf_allocVector( RTYPE, std::distance(first,last) ) );
228 RCPP_DEBUG_1(
"Vector<%d>( InputIterator, InputIterator, Func )", RTYPE )
229 std::transform( first, last,
begin(), func) ;
232 template <
typename InputIterator,
typename Func,
typename T>
233 Vector( InputIterator first, InputIterator last, Func func, T n,
235 Storage::set__( Rf_allocVector( RTYPE, n ) );
236 RCPP_DEBUG_2(
"Vector<%d>( InputIterator, InputIterator, Func, T n = %d )", RTYPE, n )
237 std::transform( first, last,
begin(), func) ;
240 #ifdef HAS_CXX0X_INITIALIZER_LIST
241 Vector( std::initializer_list<init_type> list ) {
242 assign( list.begin() , list.end() ) ;
246 template <
typename T>
253 return traits::get_na<RTYPE>();
256 return traits::is_na<RTYPE>(x);
259 #ifdef RCPP_COMMA_INITIALIZATION
262 return internal::ListInitialization<iterator,init_type>( start + 1 ) ; ;
270 return ::Rf_xlength( Storage::get__() ) ;
277 return ::Rf_xlength( Storage::get__() ) ;
283 R_xlen_t
offset(
const int& i,
const int& j)
const {
284 if( !::Rf_isMatrix(Storage::get__()) )
throw not_a_matrix() ;
287 const int* dim =
dims() ;
288 const int nrow = dim[0] ;
289 const int ncol = dim[1] ;
290 if(i < 0|| i >= nrow || j < 0 || j >= ncol ) {
291 const char* fmt =
"Location index is out of bounds: "
292 "[row index=%i; row extent=%i; "
293 "column index=%i; column extent=%i].";
294 throw index_out_of_bounds(fmt, i, nrow, j, ncol);
296 return i +
static_cast<R_xlen_t
>(nrow)*j ;
303 R_xlen_t
offset(
const R_xlen_t& i)
const {
304 if(i < 0 || i >= ::Rf_xlength(Storage::get__()) ) {
305 const char* fmt =
"Index out of bounds: [index=%i; extent=%i].";
306 throw index_out_of_bounds(fmt, i, ::Rf_xlength(Storage::get__()) ) ;
311 R_xlen_t
offset(
const std::string& name)
const {
313 if( Rf_isNull(
names) ) {
314 throw index_out_of_bounds(
"Object was created without names.");
318 for( R_xlen_t i=0; i<n; ++i){
319 if( ! name.compare( CHAR(STRING_ELT(
names, i)) ) ){
324 const char* fmt =
"Index out of bounds: [index='%s'].";
325 throw index_out_of_bounds(fmt, name);
329 template <
typename U>
380 return RObject( Storage::get__() );
384 template <
int RHS_RTYPE,
bool RHS_NA,
typename RHS_T>
393 template <
int RHS_RTYPE,
bool RHS_NA,
typename RHS_T>
408 internal::Sort_is_not_allowed_for_this_type<RTYPE>::do_nothing();
429 template <
typename InputIterator>
430 void assign( InputIterator first, InputIterator last){
436 Storage::set__(casted) ;
439 template <
typename InputIterator>
440 static Vector import( InputIterator first, InputIterator last){
442 v.
assign( first , last ) ;
446 template <
typename InputIterator,
typename F>
448 return Vector( first, last, f) ;
451 template <
typename T>
458 template <
typename T>
459 void push_back(
const T&
object,
const std::string& name ){
465 template <
typename T>
471 template <
typename T>
478 template <
typename T>
485 template <
typename T>
510 cache.update(*
this) ;
513 template <
typename U>
516 it,
names, index, u ) ;
519 template <
typename U>
524 template <
typename U>
529 template <
typename U>
531 RCPP_DEBUG_2(
" Vector::replace_element__dispatch<%s>(true, index= %d) ",
DEMANGLE(U), index ) ;
534 SET_STRING_ELT(
names, index, ::Rf_mkChar( u.name.c_str() ) ) ;
537 template <
typename U>
539 RCPP_DEBUG_2(
" Vector::replace_element__dispatch<%s>(true, index= %d) ",
DEMANGLE(U), index ) ;
542 SET_STRING_ELT(
names, index, ::Rf_mkChar( u.name.c_str() ) ) ;
551 template <
typename EXPR_VEC>
553 const EXPR_VEC& ref = rhs.
get_ref() ;
555 R_xlen_t n =
size() ;
558 for( R_xlen_t i=0; i<n; i++){
559 Proxy left = start[i] ;
560 if( ! traits::is_na<RTYPE>( left ) ){
562 left = traits::is_na<RTYPE>( tmp ) ? tmp : ( left + tmp ) ;
568 template <
typename EXPR_VEC>
570 const EXPR_VEC& ref = rhs.
get_ref() ;
572 R_xlen_t n =
size() ;
574 for( R_xlen_t i=0; i<n; i++){
575 if( ! traits::is_na<RTYPE>(start[i]) ){
588 if( Rf_isNull(
names) )
return false ;
589 R_xlen_t n = Rf_xlength(
names) ;
590 for( R_xlen_t i=0; i<n; i++){
591 if( !strcmp( target, CHAR(STRING_ELT(
names, i)) ) )
599 if (Rf_isNull(
names))
stop(
"'names' attribute is null");
600 R_xlen_t n = Rf_xlength(
names);
601 for (R_xlen_t i=0; i < n; ++i) {
602 if (strcmp(name.c_str(), CHAR(STRING_ELT(
names, i))) == 0) {
606 std::stringstream ss;
607 ss <<
"no name '" << name <<
"' found";
614 if( !::Rf_isMatrix(Storage::get__()) )
throw not_a_matrix() ;
615 return INTEGER( ::Rf_getAttrib( Storage::get__(), R_DimSymbol ) ) ;
618 RCPP_DEBUG_2(
"VECTOR<%d>::init( SEXP = <%p> )", RTYPE, Storage::get__() )
619 internal::r_init_vector<RTYPE>(Storage::get__()) ;
626 R_xlen_t n =
size() ;
632 if( Rf_isNull(
names) ){
633 for( ; it < this_end; ++it, ++target_it ){
637 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1) ) ;
639 for( ; it < this_end; ++it, ++target_it, i++ ){
641 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
643 SET_STRING_ELT( newnames, i, Rf_mkChar(
"") ) ;
644 target.
attr(
"names") = newnames ;
646 *target_it = object_sexp;
647 Storage::set__( target.
get__() ) ;
651 R_xlen_t n =
size() ;
657 if( Rf_isNull(
names) ){
658 for( ; it < this_end; ++it, ++target_it ){
662 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1) ) ;
664 for( ; it < this_end; ++it, ++target_it, i++ ){
666 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
668 SET_STRING_ELT( newnames, i, Rf_mkChar(
"") ) ;
669 target.
attr(
"names") = newnames ;
672 Storage::set__( target.
get__() ) ;
677 R_xlen_t n =
size() ;
683 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n+1 ) ) ;
685 if( Rf_isNull(
names) ){
686 for( ; it < this_end; ++it, ++target_it,i++ ){
688 SET_STRING_ELT( newnames, i , R_BlankString );
691 for( ; it < this_end; ++it, ++target_it, i++ ){
693 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
696 SET_STRING_ELT( newnames, i, Rf_mkChar( name.c_str() ) );
697 target.
attr(
"names") = newnames ;
699 *target_it = object_sexp;
700 Storage::set__( target.
get__() ) ;
703 R_xlen_t n =
size() ;
709 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n+1 ) ) ;
711 if( Rf_isNull(
names) ){
713 for( ; it < this_end; ++it, ++target_it,i++ ){
715 SET_STRING_ELT( newnames, i , dummy );
718 for( ; it < this_end; ++it, ++target_it, i++ ){
720 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
723 SET_STRING_ELT( newnames, i, Rf_mkChar( name.c_str() ) );
724 target.
attr(
"names") = newnames ;
727 Storage::set__( target.
get__() ) ;
732 R_xlen_t n =
size() ;
737 *target_it = object_sexp ;
740 if( Rf_isNull(
names) ){
741 for( ; it<this_end; ++it, ++target_it){
745 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1) );
747 SET_STRING_ELT( newnames, 0, Rf_mkChar(
"") ) ;
748 for( ; it<this_end; ++it, ++target_it, i++){
750 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i-1 ) ) ;
752 target.
attr(
"names") = newnames ;
754 Storage::set__( target.
get__() ) ;
758 R_xlen_t n =
size() ;
766 if( Rf_isNull(
names) ){
767 for( ; it<this_end; ++it, ++target_it){
771 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1) );
773 SET_STRING_ELT( newnames, 0, Rf_mkChar(
"") ) ;
774 for( ; it<this_end; ++it, ++target_it, i++){
776 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i-1 ) ) ;
778 target.
attr(
"names") = newnames ;
780 Storage::set__( target.
get__() ) ;
786 R_xlen_t n =
size() ;
792 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n+1 ) ) ;
794 SET_STRING_ELT( newnames, 0, Rf_mkChar( name.c_str() ) );
795 *target_it = object_sexp;
798 if( Rf_isNull(
names) ){
799 for( ; it < this_end; ++it, ++target_it,i++ ){
801 SET_STRING_ELT( newnames, i , R_BlankString );
804 for( ; it < this_end; ++it, ++target_it, i++ ){
806 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i-1 ) ) ;
809 target.
attr(
"names") = newnames ;
810 Storage::set__( target.
get__() ) ;
814 R_xlen_t n =
size() ;
820 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n+1 ) ) ;
822 SET_STRING_ELT( newnames, 0, Rf_mkChar( name.c_str() ) );
826 if( Rf_isNull(
names) ){
827 for( ; it < this_end; ++it, ++target_it,i++ ){
829 SET_STRING_ELT( newnames, i , R_BlankString );
832 for( ; it < this_end; ++it, ++target_it, i++ ){
834 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i-1 ) ) ;
837 target.
attr(
"names") = newnames ;
839 Storage::set__( target.
get__() ) ;
845 R_xlen_t n =
size() ;
852 if( Rf_isNull(
names) ){
853 for( ; it < position; ++it, ++target_it){
859 for( ; it < this_end; ++it, ++target_it ){
863 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1 ) ) ;
865 for( ; it < position; ++it, ++target_it, i++){
867 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
871 SET_STRING_ELT( newnames, i, ::Rf_mkChar(
"") ) ;
874 for( ; it < this_end; ++it, ++target_it, i++ ){
876 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i - 1) ) ;
878 target.
attr(
"names" ) = newnames ;
880 Storage::set__( target.
get__() ) ;
885 R_xlen_t n =
size() ;
892 if( Rf_isNull(
names) ){
893 for( ; it < position; ++it, ++target_it){
899 for( ; it < this_end; ++it, ++target_it ){
903 Shield<SEXP> newnames( ::Rf_allocVector( STRSXP, n + 1 ) ) ;
905 for( ; it < position; ++it, ++target_it, i++){
907 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) ) ;
911 SET_STRING_ELT( newnames, i, ::Rf_mkChar(
"") ) ;
914 for( ; it < this_end; ++it, ++target_it, i++ ){
916 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i - 1) ) ;
918 target.
attr(
"names" ) = newnames ;
920 Storage::set__( target.
get__() ) ;
925 if( position <
begin() || position >
end() ) {
926 R_xlen_t requested_loc;
927 R_xlen_t available_locs = std::distance(
begin(),
end());
929 if(position >
end()){
930 requested_loc = std::distance(position,
begin());
933 requested_loc = std::distance(
begin(), position);
935 const char* fmt =
"Iterator index is out of bounds: "
936 "[iterator index=%i; iterator extent=%i]";
937 throw index_out_of_bounds(fmt, requested_loc, available_locs ) ;
940 R_xlen_t n =
size() ;
947 if( Rf_isNull(
names) ){
949 for( ; it < position; ++it, ++target_it, i++){
953 for( ; it < this_end ; ++it, ++target_it){
956 Storage::set__( target.
get__() ) ;
961 for( ; it < position; ++it, ++target_it,i++){
963 SET_STRING_ELT( newnames, i , STRING_ELT(
names,i) ) ;
968 for( ; it < this_end ; ++it, ++target_it, i++){
970 SET_STRING_ELT( newnames, i-1, STRING_ELT(
names,i) ) ;
972 target.
attr(
"names" ) = newnames ;
973 Storage::set__( target.
get__() ) ;
979 if( first > last )
throw std::range_error(
"invalid range") ;
980 if( last >
end() || first <
begin() ) {
981 R_xlen_t requested_loc;
982 R_xlen_t available_locs = std::distance(
begin(),
end());
983 std::string iter_problem;
986 requested_loc = std::distance(last,
begin());
987 iter_problem =
"last";
990 requested_loc = std::distance(
begin(), first);
991 iter_problem =
"first";
993 const char* fmt =
"Iterator index is out of bounds: "
994 "[iterator=%s; index=%i; extent=%i]";
995 throw index_out_of_bounds(fmt, iter_problem,
996 requested_loc, available_locs ) ;
1001 R_xlen_t nremoved = std::distance(first,last) ;
1002 R_xlen_t target_size =
size() - nremoved ;
1003 Vector target( target_size ) ;
1008 if( Rf_isNull(
names) ){
1010 for( ; it < first; ++it, ++target_it, i++ ){
1014 for( it = last ; it < this_end; ++it, ++target_it ){
1018 Shield<SEXP> newnames( ::Rf_allocVector(STRSXP, target_size) ) ;
1020 for( ; it < first; ++it, ++target_it, i++ ){
1022 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i ) );
1025 for( it = last ; it < this_end; ++it, ++target_it, i++ ){
1027 SET_STRING_ELT( newnames, i, STRING_ELT(
names, i + nremoved ) );
1029 target.
attr(
"names" ) = newnames ;
1031 Storage::set__( target.
get__() ) ;
1037 template <
typename T>
1039 R_xlen_t n =
size() ;
1040 if( n == x.size() ){
1042 import_expression<T>(x, n ) ;
1047 Storage::set__(casted);
1052 template <
typename T>
1058 template <
typename T>
1062 Storage::set__(casted);
1066 template <
bool NA,
typename VEC>
1068 RCPP_DEBUG_4(
"Vector<%d>::import_sugar_expression( VectorBase<%d,%d,%s>, false_type )", RTYPE,
NA, RTYPE,
DEMANGLE(VEC) ) ;
1069 R_xlen_t n = other.
size() ;
1070 Storage::set__( Rf_allocVector( RTYPE, n ) ) ;
1071 import_expression<VEC>( other.
get_ref() , n ) ;
1075 template <
bool NA,
typename VEC>
1077 RCPP_DEBUG_4(
"Vector<%d>::import_sugar_expression( VectorBase<%d,%d,%s>, true_type )", RTYPE,
NA, RTYPE,
DEMANGLE(VEC) ) ;
1078 Storage::set__( other.
get_ref() ) ;
1082 template <
typename T>
1088 template <
typename T>
1093 template <
typename T>
1097 while( first != last ) *first++ = gen() ;
1100 template <
typename T>
1105 template <
typename U>
1110 for( R_xlen_t i=0; i<
size() ; i++, ++it){
1111 *it = ::Rf_duplicate( elem ) ;
1115 template <
typename U>
1126 #include <Rcpp/generated/Vector__create.h>
1141 template <
int RTYPE,
template <
class>
class StoragePolicy >
1145 typename VECTOR::iterator i =
const_cast<VECTOR &
>(rhs).begin();
1146 typename VECTOR::iterator iend =
const_cast<VECTOR &
>(rhs).end();
1152 for ( ; i != iend; ++i) {
1160 template<
template <
class>
class StoragePolicy >
1164 typename VECTOR::iterator i =
const_cast<VECTOR &
>(rhs).begin();
1165 typename VECTOR::iterator iend =
const_cast<VECTOR &
>(rhs).end();
1168 s <<
"\"" << (*i) <<
"\"";
1171 for ( ; i != iend; ++i) {
1172 s <<
" \"" << (*i) <<
"\"";
AttributeProxy attr(const std::string &name)
void fill_or_generate__impl(const T &t, traits::false_type)
traits::storage_type< RTYPE >::type stored_type
void fill_or_generate(const T &t)
iterator erase_range__impl(iterator first, iterator last)
static Vector import_transform(InputIterator first, InputIterator last, F f)
traits::r_vector_proxy< RTYPE, StoragePolicy >::type Proxy
iterator erase(int position)
internal::RangeIndexer< RTYPE, true, Vector > Indexer
SEXP eval(SEXP env) const
Vector(const GenericProxy< Proxy > &proxy)
Vector(const T &size, const U &u, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
Vector(const Dimension &dims)
Vector & operator=(const Vector &rhs)
Vector(const T &size, const stored_type &u, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
void push_front_name__impl(const stored_type &object, const std::string &name, traits::false_type)
void import_sugar_expression(const Rcpp::VectorBase< RTYPE, NA, VEC > &other, traits::true_type)
void push_back__impl(const stored_type &object, traits::true_type)
iterator erase_single__impl(iterator position)
const_Proxy operator[](R_xlen_t i) const
void assign(InputIterator first, InputIterator last)
void push_back_name__impl(const stored_type &object, const std::string &name, traits::true_type)
Vector & operator=(const T &x)
Vector(const std::string &st)
const_iterator begin() const
NameProxy operator[](const std::string &name) const
static bool is_na(stored_type x)
void push_front__impl(const stored_type &object, traits::true_type)
const_Proxy operator()(const size_t &i) const
void push_front_name__impl(const stored_type &object, const std::string &name, traits::true_type)
Vector(const Dimension &dims, const U &u)
Vector(const T &siz, stored_type(*gen)(void), typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
traits::r_vector_const_proxy< RTYPE, StoragePolicy >::type const_Proxy
iterator insert__impl(iterator position, const stored_type &object_, traits::true_type)
bool containsElementNamed(const char *target) const
Proxy operator()(const size_t &i, const size_t &j)
Vector & operator+=(const VectorBase< RTYPE, false, EXPR_VEC > &rhs)
static void replace_element__dispatch(traits::true_type, iterator it, SEXP names, R_xlen_t index, const U &u)
static void replace_element(iterator it, SEXP names, R_xlen_t index, const U &u)
Proxy operator[](R_xlen_t i)
traits::r_vector_iterator< RTYPE, StoragePolicy >::type iterator
void fill__dispatch(traits::false_type, const U &u)
traits::r_vector_cache_type< RTYPE, StoragePolicy >::type cache
traits::r_vector_const_iterator< RTYPE, StoragePolicy >::type const_iterator
const_Proxy operator()(const size_t &i, const size_t &j) const
Indexer operator[](const Range &range)
R_xlen_t offset(const int &i, const int &j) const
iterator insert(iterator position, const T &object)
Vector(const sugar::SingleLogicalResult< NA, T > &obj)
const_iterator end() const
NameProxy operator()(const std::string &name) const
Vector & sort(bool decreasing=false)
static void replace_element__dispatch__isArgument(traits::false_type, iterator it, SEXP names, R_xlen_t index, const U &u)
traits::r_vector_element_converter< RTYPE >::type converter_type
Vector(T size, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
Vector(const T &siz, stored_type(*gen)(U1, U2), const U1 &u1, const U2 &u2, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
void push_front(const T &object, const std::string &name)
traits::r_vector_proxy< RTYPE, StoragePolicy >::type value_type
Vector(const T &siz, stored_type(*gen)(U1), const U1 &u1, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
void push_front__impl(const stored_type &object, traits::false_type)
static stored_type get_na()
void import_sugar_expression(const Rcpp::VectorBase< RTYPE, NA, VEC > &other, traits::false_type)
NameProxy operator()(const std::string &name)
void import_expression(const T &other, R_xlen_t n)
StoragePolicy< Vector > Storage
const_iterator cbegin() const
const SubsetProxy< RTYPE, StoragePolicy, RHS_RTYPE, RHS_NA, RHS_T > operator[](const VectorBase< RHS_RTYPE, RHS_NA, RHS_T > &rhs) const
Vector & operator+=(const VectorBase< RTYPE, true, EXPR_VEC > &rhs)
void push_back(const T &object)
Vector(InputIterator first, InputIterator last, Func func, T n, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
Vector(const int &size, const stored_type &u)
void push_front(const T &object)
R_xlen_t offset(const R_xlen_t &i) const
Proxy at(const size_t &i)
void assign_object(const T &x, traits::true_type)
static void replace_element__dispatch(traits::false_type, iterator it, SEXP names, R_xlen_t index, const U &u)
Vector(InputIterator first, InputIterator last, Func func)
const_Proxy at(const size_t &i) const
void push_back__impl(const stored_type &object, traits::false_type)
Vector(InputIterator first, InputIterator last)
NameProxy operator[](const std::string &name)
static void replace_element__dispatch__isArgument(traits::true_type, iterator it, SEXP names, R_xlen_t index, const U &u)
Vector(const T &siz, stored_type(*gen)(U1, U2, U3), const U1 &u1, const U2 &u2, const U3 &u3, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
Vector(const no_init_vector &obj)
const_iterator cend() const
traits::init_type< RTYPE >::type init_type
SubsetProxy< RTYPE, StoragePolicy, RHS_RTYPE, RHS_NA, RHS_T > operator[](const VectorBase< RHS_RTYPE, RHS_NA, RHS_T > &rhs)
void fill__dispatch(traits::true_type, const U &u)
Vector(InputIterator first, InputIterator last, T n, typename Rcpp::traits::enable_if< traits::is_arithmetic< T >::value, void >::type *=0)
Vector(const Vector &other)
iterator insert(int position, const T &object)
Proxy operator()(const size_t &i)
int findName(const std::string &name) const
Vector(const VectorBase< RTYPE, NA, VEC > &other)
iterator insert__impl(iterator position, const stored_type &object, traits::false_type)
void push_back(const T &object, const std::string &name)
void fill_or_generate__impl(const T &gen, traits::true_type)
Vector(T value, typename Rcpp::traits::enable_if< traits::is_bool< T >::value &&RTYPE==LGLSXP, void >::type *=0)
traits::r_vector_name_proxy< RTYPE, StoragePolicy >::type NameProxy
iterator erase(iterator position)
iterator erase(iterator first, iterator last)
R_xlen_t offset(const std::string &name) const
iterator erase(int first, int last)
void assign_sugar_expression(const T &x)
void push_back_name__impl(const stored_type &object, const std::string &name, traits::false_type)
void assign_object(const T &x, traits::false_type)
static target get(const T &input)
#define RCPP_DEBUG_2(fmt, M1, M2)
#define RCPP_DEBUG_1(fmt, MSG)
#define RCPP_DEBUG_4(fmt, M1, M2, M3, M4)
#define DEMANGLE(__TYPE__)
#define RCPP_GET_NAMES(x)
SEXP Rcpp_fast_eval(SEXP expr, SEXP env)
RObject_Impl< PreserveStorage > RObject
void NORET stop(const char *fmt, Args &&... args)
std::ostream & operator<<(std::ostream &os, const Date d)
sugar::Range< RTYPE, NA, T > range(const VectorBase< RTYPE, NA, T > &x)
SEXP wrap(const Date &date)
storage_type< RTYPE >::type type
const storage_type< RTYPE >::type * type
const storage_type< RTYPE >::type & type
storage_type< RTYPE >::type * type
storage_type< RTYPE >::type & type
#define RCPP_LOOP_UNROLL(TARGET, SOURCE)