From: Soeren S. <swi...@nn...> - 2008-04-26 08:58:04
|
On Sat, 2008-04-26 at 04:13 -0400, Joseph Wang wrote: Hi Joseph, > Thanks. I've noticed the R 2.7 release and checked in some fixes before I > checked my e-mail this evenining. I'll try to get the patches in place in Yes I get some conflicts now - I am fine to not have an extra case for R2.6 :) > the next few days. R 2.7 seems to pass all the regression tests except for > the function pointer one, and I got it to work with QuantLib. What about the other two problems I am seeing? Why can't we get rid of the scorecein typemap in rtype.swg at all? I mean it is bad if things get converted to numeric (or so) although there is a magic (user written!) typemap doing the work. I still don't understand why ther should be any conversion at all... wrong type -> sorry wrong type error no? Also what about the dispatcher? Any ideas on how to better check if two types are compatible (extends seems not be the right thing for numeric types)... Soeren > On Friday 25 April 2008 12:40:21 pm Soeren Sonnenburg wrote: > > > OK, after investigating for some time: > > > > There was actually not only a bug in SWIG but in R 2.7 (and still is - > > long input lines cause it to crash, solution posted to Rd mailinglist). > > Which means R+swig works in principle. However there are definitely a > > couple of (minor/easily fixable) bugs in the R wrapper that need further > > fixes before shogun ( http://www.shogun-toolbox.org ) fully works: > > > > 1) the dispatcher (called when an object is constructed) wrongly calls > > extends(argtypes[1], 'numeric')) which will never be true for > > a matrix (some magic is needed here). > > Workaround for now is to not use > > RealFeatures(my_matrix), but > > rf=RealFeatures() > > rf$copy_feature_matrix(rf, my_matrix) > > 2) arguments that take a double* will all be modified via > > as.numeric(arg) which converts matrices -> vectors. IMHO it > > does not make sense to do any conversion > > at all but for compatibility a workaround for now is to use > > %{ if (!is.numeric($input)) $input = as.numeric($input) %} > > in the scoercein typemap in rtype.swg > > 3) the R2.7 swig mkCharEnc fix (patch submitted here on the ml) > > > > Soeren > > |