I              ! " # $ % & ' ( ) * + , - . / 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 vectors3lift (V2 1 2 :: V2 Int) ^+^ lift (V2 3 4 :: V2 Int)(4,6) *Compute the difference between two vectors3lift (V2 4 5 :: V2 Int) ^-^ lift (V2 3 1 :: V2 Int)(1,4)!(Linearly interpolate between two vectors" Compute the negation of a vector!negated (lift (V2 2 4 :: V2 Int))(-2,-4)#Compute the left scalar product2 *^ lift (V2 3 4 :: V2 Int)(6,8)$ Compute the right scalar productlift (V2 3 4 :: V2 Int) ^* 2(6,8)%)Compute division by a scalar on the right'lift (V2 4 6 :: V2 Double) ^/ 2 V2 2 3&(Compute division of a scalar on the left4 /^ lift (V2 2 4 :: V2 Double) (2.0,1.0)'"Addition with a scalar on the left2 +^ lift (V2 3 4 :: V2 Int)(5,6)(#Addition with a scalar on the rightlift (V2 1 2 :: V2 Int) ^+ 3(4,5))%Subtraction with a scalar on the left2 -^ lift (V2 3 4 :: V2 Int)(-1,-2)*&Subtraction with a scalar on the rightlift (V2 1 2 :: V2 Int) ^- 3(-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 :: Exp Double)FalsenearZero (1e-17 :: Exp Double)TruenearZero (1e-5 :: Exp Float)FalsenearZero (1e-7 :: Exp 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.5lift (V2 1 2 :: V2 Int) `dot` lift (V2 3 4 :: V2 Int)114gCompute 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.Dlift (V1 2 :: V1 Int) ^._x2lift (V1 2 :: V1 Int) & _x .~ 3(3)CDEFGHIJKLMNOPCDECDE 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.Rlift (V2 1 2 :: V2 Int) ^._y2!lift (V2 1 2 :: V2 Int) & _y .~ 3(1,3)T*the counter-clockwise perpendicular vector perp $ lift (V2 10 20 :: V2 Int)(-20,10)U-Unit vector with given phase angle (modulo 2*)Vlift (V2 1 2 :: V2 Int) ^. _yx(2,1)QRSTUVWXYZ[\]^_`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)elift (V3 1 2 3 :: V3 Int) ^. _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.) lift (V4 1 2 3 4 :: V4 Int) ^._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.^lift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !*! lift (V3 (V2 1 2) (V2 3 4) (V2 4 5) :: M32 Int)((19,25),(43,58))Entry-wise matrix addition.Ylift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !+! lift (V2 (V3 7 8 9) (V3 1 2 3) :: M23 Int)((8,10,12),(5,7,9))Entry-wise matrix subtraction.Ylift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !-! lift (V2 (V3 7 8 9) (V3 1 2 3) :: M23 Int)((-6,-6,-6),(3,3,3))Matrix * column vectorGlift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !* lift (V3 7 8 9 :: V3 Int)(50,122)Row vector * matrixElift (V2 1 2 :: V2 Int) *! lift (V2 (V3 3 4 5) (V3 6 7 8) :: M23 Int) (15,18,21)Scalar-matrix product,5 *!! lift (V2 (V2 1 2) (V2 3 4) :: M22 Int)((5,10),(15,20))Matrix-scalar product,lift (V2 (V2 1 2) (V2 3 4) :: M22 Int) !!* 5((5,10),(15,20))Matrix-scalar division-The identity matrix for any dimension vector.identity :: Exp (M44 Int) let x0 = 1 in let x1 = 0<in ((x0,x1,x1,x1),(x1,x0,x1,x1),(x1,x1,x0,x1),(x1,x1,x1,x0))identity :: Exp (V3 (V3 Int)) let x0 = 1 in let x1 = 0%in ((x0,x1,x1),(x1,x0,x1),(x1,x1,x0)) 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.4.1-CPlFGmHWFcwLmrSqvt6wZt#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.7-J48wxCiL56n44WGjfz6m2i 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-DNMaseN2lx2IwtzNggv28IData.Array.Accelerate.SmartExpAccfsink1unlift'Data.Array.Accelerate.LiftunliftliftLensbaseGHC.Numabs!Data.Array.Accelerate.Classes.Ord<= GHC.Floatpi Data.Array.Accelerate.Classes.Eq==)distributive-0.5.3-EuIpsHoIr4FDrtYfl5sBVOData.Distributive distribute