This struct is used to work with a matrix that has been allocated in R. A pointer to the data is held, along with the dimensions. An RMatrix struct is reference counted to take care of protecting it from the R garbage collector while in use, and unprotecting when it is no longer used, as necessary.
You can refer to elements using standard matrix notation, i.e., x[1,4]. No matrix operations are provided, as this struct exists only to facilitate the passing of data, and each user will have her own preferred way to do things like matrix multiplication.
Allocate a new matrix in R and create a new RMatrix to wrap it, with protection from the R garbage collector.
Allocate a new matrix in R and copy in the values of a GretlMatrix or DoubleMatrix if using the dmdgretl library for matrix algebra.
Work with an Robj struct directly. This should only be used if you fully understand the internals of this library.
If embedding an R interpreter inside a D program, this function makes it more convenient to pull a matrix from R into D.
Create a reference to an RVector and access it as a matrix. In R, matrix and vector types are different.
If using the dmdgretl library for matrix algebra, allocate a new matrix in R and copy the elements of the matrix into it.
Copy the values of m into a new matrix.
Set all values of a matrix equal to val.
Standard matrix indexing is possible.
Get the underlying Robj that will be returned to R.