1. 09 Feb, 2009 2 commits
  2. 08 Feb, 2009 2 commits
    • Liam Healy's avatar
      One-dimensional root solver ported to callbacks-included · b44593b7
      Liam Healy authored
      The one-dimensional root solvers in roots-one.lisp now works in the
      callbacks-included object, including both examples, with and without
      derivatives.  The no-derivative case has been modified to
      automatically listify the function name given.  For callbacks-included
      classes that do not define 'dimensions (because they are
      one-dimensional), there is a new macro def-ci-subclass-1d that makes
      'dimensions slot a class slot with '(1).  Defined a print-object
      method for callbacks-included classes.
      b44593b7
    • Liam Healy's avatar
      Build 'one-dimensional-root-solver-f on 'callbacks-included · 19dbbe90
      Liam Healy authored
      Now define one-dimensional-root-solver-f on 'callbacks-included.  This
      needs some modification to mobject to add the 'functions slot argument
      and remove 'dimensions from the cbstruct when it is not in the
      allocation arguments.  The :functions argument must be given as a
      list, even though there's only one function.  The example
      (roots-one-example-no-derivative) works.
      19dbbe90
  3. 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
  4. 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
  5. 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
  6. 01 Feb, 2009 1 commit
    • Liam Healy's avatar
      Polynomial uses #'evaluate · cbcc15dd
      Liam Healy authored
      Polynomial evaluation is now done with a method of #'evaluate.  We
      can't do complex evaluation because the return value would be complex,
      and there is no way to handle that in CFFI yet.  Evaluation with
      divided differences is a keyword switched part of the same method; it
      works but gives an puzzling style warning in SBCL about the keyword.
      The use of an marray in an optional/key argument necessitated a change
      to defmfun that redefined #'body-expand from #'body-no-optional-arg,
      made #'body-no-optional-arg a new function that wraps necessary
      array-handling forms around the expanded unswitched body form from
      body-expand.
      cbcc15dd
  7. 29 Jan, 2009 1 commit
    • Liam Healy's avatar
      Generic functions, fix interpolation · 04f30601
      Liam Healy authored
      Turned many functions, particularly those having to do with
      interpolation, into generic functions and methods, and thus renamed
      them and changed their arglists.  Added test for basis spline; it
      works in SBCL but does not in CCL.
      04f30601
  8. 27 Jan, 2009 2 commits
    • Liam Healy's avatar
      Interpolation fixes · 078abffa
      Liam Healy authored
      Placed missing #'mpointer calls, added :input declarations in
      defmfuns.  Fixed #'spline-example to work correctly with marrays, and
      added a test.
      078abffa
    • 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
  9. 26 Jan, 2009 1 commit
    • Liam Healy's avatar
      New macro with-ode-integration, new ODE tests · b6d90200
      Liam Healy authored
      The macro with-ode-integration has been significantly altered, using
      marrays and symbol macros to make integration forms easier.  There are
      now 10 ode tests, one for each of the supplied steppers.
      b6d90200
  10. 25 Jan, 2009 3 commits
    • Liam Healy's avatar
      ODE control objects · 4e83fcc4
      Liam Healy authored
      ODE control is now done with GSL objects, including a superclass
      'ode-control.
      4e83fcc4
    • 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
  11. 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
  12. 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
  13. 22 Jan, 2009 1 commit
  14. 21 Jan, 2009 1 commit
  15. 20 Jan, 2009 1 commit
    • Liam Healy's avatar
      Least squares added to tests, make arguments optional · f755beaf
      Liam Healy authored
      Coverted required args to optional args defmfun weighted-linear-mfit
      and replaced 'parameters with 'parameters-or-size.  Added print-steps
      options for several more examples, and put the newline at the end of
      the format string.  Added tests; CCL 64 bit now fails one of the
      linear least squares (returns zeros) and the nonlinear least squares
      (good to 6 or so significant figures).
      SBCL 64: TOTAL: 1231 assertions passed, 5 failed, 0 execution errors.
      CCL 64: TOTAL: 1234 assertions passed, 2 failed, 0 execution errors.
      f755beaf
  16. 19 Jan, 2009 2 commits
    • 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
    • Liam Healy's avatar
      Redefine defmcallback to provide and accept scalars from CL functions · c83788ed
      Liam Healy authored
      New definition for defmcallback will now convert C array pointers
      passed to the function by GSL into individual scalar arguments of the
      CL function, and will take multiple value returns and assign as
      elements of the return C arrays.  Applied to def-ode-functions and the
      van der Pol oscillator example.  Redefined #'maref-function-picker as
      a macro from a function, eliminating the need for an eval-when form.
      c83788ed
  17. 16 Jan, 2009 2 commits
    • Liam Healy's avatar
      Remove cl-utilities dependence · 1b22bb29
      Liam Healy authored
      GSLL is no longer dependent on cl-utilities, so remove it.  Generic
      function #'name needs to be loaded before the obsolete-gsl-version
      condition is defined, otherwise CLISP complains.  Conditionalize away
      a couple more 64 bit tests that were overlooked.
      1b22bb29
    • Liam Healy's avatar
      New directory "calculus" and small changes · 65a33d3e
      Liam Healy authored
      New directory "calculus" to hold numerical-differentiation,
      numerical-integeration, and monte-carlo.  Converted some return array
      arguments in BLAS to optional arguments.  Define a condition
      'obsolete-gsl-version to use in #'complete-definition.  Try to
      incorporate cygwin into init.lisp; needs testing by a cygwin user.
      65a33d3e
  18. 15 Jan, 2009 2 commits
    • Liam Healy's avatar
      Directory "mathematical" · b484c1d1
      Liam Healy authored
      New directory "mathematical" has complex.lisp and mathematical.lisp;
      fix complex function log-modulus.
      b484c1d1
    • Liam Healy's avatar
      Pass complex scalars to GSL functions · 4647599b
      Liam Healy authored
      By sending the two parts of a complex as separate doubles (complex
      double-float), or packing the two parts into a one double-float
      argument (complex single-float), it is possible to pass complex
      numbers in GSL function calls.  This is very likely to be
      non-portable, so a test is conducted and the results
      in *pass-complex-scalar-as-two-reals* determine whether defmfun does
      this translation or just creates a function that signals an error.
      The complex tests have been modified so that no longer expect an
      error:
      SBCL 64: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      CCL 64: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      This also works in 32 bit SBCL.
      4647599b
  19. 13 Jan, 2009 1 commit
    • Liam Healy's avatar
      Eliminated style warnings in SBCL · d8fd822a
      Liam Healy authored
      Removed declaration of 'indexed-functions as ignorable in
      #'with-defmfun-key-args, which now lets SBCL compile with no warnings
      of any kind.  Superficial attempt at modernizing simulated-annealing
      so that it compiles, but it still fails.
      d8fd822a
  20. 12 Jan, 2009 2 commits
    • Liam Healy's avatar
      Small fixes · ef3e446f
      Liam Healy authored
      Combination #'copy-to-destination had permutation instead of
      combination.  Only :compile-toplevel in eval-when for
      maref-function-picker to prevent warning messages.  Non-symmetric
      eigenvalues-eiegenvectors-nonsymm now return both eigenvalues and
      eigenvectors; this function evidently doesn't support
      set-parameters-nonsymmetric so that has been removed.
      ef3e446f
    • Liam Healy's avatar
      Redefine #'copy · 419e70d4
      Liam Healy authored
      Redefine #'copy so that it has one required argument (source) and one
      optional argument (destination).  For marrays, create a destination
      using make-marray, if one was not given, and then use the memcpy
      functions to fill the values.  For all other mobjects, copy will copy
      objects by calling one of two generic functions, #'copy-to-destination
      and #'copy-making-destination, depending on whether a destination was
      supplied.  The former is defined if a GSL _memcpy function exists.
      The latter will look for a GSL _clone function, then make a CL
      instance with the pointer returned as mpointer.  If there is no clone
      function, it will attempt to make a new object using make-load-form,
      so will fail if that method has not been defined.
      
      Added a check to defmfun that signals an error if a variable is used
      in the C arguments other than top-level that is not used in the CL
      arglist.  This should not happen and is usually an indication of a
      typo.
      419e70d4
  21. 11 Jan, 2009 3 commits
    • Liam Healy's avatar
      Rename #'validp from #'data-valid · 7eadb203
      Liam Healy authored
      For permutations and combinations, rename #'validp from #'data-valid
      and return :success-failure rather than :boolean.  In fact, it returns
      T or an error due to the design of the GSL functions; not clear if
      this is wanted on the GSL designers' part.  Passes SBCL 64 test.
      7eadb203
    • Liam Healy's avatar
      Non-symmetric eigensystems, array outputs for special functions · 12c2be7e
      Liam Healy authored
      Added some functions introduced in GSL 1.9 to solve eigenvectors and
      eigenvalues for non-symmetric matrices.  These are untested as yet.
      Changed array output for special functions to be optional arguments
      which can take a size (integer) and create a marray of the right
      size.
      12c2be7e
    • Liam Healy's avatar
      Use &aux definitions in defmfun; clean up foreign-friendly definitions · 0b69f21e
      Liam Healy authored
      Add &aux to defmfuns to that e.g. array arguments can optionally take
      a size and make an array (bessel.lisp).  Remove several unused
      definitions in foreign-friendly held over from ffa.
      SBCL 64: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      CCL 64: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      0b69f21e
  22. 09 Jan, 2009 2 commits
    • Liam Healy's avatar
      Improved documentation index.html · 56161207
      Liam Healy authored
      Improved overview documentation index.html with hyperlinks to the text
      files and a better description of the status of GSLL.
      56161207
    • Liam Healy's avatar
      Default optional/key argument values for arrays · 46260bed
      Liam Healy authored
      When used as the default optional/key argument values for arrays, the
      value symbol 'element-type is replaced with the actual element type
      for the method.  This replaces the :make-marray form.  When used as
      the default optional/key argument values for arrays, the form
      (eltcase element-type form element-type form ...)
      will be replaced by the appropriate form.  This replaces the direct
      appending of the (element-type form element-type form) list.
      SBCL same tests pass.
      46260bed
  23. 08 Jan, 2009 2 commits
    • Liam Healy's avatar
      Minor fixes; documentation update · 79a0f72c
      Liam Healy authored
      LU-decomposition now returns signum as a second value.  Remove unused
      *sizet-type*.  Update index.html with clbuild installation procedure
      provided by Glen Henshaw and how to run the tests.
      79a0f72c
    • Liam Healy's avatar
      Split defmfun.lisp; modify index.html · d2018a78
      Liam Healy authored
      Split out defmfun into three files because it was getting unwieldy.
      Small rearrangement of documentation with an update to adsf
      instructions.  64 bit tests results as before.
      d2018a78
  24. 07 Jan, 2009 1 commit
    • Liam Healy's avatar
      Add :gsl-version and :before options to defmfun · 61b839e8
      Liam Healy authored
      The option :gsl-version will allow specification of when the function
      was introduced into GSL.  If the current version preceeds that
      version, the defmfun compiles into an error signal.  The :before
      option allows the placement of code to execute prior to calling the
      foreign function.
      61b839e8