Skip to content
Snippets Groups Projects
  1. Jan 25, 2009
    • 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
  2. Jan 24, 2009
    • 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
  3. Jan 23, 2009
    • 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
  4. Jan 22, 2009
  5. Jan 21, 2009
  6. Jan 20, 2009
    • 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
  7. Jan 19, 2009
    • 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
  8. Jan 16, 2009
    • 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
  9. Jan 15, 2009
    • 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
  10. Jan 13, 2009
    • 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
  11. Jan 12, 2009
    • 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
  12. Jan 11, 2009
    • 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
  13. Jan 09, 2009
    • 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
  14. Jan 08, 2009
    • 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
  15. Jan 07, 2009
    • 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
  16. Jan 06, 2009
    • Liam Healy's avatar
      Optional argument defaults as GSL objects · 164cc82c
      Liam Healy authored
      Optional arguments may be specified easily as functions creating GSL
      objects, keying off the element type of the required arguments.  For
      example, the arglist
      ((matrix matrix) i
           &optional (vector :make-marray vector (dim0 matrix)))
      means that if vector is not specified, it will make a vector whose 
      element type is the same as matrix, and whose length is the number of
      rows of matrix.  This is used to proved default arguments for a number
      of functions, including the workspace argument for eigenspaces.  Some
      arguments that were required before are now optional and therefore
      placed after the required arguments.  Renamed to matrix-transpose from
      matrix-transpose-copy, and the the in-place transpose renamed to
      matrix-transpose* from matrix-transpose.  Tests on 64 bit:
      SBCL: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      CCL: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      164cc82c
  17. Jan 05, 2009
    • Liam Healy's avatar
      Default arguments for eigensystems · d0ba4920
      Liam Healy authored
      By default, create the appropriate output vectors and matrices, as
      well as the workspace, for the eigenvalue and eigenvector functions.
      d0ba4920
  18. Jan 04, 2009
    • Liam Healy's avatar
      Conditionalize with #+(and native sbcl) · 52686768
      Liam Healy authored
      Changed conditionals from #+sbcl to #+(and native sbcl) to allow for
      the easy recompilation under SBCL as non-native by commenting out the
      pushnew in init.lisp.
      52686768
    • Liam Healy's avatar
      Elementwise array operations named "elt" · 4bfa337d
      Liam Healy authored
      GSL functions that operate from one corresponding array elements and
      then overwrite the first array, as well as those that operate on each
      element of an array with a scalar, are now named starting with "elt",
      as in "elt+"; formerely they started with "m".  This is to reinforce
      the idea that they are not generally a mathematical solution to
      algebraic problems, just elementwise operations.  The scalar
      operations (addition, multiplication) are methods of elt+ and elt* as
      well. Test results 64 bit:
      SBCL: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      CCL: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      4bfa337d
    • Liam Healy's avatar
      Generic functions for array addition, multiplication with scalar · 2747131e
      Liam Healy authored
      Eliminated the functions #'m+c, #'m*c, turning them into methods of
      #'m+ and #'m*, with the scalar permitted to appear either first or
      second.  New functions #'e*, #'e/ renamed from #'m*, #'m/ to emphasize
      it is elementwise multiplication and division, leaving room for a
      matrix multiplication function #'m* at some point in the future.
      It is now possible to defmfun :definition :methods with 'both as the
      specified category.  Test results 64 bit:
      SBCL: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      CCL: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      2747131e
  19. Jan 03, 2009
    • 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
    • Liam Healy's avatar
      New #'optional-args-to-switch-gsl-functions used by defmfun · d0b63022
      Liam Healy authored
      Instead of relying on repeated and varying checks using llkp, the new
      function #'optional-args-to-switch-gsl-functions provides a uniform
      test for determining when presence/absence of optional arguments in
      the defmfun form require a switch between different GSL functions.
      All the same test results in 64-bit CCL and SBCL.
      d0b63022
  20. Jan 02, 2009
    • Liam Healy's avatar
      Documentation current · 262e486e
      Liam Healy authored
      Rewrote the documentation to reflect the current state of the
      software, as a single HTML file index.html, and used a new css style
      cribbed from iterate.  There are two text files added: status.text
      that is a summary of test pass/fail on various implementations and
      platforms, and missing-features.text that documents features of GSL
      that aren't included.
      262e486e
  21. Jan 01, 2009
    • Liam Healy's avatar
      No 64 bit integers on 32 bit platforms · c057c7f3
      Liam Healy authored
      Both CLISP and SBCL fail when making arrays of 64 bit integers,
      despite cffi-features:no-long-long being absent for either.
      Therefore, conditionalize away these types in *array-element-types* on
      32 bit platforms in general, and conditionalize away all the 64 bit
      tests as well.  Separated out integer size check into types.lisp.
      Restored tests vector-min and vector-max which fail in SBCL for
      (signed-integer 8) and (signed-integer 16) for unknown reasons. 
      Test results:
      64 bit SBCL:   TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
      64 bit CCL:    TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
      32 bit SBCL:   TOTAL: 1069 assertions passed, 31 failed, 0 execution errors.
      32 bit CLISP:  TOTAL: 1051 assertions passed, 27 failed, 5 execution errors.
      c057c7f3
  22. Dec 31, 2008
    • Liam Healy's avatar
      Fully functional on CCL · 26ad3502
      Liam Healy authored
      After exiting the foreign call, defmfun now inserts a form to set
      C-invalid to nil for outputs, as well as CL-invalid to T.
      Conditionalize the definition of native-pointer to native, because
      it's only used on native implementations and its definition in CCL was
      causing a spurious warning.  Removed defmfun expansion examples
      because there are plenty of examples available now.  From scratch,
      gsll and gsll-tests compiles and runs cleanly on CCL with no warnings
      or errors, and all 1208 tests pass.
      26ad3502
    • Liam Healy's avatar
      Redesign polynomial-solve, invert matrix · 4f581352
      Liam Healy authored
      The function #'polynomial-solve is now directly defined with defmfun
      with a single required argument and two optional arguments: the answer
      vector-complex-double-float and the workspace, both of which default
      to the right thing.  The returned is now the this marray instead of a
      list.  Simplify the definition of #'invert-matrix and return the
      matrix-double-float instead of the CL array.  All tests pass SBCL and
      CCL with trace.
      4f581352
    • Liam Healy's avatar
      Specify :inputs and :outputs; CCL works · 54353bcb
      Liam Healy authored
      More :inputs and :outputs specified.  CCL now passes all 1208 tests if
      certain functions are traced (bug in CCL?)
      (trace polynomial-eval-divided-difference swap-elements
             permutation-reverse lu-invert permutation-next)
      54353bcb
  23. Dec 30, 2008
    • 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
    • Liam Healy's avatar
      Specify :inputs and :outputs; more tests pass on non-native · 03e76278
      Liam Healy authored
      Several functions had incorrect :inputs and/or :outputs, which caused
      them to fail on non-native implementations.  BLAS2 and BLAS3 tests did
      not properly initialize all arrays.  Now 1187 tests pass in CCL.
      03e76278
  24. Dec 29, 2008
    • Liam Healy's avatar
      Better support for non-native implementations · c01366d6
      Liam Healy authored
      Testing with Clozure reveals more details on the stack overflow
      problem than what CLISP reveals.  This is fixed by using #'slot-value
      instead of #'cl-array in  #'copy-c-to-cl and #'copy-cl-to-c.
      Non-complex arrays were not handled correctly in
      #'copy-array-from-pointer; fixed.  There is a dependency of
      permutation and combination on the definition of #'data-class-name
      through defmfun.  Test results:
      CCL: TOTAL: 1143 assertions passed, 52 failed, 3 execution errors.
      CLISP: TOTAL: 996 assertions passed, 149 failed, 11 execution errors.
      SBCL: TOTAL: 1208 assertions passed, 0 failed, 0 execution errors.
      (But only the second time it's run in SLIME.)
      Variable *print-contents* to disable printing of marray contents in
      print-object; this is helpful for debugging.
      c01366d6
Loading