ij2k: Convert an (i, j) index to a linear index.

Description Usage Arguments Value

View source: R/ij2k.R

Description

Converts an (i, j) index to a linear index. Converts the double index of a square matrix to the corresponding linear one. This is column-major as it is default in R.

Usage

1
ij2k(i, j, n)

Arguments

i

i index, i.e. row position; indexing starts at 1.

j

j index, i.e. column position; indexing starts at 1.

n

size of the square matrix.

Value

Linear position.


grantham documentation built on Jan. 7, 2022, 9:06 a.m.