1. 16 Apr, 2009 1 commit
    • Liam Healy's avatar
      Tests marrays directly · 64a0b6c2
      Liam Healy authored
      Thanks to Malcolm Reynolds and Tom Hermann, lisp-unit:numerical-equal
      is now a generic function, so in the new file test-unit/augment.lisp,
      a method has been defined to work on marrays.  This now permits the
      direct comparison in tests of marrays, rather than looking at their CL
      equivalent with cl-array.  So far the only test changed is
  2. 05 Apr, 2009 2 commits
    • Liam Healy's avatar
      Standardized names of GSL function structs · eb1420b4
      Liam Healy authored
      All defcstruct definitions for functions are in the new file
      init/callback-struct.lisp.  They all have standard name format
      beginning with "fnstruct" and have been consolidated where there were
      redundant definitions.
    • Liam Healy's avatar
      Internal variable rename 'cbinfo · 3987beef
      Liam Healy authored
      Internally call the :callbacks argument to defmobject or defmfun
      'cbinfo, to better distinguish it in the source code.  In numerical
      integration example functions, apply #'realpart, because
      implementations are permitted to return complex numbers from #'expt
      when the second argument is a float.
  3. 04 Apr, 2009 2 commits
    • Liam Healy's avatar
      Added integration methods QAWS, QAWO, QAWF; new tests for numerical integration · 2217c408
      Liam Healy authored
      Integration methods 
      integration-QAWS: adaptive integration for singular functions
      integration-QAWO: adaptive integration for oscillatory functions
      integration-QAWF: adaptive integration for Fourier integrals
      have been added in a file numerical-integration-with-tables.lisp.
      These require tables with are new mobjects.  All of the tests from GSL
      in gsl-1.11/integration/test.c and gsl-1.11/integration/tests.c for
      ported functions are now in either this file or
      SBCL 64: TOTAL: 1522 assertions passed, 5 failed, 0 execution errors.
      CCL 64:  TOTAL: 1525 assertions passed, 2 failed, 0 execution errors.
    • Liam Healy's avatar
      Eliminated dependency on cl-utilities; error for obsolete defmpar · 45ca8e88
      Liam Healy authored
      The defmobject argument 'class-slots-instance is no longer used, so
      #'callback-arg-p and the only use of with-unique-names can be
      eliminated, and thus the dependency on cl-utilities.
      Constant GSL functions in the library (such as minimizers) which
      were introduced in a GSL version newer than loaded now expand as
      symbol macros which signal the 'obsolete-gsl-version error.
  4. 03 Apr, 2009 2 commits
    • Liam Healy's avatar
      Number symbols sequentially; intern specials for defmfun · 86d01196
      Liam Healy authored
      Created file init/utility.lisp, which now includes
      make-symbol-cardinal and make-symbol-cardinals.  These functions in
      turn will now take a list for name, and join the symbols together with
      "-", and will optionally intern in a package.  In #'callback-args in
      callback.lisp, the args are now numbered sequentionally (still
      uninterned, but no longer gensymmed).  In #'expand-defmfun-wrap in
      defmfun.lisp, the symbols for specials "dynfn" and "cbfn" that are
      made are now interned, numbered sequentially, and named after the
      function in which they occur.  This doesn't affect the functionality
      of the functions, it is just for readability of the macroexpansion.
      Expected tests pass.
    • Liam Healy's avatar
      Polynomial order of and optional arguments; added tests from GSL · 26a5e307
      Liam Healy authored
      Change the order of arguments to #'divided-difference and
      #'taylor-divided-difference in order to make 'dd in the first case and
      'coefficients and 'workspace in the second case optional arguments.
      Added all the tests from gsl-1.11/poly/test.c; results agree with the
      values stated there.  Complete test results:
      SBCL64: TOTAL: 1483 assertions passed, 5 failed, 0 execution errors.
      CCL64:  TOTAL: 1486 assertions passed, 2 failed, 0 execution errors.
  5. 02 Apr, 2009 2 commits
    • Liam Healy's avatar
      Replace mapcan with mappend · 7f485182
      Liam Healy authored
      In cases where the lists being nconced exist external to the call,
      replace mapcan with user-defined mappend to prevent destructive
    • Liam Healy's avatar
      Monte Carlo has more optional arguments · c0c80c3d
      Liam Healy authored
      Arguments now optional to make-monte-carlo-plain: 
             (* *monte-carlo-default-samples-per-dimension*
      	  (dim0 lower-limits)))
      (generator (make-random-number-generator +mt19937+ 0))
      (state (make-monte-carlo-plain (dim0 lower-limits)))
      (scalars t)
      and similarly for -vegas, -miser.  Argument 'number-of-samples renamed
      from 'calls to clarify.
  6. 01 Apr, 2009 4 commits
    • Liam Healy's avatar
      Pass functions with function-designators only; no make-callback · 8a30ea5a
      Liam Healy authored
      Functions to pass to GSL are no longer "declared" with make-callback.
      Instead, callbacks for each application that needs them are created at
      compile time.  These callbacks will funcall a dynamic (special)
      variable which will be bound to a "funcallable" function that is
      generated and compiled at object-creation time or defmfun runtime.
      All expected tests pass:
      SBCL 64: TOTAL: 1451 assertions passed, 5 failed, 0 execution errors.
      CCL 64:  TOTAL: 1454 assertions passed, 2 failed, 0 execution errors.
      Merge branch 'dynamic-callback'
    • Liam Healy's avatar
      Improved documentation · c54985ee
      Liam Healy authored
      Added link to "function designator" definition.
    • Liam Healy's avatar
      Clean up · ff9d0f7e
      Liam Healy authored
      Remove obsolete definitions for make-callback and move print-object to
    • Liam Healy's avatar
      Pure defmfun callbacks dynamically specified fully functional · 42e2d608
      Liam Healy authored
      Redefine the form of :callback-dynamic to be
      (dimensions (function scalarsp) ...)
      and usage in numerical-differentiation, numerical-integration, and
      monte-carlo.  Parse this variable in callbacks.lisp with #'cbd-dimensions
      and #'cbd-functions.  Fix error in wfo-declare which had gsl-function
      hardwired.  If manually defined (defconstant +success+ 0),
      all tests that pass in master also pass here:
      TOTAL: 1451 assertions passed, 5 failed, 0 execution errors.
      TOTAL: 1454 assertions passed, 2 failed, 0 execution errors.
  7. 31 Mar, 2009 1 commit
    • Liam Healy's avatar
      Pure-defmfun callbacks with funcallables · 74c8475e
      Liam Healy authored
      Both numerical-differentiation and numerical-integration have new
      :callbacks and the expansion calls new function
      #'make-compiled-funcallable which makes the funcallable at
      function-call time.  Spot tests of both work.  If a function passed to
      set-slot-function is nil, it will set the slot to null-pointer.
  8. 30 Mar, 2009 1 commit
    • Liam Healy's avatar
      ODE solver functional with funcallables · 741fd237
      Liam Healy authored
      Changed the defmobject definitions to handle a 'callback-included-cl
      object.  Changed the ODE solver definitions to take separate arguments
      for the function and Jacobian, as well as scalarsp.  Not completely
      finished, but tests
      (integrate-vanderpol 1.0d0 1.d-4 +step-rk2+ nil)
      (integrate-vanderpol 1.0d0 1.d-4 +step-rkf45+ nil)
      work correctly.
  9. 29 Mar, 2009 3 commits
    • Liam Healy's avatar
      Most mobject-based callbacks ported to funcallables · 1349c73a
      Liam Healy authored
      All mobject-based callbacks now use the funcallable mechanism, except
      ODE, which has been ported but fails to compile.  All other tests
      pass.  In the event of some or all arguments are scalars and not
      arrays, #'array-element-refs will return just the argument symbol.  To
      avoid double quoting the function name when calling the object maker,
      let bind 'function-designator in #'make-funcallable-form which does
      the quoting.
    • Liam Healy's avatar
      Added slot 'funcallables to 'callback-included · ea9a2156
      Liam Healy authored
      The callback-included objects now have a slot 'funcallables which is
      set by a function #'make-funcallables-for-object which is used by
      make-reinitialize-instance.  This required swapping the order of
      :callback-object and :before in body-expand, which shouldn't affect
      anything else.  New name #'make-funcallable-form renamed from
      #'make-funcallable to clarfiy distinction with
      #'make-funcallables-for-object.  Eliminated select-dynamic-values.
    • Liam Healy's avatar
      Incorporation of make-funcallable into callback call chain · 09ce32be
      Liam Healy authored
      The callback call chain (for mobjects at the moment) now calls
      make-funcallable when the mobject is made.  The :callbacks format is
      slightly different in that :slug is required.  The derivative-free
      minimization-multi example works, but requires a double quote on the
      function name, which should be fixed.  The runtime-called function
      #'call-maybe-scalar and its supporting definitions have been removed,
      in anticipation of all callbacks using make-funcallable.
  10. 28 Mar, 2009 1 commit
    • Liam Healy's avatar
      Complete make-funcallable · 196f0d4e
      Liam Healy authored
      The function #'make-funcallable creates a lambda form that acts as a
      bridge between the callback as passed to GSL and the user's function.
      It can be optionally compiled and is funcalled in the defmcallback
      expansion; it takes the user's function as an argument.
  11. 27 Mar, 2009 1 commit
    • Liam Healy's avatar
      Using parse-callback-fnspec and parse-callback-argspec for make-funcallable · 3cb95151
      Liam Healy authored
      Write and rewrite in terms of parse-callback-fnspec and
      The goal is to generate a lambda that wraps the user function and
      makes a funcallable function that defmcallback can call.
      Not finished, not compilable.
  12. 26 Mar, 2009 1 commit
    • Liam Healy's avatar
      Start port new spec of callback arguments, make-funcallable, ODE · c125397a
      Liam Healy authored
      New specification of callback arguments
      parse-callback-argspec takes 
        io, element-type, array-type, dimensions
      Not at all implemented anywhere in the code.
      Made file funcallable.lisp out of the old defmcallback, designed to
      create a lambda for compilation that will be funcalled by the (new)
      defmcallback body.  This still uses the old specification for function
      arguments.  Started porting ODE callbacks, but this has been suspended
      while the first two changes are being completed.  None of this works
      in any way.
  13. 23 Mar, 2009 2 commits
    • Liam Healy's avatar
      New errno code interpretation and gsl-condition definitions · d3d82a26
      Liam Healy authored
      Make a defconstant on earmuffed symbols of cffi:defcenum gsl-errorno,
      e.g. +continue+, +failure+, +success+, etc., and use those in
      define-gsl-condition forms in condition.lisp.  Remove the symbol macro
      definition of 'success.  Define a condition 'unspecified-errno in case
      an error code is processed that isn't in the list.  Redefine
      #'success-failure to true if either +success+ or +continue+, from
      In roots-multi, fixed error in multiroot-test-residual return for, and
      changed roots-multi-example-no-derivative to insure the loop is
      executed at least once so that fnval and argval are always bound
      before exiting.
    • Liam Healy's avatar
      Dynamic callbacks for nonlinear-least-squares · 26e3b36e
      Liam Healy authored
      Dynamic callbacks now operational for nonlinear-least-squares, test
      passes.  Callback struct slot name(s) and value(s) now properly set in
      pure function calls, even though this only affects Monte Carlo, which
      doesn't care whether the dimension is set or not.  The first optional
      argument to the mobject maker generated by #'mobject-maker can now
      have a default value, and the settingp will be added correctly.
  14. 22 Mar, 2009 2 commits
    • Liam Healy's avatar
      Third element of :callbacks is list of dimension names · cd435bbf
      Liam Healy authored
      Previously, the dimension-names always defaulted.  Changed all
      relevant definitions so that third element of :callbacks is a list of
      the dimension names, which must be explicitly specified.  All the
      expected tests pass on recompilation.
    • Liam Healy's avatar
      Changed arguments in defmobject · ffdf633a
      Liam Healy authored
      Variable 'initargs is no longer computed in defmobject and passed to
      mobject-maker along with cl-initialize-args from which it is computed,
      it is computed in mobject-maker.  Then 'scalarsp is added only once at
      the top of this function.  Eliminated :ci-class-slots argument.
  15. 21 Mar, 2009 3 commits
    • Liam Healy's avatar
      Dynamic callbacks for minimization-multi · 214d5642
      Liam Healy authored
      Argument 'scalarsp added at end of optional arguments to mobject
      maker; it is then passed to reinitialize-instance.  Even though it is
      not specified as an argument there, it is accepted to set the slot of
      that name.  Ported minimization-multi to dynamic callbacks; examples
      all work.  Linear least squares re-enabled in gsll.asd; no changes.
    • Liam Healy's avatar
      Use (parse-callback-static callbacks 'foreign-argument) · 43b04588
      Liam Healy authored
      Use (parse-callback-static callbacks 'foreign-argument) instead of the
      fixed symbol +callback-argument-name+, which has been removed.
      New definition for tests for numerical-differentiation and
      numerical-integration using CL function names directly.  Callback
      tests ported so far pass.
      NUMERICAL-INTEGRATION: 3 assertions passed, 0 failed.
      NUMERICAL-DIFFERENTIATION: 18 assertions passed, 0 failed.
      MONTE-CARLO: 3 assertions passed, 0 failed.
      ROOTS-ONE: 6 assertions passed, 0 failed.
      MINIMIZATION-ONE: 2 assertions passed, 0 failed.
      ROOTS-MULTI: 8 assertions passed, 0 failed.
    • Liam Healy's avatar
      Merge in master because of changes there in roots-multi etc. · c2f0f2b8
      Liam Healy authored
      Merge commit 'origin/master' into dynamic-callback.
      Since there were changes in master to solve-minimize-fit definitions
      that are being changed in dynamic-callback, it is better to get
      master pulled in now and straightened out and then make changes on top
      of that, rather than waiting until everything is merged into master.
  16. 20 Mar, 2009 4 commits
    • Liam Healy's avatar
      Make marrays make from pointer with copy · de18c122
      Liam Healy authored
      Make marrays from pointer with #'copy instead of make-marray;
      :from-pointer argument removed from #'make-marray.  Define a macro
      foreign-pointer-method that for most implementations just returns the
      form.  For CLISP however, it checks that the pointer is of type
      +foreign-pointer-type+, because in CLISP the foreign pointer class is
      T.  Export marray subclass names.
    • Liam Healy's avatar
      Fixed arguments to linear least squares functions · e4a26746
      Liam Healy authored
      In both linear-mfit-nosvd and linear-mfit-svd, the arguments
      were in the wrong order, and the there was no #'mpointer call for
      covariance.  There was a 'tolerance argument in the C arglist for
      non-svd function, which should not have been there.  Also, 'weight
      needed to be declared as an input.  This last was the cause of two
      test failures in non-native implementations.  Now
      CCL64: TOTAL: 1454 assertions passed, 2 failed, 0 execution errors.
      SBCL64:TOTAL: 1451 assertions passed, 5 failed, 0 execution errors.
    • Liam Healy's avatar
      Extend #'copy to copy to or from mpointers · efa2315f
      Liam Healy authored
      Both copy-to-array and copy-making-destination have been extended so
      that an mpointer can occur as the first or second argument.  If the
      first argument, the second argument should be a symbol representing a
      subclass of marray.  If the second argument is not present
      (copy-making-destination), 'vector-double-float is assumed.  If the
      mpointer is the second argument, the marray contents are copied into
      its contents.  These methods are useful for callbacks and GSL
      functions that send raw mpointers.  For example, a callback that uses
      foreign arrays directly can simply copy from and to them.  This has
      been applied in the solve-minimize-fit functions that return a raw
      mpointer, replacing the explicit call to make-marray.  The first
      argument to #'marray can now be either the class name or element-type.
    • Liam Healy's avatar
      Dynamic callback for roots-multi · 2153dd13
      Liam Healy authored
      Specifications of dimensions with correct depth in
      #'select-dynamic-values.  Add the set1 argument for the function in
      multi-dimensional-root-solver-f.  Fixed Jacobian for
      multi-dimensional-root-solver-fdf; it is square, there is no dim0,
      only dim1.  Added scalarsp argument to
      multi-dimensional-root-solver-fdf maker.  All roots-multi tests pass.
      ROOTS-MULTI: 8 assertions passed, 0 failed.
  17. 19 Mar, 2009 1 commit
    • Liam Healy's avatar
      Add 'scalarsp, eliminate 'callback-dynamic from callback-included · 88076763
      Liam Healy authored
      Add the slot 'scalarsp and eliminate the slot 'callback-dynamic from
      the class callback-included, and modify the defmobject uses
      accordingly.  All dynamic quantities (function, scalarsp, dimensions)
      will be set from slot values at run time.  This works for the objects
      ported so far:
       (lisp-unit:run-tests chebyshev)
       CHEBYSHEV: 1 assertions passed, 0 failed.
       (lisp-unit:run-tests roots-one)
       ROOTS-ONE: 6 assertions passed, 0 failed.
       (lisp-unit:run-tests minimization-one)
       MINIMIZATION-ONE: 2 assertions passed, 0 failed.
      Started working on roots-multi; it now compiles but does not run.
  18. 18 Mar, 2009 2 commits
    • Liam Healy's avatar
      Generalize elt-, elt/; fix docstring; export 'dim0, 'dim1 · c5e449db
      Liam Healy authored
      Add methods for #'elt- and #'elt/ that take scalars for the second
      argument.  Fix the docstring for (setf row) which had "column" instead
      of "row".  Export the symbols 'dim0 and 'dim1 because they are useful
      for users; use them in #'contents-from-pointer instead of previous
      dim1 and dim2 (et. sim. with size0, size1).
    • Liam Healy's avatar
      LU remultiplication with permutation; unify permutation functions · b7074c43
      Liam Healy authored
      The LU remultiplication tests now permute the answer at the end so
      that it ends up with the original vector with the elements in the
      original order.  The permutation functions #'permute and
      #'permute-inverse now include all arguments, including marrays and
      pointers to C arrays.  Formerely, there were separate functions
      #'permute-vector and #'permute-vector-inverse.
      SBCL64: TOTAL: 1451 assertions passed, 5 failed, 0 execution errors.
      CCL64:  TOTAL: 1452 assertions passed, 4 failed, 0 execution errors.
  19. 17 Mar, 2009 2 commits
    • Liam Healy's avatar
      Removed lisp-unit files · b5214dea
      Liam Healy authored
      Since lisp-unit with improved extensions is now a separate system at
      http://repo.or.cz/w/lisp-unit.git, the files associated with it have
      been removed from the subdirectory test-unit.  Gsll-tests is dependent
      on this system.
    • Liam Healy's avatar
      Map marrayp, roots-one and minimization-one work · 2a96cfe3
      Liam Healy authored
      The array-type as given in the callback-argspec is either :cvector or
      :marray.  The functions list-to-arrays and list-to-array expect
      argument 'marrayps or 'marrayp which are T or NIL.  That means I need
      to map the 'marrays argument in #'call-maybe-scalar which is :marray
      or :cvector to T/NIL.  Wrote function #'marrayp to do this.
      Example in one-dimensional-root-solver-fdf
      (roots-one-example-derivative +newton-fdfsolver+ nil)
      now works; in fact all roots-one tests pass:
      (lisp-unit:run-tests roots-one)
      ROOTS-ONE: 6 assertions passed, 0 failed.
      Ported minimization-one, tests pass:
      (lisp-unit:run-tests minimization-one)
      MINIMIZATION-ONE: 2 assertions passed, 0 failed.
  20. 16 Mar, 2009 3 commits
    • Liam Healy's avatar
      Merge in spun off lisp-unit system. · f434f070
      Liam Healy authored
      Merge branch 'spin-off-lisp-unit'; it is now necessary to get the
      separate system lisp-unit with floating-point comparison extensions on
      repo.or.cz in order to run gsll-tests.
    • Liam Healy's avatar
      Change tolerance for minimization-multi test · f11e6bfe
      Liam Healy authored
      Increasing the tolerance specified in lisp-unit:*epsilon* from the
      default to (* 2400 double-float-epsilon) allows the test to pass in
      SBCL64: TOTAL: 1445 assertions passed, 7 failed, 0 execution errors.
      CCL64:  TOTAL: 1446 assertions passed, 6 failed, 0 execution errors.
    • Liam Healy's avatar
      Minor fixes · 514d575c
      Liam Healy authored
      In defmethod mpointer ((object marray)) just introduced, use
      (call-next-method) instead of direct slot access.  Improve punctuation
      for error messages.