anchor.diff:          printfn "max %d ms" (Array.max arr)
           printfn "sum %d ms" (Array.sum arr)
           result
  -
  +    let testSimpleRandom = testRandomQuery AsciiProvider.convertToSimple Reader.simpleQuery
  +    let testSparseRandom = testRandomQuery AsciiProvider.convertToSparse Reader.sparseQuery 
       let testSmallMarspec() =
  -        let result = testRandomQuery "testSmallMarspec" [|@"D:\a\data\marspec\MARSPEC_10m\ascii\bathy_10m.asc"|] 10 10000 
  -        printfn "result: %A" result
  +        let outerlen = 10
  +        let innerlen = 10000
  +        let result1 = testSimpleRandom "test simple SmallMarspec" [|@"D:\a\data\marspec\MARSPEC_10m\ascii\bathy_10m.asc"|] outerlen innerlen
  +        let result2 = testSparseRandom "test sparse SmallMarspec" [|@"D:\a\data\marspec\MARSPEC_10m\ascii\bathy_10m.asc"|] outerlen innerlen
  +        printfn "simple result: %A" result1
  +        printfn "sparse result: %A" result2
  +
       let testAllBioOracle() =
           ignore // TODO
   
  
positive.code:         use writer = new BinaryWriter(File.Open(fileName, FileMode.OpenOrCreate))
          values |> Seq.iter (fun v -> if v.IsSome then writer.Write(v.Value))
  
  //    let readValue (reader:BinaryReader)  cellIndex = 
  //        // set stream to correct location
  //        reader.BaseStream.Position <- cellIndex*4L
  //        match reader.ReadInt32() with
  //        | Int32.MinValue -> None
  //        | v -> Some(v)
          
      let readValue (map:bitmap []) (reader:BinaryReader)  cellIndex =
          match BitMap.sparseIndex map cellIndex with
          | Some(index) -> SimpleReadWrite.readValue reader index
          | None -> None
          
      let readValues (map:bitmap []) valuesFileName indices = 
          use reader = new BinaryReader(File.Open(valuesFileName, FileMode.Open, FileAccess.Read, FileShare.Read))
          // Use list or array to force creation of values (otherwise reader gets disposed before the values are read)
          let values = 
              indices
              |> List.ofSeq
              
  //        let values = List.map (readValue reader) (List.ofSeq indices)
          values
  
  module AsciiProvider = 
  
negative.code: ﻿open System
  open System.IO
  open System.Collections.Generic
  open System.Collections
  