1. 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.
      741fd237
  2. 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.
      1349c73a
    • 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.
      ea9a2156
    • 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.
      09ce32be
  3. 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.
      196f0d4e
  4. 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
      parse-callback-argspec:
        make-symbol-cardinal
        reference-foreign-element
        callback-set-mvb
        make-funcallable
      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.
      3cb95151
  5. 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.
      c125397a
  6. 23 Mar, 2009 1 commit
    • 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.
      26e3b36e
  7. 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.
      cd435bbf
    • 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.
      ffdf633a
  8. 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.
      214d5642
    • 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.
      43b04588
    • 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.
      c2f0f2b8
  9. 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.
      de18c122
    • 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.
      e4a26746
    • 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.
      efa2315f
    • 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.
      2153dd13
  10. 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.
      88076763
  11. 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).
      c5e449db
    • 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.
      b7074c43
  12. 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.
      b5214dea
    • 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.
      2a96cfe3
  13. 16 Mar, 2009 4 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.
      f434f070
    • 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
      SBCL.
      SBCL64: TOTAL: 1445 assertions passed, 7 failed, 0 execution errors.
      CCL64:  TOTAL: 1446 assertions passed, 6 failed, 0 execution errors.
      f11e6bfe
    • 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.
      514d575c
    • Liam Healy's avatar
      Native: set the 'data slot in GSL structs in the #'mpointer method · 40e1bfce
      Liam Healy authored
      For native implementations (i.e., SBCL), the 'data slot of gsl-block-c
      and gsl-vector-c or gsl-matrix-c is set when mpointer is called.
      Previously, as currently for non-native implementations, it is set
      only when the marray is made.  This can fail in native implementations
      because the garbage collection can move the array around.  Therefore,
      since mpointer is only called inside a native-pointer-protect, the
      GSL structure slot is set to the current value of #'c-pointer, which
      is computed on the fly.  
      
      The test case reported by Viktor Leis for a matrix 1000x1000 which was
      generating an memory fault error now gives no error and reasonable
      output.
      40e1bfce
  14. 15 Mar, 2009 3 commits
    • Liam Healy's avatar
      Non-square matrix multiplication; marking cl-invalid · b009f3e6
      Liam Healy authored
      Fixed a problem in #'matrix-product-dimensions reported by 
      Norman Werner that prevented taking the product of non-square
      matrices, and added a test to check for the multiplication for all
      four element types supported.  This revealed a problem in non-native
      marray initialization (found in CCL) which has been fixed by marking
      foreign-arrays :cl-invalid when neither :initial-contents nor
      :initial-element have been specified.
      SBCL 64: TOTAL: 1449 assertions passed, 7 failed, 0 execution errors.
      CCL64: TOTAL: 1450 assertions passed, 6 failed, 0 execution errors.
      b009f3e6
    • Liam Healy's avatar
      Better support for array returns (prototype roots-one), ordering of load · 94bcffd5
      Liam Healy authored
      In roots-one.lisp, added arguments for dynamic callbacks.  This is not
      complete; 
       (roots-one-example-derivative +newton-fdfsolver+ nil)
      causes both SBCL and CCL to crash to low-level debuggers.
      These changes included using a new function list-to-arrays in
      call-maybe-scalar so that multiple arrays can be set. 
      New file callback-compile-defs has definitions that are needed at
      compile time of later files.  Added a call record-callbacks-for-class
      in defmobject, in addition to the expansion in the form, because the
      hash table *callbacks-for-classes* needs to be updated with the class
      being defined for the macro make-cbstruct-object to work.  Added
      comments above defmobject to explain some of the arguments.
      94bcffd5
    • 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
  15. 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
  16. 12 Mar, 2009 1 commit
    • Liam Healy's avatar
      Reduce errors due to change in lisp-unit · 83fc7bb8
      Liam Healy authored
      The new version of lisp-unit does not have a zero threshold, but
      treats an expected value of zero specially, so some answers are
      changed to zero explicitly.  Set lisp-unit:*epsilon* in an attempt to
      eliminate another new error, but it has no effect.
      83fc7bb8
  17. 11 Mar, 2009 1 commit
    • Liam Healy's avatar
      Split off lisp-unit to its own system · d8805155
      Liam Healy authored
      The unit/regression test lisp-unit has been split off into its own
      system.  This includes the extensions made to it for GSLL, as modified
      by Thomas Hermann.
      d8805155
  18. 10 Mar, 2009 1 commit
  19. 08 Mar, 2009 2 commits
    • Liam Healy's avatar
      Use tmh's lisp-unit definitions instead of old · f1dfef7b
      Liam Healy authored
      Incorporated tmh's lisp-unit definitions he posted to
      http://paste.lisp.org/display/76579 in preference to the former
      definitions in additional-definitions.lisp.  He took some of those
      ideas and incorporated them with his own.  This produces some
      mysterious errors not seen before when run on both SBCL and CCL
      (different errors for each).
      
      The plan is to spin off lisp-unit as a separate system which will just
      be loaded by gsll-tests.
      f1dfef7b
    • 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
  20. 06 Mar, 2009 1 commit
  21. 04 Mar, 2009 1 commit
  22. 02 Mar, 2009 2 commits
    • Liam Healy's avatar
      Bessel function consolidation and rename · 0daffee9
      Liam Healy authored
      Integer and fractional order Bessel functions renamed to be methods of
      the same generic function (for J and Y).  Name the array function
      analogously (-x, -order) so it is clear what is changing.  Fix
      docstring phrasing for Hankel.
      0daffee9
    • 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