Expand description
ALTREP support
The core functions to support ALTREP in R.
Structs§
Functions§
- ALTREP⚠
- Returns a nonzero value if x is a “compact representation” (ALTREP) value. Access to the data pointers of ALTREP values may be problematic and should be replaced with access to individual elements (see REAL_ELT) or vector subregions (see REAL_GET_REGION). See also: https://svn.r-project.org/R/branches/ALTREP/ALTREP.html
- ALTREP_
CLASS ⚠ - Returns the ALTREP class object containing the methods set up for use on ax. The return value is of unspecified SEXPTYPE. Behaviour is undefined if ax is not an ALTREP object.
- R_
altrep_ ⚠data1 - Returns one of the two ALTREP instance variables belonging to ax. Behaviour is undefined if ax is not an ALTREP object.
- R_
altrep_ ⚠data2 - Returns one of the two ALTREP instance variables belonging to ax. Behaviour is undefined if ax is not an ALTREP object.
- R_
altrep_ ⚠inherits - Returns a nonzero value if x is an ALTREP value whose class pointer is class.
- R_
make_ ⚠altcomplex_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altinteger_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altlist_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altlogical_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altraw_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altreal_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation integer vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
make_ ⚠altstring_ class - Allocates, registers and returns an ALTREP class with the given names. In addition to the methods given here, compact representation string vectors must implement the common “altrep” methods (see R_set_altrep_…method) and the common “altvec” methods (see R_set_altvec…_method).
- R_
new_ ⚠altrep - Allocates, constructs and returns a compact-representation value. It will have the TYPEOF() of the corresponding class and will use the methods in aclass and the instance variables to respond to calls such as XLENGTH().
- R_
set_ ⚠altcomplex_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altcomplex_ Get_ region_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Get_ region_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Is_ sorted_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Max_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Min_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ No_ NA_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altinteger_ Sum_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlist_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlist_ Set_ elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlogical_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlogical_ Get_ region_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlogical_ Is_ sorted_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlogical_ No_ NA_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altlogical_ Sum_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact integer vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altraw_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altraw_ Get_ region_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact complex vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Get_ region_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Is_ sorted_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Max_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Min_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ No_ NA_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altreal_ Sum_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact real vector class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Coerce_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ DuplicateEX_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Duplicate_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Inspect_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Length_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Serialized_ state_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ UnserializeEX_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ Unserialize_ method - Sets the function pointer inside the ALTREP class object. Currently, these methods are common to all ALTREP classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altrep_ data1 - Sets the corresponding ALTREP instance variable of ax to v, sharing it without duplication. Behaviour is undefined if ax is not an ALTREP object. Versions: Appeared in 3.5.0.
- R_
set_ ⚠altrep_ data2 - Sets the corresponding ALTREP instance variable of ax to v, sharing it without duplication. Behaviour is undefined if ax is not an ALTREP object. Versions: Appeared in 3.5.0.
- R_
set_ ⚠altstring_ Elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact string representation class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altstring_ Is_ sorted_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact string representation class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altstring_ No_ NA_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact string representation class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altstring_ Set_ elt_ method - Sets the function pointer inside the ALTREP class object. Behaviour is undefined if cls is not a compact string representation class. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altvec_ Dataptr_ method - Sets the function pointer inside the ALTREP class object. Currently, all ALTREP classes are vector classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altvec_ Dataptr_ or_ null_ method - Sets the function pointer inside the ALTREP class object. Currently, all ALTREP classes are vector classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
- R_
set_ ⚠altvec_ Extract_ subset_ method - Sets the function pointer inside the ALTREP class object. Currently, all ALTREP classes are vector classes. There is no facility for unregistering ALTREP classes, so once a function pointer is set from a package shared library, it must not be unloaded.
Type Aliases§
- R_
altcomplex_ Elt_ method_ t - Must return
x[i]
for the 0-based index i. The default method returnsCOMPLEX(x)[i]
. - R_
altcomplex_ Get_ region_ method_ t - Must copy up to n elements, starting at 0-based index i, into
buf[n]
, and return the number of elements copied. The default method defers to COMPLEX_ELT and hence the Elt method above. Versions: Appeared in 3.6.0. - R_
altinteger_ Elt_ method_ t - Must return
x[i]
for the 0-based index i. The default method returnsINTEGER(x)[i]
. - R_
altinteger_ Get_ region_ method_ t - Must copy up to n elements, starting at 0-based index i, into
buf[n]
, and return the number of elements copied. The default method defers to INTEGER_ELT and hence the Elt method above. - R_
altinteger_ Is_ sorted_ method_ t - Must return one of the sortedness constants: SORTED_DECR, UNKNOWN_SORTEDNESS, SORTED_INCR. See INTEGER_IS_SORTED. The default method always returns UNKNOWN_SORTEDNESS.
- R_
altinteger_ Max_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altinteger_ Min_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altinteger_ No_ NA_ method_ t - Must return 1 if x is known not to store any missing values (see INTEGER_NO_NA), otherwise 0 (including if it’s unknown). The default method always returns 0.
- R_
altinteger_ Sum_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altlist_ Elt_ method_ t - Must return
x[[i]]
for the 0-based index i or raise an error. - R_
altlist_ Set_ elt_ method_ t - Must set
x[[i]] <- v
for the 0-based index i, altering x, or raise an error. - R_
altlogical_ Elt_ method_ t - Must return
x[i]
for the 0-based index i. The default method returnsLOGICAL(x)[i]
. - R_
altlogical_ Get_ region_ method_ t - Must copy up to n elements, starting at 0-based index i, into
buf[n]
, and return the number of elements copied. The default method defers to LOGICAL_ELT and hence the Elt method above. - R_
altlogical_ Is_ sorted_ method_ t - Must return one of the sortedness constants: SORTED_DECR, UNKNOWN_SORTEDNESS, SORTED_INCR. See INTEGER_IS_SORTED. The default method always returns UNKNOWN_SORTEDNESS
- R_
altlogical_ No_ NA_ method_ t - Must return 1 if x is known not to store any missing values (see LOGICAL_NO_NA), otherwise 0 (including if it’s unknown). The default method always returns 0.
- R_
altlogical_ Sum_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector. Versions: Appeared in 3.6.0.
- R_
altraw_ Elt_ method_ t - Must return
x[i]
for the 0-based index i. The default method returnsRAW(x)[i]
. - R_
altraw_ Get_ region_ method_ t - Must copy up to n elements, starting at 0-based index i, into
buf[n]
, and return the number of elements copied. The default method defers toRAW_ELT
and hence the Elt method above. Versions: Appeared in 3.6.0. - R_
altreal_ Elt_ method_ t - Must return
x[i]
for the 0-based index i. The default method returnsREAL(x)[i]
. - R_
altreal_ Get_ region_ method_ t - Must copy up to n elements, starting at 0-based index i, into
buf[n]
, and return the number of elements copied. The default method defers to REAL_ELT and hence the Elt method above. - R_
altreal_ Is_ sorted_ method_ t - Must return one of the sortedness constants: SORTED_DECR, UNKNOWN_SORTEDNESS, SORTED_INCR. See REAL_IS_SORTED. The default method always returns UNKNOWN_SORTEDNESS.
- R_
altreal_ Max_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altreal_ Min_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altreal_ No_ NA_ method_ t - Must return 1 if x is known not to store any missing values (see REAL_NO_NA), otherwise 0 (including if it’s unknown). The default method always returns 0.
- R_
altreal_ Sum_ method_ t - Must calculate and return the specified summary of the contents of x, ignoring missing values if narm is TRUE. May return a null pointer, in which case R will compute the summary by accessing the elements of the vector.
- R_
altrep_ Coerce_ method_ t - Must return an R value of SEXPTYPE type containing the result of conversion of x into that type, ignoring the attributes. May return a null pointer, making R perform the conversion as usual (see coerceVector). The default method returns a null pointer.
- R_
altrep_ DuplicateEX_ method_ t - Like the Duplicate method above, but must duplicate the attributes in the same manner. May return a null pointer, in which case R will produce a materialised copy of the object by itself. The default method calls the Duplicate method, duplicates the attributes of x and installs them onto the return value.
- R_
altrep_ Duplicate_ method_ t - Must return a copy (see duplicate) of x that can be altered independently of x, ignoring the attributes. R will duplicate and install the attributes by itself.
- R_
altrep_ Inspect_ method_ t - This method will be called from .Internal(inspect(…)) after printing the standard SEXP header contents; it can then print (see Rprintf) additional information specific to this ALTREP class. When starting a new line, this method must respect the output indentation pre. Printing the vector elements, if done, should be subject to the recommended vector printing length pvec. The method should call inspect_subtree for child elements, subject to the limits in deep. If the return value is TRUE, R will consider the value inspected and won’t access its contents; otherwise R will then inspect the contents of x as if it was an ordinary value. Either way, R will then take care of inspecting the attributes of x. The default method returns FALSE. Versions: Appeared in 3.5.0.
- R_
altrep_ Length_ method_ t - Must return the length of the compact-representation vector, or signal an error. The default method signals an error.
- R_
altrep_ Serialized_ state_ method_ t - Must prepare and return a representation of x that can be given to the Unserialize methods below in order to recreate it.
- R_
altrep_ UnserializeEX_ method_ t - Like the Unserialize method above, but must also take care of setting the attributes, the levels field and the object bit on the return value. This is likely impossible to implement within the confines of the R API. The default method calls the Unserialize method, sets the attributes, the object bit, and the levels field, and returns the result.
- R_
altrep_ Unserialize_ method_ t - Must construct and return an ALTREP object of the given class given the data previously prepared by the Serialized_state method above. The default method signals an R-level error.
- R_
altstring_ Elt_ method_ t - Must return
x[i]
(for 0-based i) or signal an error. The default method always raises an error. - R_
altstring_ Is_ sorted_ method_ t - Must return one of the sortedness constants: SORTED_DECR, UNKNOWN_SORTEDNESS, SORTED_INCR. See STRING_IS_SORTED. The default method always returns UNKNOWN_SORTEDNESS.
- R_
altstring_ No_ NA_ method_ t - Must return 1 if x is known not to store any missing values (see STRING_NO_NA), otherwise 0 (including if it’s unknown). The default method always returns 0.
- R_
altstring_ Set_ elt_ method_ t - Must set
x[i] <- v
(for 0-based i), even if it’s not compatible with the chosen compact representation, or signal an error. The default method always raises an error. - R_
altvec_ Dataptr_ method_ t - Must return a pointer to the start of the buffer of type corresponding to the SEXPTYPE of x and containing XLENGTH(x) elements (see DATAPTR_RO) corresponding to the contents of x. May signal an R error instead. The default method always signals an error.
- R_
altvec_ Dataptr_ or_ null_ method_ t - Like the Dataptr method above, but the method may return a null pointer to indicate a preference for *_Elt (see REAL_ELT) and *_Get_region (see REAL_GET_REGION) methods instead of full buffer access. The return value will not be used to modify x. The default method always returns a null pointer.
- R_
altvec_ Extract_ subset_ method_ t - Must allocate and return a new vector containing the result of subsetting,
x[indx]
, following the usual semantics of the [ operator for numeric subscripts. For values outside the range of x, missing values must be returned (R_NilValue for VECSXP lists, 0 for RAWSXP vectors). May also return a null pointer (see above).