bigarray-overlap

Bigarray.overlap
README

This little library allows us to check if to bigarray share same memory area:

                    ba2
            ba1    .-------.
           .------|.        |
          |       | |       |
0x000800: [-------###-------]
                  | |
		   .
		  ba3

In this example, ba1 and ba2 share a small area and bigarray-overlap can
returns this small area to you as a new ba3 value.

open Bigarray

let () =
  let ba = Array1.create Char Bigarray.c_layout 17 in
  let ba1 = Array1.sub ba 0 10 in
  let ba2 = Array1.sub ba 7 17 in
  match Overlap.array1 ba1 ba2 with
  | Some (len, x, _y) ->
    let ba3 = Array1.sub ba x len in
    ...
  | None -> ...

overlap returns the length of the shared area, the x point from ba1 and
the y point from ba2.

A js_of_ocaml support

overlap is compatible with js_of_ocaml but it lies about expected results.
Indeed, we are not able to know the position in memory of given bigarray in
the JS world. By this fact, Overlap with js_of_ocaml will always returns
None.

Install
Published
08 Apr 2022
Sources
bigarray-overlap-0.2.1.tbz
sha256=2f520ac470054e335883eba9254bf28b6676ddb57753cfb58b22cf84ae1a66e0
sha512=223f15f815cd944cf2e9955ed9e3cf5608a9db36103e9bb017c2fe452dfb319908228b419f416f6239b8562208027068b7c44e8fb4be6c6a7858ecba540d5439
Dependencies
ocamlfind
with-test
bos
with-test
fpath
with-test
astring
with-test
alcotest
with-test
dune
>= "2.6"
ocaml
>= "4.08.0"
Reverse Dependencies
encore
= "0.5"
mrmime
>= "0.2.0"