!7E      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv w x y z { | } ~                          ! " # $ % & ' ( ) * + , - . / 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 [ \ ] ^ _ ` a b c d e f g h i j k l mnopqrstuvwxyz{|}~Safe numericalThe same functor, but with an 6 instance that performs actions in the reverse order.  numericalDerived instance.  numericalDerived instance.  numerical&Try alternatives in the same order as f.  numericalApply f-actions in the reverse order. numericalDerived instance.  SafeF numerical+A state transformer monad parameterized by:s - The state.m - The inner monad.The , function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second. numerical(A state monad parameterized by the type s of the state to carry.The , function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second. numericalIdentity functor and monad. numericalFConstruct a state monad computation from a function. (The inverse of .) numericalAUnwrap a state monad computation as a function. (The inverse of .) numericalrEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =  ( m s) numericalrEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =  ( m s) numericalUMap both the return value and final state of a computation using the given function.  ( f m) = f .  m numerical f m executes action m" on a state modified by applying f.  f m = " f >> m numericalrEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =   ( m s) numericalrEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =   ( m s) numericalUMap both the return value and final state of a computation using the given function.  ( f m) = f .  m numerical f m executes action m" on a state modified by applying f.  f m = " f >> m  numerical6Fetch the current value of the state within the monad.! numerical! s$ sets the state within the monad to s." numerical" f@ is an action that updates the state to the result of applying f to the current state. " f =   >>= (! . f)# numerical A variant of "6 in which the computation is strict in the new state. # f =   >>= (() ! . f)$ numericalMGet a specific component of the state, using a projection function supplied. $ f =  f   numericalpure state transformer numerical$equivalent state-passing computation numerical$state-passing computation to execute numerical initial state numericalreturn value and final state numerical$state-passing computation to execute numerical initial value numerical%return value of the state computation numerical$state-passing computation to execute numerical initial value numerical final state !"#$ !"#$Safe-.HVGNone .27@AHMVL_3 numericalAthis m newtype LogicalExtent sparse address seems to be dead atm numerical is possibly dead code7 numerical7 is the type used for addressing into the underlying memory buffers of numerical arrays, Used for Dense Rank n arrays, and 1dim sparse arrays.345678783456Safe.12HVMOPQRSTQRSTPOSafe 24567=?@ACPY numerical2this is uniform address interval by any other namea numericalywhenever you are tempted to do a (lo,hi) tuple, use this instead This should perhaps be made lazy, but strict for now. YZ[\]^_`abcde abcdYZ[\]^_`e None124567=>?@AHVZx numericalx is the type index for |s that use the 9 for values, in pinned byte array buffers, provided by y numericaly is the type index for |'s that use the unboxed data structure * as the underlying storage representation.z numericalz is the type index for |%s that use the boxed data structure + as the underlying storage representation.| numericalThe class instance | mode a> is a shorthand for saying that a given buffer representation mode has a  instance for both w and v. numericalv~}wxyz{|zyxwv~}|{ None&'-.=>?@AHV[E None &'.=>?@AHV\K Safe\Safe&',.2=>?@ACHUVX]Safe&',.12HSUVX^eNone&'.124=>?@ACHUVXc numerical is the I operator lifted onto a sized vector to induce a partial order relation numerical is the I operator lifted onto a sized vector to induce a partial order relation3 None&'.123=>?@ACHUVX  numerical } only has instances for Dense array formats. this class will need some sprucing up for the beta, but its ok for now. NB that  ^ is really strictly meant to be used for optimization purposes, and not meant as a default api numericalz is the type class that supports the modle widely usable class of slicing operations in Numerical. for every instance  format rank orientation, a corresponding  form ,  form and  form' type family instance should be definedThe purpose of  class is to provide numericalK provides a runtime mechanism for reflecting the orientation of the format numericalFor  form==shp, we always have that ( form  shp. when  holds, that implies that the underlying array format is a rectilinear layout whose "elements" are tiles of a fixed size array format. For this initial release and initial set of applicable rectilinear array formats, the following is always true (" form == basicLogicalShape' form  Should be O(1) always. Or more precisely O(rank) numerical fm (x,y) requires that y-x>=1, ie that more than one sub range wrt the major axis be selected, so that the logical rank of the selected array stays the same. This operation also preserves memory locality as applicable. O(1) / O(rank) numericalmajorAxixProject form xY picks a "row" with respect to the outer most dimension of the array format. This will O(1) or O(rank) numericalKthis is the nonstrided subset of general array slice notation. Invoke as rectilinearSlice" form leastCorner greatestCornerP, where the least and greatest corners of the sub array are determined by the X partial order on the bounds of the sub array. For Dense array formats, this should be O(1) or more precisely O(rank)H For the basic Sparse array formats thus far the complexity should be O(size of outermost dimension), which could be computed by 2fst . unconsOuter [form] . rectilinearShape $ form numericalEvery instance of  needs to have a corresponding , , and " numericalVthese names aren't ideal, but lets punt on bikeshedding till theres >= 2 serious users' numericalthe ' type class( numerical( gives the extent of the format) numerical) converts a given format into its "contiguous" analogue this is useful for supporting various address translation manipulation tricks efficiently. Note that any valid simple format should strive to ensure this is an O(1) operation. though certain composite '/ instances may provide a slower implementation.* numerical* transposes the format data type+ numerical+3 lets you compare where two (presumably inbounds) / values are in a formats ordering. The logical  of the array is not needed, numericalMthe (possibly empty) min and max of the valid addresses for a given format. 1minAddress = fmap _RangeMin . rangedFormatAddress and 1maxAddress = fmap _RangeMax . rangedFormatAddress& FIXME : This also is a terrible name- numerical-I takes an Index, and tries to translate it to an address if its in bounds. numerical. takes an address, and always successfully translates it to a valid index. Behavior of invalid addresses constructed by a library user is unspecified./ numerical/| takes an address, and tries to compute the next valid address, or returns Nothing if there is no subsequent valid address.0 numerical0 form ix mbeAddress' computes the next valid index after ix if it exists. It takes a  address as a hint for where to do the search for the successor. If the index is in bounds and not the last index, it returns both the index and the associated address.2 numericalThis operation is REALLY unsafe This should ONLY be used on Formats that are directly paired with a Buffer or Mutable Buffer (ie a Vector) This operation being in this class is also kinda a hack but lets leave it here for now3 numericalThe semantics of 3 form addr stepB is that when step > 0, its equivalent to iteratively computing / stepC times. However, the step size can be negative, which means it can4 numericalevery format has a "logical" sibling, that represents the address translation when the underlying buffer layer is contiguous and packed. So it could be claimed that any type that obeys a~4 a6 is one that an be a legal instance of LayoutBuilder?9 numericalGeneralized Dense Slice Projection notation, not sure if it should be defined in this module or elsewhere This provides a type safe interface for the classical general array slice notation. That said, its only useful for dense array formats, at least in general. For formats that aren't "rectilinear dense", this COULD be used as a description format for traversing over various rectilinear subsets of points though?> numericalthis is kinda a hack}345678OPQRSTYZ[\]^_`abcdev~}wxyz{|  !"#$%&'+()*,-./0123456789:;<=>?@ABCD8'+()*,-./0123 54678>?@9:;<= !"#$%&BADC None.123=>?@ACHUV-345678OPQRSTYZ[\]^_`abcdev~}wxyz{|  !"#$%&'+()*,-./012345678cb`a_9:;<=>?@ABCDLMNOPQRSTUVWXYZ[\]^&'+()*,-./0123Z][^\8cb`a_TUVWXYLMNOPQRSNone&'.123=>?@ACHMUV numerical~note that basicAffineAddressShiftGeneric may be suboptimal, need to investigate what the core looks like also TODO needs tests numerical8 o S ( ) is a 1dim array ' with a regular stride >= 1 numerical8 o R ( ) is a 1dim array ' with unit stride numerical8 n R n is a rank n Array345678OPQRSTYZ[\]^_`abcdev~}wxyz{|  !"#$%&'+()*,-./012345678~{xvsp|}yzwtuqr9:;<=>?@ABCDmno" QRST8~{xvsp|}yzwtuqrnmoNone&'.2=>?@ACHSUVXNonem345678OPQRSTYZ[\]^_`abcdev~}wxyz{|  !"#$%&'+()*,-./012345678cb`a_~{xvsp|}yzwtuqr9:;<=>?@ABCDLMNOPQRSTUVWXYZ[\]^mnoSafeĭ numerical)Every numerical algorithm runs somewhere. This could be on a CPU, a GPU, None&',.2=>?@ACHUVX  numerical is an O(1) bounds check. numerical numericalYYield the element at the given position. This method should not be called directly, use  unsafeRead instead. numericalgives the shape, a rank length list of the dimensions numerical numerical+return the Range of valid logical addresses numericalgives the next valid logical address undefined on invalid addresses and the greatest valid address. Note that for invalid addresses in between minAddress and maxAddress, will return the next valid address numerical[gives the next valid array index undefined on invalid indices and the greatest valid index numericalfor a given valid address, basicAddressRegion addr / will return an AddressInterval that contains addrR. This will be a singleton when the "maximal uniform stride interval" containing addr has strictly less than 3 elements. Otherwise will return an Address range covering the maximal interval that will have cardinality at least 3. numericalYYield the element at the given position. This method should not be called directly, use unsafeSparseRead instead.None&',.2=>?@ACHUVX} numerical marr should equal Row or Column for any sane choice of instance, because every MutableRectilinear instance will have a notion of what the nominal major axix will be. The intended use case is side condition constraints like  marr~Row)=> marr -> b  for operations where majorAxix projections are correct only for Row major formats. Such as Row based forward/backward substitution (triangular solvers) numericalnMutableInnerContigArray is the "meet" (minimum) of the locality level of marr and InnerContiguous. Thus both Contiguous and InnerContiguous are made InnerContiguous, and Strided stays Strided for now this makes sense to have in the MutableRectilinear class, though that may change. This could also be thought of as being the GLB (greatest lower bound) on locality numericalbasicSliceMajorAxis arr (x,y) returns the sub array of the same rank, with the outermost (ie major axis) dimension of arr restricted to the (x,y) is an inclusive interval, MUST satisfy x<y , and be a valid subinterval of the major axis of arr. numerical arr ix1 ix2/ picks out the (hyper) rectangle in dimension rank) where ix1 is the minimal corner and ix2 numerical}for Dense arrays, it is always easy to check if a given index is valid. this operation better have O(1) complexity or else! numericalYYield the element at the given position. This method should not be called directly, use  unsafeRead instead. numerical[Replace the element at the given position. This method should not be called directly, use  unsafeWrite instead. numericalgives the next valid logical address undefined on invalid addresses and the greatest valid address. Note that for invalid addresses in between minAddress and maxAddress, will return the next valid address. numerical[gives the next valid array index undefined on invalid indices and the greatest valid index numerical9 is needed to handle abstracting access in popcount space numericalUnsafely convert a mutable Array to its immutable version without copying. The mutable Array may not be used after this operation. Assumed O(1) complexity numericalUnsafely convert a pure Array to its mutable version without copying. the pure array may not be used after this operation. Assumed O(1) complexity numericalgives the shape, a rank length list of the dimensions numerical reports the number of manifest addresses/entries are in the array in a given address sub range. This is useful for determining when to switch from a recursive algorithm to a direct algorithm. Should this be renamed to something like basicPopCount/ numericalbasicMutableAddressToIndex2 assumes you only give it legal manifest addresses numerical5return the smallest and largest valid logical address numericalgives the next valid logical address undefined on invalid addresses and the greatest valid address. Note that for invalid addresses in between minAddress and maxAddress, will return the next valid address. numericalCgives the next valid array index, the least valid index that is or numericalfor a given valid address, basicAddressRegion addr / will return an AddressInterval that contains addrR. This will be a singleton when the "maximal uniform stride interval" containing addr has strictly less than 3 elements. Otherwise will return an Address range covering the maximal interval that will have cardinality at least 3. numericalMthis doesn't quite fit in this class, but thats ok, will deal with that later numericalReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. This method should not be called directly, use clear instead. numericalYYield the element at the given position. This method should not be called directly, use unsafeSparseRead instead. numericalSadly ~ will have to have instances written by hand for now May later migrate the freeze / thaw machinery to Array.Phased, but lets numericalEvery  MutableArrayl instance has a contiguous version of itself, This contiguous version will ALWAYS have a Builder instance. numerical is the generic data family thatGxyz*zyx !"#$$%&'()*+,--./00123456789:;<=>?@ABCDEFGHIJKLMNOOPQRRSTUVWXYZ[\]^_`abcdefghijklmnopqrsstuvwxyzz{|}~                                        !"#$ % & ' ( ) * + , - . / 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 V W X Y Z [ \ ] ^ _ ` 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 { | } ~     {|}~DGHGHD     (numerical-0.0.0.0-G1yWw4Hx7O95VnU5FU3zyONumerical.Array.Shape Numerical.NatNumerical.InternalUtils&Control.NumericalApplicative.Backwards#Control.NumericalMonad.State.StrictNumerical.Array.AddressNumerical.Array.LocalityNumerical.Array.RangeNumerical.Array.StorageNumerical.Data.Vector.HPairNumerical.Data.Vector.PairNumerical.Array.Layout.BaseNumerical.Array.Layout.SparseNumerical.Array.Layout.DenseNumerical.Array.Layout.BuilderNumerical.WorldNumerical.Array.PureNumerical.Array.MutableNumerical.ArrayForeignStorable Data.VectorData.Vector.UnboxedVectorNumerical.Matrix.BasicNumerical.Array.LayoutbaseData.Traversabletraverse Data.ProxyProxyData.Type.Equality gcastWithGHC.Errerror Backwardsforwards<**>liftA2$fTraversableBackwards$fFoldableBackwards$fAlternativeBackwards$fApplicativeBackwards$fFunctorBackwardsStateT runStateTStateIdentity runIdentitystaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTgetputmodifymodify'gets$fMonadFixIdentity$fMonadIdentity$fApplicativeIdentity$fTraversableIdentity$fFoldableIdentity$fFunctorIdentity$fMonadIOStateT$fMonadTransStateT$fMonadFixStateT$fMonadPlusStateT $fMonadStateT$fAlternativeStateT$fApplicativeStateT$fFunctorStateT SparseAddress outerIndex innerIndexAddress$fVectorVectorAddress$fMVectorMVectorAddress$fUnboxAddress $fNumAddress $fEqAddress $fOrdAddress $fShowAddress $fReadAddress$fGenericAddress $fDataAddress$fStorableAddress$fEqLogicalAddress$fOrdLogicalAddress$fShowLogicalAddress$fReadLogicalAddress$fGenericLogicalAddress$fDataLogicalAddress$fStorableLogicalAddress$fEqSparseAddress$fShowSparseAddress$fDataSparseAddress$fGenericSparseAddress LocalityMin LocalityMaxLocality ContiguousStridedInnerContiguous $fEqLocality$fShowLocality$fReadLocality$fDataLocality AffineRange_AffineRangeMin_AffineRangeStride_AffineRangeMaxHasRangerangeMinrangeMaxRange _RangeMin _RangeMaxaffineRangeStride$fHasRangeRangea$fHasRangeAffineRangea $fEqRange $fShowRange $fDataRange$fGenericRange$fFoldableRange$fTraversableRange$fFunctorRange$fEqAffineRange$fShowAffineRange$fDataAffineRange$fGenericAffineRange$fFunctorAffineRange$fFoldableAffineRange$fTraversableAffineRange BufferMut BufferPureStoredUnboxedBoxedMBufferBufferStorableBufferMutUnboxedBufferMutBoxedBufferMutStorableBuffer UnboxedBuffer BoxedBufferunsafeBufferFreezeunsafeBufferThaw$fVectorBufferPurea$fVectorBufferPurea0$fVectorBufferPurea1$fMVectorBufferMutelem$fMVectorBufferMutelem0$fMVectorBufferMutelem1$fMBuffermodea $fBuffermodea$fShowBufferPure$fDataBufferPure$fGenericBufferPure$fShowBufferPure0$fDataBufferPure0$fGenericBufferPure0$fShowBufferPure1$fDataBufferPure1$fGenericBufferPure1$fFunctorBufferPure$fFoldableBufferPure$fTraversableBufferPure $fDataStored $fDataUnboxed $fDataBoxedTransformHProdTreeMutableHProdTreeMVHProdMVHLeafMVHNodeVHProdVHLeafVHNodeHProdHPairHUnitvHPairvUnHPair$fMVectorMVHProd(,)$fMVectorMVHProda$fVectorVHProda$fVectorVHProd(,)MVProdVProdProdPairUnitMVPairMVLeafVPairVLeafvPairvUnPair$fMVectorMVProd(,)$fMVectorMVProda$fVectorVProda$fVectorVProd(,)N10N9N8N7N6N5N4N3N2N1N0SNatSZeroSSucc+UNatSZLitNat plus_id_r plus_succ_r$fEqNat $fShowNat $fReadNat $fDataNatUnBoxedShapeMorphismunShapeMVectorreShapeMVectorShapeNil:*Index shapeToList backwardsweaklyDominatesstrictlyDominates reverseShapemap2mapfoldrfoldlfoldl'foldr1foldl1 shapeSize unShapeVector reShapeVector$fVectorVectorShape$fMVectorMVectorShape$fVectorVectorShape0$fMVectorMVectorShape0$fVectorVectorShape1$fMVectorMVectorShape1 $fUnboxShape $fUnboxShape0 $fUnboxShape1$fStorableShape$fStorableShape0$fStorableShape1 $fMonoidShape$fSemigroupShape$fFoldableShape$fFoldableShape0$fFoldableShape1$fApplicativeShape$fApplicativeShape0$fFunctorShape$fFunctorShape0$fTraversableShape$fTraversableShape0$fTraversableShape1 $fShowShape $fShowShape0 $fEqShape $fEqShape0 $fDataShape $fDataShape0$fUnBoxedShapeMorphismSa$fUnBoxedShapeMorphismSa0$fUnBoxedShapeMorphismZa DenseLayoutbasicToDenseAddressbasicToDenseIndexbasicNextDenseAddressbasicNextDenseIndexRectilinearLayoutformRectOrientationrectlinearShape unconsOuter consOutermajorAxisSlicemajorAxisProjectrectlinearSliceInnerContigFormRectDownRankFormRectOrientationFormSMajorOrientationSRowed SColumned SBlockedRowSBlockedColumnMajorOrientationRowedColumned BlockedColumn BlockedRowLayoutbasicLogicalShapebasicLogicalFormtransposedLayoutbasicCompareIndexbasicAddressRangebasicToAddress basicToIndexbasicNextAddressbasicNextIndexbasicAddressPopCountbasicAddressAsIntbasicAffineAddressShiftLayoutLogicalFormat LayoutAddress TransposedFormatStorageRepFormatGDSliceGDNilGDPickGDRangeGDAll TaggedShape unTagShapemajorCompareLeftToRightmajorCompareRightToLeftshapeCompareLeftToRightshapeCompareRightToLeft$fShowTaggedShape$fEqTaggedShape $fShowGDSlice$fShowGDSlice0$fShowGDSlice1$fOrdTaggedShape$fDataMajorOrientation%InnerContiguousCompressedSparseMatrix-FormatInnerContiguousCompressedSparseInternal$_outerDimInnerContiguousSparseFormat$_innerDimInnerContiguousSparseFormat._innerDimIndexShiftInnerContiguousSparseFormat)_innerDimIndexInnerContiguousSparseFormat2_outerDim2InnerDimStartInnerContiguousSparseFormat0_outerDim2InnerDimEndInnerContiguousSparseFormat ContiguousCompressedSparseMatrix(FormatContiguousCompressedSparseInternal_outerDimContiguousSparseFormat_innerDimContiguousSparseFormat$_innerDimIndexContiguousSparseFormat(_outerDim2InnerDimContiguousSparseFormat DirectSparseCSCCompressedSparseColumnCSRCompressedSparseRow+FormatInnerContiguousCompressedSparseColumn(FormatInnerContiguousCompressedSparseRow&FormatContiguousCompressedSparseColumn#FormatContiguousCompressedSparseRowFormatDirectSparseContiguous$fLayoutFormatS$fLayoutFormatS0 $fShowFormat $fShowFormat0 $fShowFormat1 $fShowFormat2+$fShowInnerContiguousCompressedSparseMatrix&$fShowContiguousCompressedSparseMatrix $fShowFormat3ColumnRowDirectFormatColumnStridedboundsColumnStridedstrideFormColumnStridedFormatColumnInnerContiguousboundsColumnInnerContigstrideFormColumnInnerContigFormatColumnContiguousboundsColumnContigFormatRowInnerContiguousboundsFormRowInnerContigstrideFormRowInnerContigFormatRowStridedboundsFormRowStridedstrideFormRowStridedFormatRowContiguous boundsFormRowFormatDirectStridedlogicalShapeDirectStridedlogicalStrideDirectStridedFormatDirectContiguouslogicalShapeDirectContiguous$fDenseLayoutFormatS$fDenseLayoutFormatS0$fDenseLayoutFormatrank$fDenseLayoutFormatrank0$fDenseLayoutFormatrank1$fLayoutFormatrank$fLayoutFormatrank0$fLayoutFormatrank1$fDenseLayoutFormatrank2$fDenseLayoutFormatrank3$fDenseLayoutFormatrank4$fLayoutFormatrank2$fLayoutFormatrank3$fLayoutFormatrank4 $fEqFormat $fDataFormat $fDataFormat0 $fDataFormat1 LayoutBuilder buildFormatMIntFunAnyMVAMV BatchInit batchInitSize batchInitKVmaterializeBatchMV fromListBI fromVectorBI fromMVectorBIbuildFormatPureisStrictlyMonotonicVcomputeRunLengths computeStarts$fFunctorIntFun$fFunctorBatchInit$fShowBatchInit$fLayoutBuilderFormatS$fLayoutBuilderFormatS0$fLayoutBuilderFormatr$fLayoutBuilderFormatr0$fLayoutBuilderFormatS1 ForeignNativeNativePureDenseArraybasicIndexInBoundsbasicUnsafeAddressDenseReadbasicUnsafeDenseReadM PureArrayPureArrayAddress basicShapebasicSparseIndexToAddressbasicAddressToIndexbasicUnsafeAddressReadbasicUnsafeSparseReadImmArrayImMutableNativeArraynativeBufferPurenativeFormatPure$fPureArrayImmArrayrankelRectilinearArrayMutableRectilinearOrientationMutableArrayDownRankMutableInnerContigArraybasicMutableSliceMajorAxisbasicMutableProjectMajorAxisbasicMutableSliceDenseArrayBuilderbasicUnsafeNewbasicUnsafeReplicate DenseArraybasicUnsafeDenseReadbasicUnsafeDenseWriteArrayArrPure MArrayAddressbasicUnsafeAffineAddressShiftbasicUnsafeFreezebasicUnsafeThawbasicCardinalitybasicSparseNextAddressbasicSparseNextIndexbasicLocalAffineAddressRegion basicOverlaps basicClearbasicUnsafeAddressWriteMArrayMutableNativeArray nativeBuffer nativeFormat$fArrayMArrayrankelGHC.Base Applicativereturn Data.TuplefstsndliftM$!LogicalAddress&vector-0.12.0.2-H1Eu1OCXL0L9y980iV8EwUData.Vector.Generic.Baseghc-prim GHC.Classes<=< GHC.MaybeMaybe#basicAffineAddressShiftDenseGenericD:R:FormatDirectStridedSrep0D:R:FormatDirectContiguousSrep0D:R:FormatRowContiguousnrep0 ArrMutableMutableArrayContiguous