Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add generic catable rectilinear format #9

Open
cartazio opened this issue Aug 11, 2014 · 0 comments
Open

add generic catable rectilinear format #9

cartazio opened this issue Aug 11, 2014 · 0 comments
Milestone

Comments

@cartazio
Copy link
Member

note for a very very cool feature I wont add till after my alpha release!

roughly two(ish) parts, first have a generic wrapper for rectilinear formats like the following
(which may be lacking a bunch of typeable annotations, and may not be correct or fully specified )

data RFormat orient rank =  
     forall form .( RectilinearLayout form orient,Typeable form) => RFormat form 

data GAddress = forall form rank addy => 
      (SparseLayout form rank,Typable form, Typeable (SparseAddress form))
            =>  Gaddress (SparseAddress form)

data GMArrayRectilinear  orientation st elem = 
     forall arr orientation rank elem .
             (SparseArray arr rank elem, RectilinearArray arr orientation rank elem)=> 
                   GMRArr  (arr st elem)

then on top of that, build an generic native world Mutable and Pure Rectilinear formats.

that is, something like

data CatenableMArray orient st elem =
       CatMArr Vector ((Range Int), GMarrRectilinear  orient st elem)
--will have both rectilinear array and sparse array instances


data CatenableAddress =  CatenAddy -- something like (outerDimShift,GAddress)

which requires that the ranges correspond with disjoint montonic increasing intervals of the outer dimension of the CatenableMArray, and the shapes of each chunk wrt Inner Dimensions all agree.

Idea being we can treat this as being a Sparse Rectilinear Array structure, and thus have "zero copy" concatenation wrt the outer Dimension of the array while still being able to read and write to the composition thereof. Plus When building a new buildable array in a format of the same orientation as a given Catenable array, the set of (index,value) value pairs will be nearly in order already, wrt the outer dimension total ordering, so any sorting (and there may be none! :) ) will be within a given GMarrRectilinear chunk

This will make it a bit cheap to "build" larger arrays in various ways that are nearly zero copy and still be able to all the standard reads/writes and good locality traversal operations.

for the alpha I'll be doing something a lot dumber that only allows directly concatting a single pair of compatible orientation arrays and building a result array directly (so not zero copy for the purposes of being able to read/write on the composite result with sharing into the constituent original parts)

This is a really neat example of a feature only possible by dint of the explicit vocab for different layouts and their properties!

@cartazio cartazio added this to the V0.2.0.0 milestone Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant