@@ -37,14 +37,14 @@ namespace sugar{
3737 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
3838 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
3939
40- inline STORAGE operator []( int i ) const {
40+ inline STORAGE operator []( R_xlen_t i ) const {
4141 STORAGE x = lhs[i] ;
4242 if ( Rcpp::traits::is_na<RTYPE>( x ) ) return x ;
4343 STORAGE y = rhs[i] ;
4444 return Rcpp::traits::is_na<RTYPE>( y ) ? y : ( x / y ) ;
4545 }
4646
47- inline int size () const { return lhs.size () ; }
47+ inline R_xlen_t size () const { return lhs.size () ; }
4848
4949 private:
5050 const LHS_EXT& lhs ;
@@ -63,11 +63,11 @@ namespace sugar{
6363 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
6464 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
6565
66- inline double operator []( int i ) const {
66+ inline double operator []( R_xlen_t i ) const {
6767 return lhs[i] / rhs[i] ;
6868 }
6969
70- inline int size () const { return lhs.size () ; }
70+ inline R_xlen_t size () const { return lhs.size () ; }
7171
7272 private:
7373 const LHS_EXT& lhs ;
@@ -87,13 +87,13 @@ namespace sugar{
8787 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
8888 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
8989
90- inline STORAGE operator []( int i ) const {
90+ inline STORAGE operator []( R_xlen_t i ) const {
9191 STORAGE y = rhs[i] ;
9292 if ( Rcpp::traits::is_na<RTYPE>( y ) ) return y ;
9393 return lhs[i] / y ;
9494 }
9595
96- inline int size () const { return lhs.size () ; }
96+ inline R_xlen_t size () const { return lhs.size () ; }
9797
9898 private:
9999 const LHS_EXT& lhs ;
@@ -112,11 +112,11 @@ namespace sugar{
112112 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
113113 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
114114
115- inline double operator []( int i ) const {
115+ inline double operator []( R_xlen_t i ) const {
116116 return lhs[i] / rhs[i] ;
117117 }
118118
119- inline int size () const { return lhs.size () ; }
119+ inline R_xlen_t size () const { return lhs.size () ; }
120120
121121 private:
122122 const LHS_EXT& lhs ;
@@ -137,12 +137,12 @@ namespace sugar{
137137 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
138138 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
139139
140- inline STORAGE operator []( int i ) const {
140+ inline STORAGE operator []( R_xlen_t i ) const {
141141 STORAGE x = lhs[i] ;
142142 if ( Rcpp::traits::is_na<RTYPE>( x ) ) return x ;
143143 return x / rhs[i] ;
144144 }
145- inline int size () const { return lhs.size () ; }
145+ inline R_xlen_t size () const { return lhs.size () ; }
146146
147147 private:
148148 const LHS_EXT& lhs ;
@@ -161,10 +161,10 @@ namespace sugar{
161161 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
162162 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
163163
164- inline double operator []( int i ) const {
164+ inline double operator []( R_xlen_t i ) const {
165165 return lhs[i] / rhs[i] ;
166166 }
167- inline int size () const { return lhs.size () ; }
167+ inline R_xlen_t size () const { return lhs.size () ; }
168168
169169 private:
170170 const LHS_EXT& lhs ;
@@ -185,11 +185,11 @@ namespace sugar{
185185 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
186186 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
187187
188- inline STORAGE operator []( int i ) const {
188+ inline STORAGE operator []( R_xlen_t i ) const {
189189 return lhs[i] / rhs[i] ;
190190 }
191191
192- inline int size () const { return lhs.size () ; }
192+ inline R_xlen_t size () const { return lhs.size () ; }
193193
194194 private:
195195 const LHS_EXT& lhs ;
@@ -208,11 +208,11 @@ namespace sugar{
208208 Divides_Vector_Vector ( const LHS_TYPE& lhs_, const RHS_TYPE& rhs_ ) :
209209 lhs (lhs_.get_ref()), rhs(rhs_.get_ref()) {}
210210
211- inline double operator []( int i ) const {
211+ inline double operator []( R_xlen_t i ) const {
212212 return lhs[i] / rhs[i] ;
213213 }
214214
215- inline int size () const { return lhs.size () ; }
215+ inline R_xlen_t size () const { return lhs.size () ; }
216216
217217 private:
218218 const LHS_EXT& lhs ;
@@ -234,13 +234,13 @@ namespace sugar{
234234 lhs (lhs_.get_ref()), rhs(rhs_), rhs_na( Rcpp::traits::is_na<RTYPE>(rhs_) ) {
235235 }
236236
237- inline STORAGE operator []( int i ) const {
237+ inline STORAGE operator []( R_xlen_t i ) const {
238238 if (rhs_na) return rhs ;
239239 STORAGE x = lhs[i] ;
240240 return Rcpp::traits::is_na<RTYPE>(x) ? x : (x / rhs) ;
241241 }
242242
243- inline int size () const { return lhs.size () ; }
243+ inline R_xlen_t size () const { return lhs.size () ; }
244244
245245 private:
246246 const VEC_EXT& lhs ;
@@ -259,11 +259,11 @@ namespace sugar{
259259 lhs (lhs_.get_ref()), rhs(rhs_) {
260260 }
261261
262- inline double operator []( int i ) const {
262+ inline double operator []( R_xlen_t i ) const {
263263 return lhs[i] / rhs ;
264264 }
265265
266- inline int size () const { return lhs.size () ; }
266+ inline R_xlen_t size () const { return lhs.size () ; }
267267
268268 private:
269269 const VEC_EXT& lhs ;
@@ -283,12 +283,12 @@ namespace sugar{
283283 Divides_Vector_Primitive ( const VEC_TYPE& lhs_, STORAGE rhs_ ) :
284284 lhs (lhs_.get_ref()), rhs(rhs_), rhs_na( Rcpp::traits::is_na<RTYPE>(rhs_) ) {}
285285
286- inline STORAGE operator []( int i ) const {
286+ inline STORAGE operator []( R_xlen_t i ) const {
287287 if ( rhs_na ) return rhs ;
288288 STORAGE x = lhs[i] ;
289289 return Rcpp::traits::is_na<RTYPE>(x) ? x : (x / rhs) ;
290290 }
291- inline int size () const { return lhs.size () ; }
291+ inline R_xlen_t size () const { return lhs.size () ; }
292292
293293 private:
294294 const VEC_EXT& lhs ;
@@ -306,10 +306,10 @@ namespace sugar{
306306 Divides_Vector_Primitive ( const VEC_TYPE& lhs_, double rhs_ ) :
307307 lhs (lhs_), rhs(rhs_){}
308308
309- inline double operator []( int i ) const {
309+ inline double operator []( R_xlen_t i ) const {
310310 return lhs[i] / rhs ;
311311 }
312- inline int size () const { return lhs.size () ; }
312+ inline R_xlen_t size () const { return lhs.size () ; }
313313
314314 private:
315315 const VEC_EXT& lhs ;
@@ -329,12 +329,12 @@ namespace sugar{
329329 Divides_Primitive_Vector ( STORAGE lhs_, const VEC_TYPE& rhs_ ) :
330330 lhs (lhs_), rhs(rhs_.get_ref()), lhs_na( Rcpp::traits::is_na<RTYPE>(lhs_) ) {}
331331
332- inline STORAGE operator []( int i ) const {
332+ inline STORAGE operator []( R_xlen_t i ) const {
333333 if ( lhs_na ) return lhs ;
334334 STORAGE x = rhs[i] ;
335335 return Rcpp::traits::is_na<RTYPE>(x) ? x : (lhs / x) ;
336336 }
337- inline int size () const { return rhs.size () ; }
337+ inline R_xlen_t size () const { return rhs.size () ; }
338338 private:
339339 STORAGE lhs ;
340340 const VEC_EXT& rhs ;
@@ -351,10 +351,10 @@ namespace sugar{
351351 Divides_Primitive_Vector ( double lhs_, const VEC_TYPE& rhs_ ) :
352352 lhs (lhs_), rhs(rhs_.get_ref()) {}
353353
354- inline double operator []( int i ) const {
354+ inline double operator []( R_xlen_t i ) const {
355355 return lhs / rhs[i] ;
356356 }
357- inline int size () const { return rhs.size () ; }
357+ inline R_xlen_t size () const { return rhs.size () ; }
358358 private:
359359 double lhs ;
360360 const VEC_EXT& rhs ;
@@ -373,11 +373,11 @@ namespace sugar{
373373 Divides_Primitive_Vector ( STORAGE lhs_, const VEC_TYPE& rhs_ ) :
374374 lhs (lhs_), rhs(rhs_.get_ref()), lhs_na( Rcpp::traits::is_na<RTYPE>(lhs_) ) {}
375375
376- inline STORAGE operator []( int i ) const {
376+ inline STORAGE operator []( R_xlen_t i ) const {
377377 if ( lhs_na ) return lhs ;
378378 return lhs / rhs[i] ;
379379 }
380- inline int size () const { return rhs.size () ; }
380+ inline R_xlen_t size () const { return rhs.size () ; }
381381
382382 private:
383383 STORAGE lhs ;
@@ -395,10 +395,10 @@ namespace sugar{
395395 Divides_Primitive_Vector ( double lhs_, const VEC_TYPE& rhs_ ) :
396396 lhs (lhs_), rhs(rhs_.get_ref()) {}
397397
398- inline double operator []( int i ) const {
398+ inline double operator []( R_xlen_t i ) const {
399399 return lhs / rhs[i] ;
400400 }
401- inline int size () const { return rhs.size () ; }
401+ inline R_xlen_t size () const { return rhs.size () ; }
402402
403403 private:
404404 double lhs ;
0 commit comments