 15 Mar, 2009 1 commit


Liam Healy authored
The class 'callbackincluded has been simplified by replacing several obsolete slots with 'callbacks and 'callbackdynamic. The :callbacks static information is saved to a hash table so that it may be retrieved when the defmfun is expanded. The function makecbstructobject to make the callback structure as an &aux variable in reinitializeinstance :after form expanded in defmobject is now a form expansion executed at macroexpand time. The argument :callbackobject has been added to defmfun; this will result in the binding of the dynfn dynamic variable on expansion. The callback arguments for chebyshev definitions have been updated and the example works.

 14 Mar, 2009 2 commits


Liam Healy authored
Separate out the file callbackincluded.lisp from callback.lisp to define callbackrelated subclasses of mobject and macros to make instances.

Liam Healy authored
New functions parsecallbackstatic parsecallbackfnspec parsecallbackargspec work on the :callbacks argument. The first one parses the whole argument. The second one parses a particular function specification from :callbacks. The third one parses a particular argument of a particular function. When given 'dimensions, this function supplies all the dimensions, and #'defmcallback expands to make a list of the arguments. Then callmaybescalar passes these on to arraytolist, which currently only handles a vector. These are now used in #'makedefmcallbacks and #'defmcallbacks. Both montecarlointegrateplain and integrationQNG compile and run correctly. I have eliminated the old defmcallback and supporting definitions to clean up the file.

 10 Mar, 2009 1 commit


Liam Healy authored
New argument :callbacks added to defmobject. When defined (as currently defined in chebyshev), the expansion produces a defmcallback form. Since the argument :ciclassslots partially duplicates the contents of :callbacks, it needs to be fixed.

 08 Mar, 2009 1 commit


Liam Healy authored
Dimensions that have been placed into the dynamicvariable are now read and used for array input, as for example in Monte Carlo. Functions that use callbacks with scalar input and output (as for example in numericalintegration and numericaldifferentiation) are now expanded directly with a funcall instead of callmaybescalar. Modifications and new definitions to set arrays partly written and untested, await changes to defmobject where callbacks setting array values exist.

 06 Mar, 2009 1 commit


Liam Healy authored
In defmfun, wrapindexexport now directly generates the defmcallback form, which in turn handles all the argument component extraction. Monte Carlo compiles and runs correctly.

 02 Mar, 2009 2 commits


Liam Healy authored
The :callback argument to defmfun has now been split into two pieces, a set of values that will be specified at run time, which is in :callbackdynamic, and the values needed to build the callback and the callback structure, which remains in :callback. The contents are explained in callback.lisp. For mobject callbacks, the :callback part will be in the defmobject, and the :callbackdynamic will be in the defmfuns that use the mobject. Currently, the dimensions template in :callback is not read, just the first dimension in :callbackdynamic is used. This needs to be fixed. The numericalintegration, numericaldifferentiation, and montecarlo examples work.

Liam Healy authored
Extended the dynamic binding of callback functions to include a flag on whether to use scalars, and the dimension of the arguments, so that callback functions that have more than one scalar input and are defined in a defmfun will work. This includes exactly Monte Carlo functions. Scalar argument functions in numerical differentiation and numerical integration still work.

 01 Mar, 2009 1 commit


Liam Healy authored
The :callbacks argument to defmfun is now has at least four elements, the first two specifying the callback argument name and the structure name, and the remaining pairs specify the slot name and name of the variable bound to the function. Functions defined for extracting these pieces: callbackcarg, callbackstructuretype, callbackslotsfns. Even though in defmfun it is not necessary to define more than one callback function, it is possibile to define more. This has been tested on integrationQNG only.

 28 Feb, 2009 1 commit


Liam Healy authored
A dynamic (special) variable whose name is gensymmed is used to bind the function passed by the user as the argument to the GSLL function. The defmfun that defines this function also sets the callback structure to another gensymmed name, and it calls a function that funcalls the dynamic variable. This has been implemented for integrationQNG and works.

 27 Feb, 2009 1 commit


Liam Healy authored
In wrapindexexport, gensym names for the variables that will hold the actual functions passed at runtime and names for the callbacks, and save in the special callbackgensyms. Definition of integrationQNG will be a testbed.

 26 Feb, 2009 2 commits


Liam Healy authored
Fix defmakecallbacks for multidimensionalminimizerf so that the nonscalars case returns :double, not :successfailure.

Liam Healy authored

 25 Feb, 2009 1 commit


Liam Healy authored
Quote the gslnames in case it is a list of multiple functions when passing it to the #'error call for signalling 'obsoletegslversion. Also change declaration to ignorable from ignore and remove lambda list keywords to minimize style warnings for obsolete versions.

 24 Feb, 2009 3 commits


Liam Healy authored
In the defmobject macro, export the mobject names.

Liam Healy authored
Added tests from the GSL test suite for the discrete Hankel transform in dht/test.c translated into Lisp. They all check; GSL's testing routines allow for varying accuracy and they relax this (in some cases considerably) when known how inaccurate the result could be.

Liam Healy authored
Most linear algebra functions now have optional arguments which create workspace and answer arrays. All solver function that have _solve (separate solution vector) and _svx (solve inplace) forms have been unified into a single CL function. In qrpt functoins where signum is computed, it is no longer taken as input but allocated internally and return as one of the multiple values. This necessitated a change in bodyexpand that will now apply the clconvertform conversion to returned variables that are part of a multiple value list for :return.

 23 Feb, 2009 2 commits


Liam Healy authored
LUsolve and LUdecomposition now have optional arguments. For LUsolve, the choice of whether to solve inplace or in a new vector depends on how this last argument is specified. Because of the different call paths, it is possible that x is a vector or nil. If it is a vector, it will change after the foreign call, which means it needs to be added to :outputs. In order to prevent an error from the call to (setf clinvalid) and (setf cinvalid) when x is nil, these two functions have been defined for class T to do nothing but return the value. Also, copyctocl and copycltoc check whether the argument is a mobject, though this change isn't needed. There are two additional tests in 'lu that do a solve and then remultiply the results with matrixproducttriangular. In both SBCL and CCL, the answer comes out reversed. When multiplied by matrixproduct, it is correct.

Liam Healy authored
New symbol name +steprk8pd+ missed in one spot.

 21 Feb, 2009 1 commit


Liam Healy authored
Swapped the optional arguments 'weight, 'tolerance to linearmfit on the assumption that weighted fits are used more often than SVD. Exported symbols for the generic functions defined in generic.lisp (note: this will require shadowing when importing both the :gsl package and the :iterate package). Various minor improvements/updates to documentation.

 20 Feb, 2009 1 commit


Liam Healy authored
The linear multiparameter fitting functions with and without SVD have been unified into one function #'linearfit; the weighted and unweighted functions have already been unified. If tolerance is nonnil (doublefloat) the SVD functions will be called. Tests of the Airy functions have been replaced by those in GSL's gsl1.11/specfunc/test_airy.c and agree. Test totals now: SBCL 64: TOTAL: 1440 assertions passed, 5 failed, 0 execution errors. CCL 64: TOTAL: 1441 assertions passed, 4 failed, 0 execution errors.

 19 Feb, 2009 1 commit


Liam Healy authored
Added faster simplex mininimser using the symbol +simplexneldermead+; the old one is now called +simplexneldermeadon2+. Added new functions #'order, #'size, #'coefficients for Chebyshev; #'order is a generic function. Added methods for vectors with complex elements for elt+, elt, elt*, elt/. Fix spelling of "paraboloid".

 18 Feb, 2009 1 commit


Liam Healy authored
Added +halton+, +reversehalton+ to random/quasi.lisp. Added #'multilinearresiduals in solveminimizefit/linearleastsquares.lisp. Changed +sobol+, +niederreiter2+ from *..* apparently overlooked before. #'choleskysolve now written so that if xspec = T, a marray is created and the solution put in it and returned. If it is NIL, the solution will replace b. This required a modification to expanddefmfungeneric to remove &aux args from the defgeneric arglist. solveminimizefit/linearleastsquares.lisp Specify the weight as an optional argument, unifying the weighted and unweighted functions: linearfit, multiplierfit, linearmfit, linearmfitsvd. This necessitated a change in the order of the arguments. Changed call in basissplines.lisp.

 17 Feb, 2009 2 commits


Liam Healy authored
Functions added to GSL with version 1.10, and related changes:  Cholesky routines for complex matrices; Cholesky functions _solve and _svx (solution separate and inplace) now combined into a single generic function with an optional argument #'choleskysolve. Unfortunately a default marray maker can't be included in the optional argument.  Correlation added, and covariance and correlation tests expanded to all supported matrix element types.  Added #'exponentialintegralEn for nthorder exponential integral.  Also rewrote #'callbacksetslots and #'bodyexpand to eliminate gratuitous (progn nil ...) in some defmfun expansions. Test results: SBCL 64: TOTAL: 1379 assertions passed, 5 failed, 0 execution errors. CCL 64: TOTAL: 1380 assertions passed, 4 failed, 0 execution errors.

Liam Healy authored
Added definitions for GSL features that were added in version 1.9, and one from version 1.10: mminusp, mplusp, nonnegativep, +knuthran2002+, +vectorbfgs2+. Macros defmpar now has key instead of optional args. It and defrngtype take a gslversion argument; any symbols that are not defined in the user's version of GSL will be bound to an instance of 'obsoletegslversion but it is not signalled.

 16 Feb, 2009 6 commits


Liam Healy authored
Added all Mathieu functions and tests that match the GSL tests.

Liam Healy authored
SBCL gets confused about what &key arguments are acceptable for generic functions, so &allowotherkeys is added for SBCL only in the defgeneric of #'evaluate.

Liam Healy authored
The generalized (symmetric and nonsymmetric) eigensystem definitions have been added, and four separate files made for all eigensystem definitions. Not too much attention has been paid to consistent or unified names.

Liam Healy authored
Rename constant pointers into the GSL library to +...+ from *...*.

Liam Healy authored
Merge branch 'refactoringcallbacks'

Liam Healy authored
Direct function callbacks may now be used with GSL structs other than 'gslfunction, and will set the 'dimension slot as well by looking at the arglist of the function sent. This uses an #'arglist borrowed from CLOCC:port. Rewrite makecallbacks based on a hash table rather than a generic function. All the usualy tests pass. SBCL 64: TOTAL: 1259 assertions passed, 5 failed, 0 execution errors. CCL 64: TOTAL: 1260 assertions passed, 4 failed, 0 execution errors.

 15 Feb, 2009 8 commits


Liam Healy authored
As a way of making it easier to use something other than a gslfunction and with additional slots set, and to make more clear where specific variable names are treated specially, define and use: callbackargp callbackreplacearg callbackremovearg callbacksetslots Also split off #'setcbstruct which #'makecbstruct and callbacksetslots both use.

Liam Healy authored
Simple function passing to functions which don't use mobjects is possible with some modifications to defmfun which treat the C argument 'callback and the CL argument 'function specially, generating a callback structure based on 'gslfunction and filling it appropriately. Ported numericaldifferentiation and numericalintegration. Also simplified calls in numericalintegration by making the workspace argument optional and at the end of the arglist; it defaults to the right size based on 'limit. Changed one of the tests for numericalintegration because the limit test doesn't make sense with the workspace automatically allocated.

Liam Healy authored
Many callback users need just a single function taking and returning scalars. These are all defined the same way. So I have defined in callbacks.lisp a defmakecallbacks for 'singlefunction. This works for chebyshev, minimizationone, and rootsone, and it should be applicable to callbacks sent directly to functions without being stored in mobjects.

Liam Healy authored
Chebyshev object now built on callbacksincluded. The example/test was generating an error because the calls in integralchebyshev and derivativechebyshev did not have a needed #'mpointer call. This has been fixed and the test results match the previous result given in 8d9ce4e8.

Liam Healy authored
Define a finalizer for callback structure in CL slot, so that when the object is garbage collected, the foreign space for the callback is also removed. Deleted duplicate definition of makecbstructobject.

Liam Healy authored
The arguments have been changed in applystep, applyevolution so that they match for the first three arguments. The function name applystep was changed so the two are similar. The macro withodeintegration defines a local function #'nextstep instead of a symbol macro 'makenextstep because symbols in the body of a simple loop violate the CL standard. Some documentation has been updated with the contribution of Mirko Vikovic.

Liam Healy authored
Changed the code so that the callback struct is now in odestepper instead of odeevolution, because all solvers need stepper but only variable step integrators need evolution. The ode examples/tests work.

Liam Healy authored
Mobject 'odeevolution is now made as a subclass of 'callbacksincludedcl, a new class that is a subclass of 'callbacksincluded, but which stores the cbstruct pointer in a CL slot rather than in a foreign struct. This example is correct, (integratevanderpol 1.0d0 1.d4 *steprk4* nil) 40 1.0d0 1.4568569264026898d0 11.547449151779395d0

 14 Feb, 2009 1 commit


Liam Healy authored
Nonlinear least squares now works using callbacksincluded. This necessitated naming the components of dimensions individually (numberofobservations numberofparameters). This is done with added slot 'dimensionnames to the callbacksincluded class and an argument of the same name to #'defcisubclass which defaults to '(dimensions). Because of the default, the other defmobject usage need not be changed.
