Configuration Infrastructure Documentation Examples Conversion

Configuration

  • Locate the engopts.sh file so we can use it in the build of RMatlab.so
  • Avoid the use of the hard-coded .so extension. Compute from R's R configuration.
  • Verify that we have an appropriate version of Matlab, i.e. test the version.
  • Documentation for newly added functions.

    Infra-structure.

  • Explore the Matlab graphics and the handles.
  • [Done] Interface for calling R functions with named arguments from Matlab.
    Does Matlab have named argument matching? I don't think so, so you have to develop your own "convention"
    Use the interface
          
          callNamedR('paste', 1:3, 5:7, {'collapse', ' < ', 'sep', ', '})
    
    i.e. the last argument is a cell of name-value pairs.

    Alternatively, allow a struct, using the field names as the argument names and values as the arguments.

          
          callNamedR('paste', 1:3, 5:7, struct('collapse', ' < ', 'sep', ', '))
    
  • [Done] Recognize when we can use mex calls from R rather than Engine calls.
    We now assign a value into the R global environment during the call to initializeR and we can check for the existence of this to understand when to use the MEX functions.
    Also, we have a function to get the default engine.
  • [Done] Fill in the mex interface to parallel the engine API.
    mexGetVariable(Ptr), mexSetVariable(Ptr) mexEvalString mexFunctionName mexSet/mexGet for graphics handle.
  • [Done] mxSetTrapFlag for controlling error.
    The idea here is to ensure that if there is an error when calling a Matlab function (via the MEX interface), that we control back.
  • Explore using mxSetAllocFcns to handle memory management.
    Probably not necessary.
  • Documentation

  • [Done] set/get graphics properties Rd files.
  • outline.tex reference manual.
  • Examples

    Explore some examples
  • ODEs/PDEs
  • Optimization
  • Speed of Matrix computations.
  • Images.
  • Speed in comparison with using files for data exchange.
  • Conversion.

  • terms and call in an lm object being passed from R to Matlab.
  • Sparse arrays.
    Perhaps use customized converters.
    mxIsSparse().
  • Inf & NaN
    Numerics look like they basically work without special handling. Integers behave oddly. See the function nas(TRUE) in converterTests.R for anomolies. Looks okay now. Inf becomes NA.
    Strings from R become 'NA' in Matlab. Converting the other way is not a good idea, i.e 'NA' in Matlab becomes NA in R.
  • Dates
    datestr, datevec.
  • References, functions, etc.
    Pass a function to R.
  • mxSetClassName
    Classes for Matlab objects. mxIsClass Explore Matlab classes
    Classes for representing R references.
  • Extensible converter mechanism.
    Use for, e.g, dates (e.g. POSIXct, POSIXlt)
  • [Done] {Ui,I}nt{8,16,32,64}, Single from Matlab to R.
    Need to look at the class of the different Matlab objects and handle them appropriately.
    Example of uint8 img = imread('/home/duncan/rggobi.png'); Done.
  • [Done]Arrays.
    Rather than matrices. Probably can reorganize the code to handle vectors, matrices and arrays in one common block of code given the way both systems store the objects.

    Merge the vector, matrix and array converters into a single block of code. Done for R to Matlab for all basic types. And for Matlab to R for all. Strings are a little weird but I think they are okay.
    Not done for cells.

  • [Done] Complex numbers.
    Done for R to Matlab and Matlab to R.
  • Done

    These could do with checking.
    convert struct to S object.
    fix class.
    string matrices from R to Matlab.
    create cells.

    Duncan Temple Lang <duncan@wald.ucdavis.edu>
    Last modified: Wed Nov 10 06:41:53 PST 2004