1. 15 Mar, 2009 1 commit
    • Liam Healy's avatar
      Dynamic callback defined in mobject, works for chebyshev · d3fd192d
      Liam Healy authored
      The class 'callback-included has been simplified by replacing several
      obsolete slots with 'callbacks and 'callback-dynamic.  The :callbacks
      static information is saved to a hash table so that it may be
      retrieved when the defmfun is expanded.  The function
      make-cbstruct-object to make the callback structure
      as an &aux variable in reinitialize-instance :after form expanded in
      defmobject is now a form expansion executed at macroexpand time.
      The argument :callback-object 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.
      d3fd192d
  2. 14 Mar, 2009 2 commits
    • Liam Healy's avatar
      New file callback-included.lisp · 4e928c8c
      Liam Healy authored
      Separate out the file callback-included.lisp from callback.lisp to
      define callback-related subclasses of mobject and macros to make
      instances.
      4e928c8c
    • Liam Healy's avatar
      New functions to parse :callbacks argument · b07e9299
      Liam Healy authored
      New functions 
        parse-callback-static
        parse-callback-fnspec
        parse-callback-argspec
      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 call-maybe-scalar passes these on to array-to-list,
      which currently only handles a vector.  These are now used in
      #'make-defmcallbacks and #'defmcallbacks.  Both
      monte-carlo-integrate-plain and integration-QNG compile and run
      correctly.  I have eliminated the old defmcallback and supporting
      definitions to clean up the file.
      b07e9299
  3. 10 Mar, 2009 1 commit
  4. 08 Mar, 2009 1 commit
    • Liam Healy's avatar
      Dynamic dimensions for callbacks · 00d7b1db
      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.
      00d7b1db
  5. 06 Mar, 2009 1 commit
  6. 02 Mar, 2009 2 commits
    • Liam Healy's avatar
      Separate :callback-dynamic from :callbacks arguments · ce520713
      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.
      ce520713
    • Liam Healy's avatar
      Dynamic callback functions in defmfun for array arguments · 69639247
      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.
      69639247
  7. 01 Mar, 2009 1 commit
    • Liam Healy's avatar
      In defmfun, :callbacks argument extended; formalize reading · 3b409c13
      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.
      3b409c13
  8. 28 Feb, 2009 1 commit
    • Liam Healy's avatar
      Scalar functions passed as callback arguments · 01164ead
      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.
      01164ead
  9. 27 Feb, 2009 1 commit
  10. 26 Feb, 2009 2 commits
  11. 25 Feb, 2009 1 commit
    • Liam Healy's avatar
      For obsolete GSL versions, handle multiple function names correctly · 3f2965ca
      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.
      3f2965ca
  12. 24 Feb, 2009 3 commits
    • Liam Healy's avatar
      Export mobject names · 49da8c43
      Liam Healy authored
      In the defmobject macro, export the mobject names.
      49da8c43
    • Liam Healy's avatar
      Added tests for the discrete Hankel transform · 41ce0cf2
      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.
      41ce0cf2
    • Liam Healy's avatar
      Optional arguments for linear algebra functions; unification of solve and svx · fa1dbfc1
      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.
      fa1dbfc1
  13. 23 Feb, 2009 2 commits
    • Liam Healy's avatar
      Default values for LU functions; added test · c04147d7
      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.
      c04147d7
    • Liam Healy's avatar
      Fix misnamed symbol · f23f16af
      Liam Healy authored
      New symbol name +step-rk8pd+ missed in one spot.
      f23f16af
  14. 21 Feb, 2009 1 commit
    • Liam Healy's avatar
      Order of arguments in linear-mfit, export symbols, documentation update · 352210f5
      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.
      352210f5
  15. 20 Feb, 2009 1 commit
    • Liam Healy's avatar
      Unify linear-mfit; Airy tests from GSL · ed9a001e
      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.
      ed9a001e
  16. 19 Feb, 2009 1 commit
    • Liam Healy's avatar
      GSL features added in version 1.12; fix spelling · cefb7c3f
      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".
      cefb7c3f
  17. 18 Feb, 2009 1 commit
    • Liam Healy's avatar
      GSL features added in version 1.11; cholesky-solve and linear fit unification · cb88b8db
      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.
      cb88b8db
  18. 17 Feb, 2009 2 commits
    • Liam Healy's avatar
      GSL features added in version 1.10 · 94413b43
      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.
      94413b43
    • Liam Healy's avatar
      GSL features added in version 1.9 · 6e17d879
      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.
      6e17d879
  19. 16 Feb, 2009 6 commits
    • Liam Healy's avatar
      Add Mathieu functions · dd3b8e1c
      Liam Healy authored
      Added all Mathieu functions and tests that match the GSL tests.
      dd3b8e1c
    • Liam Healy's avatar
      Suppress spurious style-warnings from SBCL in generic function &key · 05428839
      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.
      05428839
    • Liam Healy's avatar
      Added generalized eigensystems and separated files · 160ffb90
      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.
      160ffb90
    • Liam Healy's avatar
      Rename constants to +...+ · b28a6a5a
      Liam Healy authored
      Rename constant pointers into the GSL library to +...+ from *...*.
      b28a6a5a
    • Liam Healy's avatar
      Merge in dynamically generated callbacks. · 26de0158
      Liam Healy authored
      Merge branch 'refactoring-callbacks'
      26de0158
    • Liam Healy's avatar
      Monte Carlo uses direct function callbacks · bcf61476
      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.
      bcf61476
  20. 15 Feb, 2009 8 commits
    • Liam Healy's avatar
      Define functions and macro to help direct use of callbacks in defmfun · 3d57ef40
      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.
      3d57ef40
    • Liam Healy's avatar
      Direct use of callbacks in functions · 575fe965
      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.
      575fe965
    • Liam Healy's avatar
      Make 'single-function "class" for (def-)make-callbacks · e236d8d7
      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.
      e236d8d7
    • Liam Healy's avatar
      Chebyshev ported to callbacks-included and example/test fixed · 84b5a165
      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.
      84b5a165
    • Liam Healy's avatar
      Finalizer for callback structure in CL slot · ea176adc
      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.
      ea176adc
    • Liam Healy's avatar
      Consistent apply-step, apply-evolution function names and arguments · f4489bf4
      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.
      f4489bf4
    • Liam Healy's avatar
      Callback struct stored in ode-stepper slot · 47ce1e4a
      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.
      47ce1e4a
    • Liam Healy's avatar
      ODE evolution ported to callbacks-included · b6561c8e
      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
      b6561c8e
  21. 14 Feb, 2009 1 commit
    • Liam Healy's avatar
      Nonlinear least squares ported to callbacks-included; 'dimension-names · 59d0892f
      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.
      59d0892f