- 08 Dec, 2009 1 commit
-
-
Liam Healy authored
Eventually, the definitions used for dealing with types and foreign arrays that aren't specific to GSL will be split off into another system, so that it will be easier to build other foreign library interfaces using these definitions. As a start, the grid/ directory defines a package 'c-array and some of the type definitions formerly in init/. Everything compiles and tests as before, on SBCL TOTAL: 1627 assertions passed, 6 failed, 0 execution errors.
-
- 06 Jun, 2009 1 commit
-
-
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.
-
- 05 Jun, 2009 2 commits
-
-
Liam Healy authored
The row separator symbol in #m, '^, is now exported. Since cl-utilities is now required for the macro reader, we might as well use it in iterate.lisp for the names in the defmacro-driver clauses.
-
Liam Healy authored
The reader macro #m now evaluates its arguments, so creating a vector with e.g. #m(pi (sqrt 3) (cos (/ pi 4))) is now possible. Matrices are specified by using ^ in the list to separate rows. GSLL now requires cl-utilities once again.
-
- 25 May, 2009 1 commit
-
-
Liam Healy authored
Use #'size instead of #'total-size for marrays.
-
- 20 Mar, 2009 2 commits
-
-
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 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.
-
- 16 Mar, 2009 2 commits
-
-
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 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.
-
- 11 Feb, 2009 1 commit
-
-
Liam Healy authored
In #'make-marray, :cl-array argument will build that marray out of a CL array. This CL array should have been generated with #'make-ffa; this symbol 'make-ffa is now exported for users.
-
- 29 Dec, 2008 1 commit
-
-
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.
-
- 28 Dec, 2008 2 commits
-
-
Liam Healy authored
Split off the class definition for foreign-array into its own file along with applicable definitions. Make permutations and combinations direct subclasses of both foreign-array and marray, but not subclasses of vectors. All these classes now have initialize-instance :after methods that allocate and set the pointers and finalizers. All tests pass.
-
Liam Healy authored
Fixed several errors that only were present for #-native implementations (i.e. not SBCL). It is not yet complete for non-native arrays. It now compiles completely in CLISP but crashes immediately with a SIGSEGV on amd64 platforms. This is apparently due to this bug: http://sourceforge.net/tracker/?func=detail&atid=101355&aid=2292928&group_id=1355
-
- 26 Dec, 2008 2 commits
-
-
Liam Healy authored
All GSL objects are full CL objects with garbage collection. There is no need to manually free the associated memory. All objects may be assigned in the normal CL way, e.g. let, so there is not #'letm macro anymore. Everything compiles cleanly in gsll, but nothing has been tested.
-
Liam Healy authored
New class foreign-array represents foreign (C) arrays, without GSL or mobject superclass. New class name 'marray was 'gsl-data, representing arrays in GSL. These objects are made by #'make-marray, formerely #'make-array*. New file names: init/mobject.lisp was init/gsl-objects.lisp and data/marray.lisp was data/data.lisp.
-
- 25 Dec, 2008 1 commit
-
-
Liam Healy authored
Defined make-load-form method for data. For histogram and random number generators, old code has been removed. Nothing has been compiled.
-
- 22 Dec, 2008 1 commit
-
-
Liam Healy authored
Redefine 'mobject from 'gsl-object. The class 'gsl-data in data.lisp is now a subclass of it, and does not explicitly have the mpointer slot, because mobject does. Adapted #'defmobject to work with objects that have no "setter" (initialization). This expands correctly for basis-splines (no setter) and hankel (setter). The basis-splines defintions rely on the new mobjects.
-
- 07 Dec, 2008 2 commits
-
-
Liam Healy authored
Define and call copy-cl-to-c and copy-c-to-cl only for non-native implementations; they include checks of the flags c-invalid and cl-invalid. Make sure synchronization is called at the right points. Make sure that flags are set at the right points and cleared after a copy. Not tested yet. Any per-function problems are likely from incorrect listing of inputs and/or outputs.
-
Liam Healy authored
Instead of making the ffa in make-array*, we now make it in the initialize-instance :after method for gsl-data. This means that subclasses (permutations, combinations) will automatically make the arrays. Rewrote make-array* so that it is just a wrapper for make-instance, computing the dimensions from the specified initial parameters. Permutations and combinations are now made with make-* functions.
-
- 06 Dec, 2008 1 commit
-
-
Liam Healy authored
The letm expansion definitions for arrays, permutations, and combinations has been eliminated. These objects are now made with there own functions and may be created anywhere, not necessarily inside a letm.
-
- 01 Dec, 2008 1 commit
-
-
Liam Healy authored
GSL arrays are garbage-collected objects, and so can be made like any other lisp object; they do not need to be make inside a wrapper form. #m is a macro which makes them; it expands to a #'make-array* call. Examples and usage ported to this new form. Compiled only; not tested yet. No effort to port to non-native implementation yet; tests as expanded in the tests/ directory are not ported yet.
-
- 29 Nov, 2008 1 commit
-
-
Liam Healy authored
Redefine #'alloc-gsl-struct as a generic function and define a method specifically for combinations. Define #'native-pointer in defmfun.lisp with a new function #'native-pointer-protect made from its body left in data.lisp, so that now floating-point and mathematical can be compiled and loaded as defined in the asd file. Use :pointer for foreign argument types instead of gsl-vector-c.
-
- 28 Nov, 2008 1 commit
-
-
Liam Healy authored
Native arrays are now completely dynamic, i.e., they are garbarge collected and there is no need for any kind of wrapper, because the with-pinned-objects is wrapped at the defmfun level. Most tests pass on SBCL, but there are still a number that fail. The GSL parts are always present; there is potentially unnecessary allocation of all GSL-required structs at creation time, which might merit some investigation for a more just-in-time creation procedure. Potential problems on non-native implementations completely uninvestigated.
-
- 23 Nov, 2008 1 commit
-
-
Liam Healy authored
Using trivial-garbage to define a portable finalizer in #'alloc-gsl-struct. Removed #'free-gsl-struct; #'expand-data no longer calls #'free-gsl-struct. As in the old free-gsl-struct, the finalizer removes the gsl-vector-c or gsl-matrix-c, and the gsl-block-c if applicable. Test results are the same (1 failure for unrelated reason).
-
- 16 Nov, 2008 1 commit
-
-
Liam Healy authored
By incorporating a few definitions modified from Tamas Papp's FFA directly into GSLL, there is no dependence anymore on FFA separately. With the conversion of a few definitions, the dependency on iterate has therefore been eliminated also. This compiles without errors or warnings on SBCL.
-
- 12 Nov, 2008 1 commit
-
-
Liam Healy authored
To make terminology consistent, the "C standard" form of type, also what I call "CFFI" form, is called that instead of "FFA" in some places. Specifically, #'cl-cffi is renamed from #'cl-ffa and now the name matches the already-existing #'cffi-cl.
-
- 02 Nov, 2008 2 commits
-
-
Liam Healy authored
For testing, both vectors and matrices can be made with #'array-default, replacing #'vector-default. The numbers in *double-float-pool* in are now double floats (with d0), and the #'make-list-from-pool coerces to the right type. In both.lisp, #'set-value and #'get-value are for vectors only, not both, because matrices require an extra index argument. Since these functions are for debugging only as the comment says, I'm writing equivalent matrix functions, and I'm not doing tests for them.
-
Liam Healy authored
Complex arrays can be initialized with either reals or complexes. If initialized with reals, there must be an even number. Now created complex arrays are the right length and are not always zero in the imaginary part. Pool data supplied in *signed-byte-pool* is between ±127 inclusive, instead of ±255, which is required for making (signed-byte 8). Added some tests from functions in both.lisp to generate-tests.lisp.
-
- 29 Aug, 2008 1 commit
-
-
Liam Healy authored
Put maref and cl-array into a new file maref.lisp, each one has three methods (gsl-data, CL array, GSL pointer). The pointer method for maref selects over all possible element types. This compiles but is not tested.
-
- 24 Aug, 2008 1 commit
-
-
Liam Healy authored
Define '+foreign-pointer-class+ to be the class name for foreign pointers, which will be assumed to be GSL vectors or matrix pointers. Use in new method #'cl-array to return a CL array from a pure GSL vector double pointer, such as is returned by several functions in solve-minimize-fit.
-
- 23 Aug, 2008 1 commit
-
-
Liam Healy authored
The generic function #'maref will work on foreign pointers and assume them to be pointing to either a gsl-vector-c or a gsl-matrix-c, depending on how many indices are given. This then functions like the old #'vref and #'mref. It is used in the new function #'make-vector-from-gsl which creates a CL vector (using make-array*) which is needed by several functions in solve-minimize-fit. It is also useful in the callbacks a user would define for solve-minimize-fit functions. Similar functionality added to (setf aref) which was turned into a generic function. As part of the changes needed to define these methods, the defmfun family was modified to accept optional arguments in #'expand-defmfun-method, which is invoked when :definition :method is given. Functions with optional arguments fall into two categories as far as defmfun is concerned: those that correspond to multiple GSL functions, and those that don't. This should work in both cases.
-
- 22 Aug, 2008 1 commit
-
-
Liam Healy authored
Ported Monte-carlo to ffa, with all examples working. This necessitated the introduction of a new local macro in letm, #'a*, which is like #'a, but evaluates its arguments (and thus allows pi).
-
- 17 Aug, 2008 2 commits
-
-
Liam Healy authored
Little actual ffa usage, just the port to 'sizet, method and use of #'mpointer in the histogram context. It would be nice to be able to adapt defmfun to discriminating between 1d and 2d histograms rather than using histo-1d2d, but I will put that off for now. This compiles but is not tested.
-
Liam Healy authored
The vector usage in random, plus a few sizet types, ported. Not tested.
-
- 25 Jul, 2008 6 commits
-
-
lhealy authored
git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@70 af03a46b-e846-0410-96e5-d5653c316fd0
-
lhealy authored
to load correctly. git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@67 af03a46b-e846-0410-96e5-d5653c316fd0
-
lhealy authored
documentation.html but it is still incomplete. git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@66 af03a46b-e846-0410-96e5-d5653c316fd0
-
lhealy authored
git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@65 af03a46b-e846-0410-96e5-d5653c316fd0
-
lhealy authored
ctype to 'sizet from 'size to better pick it out of the source code. git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@64 af03a46b-e846-0410-96e5-d5653c316fd0
-
lhealy authored
Remove old definition of make-array*. git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@63 af03a46b-e846-0410-96e5-d5653c316fd0
-