1. 13 Jan, 2012 1 commit
  2. 30 Oct, 2011 1 commit
  3. 17 Aug, 2011 1 commit
  4. 26 May, 2011 1 commit
  5. 10 Jan, 2011 1 commit
  6. 13 Jul, 2010 1 commit
    • Liam M. Healy's avatar
      Arrays passed to and received from callbacks are foreign-arrays · 13703fa9
      Liam M. Healy authored
      Using the new function faify-form, pointers passed by GSL to callbacks
      are converted to foreign-array objects if scalarsp is nil.  This has
      been tested on multidimensional minimization only so far, and works.
      Note that this is potentially inefficient, as each time the callback
      is called, new objects are made and in the callback itself any grefs
      involve a generic function dispatch.  However, it is easier to write
      the callback than dealing with the raw pointer.
      13703fa9
  7. 01 Jul, 2010 1 commit
  8. 30 Jun, 2010 1 commit
  9. 27 Jun, 2010 1 commit
    • Liam Healy's avatar
      New function #'make-foreign-array-from-gsl-pointer untested · 78b25a17
      Liam Healy authored
      New function #'make-foreign-array-from-gsl-pointer allows construction
      of a foreign-array with the appropriate metadata when given the
      mpointer.  It has not been tested.  Its main use will be in GSL
      routines that create their own GSL vector (or matrix); previously
      those were copied from the pointer, now they are just wrapped with the
      appropriate GSLL object.  File renamed to "foreign-array.lisp" from
      "marray.lisp".
      78b25a17
  10. 27 Dec, 2009 1 commit
  11. 10 Jun, 2009 1 commit
    • Liam Healy's avatar
      Fix multidimensional minimization with scalarsp · a2ba427b
      Liam Healy authored
      In the definition of multi-dimensional-minimizer-fdf, the dimensions
      of the :output for df and fdf have been corrected by removing an extra
      dim0.  The parabaloid example has been implemented using scalars, and
      the results match that of the vector form.  A test has been added for
      the scalar form.
      a2ba427b
  12. 06 Jun, 2009 1 commit
    • Liam Healy's avatar
      Define C structures using CFFI-grovel · 8c0e6eb7
      Liam Healy authored
      Almost all GSL structures are now defined using CFFI-grovel, which
      makes the code more robust should there be changes in GSL.  The
      exceptions are complex-float-c, complex-double-c, and
      simulated-annealing-parameters; because these structures are used by
      value, they need to be defined with fsbv:defcstruct at the present.
      8c0e6eb7
  13. 05 Apr, 2009 1 commit
    • 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.
      eb1420b4
  14. 29 Mar, 2009 1 commit
    • 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
  15. 23 Mar, 2009 1 commit
    • 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
      non-negative.  
      
      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.
      d3d82a26
  16. 22 Mar, 2009 1 commit
    • 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
  17. 21 Mar, 2009 2 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
  18. 20 Mar, 2009 2 commits
    • 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
  19. 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
  20. 16 Feb, 2009 1 commit
  21. 09 Feb, 2009 1 commit
    • Liam Healy's avatar
      New macro #'def-make-callbacks · 6b35d063
      Liam Healy authored
      New macro #'def-make-callbacks will expand to the appropriate
      defmethod for make-callback-fn, so that the defmcallbacks are defined
      appropriately.
      6b35d063
  22. 07 Feb, 2009 3 commits
    • Liam Healy's avatar
      Define callbacks with #'make-callbacks form at top level · 866e84bd
      Liam Healy authored
      Defined a new macro #'make-callbacks that is invoked at top level.  It
      is given the mobject class name, the function name(s), dimension(s)
      and whether it should assume scalar input/output.  It will define the
      appropriate callbacks for use in the mobject.  This eliminates the
      need for defun* and should work with all CL implementations.  Tested
      on both roots-multi only.
      866e84bd
    • Liam Healy's avatar
      Use new 'callback-included classes for all roots-multi · 5079794d
      Liam Healy authored
      Converted roots solver using the derivative to the new class
      definition based on 'callback-included.  Now example
      #'roots-multi-example-derivative works.  Removed unneeded
      definitions.
      5079794d
    • Liam Healy's avatar
      Class 'callback-included has slots with struct information · 42e73fd8
      Liam Healy authored
      The class 'callback-included has the following slots:
      cbstruct-name, array-type, callback-labels, functions, dimensions;
      the first three will be :allocation :class in all subclasses.
      This has been implemented and tested with the 
      'multi-dimensional-root-solver-f object in roots-multi.lisp.  The
      example #'roots-multi-example-no-derivative works.
      42e73fd8
  23. 04 Feb, 2009 1 commit
    • Liam Healy's avatar
      Hacked changes define cbstruct in mobject maker · 0dbbb5e4
      Liam Healy authored
      Have the mobject maker build the cbstruct.  This is now hacked in and
      works with roots-multi in #'roots-multi-example-no-derivative, but
      with #'make-multi-dimensional-root-solver-f having a hardwired
      dimension of 2.  No clear way to communicate the dimension(s) from the
      other part of the defmobject form.  Started to think/write a subclass
      'callback-included of 'mobject, but this may be overkill as all
      variables except 'dimensions are exclusive to the cbstruct maker
      itself so don't really need to be class slots.
      0dbbb5e4
  24. 02 Feb, 2009 1 commit
    • Liam Healy's avatar
      Split up definition of defmobject, add definition of defun* · 7b9eb8c5
      Liam Healy authored
      The definition of defmobject has become too large so the parts that
      are responsible for construction of the various functions are broken
      out as functions:
        make-initialize-instance
        make-reinitialize-instance
        mobject-maker
      
      The definition of callbacks for GSL will be changed so that the
      callback function (defmcallback) is defined at the time the function
      is defined, and the callback GSL structure is made (defcbstruct) at
      the time the corresponding defmobject is made, along with a freeing
      function to add to the finalizers.  (For callbacks used in functions
      without mobjects, the struct will be allocated before and then freed
      after the call.)  As a first step toward this organization, defun* is
      defined to handle in one form the definition of a CL function and of a
      callback.
      7b9eb8c5
  25. 27 Jan, 2009 1 commit
    • Liam Healy's avatar
      Non-native and :callback-toplevel-only fixes · 86da4ec7
      Liam Healy authored
      Fixed several bugs that affected non-native implementations, where
      :inputs, :outputs, or both were not properly declared.  According to
      the CFFI manual, "Portability note: defcallback will not work
      correctly on some Lisps if it's not a top-level form." Evidently, this
      includes Clozure CL, so a new symbol :callback-toplevel-only has been
      pushed onto *features* if openmcl.  This changes examples with
      callbacks to define the callbacks in a separate defparameter rather
      than in-line when the mobject is made of the function is called.  As a
      result of both these changes, the only errors left in CCL tests were
      ones seen previously.  
      CCL 64: TOTAL: 1259 assertions passed, 3 failed, 0 execution errors.
      SBCL 64: TOTAL: 1257 assertions passed, 5 failed, 0 execution errors.
      86da4ec7
  26. 25 Jan, 2009 2 commits
    • Liam Healy's avatar
      Keyword arguments to defmobject · cd6a85f8
      Liam Healy authored
      Change optional arguments to defmobject to keyword arguments, and add
      :gsl-version argument that will create the maker function to signal an
      error if the installed version of GSL is too old.
      cd6a85f8
    • Liam Healy's avatar
      Use lambda forms in callbacks · b134ed94
      Liam Healy authored
      It is possible to use lambda forms as well as function names in
      callback definers; this is demonstrated in the Monte Carlo example.
      Eliminated make-mfunction and folded its functionality into
      make-solver-functions.  Added a section to the documentation to
      explain how function definitions work.
      b134ed94
  27. 24 Jan, 2009 2 commits
    • Liam Healy's avatar
      Define callbacks by returning the struct pointer, without setting specials · f0c7ecec
      Liam Healy authored
      Macro defcbstruct and all the macros built on it now simply return the
      C struct needed by GSL functions instead of binding a special whose
      name is then passed to the GSL functions.  Specials can still be used
      of course in the standard way like defparameter, but the results can
      also be bound locally with a let or passed in directly.  The name of a
      callback passed to defmcallback and to defcbstruct in all the macros
      that expand both is now gensymmed (since it is used only long enough
      to put in a slot of the cbstruct) instead of taken to be the name of
      the CL function, in order to make clear the different objects.
      Unfortunately, there is appears to be a bug in CFFI using defcallback
      with an uninterned symbol in CCL, so I have put a workaround in.
      However, there is still another error even with this workaround.
      Thus test results are:
      SBCL 64: TOTAL: 1248 assertions passed, 5 failed, 0 execution errors.
      CCL 64: TOTAL: 1229 assertions passed, 2 failed, 6 execution errors.
      f0c7ecec
    • Liam Healy's avatar
      Relocate definition, optional arguments, nonlinear least squares streamline · 42cf5a7b
      Liam Healy authored
      Moved gsl-mfunction, def-mfunction, and gsl-mfunction-fdf from
      roots-multi.lisp to generic.lisp because they are common to several
      files in the solve-minimize-fit module.  Made arguments default
      instead of required in #'linear-mfit, linear-mfit-svd,
      weighted-linear-mfit, weighted-linear-mfit-svd.  Most of these do not
      have examples, so untested.  This required new functions
      #'default-covariance, #'default-lls-workspace.  Renamed examples to
      #'linear-least-squares-univariate-example and
      #'linear-least-squares-multivariate-example, and changed to
      'print-details.  Revised definitions in nonlinear least squares to
      streamline data flow; there is no setup function or global
      pre-declaration of the number of parameters or observations required
      anymore.  The example function now called
      nonlinear-least-squares-example will take the number of observations
      and the fitter method as optional arguments.
      42cf5a7b
  28. 23 Jan, 2009 1 commit
    • Liam Healy's avatar
      Minimization will take scalar functions, added tests, optional printing · 78b88074
      Liam Healy authored
      The minimization functions may now take and return scalars or marrays.
      The examples take optional arguments with the solver method and
      whether to print the steps.  They are now part of the #'examples and
      test suite.  Use maref instead of cl-array in
      #'roots-multi-example-no-derivative.  Add optional solver method to
      roots one and roots multi, and add tests for all solvers.
      78b88074
  29. 22 Jan, 2009 1 commit
  30. 19 Jan, 2009 1 commit
    • Liam Healy's avatar
      More callbacks take and return scalars · f15ffdda
      Liam Healy authored
      More usage of callbacks using or computing multiple quantities
      now do so on scalars because the macros in GSLL pull out the
      individual elements of foreign arrays, and accept multiple values and
      put them into the right foreign arrays.  In roots-multi,
      #'multiroot-slot takes a mobject and extracts the mpointer before
      calling the foreign slot value.  Several examples in
      solve-minimize-fit now have optional 'print-steps argument.  These
      examples are now the basis for additional tests.
      f15ffdda
  31. 03 Jan, 2009 1 commit
    • Liam Healy's avatar
      Generic functions for solve-minimize-fit · f6c5e260
      Liam Healy authored
      Introduced in generic.lisp the generic functions iterate, solution,
      function-value, last-step.  These replace regular functions with
      solver-specific names.
      f6c5e260
  32. 30 Dec, 2008 1 commit
    • Liam Healy's avatar
      Define duplicate functions with defun · 8a8148f8
      Liam Healy authored
      The duplicate example functions for solving and minimizing are defined
      with defun now instead of setf fdefinition in the hopes of minimizing
      warnings and messages from some compilers.  Eliminated obsolete
      comments.
      8a8148f8
  33. 29 Dec, 2008 1 commit
    • Liam Healy's avatar
      GSL arrays created by GSL functions · 38ddfa1a
      Liam Healy authored
      Made the generic function #'contents-from-pointer that takes a pointer
      to a GSL struct and produces a list of the contents suitable for the
      :initial-contents argument to #'make-marray.  Added an argument
      :from-pointer to #'make-marray that then creates a new marray with the
      same contents.  Some functions in solve-minimize-fit return a pointer
      to a GSL vector with double-floats.  Copying in this way is necessary
      because GSL has malloced the data in a non-CL place.  Sometimes, this
      results in the copying of data whose only further use will be to
      extract a pointer to pass to another GSL function.  Added a method
      to #'mpointer that permits directly passing a pointer, but this isn't
      useful for arrays because there are many element types so the
      functions have been defined as methods.
      38ddfa1a
  34. 27 Dec, 2008 1 commit
    • Liam Healy's avatar
      Set mpointer vlaue, show relevant .h file; non-int return for reinitialize-instance · 8a0ac730
      Liam Healy authored
      In defmobject, set the mpointer value if #'allocate is being called.
      For each file that defines a defmobject, I put a comment at the top
      showing the relevant GSL header file.  For generators and quasi, the
      (re)initializing function returns void and not an :int, so that is
      changed in the defmobject definition, which now permits a list of two
      elements in initialize-suffix, with the second element indicating the
      :c-return.
      8a0ac730