! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone*:DR I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone $*:DORT Basis element8A vector is an additive group with additional structure.TODO: Support both  and The zero vectorCompute the sum of two vectorsV2 1 2 ^+^ V2 3 4V2 4 6 *Compute the difference between two vectorsV2 4 5 - V2 3 1V2 1 4!(Linearly interpolate between two vectors" Compute the negation of a vectornegated (V2 2 4) V2 (-2) (-4)#Compute the left scalar product 2 *^ V2 3 4V2 6 8$ Compute the right scalar product V2 3 4 ^* 2V2 6 8%)Compute division by a scalar on the rightV2 4 6 ^/ 2 V2 2 3&(Compute division of a scalar on the left 4 /^ V2 2 4V2 2 1'"Addition with a scalar on the left 2 +^ V2 3 4V2 5 4(#Addition with a scalar on the right V2 1 2 ^+ 3V2 4 3)%Subtraction with a scalar on the left 2 -^ V2 3 4V2 1 2*&Subtraction with a scalar on the right V2 1 2 ^- 3 V2 (-2) (-1) !"#$%&'()* !"#$%&'()* !"#$%&'()*  !"#$%&'()* 6 6#7$7%7&7'6(6)6*6 2015 Trevor L. McDonell BSD-style (see the file LICENSE).Trevor L. McDonell <tmcdonell@cse.unsw.edu.au> experimental non-portableNone*:DRT*Sink a unary functor from Accelerate terms through two surface types I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone*:+DProvides a fairly subjective test to see if a quantity is near zero.nearZero (1e-11 :: Double)FalsenearZero (1e-17 :: Double)TruenearZero (1e-5 :: Float)FalsenearZero (1e-7 :: Float)True,%Determine if a quantity is near zero.-  a  1e-12.  a  1e-6/  a  1e-120  a  1e-6+,-./0+,+,0/.-+,-./0 I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone*:DRT 2,Free and sparse inner product/metric spaces.3MCompute the inner product of two vectors or (equivalently) convert a vector f a into a covector f a -> a.V2 1 2 `dot` V2 3 4114gCompute the squared norm. The name quadrance arises from Norman J. Wildberger's rational trigonometry.5 Compute the 4 of the difference6:Compute the distance between two vectors in a metric space7.Compute the norm of a vector in a metric space8)Convert a non-zero vector to unit vector.9 Normalize a 2 functor to have unit 74. This function does not change the functor if its 7 is 0 or 1.: project u v computes the projection of v onto u. 123456789: 123456789: 234567819:123456789:I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone *9;<=DRT;<=>?@AB;<=>?@ABI2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone$*9:;<=DRTC)A space that has at least 1 basis vector D.D V1 2 ^._x2V1 2 & _x .~ 3V1 3CDEFGHIJKLMNOPCDECDE CDEFGHIJKLMNOPI2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone$*9:;<=DRTQ6A space that distinguishes 2 orthogonal basis vectors D and R, but may have more.R V2 1 2 ^._y2V2 1 2 & _y .~ 3V2 1 3T*the counter-clockwise perpendicular vectorperp $ V2 10 20 V2 (-20) 10U-Unit vector with given phase angle (modulo 2*)V V2 1 2 ^. _yxV2 2 1QRSTUVWXYZ[\]^_`abc CDEQRSTUVW CDQRSVEWTUQRSTUVWXYZ[\]^_`abcI2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone$*9:;<=DRTd7A space that distinguishes 3 orthogonal basis vectors: D, R, and e. (Although it may have more)eV3 1 2 3 ^. _z3g cross producthscalar triple productdefghijklmnopqrstuvwxyz{|}~CDEQRSVWdefghijklmnopqrghCDQRSVdefijklmnopqEWrdefghijklmnopqrstuvwxyz{|}~I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone *9;<=DRT  I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone$*9:;<=DRT4A space that distinguishes orthogonal basis vectors D, R, e, and . (Although it may have more.)V4 1 2 3 4 ^._w4OConvert a 3-dimensional affine vector into a 4-dimensional homogeneous vector.NConvert a 3-dimensional affine point into a 4-dimensional homogeneous vector.gConvert 4-dimensional projective coordinates to a 3-dimensional point. This operation may be denoted, %euclidean [x:y:z:w] = (x/w, y/w, z/w)/ where the projective, homogenous, coordinate  [x:y:z:w]0 is one of many associated with a single point (x/w, y/w, z/w).DM CDEQRSVWdefijklmnopqrM CDQRSVdefijklmnopqEWrBI2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone*/09:;<=DRTValid Plcker coordinates p will have  p  0QThat said, floating point makes a mockery of this claim, so you may want to use nearZero.cThis isn't the actual metric because this bilinear form gives rise to an isotropic quadratic spaceGiven a pair of points represented by homogeneous coordinates generate Plcker coordinates for the line through them, directed from the second towards the first.Given a pair of 3D points, generate Plcker coordinates for the line through them, directed from the second towards the first.   5I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone*:DRT Compute the trace of a matrix Compute the diagonal of a matrixTMatrix product. This can compute any combination of sparse and dense multiplication.:V2 (V3 1 2 3) (V3 4 5 6) !*! V3 (V2 1 2) (V2 3 4) (V2 4 5)V2 (V2 19 25) (V2 43 58)SV2 (fromList [(1,2)]) (fromList [(2,3)]) !*! fromList [(1,V3 0 0 1), (2, V3 0 0 5)]V2 (V3 0 0 2) (V3 0 0 15)Entry-wise matrix addition.5V2 (V3 1 2 3) (V3 4 5 6) !+! V2 (V3 7 8 9) (V3 1 2 3)V2 (V3 8 10 12) (V3 5 7 9)Entry-wise matrix subtraction.5V2 (V3 1 2 3) (V3 4 5 6) !-! V2 (V3 7 8 9) (V3 1 2 3)!V2 (V3 (-6) (-6) (-6)) (V3 3 3 3)Matrix * column vector$V2 (V3 1 2 3) (V3 4 5 6) !* V3 7 8 9 V2 50 122Row vector * matrix"V2 1 2 *! V2 (V3 3 4 5) (V3 6 7 8) V3 15 18 21Scalar-matrix product5 *!! V2 (V2 1 2) (V2 3 4)V2 (V2 5 10) (V2 15 20)Matrix-scalar productV2 (V2 1 2) (V2 3 4) !!* 5V2 (V2 5 10) (V2 15 20)Matrix-scalar division-The identity matrix for any dimension vector.identity :: M44 Int6V4 (V4 1 0 0 0) (V4 0 1 0 0) (V4 0 0 1 0) (V4 0 0 0 1)identity :: V3 (V3 Int)#V3 (V3 1 0 0) (V3 0 1 0) (V3 0 0 1) is just an alias for  )transpose (V3 (V2 1 2) (V2 3 4) (V2 5 6))V2 (V3 1 3 5) (V3 2 4 6)76677777I2014 Edward Kmett, Charles Durham, 2015 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone   !"#$%&'()*+,123456789:CDEQRSTUVWdefghijklmnopqr ! !"#"#$%$%&'&' ( ) * * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I JKLMNOPQRSTUKVWLXYZ[\]^_`abcdeKVWLfghijklmnopqrstuvwxyz{|KVWL}~KKVWLK +linear-accelerate-0.3-1hKjFmdEugHbnO4AmL79L#Data.Array.Accelerate.Linear.Matrix'Data.Array.Accelerate.Linear.Quaternion$Data.Array.Accelerate.Linear.PluckerData.Array.Accelerate.Linear.V4Data.Array.Accelerate.Linear.V3Data.Array.Accelerate.Linear.V2Data.Array.Accelerate.Linear.V1Data.Array.Accelerate.Linear.V0!Data.Array.Accelerate.Linear.Type#Data.Array.Accelerate.Linear.Vector$Data.Array.Accelerate.Linear.Epsilon#Data.Array.Accelerate.Linear.Metric!Data.Array.Accelerate.Linear.LiftData.Array.Accelerate.Linear$linear-1.20.5-CEAsJizrl7jL0iAxtpGqYP Linear.MatrixM22M23M24M32M33M34M42M43M44Linear.Quaternion QuaternionLinear.PluckerPlucker Linear.V4V4 Linear.V3V3 Linear.V2V2 Linear.V1V1 Linear.V0V0Box2BoxEel IsAdditiveAdditivezero^+^^-^lerpnegated*^^*^//^+^^+-^^-EpsilonnearZero$fEpsilonCDouble$fEpsilonCFloat$fEpsilonDouble$fEpsilonFloatIsMetricMetricdot quadranceqddistancenormsignorm normalizeproject$fEachExpExpExpExp$fNumExp $fUnliftExpV0 $fLiftExpV0$fIsProductcstV0$fEltV0 $fAdditiveV0 $fMetricV0R1_xex $fFloatingExp$fFractionalExp $fUnliftExpV1 $fLiftExpV1$fIsProductcstV1$fEltV1$fR1V1 $fAdditiveV1 $fMetricV1R2_y_xyperpangle_yxey $fUnliftExpV2 $fLiftExpV2$fIsProductcstV2$fEltV2$fR2V2$fR1V2 $fAdditiveV2 $fMetricV2R3_z_xyzcrosstriple_xz_yz_zx_zy_xzy_yxz_yzx_zxy_zyxez $fUnliftExpV3 $fLiftExpV3$fIsProductcstV3$fEltV3$fR3V3$fR2V3$fR1V3 $fAdditiveV3 $fMetricV3$fUnliftExpQuaternion$fLiftExpQuaternion$fIsProductcstQuaternion$fEltQuaternion$fAdditiveQuaternion$fMetricQuaternionR4_w_xyzwvectorpointnormalizePoint_xw_yw_zw_wx_wy_wz_xyw_xzw_xwy_xwz_yxw_yzw_ywx_ywz_zxw_zyw_zwx_zwy_wxy_wxz_wyx_wyz_wzx_wzy_xywz_xzyw_xzwy_xwyz_xwzy_yxzw_yxwz_yzxw_yzwx_ywxz_ywzx_zxyw_zxwy_zyxw_zywx_zwxy_zwyx_wxyz_wxzy_wyxz_wyzx_wzxy_wzyxew $fUnliftExpV4 $fLiftExpV4$fIsProductcstV4$fEltV4$fR4V4$fR3V4$fR2V4$fR1V4 $fAdditiveV4 $fMetricV4 squaredError><plucker plucker3D$fUnliftExpPlucker$fLiftExpPlucker$fIsProductcstPlucker $fEltPlucker$fAdditivePlucker$fMetricPluckerTracetracediagonal!*!!+!!-!!**!*!!!!*!!/identity transpose$fTraceQuaternion$fTracePlucker $fTraceV4 $fTraceV3 $fTraceV2 $fTraceV1 $fTraceV0$fTraceComplex)accelerate-1.0.0.0-LOVA0lgXCNoEnbnEOzAgocData.Array.Accelerate.SmartExpAccfsink1unlift'Data.Array.Accelerate.LiftunliftliftLensbaseGHC.Numabs!Data.Array.Accelerate.Classes.Ord<= GHC.Floatpi Data.Array.Accelerate.Classes.Eq==)distributive-0.5.2-JCgfTXNR3ywAyV7fFWIBI5Data.Distributive distribute