# Converting array and vector Indices Calculate the vector index from array indices, and vice versa.

### Description

`array`

s are `numeric`

s with a `dim`

attribute and are
stored with the first index moving fastest (i.e. by column). They can be
indexed both ways.

### Usage

1 2 3 |

### Arguments

`iarr` |
vector with the indices into the array dimensions |

`dim` |
vector with the array dimensions, as returned by |

`ivec` |
scalar with the index into the vector |

### Value

`array2vec`

returns a scalar, `vec2array`

a
`matrix`

.

### Author(s)

C. Beleites

### See Also

see `Extract`

on the difference of indexing an
`array`

with a vector or a `matrix`

.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |