1. 23 Nov, 2013 1 commit
  2. 23 Mar, 2013 1 commit
    • Liam M. Healy's avatar
      System of units specification is through an nf-option · 6ca09dfb
      Liam M. Healy authored
      The specification of the system-of-units is through an nf-option, and
      no longer passed as arguments to functions.  Systems of units (with or
      without augmented units) are made via make-sysunits or
      define-system-of-units, set-default-system-of-units that call it.
      
      This does not compile.
      6ca09dfb
  3. 09 Mar, 2013 1 commit
    • Liam M. Healy's avatar
      New systems grid, antik-base · d7af2a3c
      Liam M. Healy authored
      New systems grid, antik-base which load by themselves, and grid tests run if lisp-unit is loaded.  The physical-dimension system gets an error on load.
      d7af2a3c
  4. 02 Oct, 2011 1 commit
    • Liam M. Healy's avatar
      Fix error in setting an element of a pq grid · c01609e0
      Liam M. Healy authored
      Fixed error in setting an element of a pq grid; it was trying to set
      the element of the magnitude to the pq scalar, now setting the element
      to the magnitude of the scalar.  Now works:
      ANTIK-USER(3): (defparameter test #_#m(1.0d0 2.0d0 3.0d0)_km)
      TEST
      ANTIK-USER(4): test
      #_#(1000.000000000000000d0 2000.000000000000000d0 3000.000000000000000d0)_m
      ANTIK-USER(5): (setf (grid:aref test 0) #_13.0d0_km)
      #_13000.000000000000000d0_m
      ANTIK-USER(6): test
      #_#(13000.000000000000000d0 2000.000000000000000d0 3000.000000000000000d0)_m
      c01609e0
  5. 21 Aug, 2011 1 commit
    • Liam M. Healy's avatar
      New argument toggle-physical-dimension to elementwise · b9c0b31d
      Liam M. Healy authored
      For arguments to elementwise that either create results that have
      physical dimension when their arguments don't or vice versa, new
      argument toggle-physical-dimension replaces dimensionless-return which
      only handled the latter case.  New function
      grid::pdq-grid-specification to make a specification for a pdq
      from the specification for its magnitude.
      b9c0b31d
  6. 20 Aug, 2011 1 commit
  7. 04 Aug, 2011 1 commit
  8. 22 Jun, 2011 3 commits
    • Liam M. Healy's avatar
      New function #'equal-dimensions · de75bf6d
      Liam M. Healy authored
      Define a new function #'equal-dimensions which was previously embedded
      in grid::make-grid-data, and is now corrected to handle zero elements
      correctly as prescribed by zero-is-dimensionless.  Test case:
      #m(0.0 #_1.0_km 0.0)
      de75bf6d
    • Liam M. Healy's avatar
      Use all-same to determine if elements of a pq grid have all the same dimension · 3dd99b49
      Liam M. Healy authored
      Once again rewrite (grid::make-grid-data (eql 'physical-quantity)) so
      that we no longer use #'reduce at all to find the same dimension, but
      rather #'all-same which now has a new :post-function argument.  Test
      case 
      (MAKE-GRID '((FOREIGN-ARRAY 3) DOUBLE-FLOAT) :INITIAL-CONTENTS '(0.0 #_-3.377500000000000d0_km 0.0))
      formerly would return the double float foreign array, no physical
      quantity, now it returns the correct thing,
      #m(0.000000000000000d0 #_-3.377500000000000d0_km 0.000000000000000d0)
      3dd99b49
    • Liam M. Healy's avatar
      Fix make-grid-data for pq when there is just one element · a32546e9
      Liam M. Healy authored
      An error was signalled when calling make-grid-data with a single pq
      element.  This was caused because of the definition of #'reduce, "If
      the subsequence contains exactly one element and no initial-value is
      given, then that element is returned and function is not called".
      This is now fixed.  Test example: #m(#_1.0d0_m) now returns the
      correct thing.
      a32546e9
  9. 07 Jun, 2011 1 commit
  10. 31 May, 2011 1 commit
    • Liam M. Healy's avatar
      Arithmetic of scalar pq with a grid · 4699de4b
      Liam M. Healy authored
      In funcall-dyadic, handle the case of a dyadic mathematical operation
      of a scalar pq with a grid.  This is passed down from
      physical-quantity methods by a new macro #'grid-call-next-method.
      4699de4b
  11. 24 May, 2011 1 commit
  12. 15 Apr, 2011 1 commit
  13. 28 Mar, 2011 1 commit
    • Liam M. Healy's avatar
      Eliminate call to make-pq-grid-specification; make-grid-data with no initial-contents · 51a4b48c
      Liam M. Healy authored
      Eliminate call to make-pq-grid-specification as it is unnecessary;
      make-grid does the job as well when make-grid-data works with no
      initial-contents.  The latter is achieved by filling the dimel array
      with nils.  Started a new function make-pq-grid-NEW (which will
      eventually be named #'make-pq-grid when the old one is eliminated)
      derived from the body of (grid::make-grid-data (eql
      'physical-quantity)) in intending to replace that part, but also to
      replace make-pq-grid with different arguments as called from make-pq.
      51a4b48c
  14. 23 Mar, 2011 2 commits
    • Liam M. Healy's avatar
      New function make-pq-grid-specification · 135361ef
      Liam M. Healy authored
      New function #'make-pq-grid-specification makes a pq grid according to
      specification.  At present, it will give an error if initial-contents
      or intiial-element are specified, so it is presumed that the values
      will set after creation.  It is called from make-grid, and is derived
      from code that was there; it needed to be broken out into a separate
      function in a different file because it uses symbols not exported
      until later.  Also, it is good conceptually to have this as a separate
      function.
      135361ef
    • Liam M. Healy's avatar
      PQ grid specification and creation with make-grid · 56d58d21
      Liam M. Healy authored
      The grid type of a pq grid, as given by grid:gridp, will be
      (physical-quantity <magnitude-grid-type>).  This is accepted by
      make-specification and by make-grid.  For make-grid, this is
      translated into a call to make-pq.
      
      This is tested with an example: 
      (grid:make-grid '(physical-quantity (grid:foreign-array 3) double-float))
      #<Physical quantity mag (2.024e-320 6.953e-310 1.036e-317), units #(METER METER METER)>
      (grid:specification @)
      (PHYSICAL-QUANTITY (GRID:FOREIGN-ARRAY 3) DOUBLE-FLOAT)
      56d58d21
  15. 14 Mar, 2011 1 commit
    • Liam M. Healy's avatar
      Add print-grid-readably · fbb120e0
      Liam M. Healy authored
      New function print-grid-readably to put the surrounding output
      defining a readable grid.  Temporarily comment out resetting
      full-precision nf parameter in cl-readable-nf so that when printing
      grids readably, the set precision is used.
      fbb120e0
  16. 01 Mar, 2011 1 commit
  17. 22 Feb, 2011 1 commit
  18. 12 Feb, 2011 3 commits
  19. 11 Feb, 2011 1 commit
  20. 06 Feb, 2011 2 commits
    • Liam M. Healy's avatar
      Make pq grids if :initial values are pqs · 05660810
      Liam M. Healy authored
      The grid::make-grid-data :around method now works to insert
      'physical-quantity into the specification (i.e., call
      grid::make-grid-data (eql 'physical-quantity) method) if it doesn't
      already have it but the initial-element or initial-contents are
      physical-quanitity(ies).  The following work:
         1. (grid:make-grid '((grid:foreign-array 3) double-float) :initial-element #_23_m)
         2. (grid:make-grid '((grid:foreign-array 3) double-float) :initial-contents '(#_1_km #_2_km #_3_sec))
         3. (grid:make-grid '((grid:foreign-array 3) double-float)
      		      :initial-contents '((#_1_km #_2_km #_3_sec) (#_1_m #_2_m #_88_sec)))
      05660810
    • Liam M. Healy's avatar
      #'make-grid-data (eql 'physical-quantity) rewrite · d1da3f0f
      Liam M. Healy authored
      Method #'make-grid-data (eql 'physical-quantity) now works with
      :initial-contents and :initial-elements with both scalar and
      non-scalar units.  New function map-pq.
      d1da3f0f
  21. 29 Jan, 2011 5 commits
    • Liam M. Healy's avatar
      Concatenate pq non-scalar grid, with test · d66dd4dc
      Liam M. Healy authored
      Add (grid::affi physical-quantity) method.  Fix arguments error in
      (setf gref*) call in (grid:gref physical-quantity).  As a result, a
      pq non-scalar unit grid with array magnitude functions correctly.
      Add test of concatenate-grids with pq arguments.
      d66dd4dc
    • Liam M. Healy's avatar
      Make pq grids work in merge-specification · b742a40b
      Liam M. Healy authored
      b742a40b
    • Liam M. Healy's avatar
      Error checks for making grids · 2335aa7a
      Liam M. Healy authored
      New function #'grid::check-initial-contents to check that
      initial-contents is not nil when it is explicitly specified, called in
      several places.  New function #'grid:check-dimension to check that the
      object is a list of non-negative integers.  Check that
      category-or-rank in call to #'data-class-name is acceptable, signal an
      error if not instead of just returning category-or-rank.
      2335aa7a
    • Liam M. Healy's avatar
      Non-scalar units tests, grid::make-grid-data initial-contents must be non-nil · ab18501c
      Liam M. Healy authored
      Restore the test grid-array-units for non-scalar units.  Check that
      initial-contents (not just initial-contents-p) are non-nil in
      make-grid-data, because it doesn't make sense to specify
      :initial-contents as nil.  
      
      Now all tests in package ANTIK pass:
      GRID-ARRAY-UNITS: 3 assertions passed, 0 failed.
      GRID-SCALAR-UNITS: 9 assertions passed, 0 failed.
      NUMBERS: 38 assertions passed, 0 failed.
      UNITS: 9 assertions passed, 0 failed.
      TOTAL: 59 assertions passed, 0 failed, 0 execution errors.
      ab18501c
    • Liam M. Healy's avatar
      Enable creation of non-scalar unit pq grids with make-grid · ddef4ddd
      Liam M. Healy authored
      It is now possible to create a non-scalar unit pq grid using make-grid
      (and not just make-pq).  This means that e.g. #m can be used to make
      such an object, e.g. #m(#_1.0d0_m #_5.0d0_s).  This relies on a new
      function scalar-units-p, which tries to parse the unit expression, and
      if it's unparseable, assumes that it must be a list of such
      expressions.  Changed check-dimension so that it works on grids
      instead of sequences.
      ddef4ddd
  22. 27 Jan, 2011 3 commits
  23. 24 Jan, 2011 2 commits
    • Liam M. Healy's avatar
      Align equal-dimension and check-dimension more closely · ae9c9171
      Liam M. Healy authored
      1. Moved equal-dimension to physical-quantities.lisp.
      2. Add arguments errorp and zeros-have-any-dimension.
      3. Allow x or y to be a dimel and not only a pq.
      4. New function dimel-or-not.
      5. All three functions return a dimel if successful, or nil otherwise.
      6. All three functions take a pq, dimel, or other object as input; any other object is considered dimensionless.
      7. Possibly check-dimension and equal-dimension can be merged.
      ae9c9171
    • Liam M. Healy's avatar
      PQ grids with non-scalar units: gref, gref*, make-pq functioning · 09a0e4bd
      Liam M. Healy authored
      Physical quantities for grids, where units are different for different
      elements can be defined with make-pq, with either a list or array
      units.  Functions gref and gref* work for pq grids.
      09a0e4bd
  24. 23 Jan, 2011 1 commit
  25. 18 Jan, 2011 1 commit
    • Liam M. Healy's avatar
      Fresh start at making physical quantities · e2a78fd1
      Liam M. Healy authored
      Start two new files, physical-quantities/grid.lisp and
      physical-quantities/scalar.lisp to handle making physical quantities.
      Preliminary forms are written but they have not been compiled or
      tested.
      e2a78fd1