Commit ebf8d506 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Merge branch 'master' into multiple-systems

Conflicts:
	antik-OBSOLETE.asd
	grid/functions.lisp
	physical-quantities/grid.lisp
parents bf4620d4 ceee01b4
;; Antik system definition
;; Liam Healy 2010-12-24 09:43:28EST antik.asd
;; Time-stamp: <2013-03-09 10:38:42EST antik-OBSOLETE.asd>
;; Time-stamp: <2013-11-09 09:21:01EST antik-OBSOLETE.asd>
;; Copyright 2010, 2011, 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -96,6 +96,32 @@
(:file "foreign-array" :depends-on ("types" "element-types"))
(:file "vector-matrix" :depends-on ("element-types" "subclass"))
(:file "methods" :depends-on ("foreign-array" "vector-matrix"))))
(:module physical-quantities
:serial t
:depends-on (init input-output)
:components
((:file "format-output")
(:file "units")
(:file "scalar")
(:file "grid")
(:file "funcall")
(:file "unit-definitions")
(:file "sysunit-definitions")
(:file "physical-quantities")
(:file "undimension")
(:file "arithmetic")
(:file "iso8601")
(:file "dtspec")
(:file "time-interval")
(:file "angle")
(:file "angle-component")
(:file "state")
(:file "timepoint")
(:file "relative-time")
(:file "read-time")
(:file "formats")
(:file "convert-timescale")
(:file "dtmath")))
(:module mathematics
:serial t
:components
......@@ -134,7 +160,8 @@
:components
((:module optimize
:components
((:file "one-dim")))
((:file "one-dim")
(:file "least-squares")))
(:module linear-algebra
:components
((:file "linear-algebra")))
......
;; Functions on cartesian space
;; Liam Healy 2010-12-26 20:58:14EST cartesian.lisp
;; Time-stamp: <2012-06-03 22:34:26EDT cartesian.lisp>
;; Time-stamp: <2013-10-22 18:18:45EDT cartesian.lisp>
;; Copyright 2011, 2012 Liam M. Healy
;; Copyright 2011, 2012, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -32,20 +32,16 @@
(defun right-angle (vector)
"Find an arbitrary right angle to the vector."
(let* ((vec (pqval vector))
(bigind
;; Find which component is the largest
(iterate (for i vector-element-index vector)
(finding i maximizing (abs (grid:aref vec i)))))
(project (grid:copy-to vec))
(return (grid:copy-to vec)))
;; Find vector projected into the plane perpendicular
(setf (grid:aref project bigind) 0.0
;; The return vector is the original vector with a different
;; value in what was the largest component.
(grid:aref return bigind)
(cl:- (cl:/ (grid:inner project project) (grid:aref vec bigind))))
(grid:normalize return)))
;; See [[id:7154d151-388f-48d9-b1d1-ca811fc04222][Perpendicular vector]]
;; See http://www.gamedev.net/topic/572770-finding-vector-perpendicular-to-line-in-3d/
;; Take the cross product with the coordinate unit vector of the smallest component.
(let ((vec (pqval vector)))
(grid:normalize
(grid:cross
vec
(coordinate-unit-vector
(iterate (for i vector-element-index vec)
(finding i minimizing (abs (grid:aref vec i)))))))))
(defun coplanar (vect1-or-matrix &optional vect2 vect3)
"The cosine of the angle between vect1 and the cross product of vect2 and vect3.
......
No preview for this file type
......@@ -186,14 +186,18 @@ This section will describe the definitions for organizing computations. At pres
@node Parameters, , Introduction to organization, Organization of Computation
@section Parameters
@cindex Parameters
Parameters are named values that are defined and used in computations or in presentation; the concept is distinct from Common Lisp's @url{http://www.lispworks.com/documentation/HyperSpec/Body/m_defpar.htm#defparameter,defparameter} macro. They are organized into named categories; Antik itself defines one category, @code{NF}, which is used for numerical formatting. Each parameter is defined with a default value and description. The value can be changed with @code{(setf parameter-value)} and used with @code{parameter-value}, or changed locally (analogous to @code{let} for CL variables) with @code{with-parameters}.
Parameters are named values that are defined and used in computations or in presentation. The @url{http://www.lispworks.com/documentation/HyperSpec/Body/m_defpar.htm#defparameter,defparameter} macro defines parameters (dynamic variables) but Antik has definitions that permit grouping them and including properties such as the type, which will be checked when values are assigned, and defining synonyms. The grouping is in named categories; Antik itself defines one category, @code{NF}, which is used for numerical formatting. Each category used will become a package, and the symbols exported from that package. The value can be changed with @code{(setf parameter-value)} and used with @code{parameter-value}, or changed locally (analogous to @code{let} for CL variables) with @code{with-parameters}. It is also permissible to assign as a normal variable (e.g., with let and setf), but no type checking is performed.
@example
;;; First create the category
(define-parameter-category kepler)
;;; Then define some parameters
(define-parameter kepler foo 122 fixnum "A fixnum parameter of kepler.")
(define-parameter kepler bar "hi" string "A string parameter of kepler.")
(define-parameter kepler foo
:value 122
:type fixnum
:documentation "A fixnum parameter of kepler.")
(define-parameter kepler bar
:value "hi"
:type string
:documentation "A string parameter of kepler.")
;;; Get their values
(parameter-value kepler bar)
......@@ -212,7 +216,7 @@ foo: 122, bar: "hi"
NIL
;;; Locally change values
(with-parameters (kepler foo 143 bar "bye")
(with-parameters (kepler (foo 143) (bar "bye"))
(show-foo-bar))
foo: 143, bar: "bye"
NIL
......@@ -222,43 +226,40 @@ foo: 122, bar: "hi"
NIL
;;; Make a mistake
(with-parameters (kepler foo 143 bar -44)
(with-parameters (kepler (foo 143) (bar -44))
(show-foo-bar))
Error: Value -44 is of type FIXNUM, not of the required type STRING.
;;; Globally change values
(set-parameter-value kepler bar "a new value")
(setf (parameter-value kepler bar) "a new value")
(show-foo-bar)
foo: 122, bar: "a new value"
;;; Set multple values
;;; Set multiple values
(set-parameters kepler bar "xyz" foo 1)
(show-foo-bar)
foo: 1, bar: "xyz"
;;; Get information about the categories and parameters
(parameter-help)
Parameter categories: KEPLER.
Parameter categories: KEPLER and NF.
(parameter-help :kepler)
Parameters in KEPLER: BAR and FOO.
(parameter-help :kepler :bar)
BAR: A string parameter of kepler.
Type is: STRING, default value is "hi".
(parameter-value* kepler (mkstr "FO" "O"))
122
Type is STRING,
Current value is "xyz".
@end example
@include include/macro-antik-define-parameter-category.texinfo
@include include/macro-antik-define-parameter.texinfo
@include include/fun-antik-parameter-help.texinfo
@include include/macro-antik-parameters-set.texinfo
@include include/macro-antik-parameter-value.texinfo
@include include/macro-antik-parameter-value-star.texinfo
@include include/macro-antik-reset-parameters.texinfo
@include include/macro-antik-set-parameter-value.texinfo
@include include/macro-antik-set-parameter.texinfo
@include include/macro-antik-set-parameters.texinfo
@include include/macro-antik-with-parameters.texinfo
@node Grids, Physical Quantities, Organization of Computation, Top
@chapter Grids
@cindex Vectors
......@@ -1225,7 +1226,6 @@ NIL
@include include/class-antik-physical-quantity.texinfo
@include include/fun-antik-check-dimension.texinfo
@include include/fun-antik-make-pq.texinfo
@include include/fun-antik-new-units.texinfo
@include include/fun-antik-pqval.texinfo
@include include/macro-antik-with-pq.texinfo
@include include/var-antik-star-zero-is-dimensionless-star.texinfo
......@@ -1274,47 +1274,39 @@ For units defined by Antik, see the source file @file{antik/physical-quantities/
@node Systems of units, , Dimensions, Physical dimension
@subsection Systems of units
A @dfn{system of units} is a set of units, one for each of the physical dimensions that Antik can handle. A system of units is needed by Antik for printing output and in special cases for converting physical quantities that have a physical dimension defined (e.g. length), but no units. The system of units defined by
@code{*system-of-units*} is used to determine the units in which the output is printed. There are pre-defined several systems of units, @code{*siu*}, @code{*englishu*}, @code{*cgsu*}:
@code{(nf-option :system-of-units)} is used to determine the units in which the output is printed. There are pre-defined several systems of units, @code{si}, @code{english}, @code{cgs}:
@example
ANTIK-USER> (defparameter *length1* #_10_m)
*LENGTH1*
ANTIK-USER> *length1*
#_10.000000000000000_m
ANTIK-USER> (setf *system-of-units* *englishu*)
(((1 0 0 0 0 0 0 0 0) . FOOT) ((0 0 0 0 0 0 0 0 1) . RADIAN)
((0 0 1 0 0 0 0 0 0) . SLUG) ((0 1 0 0 0 0 0 0 0) . SECOND)
((1 -2 1 0 0 0 0 0 0) . POUND-FORCE) ((2 -3 1 0 0 0 0 0 0) . HORSEPOWER)
((2 -2 1 0 0 0 0 0 0) . FOOT-POUND)
((-1 -2 1 0 0 0 0 0 0) . POUNDS-PER-SQUARE-INCH))
ANTIK-USER> (set-system-of-units :english)
; No value
ANTIK-USER> *length1*
#_32.808398950131235_ft
@end example
So by setting the system of units, you can convert values as needed,
@example
ANTIK-USER> (setf *system-of-units* *siu*)
ANTIK-USER> (set-system-of-units :si)
; No value
ANTIK-USER> #_12_feet
#_3.657600000000000d0_m
ANTIK-USER> (setf *system-of-units* *englishu*)
ANTIK-USER> (set-system-of-units :english)
ANTIK-USER> #_3_m
#_9.842519685039370d0_ft
@end example
A new system of units may be defined with @code{define-sysunits}. One need not define all physical dimensions, but if a unit is needed for a particular dimension and it's not defined, an error will be signalled. For convenience, a system of units may be defined by alteration of an existing system of units. For example, suppose that you wish to have a system of units that is like SI except that lengths are measured in km instead of meters. This will define such a system:
A new system of units may be defined with @code{define-system-of-units}. One need not define all physical dimensions, but if a unit is needed for a particular dimension and it's not defined, an error will be signalled. For convenience, a system of units may be defined by augmentation of an existing system of units. For example, suppose that you wish to have a system of units that is like SI except that lengths are measured in km instead of meters. This will define such a system:
@example
(define-sysunits *kmu* (km) *siu* "Kilometer system.")
(define-system-of-units kmdeg (km degree) si)
@end example
To set the default system of units, use @code{set-default-sysunits}. To define a symbol macro to set a default system of units, use @code{setsys}. The SI system is the initial default system of units. It may be reset as the system of units with the symbol macro @code{si}.
For formatted output of angles, the units (degrees or radians) may be set with the nf option @code{:degrees}, so the system of units may be maintained whether degrees or radians are desired on output.
The SI system is the initial system of units.
@include include/macro-antik-define-sysunits.texinfo
@include include/fun-antik-set-default-sysunits.texinfo
@include include/macro-antik-setsys.texinfo
@include include/var-antik-star-system-of-units-star.texinfo
@include include/var-antik-star-siu-star.texinfo
@include include/var-antik-star-englishu-star.texinfo
@include include/var-antik-star-cgsu-star.texinfo
@include include/macro-antik-define-system-of-units.texinfo
@include include/fun-antik-set-system-of-units.texinfo
@include include/macro-antik-with-system-of-units.texinfo
@include include/macro-antik-with-si-units.texinfo
@node Physical constants, Date and time, Physical dimension, Physical Quantities
@section Physical constants
......
......@@ -36,7 +36,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Physical-dimension.html#Physical-dimens
<h4 class="subsection">5.3.1 Introduction</h4>
<p><a name="index-Class_002c-physical_002dquantity-318"></a>Antik has a class <code>physical-quantity</code> which is used to represent values that have physical dimension, such as mass or length; e.g.
<p><a name="index-Class_002c-physical_002dquantity-312"></a>Antik has a class <code>physical-quantity</code> which is used to represent values that have physical dimension, such as mass or length; e.g.
<pre class="example"> ANTIK-USER&gt; #_35_km
#_35000.000000000000000_m
ANTIK-USER&gt; (* #_5_m #_8_kg)
......
......@@ -36,42 +36,42 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Three-Dimensional-Space.html#Three-Dime
<h3 class="section">8.1 Cartesian</h3>
<p><a name="index-Cartesian-space-406"></a><a name="index-Functions_002c-Cartesian-space-407"></a>
<p><a name="index-Cartesian-space-392"></a><a name="index-Functions_002c-Cartesian-space-393"></a>
<div class="defun">
&mdash; Function: <b>antik:coordinate-unit-vector</b><var> i &amp;optional length<a name="index-antik_003acoordinate_002dunit_002dvector-408"></a></var><br>
<blockquote><p><a name="index-antik_003acoordinate_002dunit_002dvector-409"></a>A coordinate unit vector.
&mdash; Function: <b>antik:coordinate-unit-vector</b><var> i &amp;optional length<a name="index-antik_003acoordinate_002dunit_002dvector-394"></a></var><br>
<blockquote><p><a name="index-antik_003acoordinate_002dunit_002dvector-395"></a>A coordinate unit vector.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:coplanar</b><var> vect1-or-matrix &amp;optional vect2 vect3<a name="index-antik_003acoplanar-410"></a></var><br>
<blockquote><p><a name="index-antik_003acoplanar-411"></a>The sine of the angle between vect1 and the cross product
of vect2 and vect3. This should be near zero.
&mdash; Function: <b>antik:coplanar</b><var> vect1-or-matrix &amp;optional vect2 vect3<a name="index-antik_003acoplanar-396"></a></var><br>
<blockquote><p><a name="index-antik_003acoplanar-397"></a>The cosine of the angle between vect1 and the cross product of vect2 and vect3.
This should be near zero if the vectors are coplanar.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:distance</b><var> a b<a name="index-antik_003adistance-412"></a></var><br>
<blockquote><p><a name="index-antik_003adistance-413"></a>The length of the vector and the vector difference a-b.
&mdash; Function: <b>antik:distance</b><var> a b &amp;optional combination-function<a name="index-antik_003adistance-398"></a></var><br>
<blockquote><p><a name="index-antik_003adistance-399"></a>The length of the vector and the vector difference a-b.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:first-3vector</b><var> vec<a name="index-antik_003afirst_002d3vector-414"></a></var><br>
<blockquote><p><a name="index-antik_003afirst_002d3vector-415"></a>Extract the first 3-vector.
&mdash; Function: <b>antik:first-3vector</b><var> vec<a name="index-antik_003afirst_002d3vector-400"></a></var><br>
<blockquote><p><a name="index-antik_003afirst_002d3vector-401"></a>Extract the first 3-vector.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:right-angle</b><var> vector<a name="index-antik_003aright_002dangle-416"></a></var><br>
<blockquote><p><a name="index-antik_003aright_002dangle-417"></a>Find an arbitrary right angle to the vector.
&mdash; Function: <b>antik:right-angle</b><var> vector<a name="index-antik_003aright_002dangle-402"></a></var><br>
<blockquote><p><a name="index-antik_003aright_002dangle-403"></a>Find an arbitrary right angle to the vector.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:second-3vector</b><var> vec<a name="index-antik_003asecond_002d3vector-418"></a></var><br>
<blockquote><p><a name="index-antik_003asecond_002d3vector-419"></a>Extract the second 3-vector.
&mdash; Function: <b>antik:second-3vector</b><var> vec<a name="index-antik_003asecond_002d3vector-404"></a></var><br>
<blockquote><p><a name="index-antik_003asecond_002d3vector-405"></a>Extract the second 3-vector.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:vector-angle</b><var> a b<a name="index-antik_003avector_002dangle-420"></a></var><br>
<blockquote><p><a name="index-antik_003avector_002dangle-421"></a>The short angle between a and b, and the rotation vector.
&mdash; Function: <b>antik:vector-angle</b><var> a b<a name="index-antik_003avector_002dangle-406"></a></var><br>
<blockquote><p><a name="index-antik_003avector_002dangle-407"></a>The short angle between a and b, and the rotation vector.
</p></blockquote></div>
</body></html>
......
......@@ -36,25 +36,25 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Capabilities-and-Internals.html#Capabil
<h4 class="subsection">4.6.1 Classes</h4>
<p><a name="index-Class_002c-foreign_002darray-252"></a>
<p><a name="index-Class_002c-foreign_002darray-246"></a>
<div class="defun">
&mdash; Class: <b>grid:foreign-array</b><var><a name="index-grid_003aforeign_002darray-253"></a></var><br>
<blockquote><p><a name="index-grid_003aforeign_002darray-254"></a>Class precedence list: <code>foreign-array, standard-object, t</code>
&mdash; Class: <b>grid:foreign-array</b><var><a name="index-grid_003aforeign_002darray-247"></a></var><br>
<blockquote><p><a name="index-grid_003aforeign_002darray-248"></a>Class precedence list: <code>foreign-array, standard-object, t</code>
<p>Arrays that can be referenced by foreign functions.
</p></blockquote></div>
<div class="defun">
&mdash; Class: <b>grid:matrix</b><var><a name="index-grid_003amatrix-255"></a></var><br>
<blockquote><p><a name="index-grid_003amatrix-256"></a>Class precedence list: <code>matrix, foreign-array, standard-object, t</code>
&mdash; Class: <b>grid:matrix</b><var><a name="index-grid_003amatrix-249"></a></var><br>
<blockquote><p><a name="index-grid_003amatrix-250"></a>Class precedence list: <code>matrix, foreign-array, standard-object, t</code>
<p>Foreign matrices.
</p></blockquote></div>
<div class="defun">
&mdash; Class: <b>grid:mvector</b><var><a name="index-grid_003amvector-257"></a></var><br>
<blockquote><p><a name="index-grid_003amvector-258"></a>Class precedence list: <code>mvector, foreign-array, standard-object, t</code>
&mdash; Class: <b>grid:mvector</b><var><a name="index-grid_003amvector-251"></a></var><br>
<blockquote><p><a name="index-grid_003amvector-252"></a>Class precedence list: <code>mvector, foreign-array, standard-object, t</code>
<p>Foreign vectors.
</p></blockquote></div>
......
......@@ -37,8 +37,8 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Capabilities-and-Internals.html#Capabil
<h4 class="subsection">4.6.3 Condition</h4>
<div class="defun">
&mdash; Condition: <b>grid:array-mismatch</b><var><a name="index-grid_003aarray_002dmismatch-288"></a></var><br>
<blockquote><p><a name="index-grid_003aarray_002dmismatch-289"></a>Class precedence list: <code>array-mismatch, error, serious-condition, condition, t</code>
&mdash; Condition: <b>grid:array-mismatch</b><var><a name="index-grid_003aarray_002dmismatch-282"></a></var><br>
<blockquote><p><a name="index-grid_003aarray_002dmismatch-283"></a>Class precedence list: <code>array-mismatch, error, serious-condition, condition, t</code>
<p>An error indicating that the two arrays do not have
the same dimensions.
......
......@@ -55,6 +55,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Mathematics.html#Mathematics">Mathemati
<blockquote><p><a name="index-antik_003ahandling_002dcomplex_002dnumber-80"></a>A handler to make the complex number.
</p></blockquote></div>
<!-- This needs node information -->
<h3 class="section">2.3 Iterate generalized numbers</h3>
<p>Extensions to the <a href="http://common-lisp.net/project/iterate/"><samp><span class="command">iterate</span></samp></a>
......
......@@ -35,72 +35,72 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Capabilities-and-Internals.html#Capabil
<h4 class="subsection">4.6.4 Constants and Variables</h4>
<div class="defun">
&mdash; Constant: <b>grid:+foreign-pointer-class+</b><var><a name="index-grid_003a_002bforeign_002dpointer_002dclass_002b-290"></a></var><br>
<blockquote><p><a name="index-grid_003a_002bforeign_002dpointer_002dclass_002b-291"></a>The class in which foreign pointers fall.
&mdash; Constant: <b>grid:+foreign-pointer-class+</b><var><a name="index-grid_003a_002bforeign_002dpointer_002dclass_002b-284"></a></var><br>
<blockquote><p><a name="index-grid_003a_002bforeign_002dpointer_002dclass_002b-285"></a>The class in which foreign pointers fall.
</p></blockquote></div>
<div class="defun">
&mdash; Constant: <b>grid:+foreign-pointer-type+</b><var><a name="index-grid_003a_002bforeign_002dpointer_002dtype_002b-292"></a></var><br>
<blockquote><p><a name="index-grid_003a_002bforeign_002dpointer_002dtype_002b-293"></a>The type of foreign pointers.
&mdash; Constant: <b>grid:+foreign-pointer-type+</b><var><a name="index-grid_003a_002bforeign_002dpointer_002dtype_002b-286"></a></var><br>
<blockquote><p><a name="index-grid_003a_002bforeign_002dpointer_002dtype_002b-287"></a>The type of foreign pointers.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*array-element-types-no-complex*</b><var><a name="index-grid_003a_002aarray_002delement_002dtypes_002dno_002dcomplex_002a-294"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aarray_002delement_002dtypes_002dno_002dcomplex_002a-295"></a>All the array element types supported except for complex types.
&mdash; Variable: <b>grid:*array-element-types-no-complex*</b><var><a name="index-grid_003a_002aarray_002delement_002dtypes_002dno_002dcomplex_002a-288"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aarray_002delement_002dtypes_002dno_002dcomplex_002a-289"></a>All the array element types supported except for complex types.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*array-element-types*</b><var><a name="index-grid_003a_002aarray_002delement_002dtypes_002a-296"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aarray_002delement_002dtypes_002a-297"></a>All the array element types supported.
&mdash; Variable: <b>grid:*array-element-types*</b><var><a name="index-grid_003a_002aarray_002delement_002dtypes_002a-290"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aarray_002delement_002dtypes_002a-291"></a>All the array element types supported.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*complex-types*</b><var><a name="index-grid_003a_002acomplex_002dtypes_002a-298"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acomplex_002dtypes_002a-299"></a>All the supported complex array element types.
&mdash; Variable: <b>grid:*complex-types*</b><var><a name="index-grid_003a_002acomplex_002dtypes_002a-292"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acomplex_002dtypes_002a-293"></a>All the supported complex array element types.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*cstd-cl-type-mapping*</b><var><a name="index-grid_003a_002acstd_002dcl_002dtype_002dmapping_002a-300"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acstd_002dcl_002dtype_002dmapping_002a-301"></a>An alist of the <code>c</code> standard types as keywords, and the <code>cl</code> type
&mdash; Variable: <b>grid:*cstd-cl-type-mapping*</b><var><a name="index-grid_003a_002acstd_002dcl_002dtype_002dmapping_002a-294"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acstd_002dcl_002dtype_002dmapping_002a-295"></a>An alist of the <code>c</code> standard types as keywords, and the <code>cl</code> type
The exception is complex types, which don't have a definition
in the <code>c</code> standard; in that case, the <code>c</code> type is the foreign struct
definition.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*cstd-integer-types*</b><var><a name="index-grid_003a_002acstd_002dinteger_002dtypes_002a-302"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acstd_002dinteger_002dtypes_002a-303"></a>List of integer types supported by <code>cffi</code>, from the <code>cffi</code> docs.
&mdash; Variable: <b>grid:*cstd-integer-types*</b><var><a name="index-grid_003a_002acstd_002dinteger_002dtypes_002a-296"></a></var><br>
<blockquote><p><a name="index-grid_003a_002acstd_002dinteger_002dtypes_002a-297"></a>List of integer types supported by <code>cffi</code>, from the <code>cffi</code> docs.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*double-types*</b><var><a name="index-grid_003a_002adouble_002dtypes_002a-304"></a></var><br>
<blockquote><p><a name="index-grid_003a_002adouble_002dtypes_002a-305"></a>All the supported double float element types.
&mdash; Variable: <b>grid:*double-types*</b><var><a name="index-grid_003a_002adouble_002dtypes_002a-298"></a></var><br>
<blockquote><p><a name="index-grid_003a_002adouble_002dtypes_002a-299"></a>All the supported double float element types.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*float-complex-types*</b><var><a name="index-grid_003a_002afloat_002dcomplex_002dtypes_002a-306"></a></var><br>
<blockquote><p><a name="index-grid_003a_002afloat_002dcomplex_002dtypes_002a-307"></a>All the float or complex array element types supported.
&mdash; Variable: <b>grid:*float-complex-types*</b><var><a name="index-grid_003a_002afloat_002dcomplex_002dtypes_002a-300"></a></var><br>
<blockquote><p><a name="index-grid_003a_002afloat_002dcomplex_002dtypes_002a-301"></a>All the float or complex array element types supported.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*float-types*</b><var><a name="index-grid_003a_002afloat_002dtypes_002a-308"></a></var><br>
<blockquote><p><a name="index-grid_003a_002afloat_002dtypes_002a-309"></a>All the float array element types.
&mdash; Variable: <b>grid:*float-types*</b><var><a name="index-grid_003a_002afloat_002dtypes_002a-302"></a></var><br>
<blockquote><p><a name="index-grid_003a_002afloat_002dtypes_002a-303"></a>All the float array element types.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*grid-types*</b><var><a name="index-grid_003a_002agrid_002dtypes_002a-310"></a></var><br>
<blockquote><p><a name="index-grid_003a_002agrid_002dtypes_002a-311"></a>A list of (disjoint) types that are accepted as grids. Not every
&mdash; Variable: <b>grid:*grid-types*</b><var><a name="index-grid_003a_002agrid_002dtypes_002a-304"></a></var><br>
<blockquote><p><a name="index-grid_003a_002agrid_002dtypes_002a-305"></a>A list of (disjoint) types that are accepted as grids. Not every
object of the given type is necessarily a grid, however.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*print-contents*</b><var><a name="index-grid_003a_002aprint_002dcontents_002a-312"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aprint_002dcontents_002a-313"></a>Print the contents of the foreign-array.
&mdash; Variable: <b>grid:*print-contents*</b><var><a name="index-grid_003a_002aprint_002dcontents_002a-306"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aprint_002dcontents_002a-307"></a>Print the contents of the foreign-array.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>grid:*print-foreign-array-readably*</b><var><a name="index-grid_003a_002aprint_002dforeign_002darray_002dreadably_002a-314"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aprint_002dforeign_002darray_002dreadably_002a-315"></a>Print the contents of the foreign-array with the #m reader macro.
&mdash; Variable: <b>grid:*print-foreign-array-readably*</b><var><a name="index-grid_003a_002aprint_002dforeign_002darray_002dreadably_002a-308"></a></var><br>
<blockquote><p><a name="index-grid_003a_002aprint_002dforeign_002darray_002dreadably_002a-309"></a>Print the contents of the foreign-array with the #m reader macro.
</p></blockquote></div>
</body></html>
......
......@@ -35,7 +35,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<h2 class="chapter">12 Copying</h2>
<p><a name="index-Copying-Antik-software-466"></a>All code and documentation in this collection is copyright as indicated
<p><a name="index-Copying-Antik-software-452"></a>All code and documentation in this collection is copyright as indicated
at the top of this document. It may be copied under the
<a href="http://www.gnu.org/licenses/gpl.html">GPL v3</a>.
......
......@@ -37,13 +37,13 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Operations.html#Operations">Operations<
<h4 class="subsection">4.3.2 Copying</h4>
<div class="defun">
&mdash; Generic Function: <b>grid:copy</b><var> object &amp;key specification grid-type dimensions element-type destination<a name="index-grid_003acopy-143"></a></var><br>
<blockquote><p><a name="index-grid_003acopy-144"></a>Copy contents into existing or new object.
&mdash; Generic Function: <b>grid:copy</b><var> object &amp;key specification grid-type dimensions element-type destination<a name="index-grid_003acopy-137"></a></var><br>
<blockquote><p><a name="index-grid_003acopy-138"></a>Copy contents into existing or new object.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>grid:copy-to</b><var> object &amp;optional type<a name="index-grid_003acopy_002dto-145"></a></var><br>
<blockquote><p><a name="index-grid_003acopy_002dto-146"></a>Make a grid of the specified type from the object.
&mdash; Function: <b>grid:copy-to</b><var> object &amp;optional type<a name="index-grid_003acopy_002dto-139"></a></var><br>
<blockquote><p><a name="index-grid_003acopy_002dto-140"></a>Make a grid of the specified type from the object.
</p></blockquote></div>
Copying is performed with the function <code>copy</code>. This works between
<code>grid:foreign-array</code>s, pointers, and CL arrays. There are two
......
......@@ -36,7 +36,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Grids.html#Grids">Grids</a>
<h3 class="section">4.2 Creating a grid</h3>
<p><a name="index-Grid_002c-creating-105"></a><a name="index-Creating-a-grid-106"></a>
<p><a name="index-Grid_002c-creating-99"></a><a name="index-Creating-a-grid-100"></a>
<ul class="menu">
<li><a accesskey="1" href="Reader-macro-and-function-_003ccode_003egrid_003c_002fcode_003e.html#Reader-macro-and-function-_003ccode_003egrid_003c_002fcode_003e">Reader macro and function <code>grid</code></a>
......
......@@ -36,7 +36,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Physical-Quantities.html#Physical-Quant
<h3 class="section">5.5 Date and time</h3>
<p><a name="index-Class_002c-date-and-time-352"></a><a name="index-Date-353"></a><a name="index-Time-_0028of-day_0029-354"></a><a name="index-Date-and-time_002c-creating-355"></a><a name="index-Reader-macro_002c-date-and-time-356"></a><a name="index-ISO8601-357"></a><a name="index-UTC-_0028coordinated-universal-time_0029-358"></a><a name="index-TAI-_0028atomic-time_0029-359"></a><a name="index-Coordinated-Universal-Time-_0028UTC_0029-360"></a><a name="index-International-Atomic-Time-_0028TAI_0029-361"></a><a name="index-UT1-362"></a><a name="index-Astronomical-time-_0028UT1_0029-363"></a><a name="index-Timezones-364"></a>Dates and times can be represented in Antik with the <code>timepoint</code> class. A timepoint is a specific point in Newtonian time, so includes a date and time, and a <dfn>timescale</dfn> (best thought of as a timezone). Timepoints are most conveniently made with the <dfn>#d</dfn> reader macro; the default timescale is <a href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>, and the standard format for specification of timepoints is
<p><a name="index-Class_002c-date-and-time-338"></a><a name="index-Date-339"></a><a name="index-Time-_0028of-day_0029-340"></a><a name="index-Date-and-time_002c-creating-341"></a><a name="index-Reader-macro_002c-date-and-time-342"></a><a name="index-ISO8601-343"></a><a name="index-UTC-_0028coordinated-universal-time_0029-344"></a><a name="index-TAI-_0028atomic-time_0029-345"></a><a name="index-Coordinated-Universal-Time-_0028UTC_0029-346"></a><a name="index-International-Atomic-Time-_0028TAI_0029-347"></a><a name="index-UT1-348"></a><a name="index-Astronomical-time-_0028UT1_0029-349"></a><a name="index-Timezones-350"></a>Dates and times can be represented in Antik with the <code>timepoint</code> class. A timepoint is a specific point in Newtonian time, so includes a date and time, and a <dfn>timescale</dfn> (best thought of as a timezone). Timepoints are most conveniently made with the <dfn>#d</dfn> reader macro; the default timescale is <a href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>, and the standard format for specification of timepoints is
<a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a>
<pre class="example"> ANTIK-USER&gt; #d2011-08-04T12:00
2011-08-04 12:00:00.000
......@@ -65,36 +65,36 @@ In order to convert to and from UT1, it is necessary to obtain earth orientation
<p>Dates are output in ISO8601 format. The function <code>write-us-date</code> can be used to format in US style.
<div class="defun">
&mdash; Class: <b>antik:timepoint</b><var><a name="index-antik_003atimepoint-365"></a></var><br>
<blockquote><p><a name="index-antik_003atimepoint-366"></a>Class precedence list: <code>timepoint, dtspec, standard-object, t</code>
&mdash; Class: <b>antik:timepoint</b><var><a name="index-antik_003atimepoint-351"></a></var><br>
<blockquote><p><a name="index-antik_003atimepoint-352"></a>Class precedence list: <code>timepoint, dtspec, standard-object, t</code>
<p>Specification of a point in time, including a scale.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>antik:*real-ut1-utc*</b><var><a name="index-antik_003a_002areal_002dut1_002dutc_002a-367"></a></var><br>
<blockquote><p><a name="index-antik_003a_002areal_002dut1_002dutc_002a-368"></a>If <code>nil</code>, <code>ut1</code> will be taken the same as <code>utc</code>.
&mdash; Variable: <b>antik:*real-ut1-utc*</b><var><a name="index-antik_003a_002areal_002dut1_002dutc_002a-353"></a></var><br>
<blockquote><p><a name="index-antik_003a_002areal_002dut1_002dutc_002a-354"></a>If <code>nil</code>, <code>ut1</code> will be taken the same as <code>utc</code>.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:read-time</b><var> string<a name="index-antik_003aread_002dtime-369"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dtime-370"></a>Parse the datime or time interval string and create a timepoint object.
&mdash; Function: <b>antik:read-time</b><var> string<a name="index-antik_003aread_002dtime-355"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dtime-356"></a>Parse the datime or time interval string and create a timepoint object.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:read-timepoint</b><var> string &amp;optional pos-ymdhms scale<a name="index-antik_003aread_002dtimepoint-371"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dtimepoint-372"></a>Read a timepoint from a string with specification for the position in the string of each component; pos-ymdhms is a list of year, month, day, hour, minute, and second as sequence numbers for the integers in the string. Scale is the timescale (zone) as a string or symbol. If pos-ymdhms has only three components, or only a date is provided, the timepoint created will be specifed as day-only. The default reads an <code>iso8601</code> string like <code>1999-03-30t12:33:45</code>.
&mdash; Function: <b>antik:read-timepoint</b><var> string &amp;optional pos-ymdhms scale<a name="index-antik_003aread_002dtimepoint-357"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dtimepoint-358"></a>Read a timepoint from a string with specification for the position in the string of each component; pos-ymdhms is a list of year, month, day, hour, minute, and second as sequence numbers for the integers in the string. Scale is the timescale (zone) as a string or symbol. If pos-ymdhms has only three components, or only a date is provided, the timepoint created will be specifed as day-only. The default reads an <code>iso8601</code> string like <code>1999-03-30t12:33:45</code>.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:read-us-date</b><var> string &amp;optional day-only<a name="index-antik_003aread_002dus_002ddate-373"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dus_002ddate-374"></a>Read dates and times in customary <code>us</code> format MM/DD/YYYY; times may
&mdash; Function: <b>antik:read-us-date</b><var> string &amp;optional day-only<a name="index-antik_003aread_002dus_002ddate-359"></a></var><br>
<blockquote><p><a name="index-antik_003aread_002dus_002ddate-360"></a>Read dates and times in customary <code>us</code> format MM/DD/YYYY; times may
be included as well if day-only is nil.
</p></blockquote></div>
<div class="defun">
&mdash; Function: <b>antik:write-us-date</b><var> datime<a name="index-antik_003awrite_002dus_002ddate-375"></a></var><br>
<blockquote><p><a name="index-antik_003awrite_002dus_002ddate-376"></a>Write dates and times in customary <code>us</code> format MM/DD/YYYY.
&mdash; Function: <b>antik:write-us-date</b><var> datime<a name="index-antik_003awrite_002dus_002ddate-361"></a></var><br>
<blockquote><p><a name="index-antik_003awrite_002dus_002ddate-362"></a>Write dates and times in customary <code>us</code> format MM/DD/YYYY.
</p></blockquote></div>
</body></html>
......
......@@ -35,7 +35,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<h2 class="chapter">11 Download and installation</h2>
<p><a name="index-Installation-of-Antik-463"></a><a name="index-Download-of-Antik-464"></a><a name="index-Dependencies-of-Antik-on-external-libraries-465"></a>The recommended way to download and install this software is through
<p><a name="index-Installation-of-Antik-449"></a><a name="index-Download-of-Antik-450"></a><a name="index-Dependencies-of-Antik-on-external-libraries-451"></a>The recommended way to download and install this software is through
<a href="http://www.quicklisp.org/">quicklisp</a>. Install quicklisp following
the directions, then do one of:
<pre class="example"> (ql:quickload "antik")
......
......@@ -34,7 +34,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Grids.html#Grids">Grids</a>
<h3 class="section">4.7 Efficiency</h3>
<p><a name="index-Efficiency-of-computation-for-grids-316"></a><a name="index-Grid_002c-efficiency-of-computation-317"></a>Access to elements of foreign arrays, for getting or setting, can be
<p><a name="index-Efficiency-of-computation-for-grids-310"></a><a name="index-Grid_002c-efficiency-of-computation-311"></a>Access to elements of foreign arrays, for getting or setting, can be
very slow if they are not declared. These declarations can take
<a href="http://www.lispworks.com/documentation/HyperSpec/Body/03_c.htm">several forms</a>: <samp><span class="command">declare</span></samp>, <samp><span class="command">declaim</span></samp>,
<samp><span class="command">proclaim</span></samp>, or <samp><span class="command">the</span></samp>. With the exception of the
......
......@@ -37,23 +37,23 @@ Up:&nbsp;<a rel="up" accesskey="u" href="Operations.html#Operations">Operations<
<h4 class="subsection">4.3.1 Elements</h4>
<div class="defun">
&mdash; Generic Function: <b>grid:aref</b><var> grid &amp;rest indices<a name="index-grid_003aaref-135"></a></var><br>
<blockquote><p><a name="index-grid_003aaref-136"></a>Select the element from the grid.
&mdash; Generic Function: <b>grid:aref</b><var> grid &amp;rest indices<a name="index-grid_003aaref-129"></a></var><br>
<blockquote><p><a name="index-grid_003aaref-130"></a>Select the element from the grid.