- 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 :ci-class-slots 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 dynamic-variable 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 numerical-integration and numerical-differentiation) are now expanded directly with a funcall instead of call-maybe-scalar. 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, wrap-index-export 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 :callback-dynamic, 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 :callback-dynamic will be in the defmfuns that use the mobject. Currently, the dimensions template in :callback is not read, just the first dimension in :callback-dynamic is used. This needs to be fixed. The numerical-integration, numerical-differentiation, and monte-carlo 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: callback-carg, callback-structure-type, callback-slots-fns. 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 integration-QNG 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 integration-QNG and works.
-
- 27 Feb, 2009 1 commit
-
-
Liam Healy authored
In wrap-index-export, gensym names for the variables that will hold the actual functions passed at runtime and names for the callbacks, and save in the special callback-gensyms. Definition of integration-QNG will be a testbed.
-
- 26 Feb, 2009 2 commits
-
-
Liam Healy authored
Fix def-make-callbacks for multi-dimensional-minimizer-f so that the non-scalars case returns :double, not :success-failure.
-
Liam Healy authored
-
- 25 Feb, 2009 1 commit
-
-
Liam Healy authored
Quote the gsl-names in case it is a list of multiple functions when passing it to the #'error call for signalling 'obsolete-gsl-version. 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 in-place) 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 body-expand that will now apply the cl-convert-form conversion to returned variables that are part of a multiple value list for :return.
-
- 23 Feb, 2009 2 commits
-
-
Liam Healy authored
LU-solve and LU-decomposition now have optional arguments. For LU-solve, the choice of whether to solve in-place 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 cl-invalid) and (setf c-invalid) when x is nil, these two functions have been defined for class T to do nothing but return the value. Also, copy-c-to-cl and copy-cl-to-c 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 matrix-product-triangular. In both SBCL and CCL, the answer comes out reversed. When multiplied by matrix-product, it is correct.
-
Liam Healy authored
New symbol name +step-rk8pd+ missed in one spot.
-
- 21 Feb, 2009 1 commit
-
-
Liam Healy authored
Swapped the optional arguments 'weight, 'tolerance to linear-mfit 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 multi-parameter fitting functions with and without SVD have been unified into one function #'linear-fit; the weighted and unweighted functions have already been unified. If tolerance is non-nil (double-float) the SVD functions will be called. Tests of the Airy functions have been replaced by those in GSL's gsl-1.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 +simplex-nelder-mead+; the old one is now called +simplex-nelder-mead-on2+. 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+, +reverse-halton+ to random/quasi.lisp. Added #'multi-linear-residuals in solve-minimize-fit/linear-least-squares.lisp. Changed +sobol+, +niederreiter2+ from *..* apparently overlooked before. #'cholesky-solve now written so that if x-spec = 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 expand-defmfun-generic to remove &aux args from the defgeneric arglist. solve-minimize-fit/linear-least-squares.lisp Specify the weight as an optional argument, unifying the weighted and unweighted functions: linear-fit, multiplier-fit, linear-mfit, linear-mfit-svd. This necessitated a change in the order of the arguments. Changed call in basis-splines.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 in-place) now combined into a single generic function with an optional argument #'cholesky-solve. 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 #'exponential-integral-En for nth-order exponential integral. - Also rewrote #'callback-set-slots and #'body-expand 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, non-negative-p, +knuthran2002+, +vector-bfgs2+. Macros defmpar now has key instead of optional args. It and def-rng-type take a gsl-version argument; any symbols that are not defined in the user's version of GSL will be bound to an instance of 'obsolete-gsl-version 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 &allow-other-keys is added for SBCL only in the defgeneric of #'evaluate.
-
Liam Healy authored
The generalized (symmetric and non-symmetric) 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 'refactoring-callbacks'
-
Liam Healy authored
Direct function callbacks may now be used with GSL structs other than 'gsl-function, 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 make-callbacks 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 gsl-function and with additional slots set, and to make more clear where specific variable names are treated specially, define and use: callback-arg-p callback-replace-arg callback-remove-arg callback-set-slots Also split off #'set-cbstruct which #'make-cbstruct and callback-set-slots 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 'gsl-function and filling it appropriately. Ported numerical-differentiation and numerical-integration. Also simplified calls in numerical-integration 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 numerical-integration 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 def-make-callbacks for 'single-function. This works for chebyshev, minimization-one, and roots-one, and it should be applicable to callbacks sent directly to functions without being stored in mobjects.
-
Liam Healy authored
Chebyshev object now built on callbacks-included. The example/test was generating an error because the calls in integral-chebyshev and derivative-chebyshev 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 make-cbstruct-object.
-
Liam Healy authored
The arguments have been changed in apply-step, apply-evolution so that they match for the first three arguments. The function name apply-step was changed so the two are similar. The macro with-ode-integration defines a local function #'next-step instead of a symbol macro 'make-next-step 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 ode-stepper instead of ode-evolution, because all solvers need stepper but only variable step integrators need evolution. The ode examples/tests work.
-
Liam Healy authored
Mobject 'ode-evolution is now made as a subclass of 'callbacks-included-cl, a new class that is a subclass of 'callbacks-included, but which stores the cbstruct pointer in a CL slot rather than in a foreign struct. This example is correct, (integrate-vanderpol 1.0d0 1.d-4 *step-rk4* nil) 40 1.0d0 -1.4568569264026898d0 -11.547449151779395d0
-
- 14 Feb, 2009 1 commit
-
-
Liam Healy authored
Nonlinear least squares now works using callbacks-included. This necessitated naming the components of dimensions individually (number-of-observations number-of-parameters). This is done with added slot 'dimension-names to the callbacks-included class and an argument of the same name to #'def-ci-subclass which defaults to '(dimensions). Because of the default, the other defmobject usage need not be changed.
-
- 13 Feb, 2009 2 commits
-
-
Liam Healy authored
Conditionalize the array copy 64-bit tests matrix-copy-to-cl-and-back.lisp and vector-copy-to-cl-and-back.lisp with #+int64 so they don't run on 32 bit computers.
-
Liam Healy authored
Tests of copying marrays to and from CL.
-
- 12 Feb, 2009 1 commit
-
-
Liam Healy authored
The function #'copy will now copy contents between marrays and CL arrays. The destination array can be supplied literally, or created by this function by specifying the desired type: when copying from a marray to a CL array, specify 'array; when copying from a CL array to a marray, specify the element type of the marray. For example, (COPY (COPY (MAKE-MARRAY '(COMPLEX DOUBLE-FLOAT) :INITIAL-CONTENTS '((-34.5 8.24 3.29 -8.93 34.12 -6.15) (-8.93 34.12 -6.15 49.27 -13.49 32.5) (49.27 -13.49 32.5 42.73 -17.24 43.31))) 'ARRAY) '(COMPLEX DOUBLE-FLOAT)) copies from the matrix-complex-double-float made in the make-marray form to a CL array, then copies the contents to a new matrix-complex-double-float.
-