Description Objects from the Class Slots Methods Note See Also Examples

The `"abIndex"`

`class`

, short for “Abstract
Index Vector”, is used for dealing with large index vectors more
efficiently, than using integer (or `numeric`

) vectors of
the kind `2:1000000`

or `c(0:1e5, 1000:1e6)`

.

Note that the current implementation details are subject to change,
and if you consider working with these classes, please contact the
package maintainers (`packageDescription("Matrix")$Maintainer`

).

Objects can be created by calls of the form `new("abIndex", ...)`

,
but more easily and typically either by `as(x, "abIndex")`

where
`x`

is an integer (valued) vector, or directly by
`abIseq()`

and combination `c(...)`

of such.

`kind`

:a

`character`

string, one of`("int32", "double", "rleDiff")`

, denoting the internal structure of the abIndex object.`x`

:Object of class

`"numLike"`

; is used (i.e., not of length`0`

) only iff the object is*not*compressed, i.e., currently exactly when`kind != "rleDiff"`

.`rleD`

:object of class

`"rleDiff"`

, used for compression via`rle`

.

- as.numeric, as.integer, as.vector
`signature(x = "abIndex")`

: ...- [
`signature(x = "abIndex", i = "index", j = "ANY", drop = "ANY")`

: ...- coerce
`signature(from = "numeric", to = "abIndex")`

: ...- coerce
`signature(from = "abIndex", to = "numeric")`

: ...- coerce
`signature(from = "abIndex", to = "integer")`

: ...- length
`signature(x = "abIndex")`

: ...- Ops
`signature(e1 = "numeric", e2 = "abIndex")`

: These and the following arithmetic and logic operations are**not yet implemented**; see`Ops`

for a list of these (S4) group methods.- Ops
`signature(e1 = "abIndex", e2 = "abIndex")`

: ...- Ops
`signature(e1 = "abIndex", e2 = "numeric")`

: ...- Summary
`signature(x = "abIndex")`

: ...- show
`("abIndex")`

: simple`show`

method, building on`show(<rleDiff>)`

.- is.na
`("abIndex")`

: works analogously to regular vectors.- is.finite, is.infinite
`("abIndex")`

: ditto.

This is currently experimental and not yet used for our own code.
Please contact us (`packageDescription("Matrix")$Maintainer`

),
if you plan to make use of this class.

Partly builds on ideas and code from Jens Oehlschlaegel, as implemented (around 2008, in the GPL'ed part of) package ff.

`rle`

(base) which is used here;
`numeric`

1 2 3 4 5 6 7 8 |

```
Class "abIndex" [package "Matrix"]
Slots:
Name: kind x rleD
Class: character numLike rleDiff
Formal class 'abIndex' [package "Matrix"] with 3 slots
..@ kind: chr "rleDiff"
..@ x : int(0)
..@ rleD:Formal class 'rleDiff' [package "Matrix"] with 2 slots
.. .. ..@ first: int -3
.. .. ..@ rle :List of 2
.. .. .. ..$ lengths: int [1:3] 43 1 50
.. .. .. ..$ values : int [1:3] 1 -20 1
.. .. .. ..- attr(*, "class")= chr "rle"
Abstract Index vector (class 'abIndex') of length 95, kind "rleDiff"
and slot "rleD":
RLE difference (class 'rleDiff'): first = -3, "rle":
Run Length Encoding
lengths: int [1:3] 43 1 50
values : int [1:3] 1 -20 1
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.