1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
    • 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.
    • 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
  7. 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.
    • 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
       (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.
    • 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.
  8. 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
    • Liam Healy's avatar
      New functions to parse :callbacks argument · b07e9299
      Liam Healy authored
      New functions 
      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.
  9. 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.
  10. 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.
  11. 10 Mar, 2009 1 commit
  12. 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.
    • 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.
  13. 06 Mar, 2009 1 commit
  14. 04 Mar, 2009 1 commit
  15. 02 Mar, 2009 3 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.
    • 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.
    • 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.
  16. 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.
  17. 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.
  18. 27 Feb, 2009 1 commit
  19. 26 Feb, 2009 2 commits
  20. 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.
  21. 24 Feb, 2009 3 commits
    • Liam Healy's avatar
      Export mobject names · 49da8c43
      Liam Healy authored
      In the defmobject macro, export the mobject names.
    • 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.
    • 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