1. 03 Jan, 2011 1 commit
    • Liam M. Healy's avatar
      Physical quantities with grids · 043a16fd
      Liam M. Healy authored
      Start implementation of physical quantities with grid magnitudes.
      Compiles and loads cleanly but mostly non-functional or only
      accidentally functional.
      043a16fd
  2. 01 Jan, 2011 1 commit
  3. 27 Dec, 2010 1 commit
    • Liam M. Healy's avatar
      Add Cartesian · 299f5226
      Liam M. Healy authored
      Adds distance, angle and rotation-related functions on Cartesian
      space.
      299f5226
  4. 26 Dec, 2010 2 commits
    • Liam M. Healy's avatar
      New function make-simple-grid · 5a8444f9
      Liam M. Healy authored
      New function make-simple-grid with defaults 
       *default-grid-type* 
       *default-element-type*
       *default-dimensions*
      which will make it easier to create grids with default properties.
      5a8444f9
    • Liam M. Healy's avatar
      Port the rest of the files in physical-quantities · 9c134491
      Liam M. Healy authored
      Port the rest of the files in physical-quantities.  Use Drakma to
      download the USNO finals.all file with earth orientation data.  It all
      compiles and loads and superficially works, but no real testing has
      been done.
      9c134491
  5. 25 Dec, 2010 4 commits
  6. 24 Dec, 2010 8 commits
  7. 23 Dec, 2010 4 commits
  8. 03 Dec, 2010 1 commit
  9. 28 Nov, 2010 1 commit
    • Liam Healy's avatar
      Eliminate complex-to-cl; require FSBV · e94b9ec2
      Liam Healy authored
      Using fsbv:defcstruct defines conversion between foreign and Lisp for
      complex types, so a separate complex-to-cl is no longer necessary.
      This means that FSBV is required.  If FSBV's convert.lisp is separated
      from FSBV and loaded by itself, then only defconvert may be used and
      (the rest of) FSBV will not be necessary.
      e94b9ec2
  10. 27 Nov, 2010 1 commit
    • Liam Healy's avatar
      Rewrite complex-to-cl using the complex component type · 74c5ef1e
      Liam Healy authored
      Rewrite the function complex-to-cl to properly use complex component
      type instead of always using double float.  This fixes two errors in
      GSLL which do calculations on (complex single-float).  The body of the
      function is based on the form that FSBV generates for
      foreign-object-components.  Function relocated from
      number-conversion.lisp to complex-types.lisp
      74c5ef1e
  11. 25 Nov, 2010 1 commit
  12. 22 Nov, 2010 1 commit
  13. 21 Nov, 2010 1 commit
    • Liam Healy's avatar
      Define faref and set-faref macros to expand array element access · f78ee904
      Liam Healy authored
      The macros faref and set-faref are defined to expand array element
      access most efficiently.  They take an explicit 'type-declaration
      argument, which may be nil.  If nil, they expand to forms with
      run-time evaluated values.  If there is a non-nil type given, they
      expand to the appropriate cffi:mem-aref.  These are used by all gref,
      gref*, (setf gref) and (setf gref*) methods, general and specific, and
      by compiler macros that look for declarations.  It is not clear if and
      how the setf macros are being expanded properly, but it is hoped that
      the 'gsetf macro (which could be a shadow of cl:setf) will help insure
      that maximum use is made of any declarations.
      f78ee904
  14. 19 Nov, 2010 1 commit
  15. 15 Nov, 2010 3 commits
  16. 14 Nov, 2010 2 commits
    • Liam Healy's avatar
      Compiler macro for gref that expands to gref* · 7bc80076
      Liam Healy authored
      The compiler macro for gref that expands to gref* now is specific to a
      foreign-array type and thus requires a declaration, because it's
      probably not good for CL arrays.  It also now works on matrix types,
      linearizing the array appropriately according to the declared
      dimensions.  There is now a helper function using-declared-type used
      in the compiler macros for gref and gref*.
      7bc80076
    • Liam Healy's avatar
      Put declarations in gref* and (setf gref*) definitions · d0b18e48
      Liam Healy authored
      Added declarations of inputs and outputs and intermediate quantities
      in gref* and (setf gref*).
      d0b18e48
  17. 13 Nov, 2010 1 commit
  18. 08 Nov, 2010 2 commits
    • Liam M. Healy's avatar
      Fix error in reading declaration of foreign array · fe5dcfb9
      Liam M. Healy authored
      Fixed an error in declared-type-dimensions which had an assumption
      that the declaration is a list.  Declare forms do work in SBCL
      1.0.43.79.  
      
      Example form:
      (defun foreign-array-test (dim)
        "Test for foreign-array speed, adapted from Sebastian Sturm's code."
        (let ((input (grid:make-foreign-array
      		'double-float :dimensions dim
      		:initial-element 1.0d0))
      	(output (grid:make-foreign-array 'double-float :dimensions dim)))
          (declare (type grid:vector-double-float input output))
          (let ((tv0 0.0d0) (tv1 0.0d0))
            (declare (type double-float tv0 tv1))
            (iter (for i from 0 below dim)
      	    (setf tv0 0.0d0)
      	    (iter (for m from 0 to i)
      		  (iter (for n from i below dim)
      			(setf tv1 0.0d0)
      			(iter (for k from m to n)
      			      (incf tv1 (the double-float (grid:gref input k))))
      			(incf tv0 (expt tv1 -2))))
      	    (setf (grid:gref output i)
      		  (- (the double-float (grid:gref input i)) tv0))))))
      Results
      (time (foreign-array-test 100))
      Evaluation took:
        0.125 seconds of real time
        0.124008 seconds of total run time (0.124008 user, 0.000000 system)
        99.20% CPU
        382,132,350 processor cycles
        8,240 bytes consed
      fe5dcfb9
    • Liam Healy's avatar
  19. 07 Nov, 2010 2 commits
    • Liam Healy's avatar
      Type declarations for foreign-arrays · 34cf24cb
      Liam Healy authored
      Accept 'the type declarations for foreign arrays subtypes for speed
      improvement of gref*.  This currently works on gref* and not (setf
      gref*), and produces approximately 30x speed improvement.  Also added
      ability to read a traditional declaration, e.g. (type
      vector-double-float zvector), which relies on the CLtL2 function
      variable-information and thus is not portable (SBCL only at present);
      however, this function always returns nil for the third value (type
      declaration) when tested.
      34cf24cb
    • Liam Healy's avatar
      Accelerate foreign-array computations · 13d603f2
      Liam Healy authored
      By defining gref methods specific to each class
      (e.g. vector-double-float) that then calls cffi:mem-aref with an
      explicit element type, the speed of gref and (setf gref) are greatly
      increased.  Also, define a compiler macro that turns the gref into
      gref* for vectors; speed improvement results from this
      appear inexplicably minimal.
      13d603f2
  20. 07 Sep, 2010 1 commit
  21. 27 Aug, 2010 1 commit