|
Start of topic | Skip to actions
Here are design note for RSwig. An experimental interface between R and Swig.
The patches are attached to this page and are built against CVS (although they should apply cleamly to most recent versions of SWIG.)
Also attached is the file "make.out" which is the current unit test report.
This is based on the work http://www.omegahat.org/RSWIG/ by Duncan Temple Lang.
See RSwigBlog for current details.
If you are interesting in working this this please contact Joseph Wang. This is part of a general project to understand warrant pricing on the Shanghai exchange.
Purpose of RSWIGThe motivation for this work is to for academic research I am doing on derivatives on the Shanghai stock market. I'm always interested in hearing news, opinions, and job openings about Chinese derivatives. See my Home Page -- JosephWang - 27 Feb 2006Design notesBasic philosophy is to have SWIG create a minimal wrapper around C++ and then to do as much as possible in R.Class implementationC++ objects are implemented as external pointer objects with the class being the mangled name of the class. The C++ classes are encapsulated as an SEXP with an external pointer type. The class is the mangled name of the class. The nice thing about R is that is allows you to keep track of the pointer object which removes the necessity for a lot of the proxy class baggage you see in other languages.Enumerationsenumerations are characters which are then converted back and forth to ints before calling the C routines. All of the enumeration code is done in R. For enumerations to work, the enum has to be defined in the .i file. There are problems if the .i references an enumeration which is not in the .i file through a typedef. RSwigDocumentationIndexesgetitem and setitem use C++ conventions (i.e. zero based indices). [<- and [ are overloaded to allow for R syntax (one based indices and slices) Need to think of a way of getting a function to trigger a wrapper call. I don't want so much stuff in the cxx file.Arrays
Notes
Short Term TODO
Long Term TODOSee the list of RSwigTodo
| ||||