:`          ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ 2018 Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%;<=V Q2014 Edward Kmett, Charles Durham, [2015..2018] 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 a 1e-12> ` a a 1e-6? ` a a 1e-12@ ` a a 1e-6;<;<@?>=;< [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone+<FTRABBA[2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE).Trevor L. McDonell <tmcdonell@cse.unsw.edu.au> experimental non-portableNone+<FTV"b*Sink a unary functor from Accelerate termscd through two surface typesec Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone %+<FQTV6C Basis elementF8A vector is an additive group with additional structure.TODO: Support both f and gGThe zero vectorHCompute the sum of two vectors:test $ lift (V2 1 2 :: V2 Int) ^+^ lift (V2 3 4 :: V2 Int)V2 4 6I*Compute the difference between two vectors:test $ lift (V2 4 5 :: V2 Int) ^-^ lift (V2 3 1 :: V2 Int)V2 1 4J(Linearly interpolate between two vectorsK Compute the negation of a vector(test $ negated (lift (V2 2 4 :: V2 Int)) V2 (-2) (-4)LCompute the left scalar product#test $ 2 *^ lift (V2 3 4 :: V2 Int)V2 6 8M Compute the right scalar product#test $ lift (V2 3 4 :: V2 Int) ^* 2V2 6 8N)Compute division by a scalar on the right&test $ lift (V2 4 6 :: V2 Double) ^/ 2 V2 2.0 3.0O(Compute division of a scalar on the left&test $ 4 /^ lift (V2 2 4 :: V2 Double) V2 2.0 1.0P"Addition with a scalar on the left#test $ 2 +^ lift (V2 3 4 :: V2 Int)V2 5 6Q#Addition with a scalar on the right#test $ lift (V2 1 2 :: V2 Int) ^+ 3V2 4 5R%Subtraction with a scalar on the left#test $ 2 -^ lift (V2 3 4 :: V2 Int) V2 (-1) (-2)S&Subtraction with a scalar on the right#test $ lift (V2 1 2 :: V2 Int) ^- 3 V2 (-2) (-1)CDEFJIHGKLMNOPQRSFGHIJCDEKLMNOPQRSCDEFGHIJ H6I6L7M7N7O7P6Q6R6S6 Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone+<FTVE U,Free and sparse inner product/metric spaces.VMCompute 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)11WgCompute the squared norm. The name quadrance arises from Norman J. Wildberger's rational trigonometry.X Compute the W of the differenceY:Compute the distance between two vectors in a metric spaceZ.Compute the norm of a vector in a metric space[)Convert a non-zero vector to unit vector.\ Normalize a U functor to have unit Z4. This function does not change the functor if its Z is 0 or 1.] project u v computes the projection of v onto u. TU[ZYXWV\] UVWXYZ[T\]UVWXYZ[Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%+;<=>?FTVK~^)A space that has at least 1 basis vector _._!test $ lift (V1 2 :: V1 Int) ^._x2&test $ lift (V1 2 :: V1 Int) & _x .~ 3V1 3^_`^_`^_Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%+;<=>?FTVTq6A space that distinguishes 2 orthogonal basis vectors _ and r, but may have more.r#test $ lift (V2 1 2 :: V2 Int) ^._y2(test $ lift (V2 1 2 :: V2 Int) & _y .~ 3V2 1 3t*the counter-clockwise perpendicular vector'test $ perp $ lift (V2 10 20 :: V2 Int) V2 (-20) 10u-Unit vector with given phase angle (modulo 2*h)v%test $ lift (V2 1 2 :: V2 Int) ^. _yxV2 2 1 ^_`qrstuvw ^_qrsv`wtuqrsQ2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%+;<=>?FTV\7A space that distinguishes 3 orthogonal basis vectors: _, r, and . (Although it may have more)&test $ lift (V3 1 2 3 :: V3 Int) ^. _z3+test $ lift (V3 1 2 3 :: V3 Int) & _z .~ 42 V3 1 2 42 cross productscalar triple product^_`qrsvw^_qrsv`wQ2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%+;<=>?FTVj4A space that distinguishes orthogonal basis vectors _, r, , and . (Although it may have more.)'test $ lift (V4 1 2 3 4 :: V4 Int) ^._w4-test $ lift (V4 1 2 3 4 :: V4 Int) & _w .~ 42 V4 1 2 3 42OConvert 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).M^_`qrsvwM^_qrsv`wQ2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone +;=>?FTVoQ2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%*+;<=>?FTV{6Spherical linear interpolation between two quaternionsi with a specified branch cutj with a specified branch cutk with a specified branch cutl with a specified branch cutm with a specified branch cutn with a specified branch cutnorm of the imaginary componentraise a  to a scalar powerApply a rotation to a vector   axis theta builds a  representing a rotation of theta radians about axis.o0Helper for calculating with specific branch cutsp0Helper for calculating with specific branch cutsq$quadrance of the imaginary component   Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone%*+01;<=>?FTVValid Plcker coordinates p will have  p r 0QThat said, floating point makes a mockery of this claim, so you may want to use <.dThis isn't the actual metric because this bilinear form gives rise to an isotropic quadratic space.sChecks if the line is near-isotropic (isotropic vectors in this quadratic space represent lines in real 3D space).Given 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.4Checks if two lines intersect (or nearly intersect).%Check how two lines pass each other.  passes l1 l2 describes l2 when looking down l1. !Checks if two lines are parallel.sQRepresent a Plcker coordinate as a pair of 3-tuples, typically denoted U and V.!7The minimum squared distance of a line from the origin."0The point where a line is closest to the origin.#Not all 6-dimensional points correspond to a line in 3D. This predicate tests that a Plcker coordinate lies on the Grassmann manifold, and does indeed represent a 3D line.$PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a %PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a &PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a 'PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a (PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a )PThese elements form a basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). $ :: t (  a) a % :: t (  a) a & :: t (  a) a ' :: t (  a) a ( :: t (  a) a ) :: t (  a) a *[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a +[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a ,[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a -[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a .[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a /[These elements form an alternate basis for the Plcker space, or the Grassmanian manifold Gr(2,V4). * :: u a => t (  a) a + :: u a => t (  a) a , :: u a => t (  a) a - :: u a => t (  a) a . :: u a => t (  a) a / :: u a => t (  a) a    !"#$%&'()*+,-./   !"#$%&*).+/',(-5@2014 Edward Kmett [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone+<FTmACompute the trace of a matrixB Compute the diagonal of a matrix@AB@AB@ABQ2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone+<FTV!KTMatrix product. This can compute any combination of sparse and dense multiplication.etest $ 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)V2 (V2 19 25) (V2 43 58)LEntry-wise matrix addition.`test $ lift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !+! lift (V2 (V3 7 8 9) (V3 1 2 3) :: M23 Int)V2 (V3 8 10 12) (V3 5 7 9)MEntry-wise matrix subtraction.`test $ lift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !-! lift (V2 (V3 7 8 9) (V3 1 2 3) :: M23 Int)!V2 (V3 (-6) (-6) (-6)) (V3 3 3 3)NMatrix * column vectorNtest $ lift (V2 (V3 1 2 3) (V3 4 5 6) :: M23 Int) !* lift (V3 7 8 9 :: V3 Int) V2 50 122ORow vector * matrixLtest $ lift (V2 1 2 :: V2 Int) *! lift (V2 (V3 3 4 5) (V3 6 7 8) :: M23 Int) V3 15 18 21PScalar-matrix product3test $ 5 *!! lift (V2 (V2 1 2) (V2 3 4) :: M22 Int)V2 (V2 5 10) (V2 15 20)QMatrix-scalar product3test $ lift (V2 (V2 1 2) (V2 3 4) :: M22 Int) !!* 5V2 (V2 5 10) (V2 15 20)RMatrix-scalar divisionS-The identity matrix for any dimension vector."test $ (identity :: Exp (M44 Int))6V4 (V4 1 0 0 0) (V4 0 1 0 0) (V4 0 0 1 0) (V4 0 0 0 1)&test $ (identity :: Exp (V3 (V3 Int)))#V3 (V3 1 0 0) (V3 0 1 0) (V3 0 0 1)TT is just an alias for vBtest $ transpose $ lift (V3 (V2 1 2) (V2 3 4) (V2 5 6) :: M32 Int)V2 (V3 1 3 5) (V3 2 4 6)U$Build a rotation matrix from a unit V=Build a transformation matrix from a rotation expressed as a  and a translation vector.WOBuild a transformation matrix from a rotation matrix and a translation vector.X8Convert a 4x3 matrix to a 4x4 matrix, extending it with  [ 0 0 0 1 ] column vectorYXConvert a 3x3 matrix to a 4x4 matrix extending it with zeros in the new row and column.Z2x2 matrix determinant[3x3 matrix determinant\4x4 matrix determinant]2x2 matrix inverse^3x3 matrix inverse_4x4 matrix inverse!@ABKLMNOPQRSTUVWXYZ[\]^_!KLMNOQPRYXZ[\]^_ST@ABUVWK7L6M6N7O7P7Q7R7Q2014 Edward Kmett, Charles Durham, [2015..2018] Trevor L. McDonell BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> experimental non-portableNone  ;<ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`qrstuvw  !"#$%&'()*+,-./@ABKLMNOPQRSTUVWXYZ[\]^_w !"#"#$%$%&'&'()()*+*+,-,-./.0.1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o pqrstuvwxyz{|}~vwxy|vwxy|vwxy|yx|   @ vwx | !"#$%&'()*+,-./vwx01|23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_[`ab[cd[ceXfgXfhXfiXfjXfkXflXfmnop[qrstuv[wxyz{|0linear-accelerate-0.6.0.0-BpK6On8u7y47YniNPkdvHV#Data.Array.Accelerate.Linear.Matrix$Data.Array.Accelerate.Linear.Plucker'Data.Array.Accelerate.Linear.QuaternionData.Array.Accelerate.Linear.V0Data.Array.Accelerate.Linear.V4Data.Array.Accelerate.Linear.V3Data.Array.Accelerate.Linear.V2Data.Array.Accelerate.Linear.V1&Data.Array.Accelerate.Linear.Conjugate$Data.Array.Accelerate.Linear.Epsilon!Data.Array.Accelerate.Linear.Type#Data.Array.Accelerate.Linear.Vector#Data.Array.Accelerate.Linear.Metric"Data.Array.Accelerate.Linear.Trace!Data.Array.Accelerate.Linear.LiftData.Array.Accelerate.Linear$linear-1.20.7-A94GAJeQ1UJ94Gh1xcTI1S Linear.MatrixM22M23M24M32M33M34M42M43M44Linear.PluckerPluckerCounterclockwise ClockwiseCoplanarLinePassLinear.Quaternion Quaternion Linear.V0V0 Linear.V4V4 Linear.V3V3 Linear.V2V2 Linear.V1V1Linear.Conjugate conjugate ConjugateTrivialConjugate$fTrivialConjugateExp$fTrivialConjugateExp0$fTrivialConjugateExp1$fTrivialConjugateExp2$fTrivialConjugateExp3$fTrivialConjugateExp4$fTrivialConjugateExp5$fTrivialConjugateExp6$fTrivialConjugateExp7$fTrivialConjugateExp8$fTrivialConjugateExp9$fTrivialConjugateExp10$fTrivialConjugateExp11$fTrivialConjugateExp12$fConjugateExp$fConjugateExp0$fConjugateExp1$fConjugateExp2$fConjugateExp3$fConjugateExp4$fConjugateExp5$fConjugateExp6$fConjugateExp7$fConjugateExp8$fConjugateExp9$fConjugateExp10$fConjugateExp11$fConjugateExp12$fConjugateExp13EpsilonnearZero$fEpsilonCDouble$fEpsilonCFloat$fEpsilonDouble$fEpsilonFloatBox2BoxEelAdditivezero^+^^-^lerpnegated*^^*^//^+^^+-^^-IsMetricMetricdot quadranceqddistancenormsignorm normalizeprojectR1_xex $fFunctorV1 $fEpsilonV1 $fFloatingExp$fFractionalExp$fNumExp $fBoundedExp$fOrdV1$fEqV1$fEachExpExpExpExp $fUnliftExpV1 $fLiftExpV1$fIsProductcstV1$fEltV1 $fAdditiveV1 $fMetricV1$fR1V1R2_y_xyperpangle_yxey $fFunctorV2 $fEpsilonV2$fOrdV2$fEqV2 $fUnliftExpV2 $fLiftExpV2$fIsProductcstV2$fEltV2$fR1V2 $fAdditiveV2 $fMetricV2$fR2V2R3_z_xyzcrosstriple_xz_yz_zx_zy_xzy_yxz_yzx_zxy_zyxez $fFunctorV3 $fEpsilonV3$fOrdV3$fEqV3 $fUnliftExpV3 $fLiftExpV3$fIsProductcstV3$fEltV3$fR2V3$fR1V3 $fAdditiveV3 $fMetricV3$fR3V3R4_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 $fFunctorV4 $fEpsilonV4$fOrdV4$fEqV4 $fUnliftExpV4 $fLiftExpV4$fIsProductcstV4$fEltV4$fR3V4$fR2V4$fR1V4 $fAdditiveV4 $fMetricV4$fR4V4 $fFunctorV0$fOrdV0$fEqV0 $fUnliftExpV0 $fLiftExpV0$fIsProductcstV0$fEltV0 $fAdditiveV0 $fMetricV0slerpasinqacosqatanqasinhqacoshqatanhqabsipowrotate axisAngle$fFunctorQuaternion$fEpsilonQuaternion$fOrdQuaternion$fEqQuaternion$fUnliftExpQuaternion$fLiftExpQuaternion$fIsProductcstQuaternion$fEltQuaternion$fAdditiveQuaternion$fMetricQuaternion squaredError>< isotropicplucker plucker3D intersectspassesparallelquadranceToOriginclosestToOriginisLinep01p02p03p23p31p12p10p20p30p32p13p21 $fEqLinePass $fEltLinePass$fFunctorPlucker$fEpsilonPlucker $fOrdPlucker $fEqPlucker$fUnliftExpPlucker$fLiftExpPlucker$fIsProductcstPlucker $fEltPlucker$fAdditivePlucker$fMetricPluckerTracetracediagonal$fTraceQuaternion$fTracePlucker $fTraceV4 $fTraceV3 $fTraceV2 $fTraceV1 $fTraceV0$fTraceComplex!*!!+!!-!!**!*!!!!*!!/identity transposefromQuaternionmkTransformationmkTransformationMat m43_to_m44 m33_to_m44det22det33det44inv22inv33inv44baseGHC.Numabs)accelerate-1.2.0.0-916JS7MAY1kL8ncMNEqdSw!Data.Array.Accelerate.Classes.Ord<=fsink1unlift'Data.Array.Accelerate.LiftunliftliftLensData.Array.Accelerate.SmartExpAcc GHC.FloatpiasinacosatanasinhacoshatanhcutcutWithqi Data.Array.Accelerate.Classes.Eq==toUV!lens-4.16.1-cE5AUiZDRw7ch1hh8OBxCControl.Lens.TypeLens'!Data.Array.Accelerate.Classes.NumNum)distributive-0.5.3-Ji0AuDEAzLqJ9qz0TO4QLqData.Distributive distribute