Copyright © 2007-2017 The OpenMx Project

Published on *OpenMx* (http://openmx.ssri.psu.edu)

These are a list of standards we are conforming to in development of OpenMx.

Numerical routines will be written in C or written in Fortran with a C wrapper. This decision is driven by the structure of linkable R numerical libraries, which are written to allow C to call R internals and compile them in. In this way, we can compile lightweight computational nodes that make use of the matrix algebra evaluation functions, random number generator, integration functions, and statistical distribution functions built into R. C functions need to maintain Fortran style arguments, data structures, and not depend on the use of return() values when such functions might be replaced by Fortran subprograms. Documentation on conventions for writing compiled code that can be linked to R libraries can be found in the CRAN manual Writing R Extensions [1], chapters 5 and 6.

BLAS, LAPACK, some LINPACK function definitions are provided in R. BLAS and LAPACK routines will be used whenever possible, since this minimizes the code to be written and the porting support for the future. BLAS documentation can be found here [2] and LAPACK documentation here [3] and a table of other possibilities here [4]. Sparse routines from ScaLAPACK may also be useful, and these can be found here [5]. Inevitably, some numerical routines will need to be added. These will be added in such a way as to use BLAS as much as possible and to conform to the R calling standards so that we can give these routines back to the R community. We should keep track of the proposed Parallel Linear Algebra for Scalable Multi-Core Architectures (PLASMA) standard being developed at Oak Ridge.

**Links**

[1] http://cran.r-project.org/doc/manuals/R-exts.pdf

[2] http://www.netlib.org/blas/faq.html

[3] http://www.netlib.org/lapack/

[4] http://www.netlib.org/utk/people/JackDongarra/la-sw.html

[5] http://www.netlib.org/scalapack/