From ec98e8e62b3f93c9a867b9724919452feeff0d95 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 18 Jun 2024 17:16:30 +0200 Subject: [PATCH] Remove obsolete APIs --- RELEASE_NOTES.md | 31 +- .../Aardvark.Base.FSharp.fsproj | 4 - .../Immutable/RangeSetOld_auto.fs | 455 -------- .../Immutable/RangeSetOld_template.fs | 242 ---- .../Datastructures/Immutable/RangeSet_auto.fs | 24 - .../Immutable/RangeSet_template.fs | 6 - .../Datastructures/Mutable/Order.fs | 299 ----- .../Runtime/ExecutableMemory.fs | 111 -- .../Runtime/NativeMemory.fs | 3 - .../Utilities/Interop/Dictionary.fs | 24 +- .../Utilities/Interop/FSLibExtensions.fs | 16 - .../Utilities/Interop/String.fs | 16 - src/Aardvark.Base.IO/FieldCoderExtensions.cs | 10 - .../Aardvark.Base.Runtime.fsproj | 5 - src/Aardvark.Base.Runtime/AdaptiveCode.fs | 1019 ----------------- src/Aardvark.Base.Runtime/Assembler/AMD64.fs | 879 -------------- .../Assembler/AssemblerStream.fs | 15 - .../Assembler/AssemblerTypes.fs | 129 --- .../Assembler/NativeProgram.fs | 528 --------- src/Aardvark.Base/Math/Base/Constant.cs | 31 - src/Aardvark.Base/Math/Colors/Color_auto.cs | 50 - .../Math/Colors/Color_template.cs | 5 - .../Math/Interpolation/Interpolation.cs | 30 - src/Aardvark.Base/Math/RangesBoxes/Cell.cs | 6 - src/Aardvark.Base/Math/Trafos/M44_auto.cs | 52 - src/Aardvark.Base/Math/Trafos/M44_template.cs | 26 - src/Aardvark.Base/Math/Trafos/Trafo_auto.cs | 66 -- .../Math/Trafos/Trafo_template.cs | 33 - 28 files changed, 25 insertions(+), 4090 deletions(-) delete mode 100644 src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_auto.fs delete mode 100644 src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_template.fs delete mode 100644 src/Aardvark.Base.FSharp/Datastructures/Mutable/Order.fs delete mode 100644 src/Aardvark.Base.FSharp/Runtime/ExecutableMemory.fs delete mode 100644 src/Aardvark.Base.Runtime/AdaptiveCode.fs delete mode 100644 src/Aardvark.Base.Runtime/Assembler/AMD64.fs delete mode 100644 src/Aardvark.Base.Runtime/Assembler/AssemblerStream.fs delete mode 100644 src/Aardvark.Base.Runtime/Assembler/AssemblerTypes.fs delete mode 100644 src/Aardvark.Base.Runtime/Assembler/NativeProgram.fs diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e5981a0b5..31a0bedb7 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,16 +4,33 @@ - Added F# tensor utilities and math functions using SRTP - Deprecated Error type - Deprecated GenericValues.zero -- Removed Async.AwaitTask (already in FSharp.Core) -- Removed Caching.cacheFunction - Fixed return type of LengthSquared for integer-based vectors. Now returns an integer instead of double. -- [Color] Removed obsolete conversion functions - Added missing readonly modifiers for structs - Renamed CIeLuvf to CieLuvf -- [PixImage] Removed obsolete loading API -- Removed IDictionary.GetValueOrDefault -- Removed broken UnsafeCoerce utilities -- Removed obsolete CameraExtrinsics and CameraIntrinsics +- Removed obsolete API: + - [Color] obsolete conversion functions + - [Color] `Parse()` overload with IFormatProvider parameter + - [PixImage] obsolete loading API + - `Async.AwaitTask` (already in FSharp.Core) + - `Caching.cacheFunction` + - `IDictionary.GetValueOrDefault` + - broken UnsafeCoerce utilities + - `CameraExtrinsics` and `CameraIntrinsics` + - float variants of `Constant` + - `IPol.SlerpShortest` + - `Cell.Parse()` with offset parameter + - `M44x.PerspectiveProjectionTransformLH` + - `Trafo.PerspectiveProjectionOpenGl` + - `Trafo.PerspectiveProjectionLH` + - `Trafo.OrthoProjectionOpenGl` + - `RangeSet` and `RangeSet64` + - `RangeSet1*.insert` and `window` + - `Time` and `TimeLink` + - `ExecutableMemory` + - `Dictionary.TryRemove` and `GetOrAdd` + - `Seq.forany` and `Array.forany` (use `exists` instead) + - `Strings` module + - Assembler related types and functions (use Aardvark.Assembler instead) ### 5.2.31 * fixed Hash Computations for non-primitive types diff --git a/src/Aardvark.Base.FSharp/Aardvark.Base.FSharp.fsproj b/src/Aardvark.Base.FSharp/Aardvark.Base.FSharp.fsproj index b609aea7d..205813f29 100644 --- a/src/Aardvark.Base.FSharp/Aardvark.Base.FSharp.fsproj +++ b/src/Aardvark.Base.FSharp/Aardvark.Base.FSharp.fsproj @@ -41,7 +41,6 @@ - @@ -51,8 +50,6 @@ - - @@ -73,7 +70,6 @@ - diff --git a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_auto.fs b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_auto.fs deleted file mode 100644 index 2d1137f3d..000000000 --- a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_auto.fs +++ /dev/null @@ -1,455 +0,0 @@ -namespace Aardvark.Base - -open System -open System.Collections -open System.Collections.Generic -open FingerTreeImplementation - -#nowarn "44" - -[] -type private HalfRange = - struct - val mutable public IsMax : bool - val mutable public Value : int32 - - new(m,v) = { IsMax = m; Value = v } - - override x.GetHashCode() = - if x.IsMax then 0 - else x.Value.GetHashCode() - - override x.Equals o = - match o with - | :? HalfRange as o -> - x.IsMax = o.IsMax && x.Value = o.Value - | _ -> - false - - member x.CompareTo (o : HalfRange) = - let c = x.Value.CompareTo o.Value - if c = 0 then - if x.IsMax = o.IsMax then 0 - else (if x.IsMax then 1 else -1) - else - c - - interface IComparable with - member x.CompareTo o = - match o with - | :? HalfRange as o -> x.CompareTo(o) - | _ -> failwith "uncomparable" - end - - -[] -[] -type RangeSet = private { root : FingerTreeNode } with - - member private x.AsString = - x |> Seq.map (sprintf "%A") - |> String.concat "; " - |> sprintf "set [%s]" - - member x.Min = - match x.root |> FingerTreeNode.firstOpt with - | Some f -> f.Value - | _ -> Int32.MaxValue - - member x.Max = - match x.root |> FingerTreeNode.lastOpt with - | Some f -> f.Value - | _ -> Int32.MinValue - - member x.Range = - match FingerTreeNode.firstOpt x.root, FingerTreeNode.lastOpt x.root with - | Some min, Some max -> Range1i(min.Value, max.Value) - | _ -> Range1i.Invalid - - interface IEnumerable with - member x.GetEnumerator() = new RangeSetEnumerator(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> IEnumerator - - interface IEnumerable with - member x.GetEnumerator() = new RangeSetEnumerator(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> _ - - -and private RangeSetEnumerator(i : IEnumerator) = - - let mutable last = HalfRange() - let mutable current = HalfRange() - - member x.Current = Range1i(last.Value, current.Value - 1) - - interface IEnumerator with - member x.MoveNext() = - if i.MoveNext() then - last <- i.Current - if i.MoveNext() then - current <- i.Current - true - else - false - else - false - - member x.Current = x.Current :> obj - - member x.Reset() = - i.Reset() - - interface IEnumerator with - member x.Current = x.Current - member x.Dispose() = i.Dispose() - -[] -[] -module RangeSet = - let private mm = - { - quantify = fun (r : HalfRange) -> r - mempty = HalfRange(false, Int32.MinValue) - mappend = fun l r -> if l.CompareTo r > 0 then l else r - } - - let private minRange = HalfRange(false, Int32.MinValue) - - let inline private leq v = HalfRange(true, v) - let inline private geq v = HalfRange(false, v) - - let inline private (|Leq|Geq|) (r : HalfRange) = - if r.IsMax then Leq r.Value - else Geq r.Value - - let empty = { root = Empty } - - let insert (range : Range1i) (t : RangeSet) = - let rangeMax = range.Max + 1 - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = leq rangeMax - let min = geq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Deep(max, One(min), Empty, One(max)) } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l |> FingerTreeNode.append mm min |> FingerTreeNode.append mm max } - | Geq _ -> { root = l |> FingerTreeNode.append mm max } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm min } - | Geq _ -> { root = r |> FingerTreeNode.prepend mm max |> FingerTreeNode.prepend mm min } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min;max] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - let remove (range : Range1i) (t : RangeSet) = - let rangeMax = range.Max + 1 - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = geq rangeMax - let min = leq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Empty } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l } - | Geq _ -> { root = l |> FingerTreeNode.append mm min } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm max } - | Geq _ -> { root = r } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min; max] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - let ofSeq (s : seq) = - let mutable res = empty - for e in s do res <- insert e res - res - - let inline ofList (l : list) = ofSeq l - let inline ofArray (l : Range1i[]) = ofSeq l - - let toSeq (r : RangeSet) = r :> seq<_> - let toList (r : RangeSet) = r |> Seq.toList - let toArray (r : RangeSet) = r |> Seq.toArray - - let inline min (t : RangeSet) = t.Min - let inline max (t : RangeSet) = t.Max - let inline range (t : RangeSet) = t.Range - - let window (window : Range1i) (set : RangeSet) = - let rangeMax = window.Max + 1 - - let (l,rest) = set.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo window.Min > 0) minRange - let (inner,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax >= 0) minRange - - let inner = - match FingerTreeNode.lastOpt l with - | Some (Geq _) -> FingerTreeNode.prepend mm (geq window.Min) inner - | _ -> inner - - let inner = - match FingerTreeNode.firstOpt r with - | Some (Leq _) -> FingerTreeNode.append mm (leq rangeMax) inner - | _ -> inner - - { root = inner } - -[] -type private HalfRange64 = - struct - val mutable public IsMax : bool - val mutable public Value : int64 - - new(m,v) = { IsMax = m; Value = v } - - override x.GetHashCode() = - if x.IsMax then 0 - else x.Value.GetHashCode() - - override x.Equals o = - match o with - | :? HalfRange64 as o -> - x.IsMax = o.IsMax && x.Value = o.Value - | _ -> - false - - member x.CompareTo (o : HalfRange64) = - let c = x.Value.CompareTo o.Value - if c = 0 then - if x.IsMax = o.IsMax then 0 - else (if x.IsMax then 1 else -1) - else - c - - interface IComparable with - member x.CompareTo o = - match o with - | :? HalfRange64 as o -> x.CompareTo(o) - | _ -> failwith "uncomparable" - end - - -[] -[] -type RangeSet64 = private { root : FingerTreeNode } with - - member private x.AsString = - x |> Seq.map (sprintf "%A") - |> String.concat "; " - |> sprintf "set [%s]" - - member x.Min = - match x.root |> FingerTreeNode.firstOpt with - | Some f -> f.Value - | _ -> Int64.MaxValue - - member x.Max = - match x.root |> FingerTreeNode.lastOpt with - | Some f -> f.Value - | _ -> Int64.MinValue - - member x.Range = - match FingerTreeNode.firstOpt x.root, FingerTreeNode.lastOpt x.root with - | Some min, Some max -> Range1l(min.Value, max.Value) - | _ -> Range1l.Invalid - - interface IEnumerable with - member x.GetEnumerator() = new RangeSet64Enumerator(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> IEnumerator - - interface IEnumerable with - member x.GetEnumerator() = new RangeSet64Enumerator(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> _ - - -and private RangeSet64Enumerator(i : IEnumerator) = - - let mutable last = HalfRange64() - let mutable current = HalfRange64() - - member x.Current = Range1l(last.Value, current.Value - 1L) - - interface IEnumerator with - member x.MoveNext() = - if i.MoveNext() then - last <- i.Current - if i.MoveNext() then - current <- i.Current - true - else - false - else - false - - member x.Current = x.Current :> obj - - member x.Reset() = - i.Reset() - - interface IEnumerator with - member x.Current = x.Current - member x.Dispose() = i.Dispose() - -[] -[] -module RangeSet64 = - let private mm = - { - quantify = fun (r : HalfRange64) -> r - mempty = HalfRange64(false, Int64.MinValue) - mappend = fun l r -> if l.CompareTo r > 0 then l else r - } - - let private minRange = HalfRange64(false, Int64.MinValue) - - let inline private leq v = HalfRange64(true, v) - let inline private geq v = HalfRange64(false, v) - - let inline private (|Leq|Geq|) (r : HalfRange64) = - if r.IsMax then Leq r.Value - else Geq r.Value - - let empty = { root = Empty } - - let insert (range : Range1l) (t : RangeSet64) = - let rangeMax = range.Max + 1L - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = leq rangeMax - let min = geq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Deep(max, One(min), Empty, One(max)) } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l |> FingerTreeNode.append mm min |> FingerTreeNode.append mm max } - | Geq _ -> { root = l |> FingerTreeNode.append mm max } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm min } - | Geq _ -> { root = r |> FingerTreeNode.prepend mm max |> FingerTreeNode.prepend mm min } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min;max] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - let remove (range : Range1l) (t : RangeSet64) = - let rangeMax = range.Max + 1L - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = geq rangeMax - let min = leq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Empty } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l } - | Geq _ -> { root = l |> FingerTreeNode.append mm min } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm max } - | Geq _ -> { root = r } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min; max] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - let ofSeq (s : seq) = - let mutable res = empty - for e in s do res <- insert e res - res - - let inline ofList (l : list) = ofSeq l - let inline ofArray (l : Range1l[]) = ofSeq l - - let toSeq (r : RangeSet64) = r :> seq<_> - let toList (r : RangeSet64) = r |> Seq.toList - let toArray (r : RangeSet64) = r |> Seq.toArray - - let inline min (t : RangeSet64) = t.Min - let inline max (t : RangeSet64) = t.Max - let inline range (t : RangeSet64) = t.Range - - let window (window : Range1l) (set : RangeSet64) = - let rangeMax = window.Max + 1L - - let (l,rest) = set.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo window.Min > 0) minRange - let (inner,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax >= 0) minRange - - let inner = - match FingerTreeNode.lastOpt l with - | Some (Geq _) -> FingerTreeNode.prepend mm (geq window.Min) inner - | _ -> inner - - let inner = - match FingerTreeNode.firstOpt r with - | Some (Leq _) -> FingerTreeNode.append mm (leq rangeMax) inner - | _ -> inner - - { root = inner } - diff --git a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_template.fs b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_template.fs deleted file mode 100644 index 759b6e7f8..000000000 --- a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSetOld_template.fs +++ /dev/null @@ -1,242 +0,0 @@ -namespace Aardvark.Base - -open System -open System.Collections -open System.Collections.Generic -open FingerTreeImplementation - -#nowarn "44" - -//# foreach (var isLong in new[] { false, true }) { -//# var halfrange = isLong ? "HalfRange64" : "HalfRange"; -//# var rangeset = isLong ? "RangeSet64" : "RangeSet"; -//# var rangesetenumerator = isLong ? "RangeSet64Enumerator" : "RangeSetEnumerator"; -//# var range = isLong ? "Range1l" : "Range1i"; -//# var systype = isLong ? "Int64" : "Int32"; -//# var ft = isLong ? "int64" : "int32"; -//# var one = isLong ? "1L" : "1"; -//# var replacement = isLong ? "RangeSet1l" : "RangeSet1i"; -[] -type private __halfrange__ = - struct - val mutable public IsMax : bool - val mutable public Value : __ft__ - - new(m,v) = { IsMax = m; Value = v } - - override x.GetHashCode() = - if x.IsMax then 0 - else x.Value.GetHashCode() - - override x.Equals o = - match o with - | :? __halfrange__ as o -> - x.IsMax = o.IsMax && x.Value = o.Value - | _ -> - false - - member x.CompareTo (o : __halfrange__) = - let c = x.Value.CompareTo o.Value - if c = 0 then - if x.IsMax = o.IsMax then 0 - else (if x.IsMax then 1 else -1) - else - c - - interface IComparable with - member x.CompareTo o = - match o with - | :? __halfrange__ as o -> x.CompareTo(o) - | _ -> failwith "uncomparable" - end - - -[] -[] -type __rangeset__ = private { root : FingerTreeNode<__halfrange__, __halfrange__> } with - - member private x.AsString = - x |> Seq.map (sprintf "%A") - |> String.concat "; " - |> sprintf "set [%s]" - - member x.Min = - match x.root |> FingerTreeNode.firstOpt with - | Some f -> f.Value - | _ -> __systype__.MaxValue - - member x.Max = - match x.root |> FingerTreeNode.lastOpt with - | Some f -> f.Value - | _ -> __systype__.MinValue - - member x.Range = - match FingerTreeNode.firstOpt x.root, FingerTreeNode.lastOpt x.root with - | Some min, Some max -> __range__(min.Value, max.Value) - | _ -> __range__.Invalid - - interface IEnumerable with - member x.GetEnumerator() = new __rangesetenumerator__(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> IEnumerator - - interface IEnumerable<__range__> with - member x.GetEnumerator() = new __rangesetenumerator__(FingerTreeImplementation.FingerTreeNode.getEnumeratorFw x.root) :> _ - - -and private __rangesetenumerator__(i : IEnumerator<__halfrange__>) = - - let mutable last = __halfrange__() - let mutable current = __halfrange__() - - member x.Current = __range__(last.Value, current.Value - __one__) - - interface IEnumerator with - member x.MoveNext() = - if i.MoveNext() then - last <- i.Current - if i.MoveNext() then - current <- i.Current - true - else - false - else - false - - member x.Current = x.Current :> obj - - member x.Reset() = - i.Reset() - - interface IEnumerator<__range__> with - member x.Current = x.Current - member x.Dispose() = i.Dispose() - -[] -[] -module __rangeset__ = - let private mm = - { - quantify = fun (r : __halfrange__) -> r - mempty = __halfrange__(false, __systype__.MinValue) - mappend = fun l r -> if l.CompareTo r > 0 then l else r - } - - let private minRange = __halfrange__(false, __systype__.MinValue) - - let inline private leq v = __halfrange__(true, v) - let inline private geq v = __halfrange__(false, v) - - let inline private (|Leq|Geq|) (r : __halfrange__) = - if r.IsMax then Leq r.Value - else Geq r.Value - - let empty = { root = Empty } - - let insert (range : __range__) (t : __rangeset__) = - let rangeMax = range.Max + __one__ - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = leq rangeMax - let min = geq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Deep(max, One(min), Empty, One(max)) } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l |> FingerTreeNode.append mm min |> FingerTreeNode.append mm max } - | Geq _ -> { root = l |> FingerTreeNode.append mm max } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm min } - | Geq _ -> { root = r |> FingerTreeNode.prepend mm max |> FingerTreeNode.prepend mm min } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min;max] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - let remove (range : __range__) (t : __rangeset__) = - let rangeMax = range.Max + __one__ - - let (l,rest) = t.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo range.Min >= 0) minRange - let (_,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax > 0) minRange - - let max = geq rangeMax - let min = leq range.Min - - match FingerTreeNode.lastOpt l, FingerTreeNode.firstOpt r with - | None, None -> - { root = Empty } - - | Some lmax, None -> - match lmax with - | Leq _ -> { root = l } - | Geq _ -> { root = l |> FingerTreeNode.append mm min } - - | None, Some rmin -> - match rmin with - | Leq _ -> { root = r |> FingerTreeNode.prepend mm max } - | Geq _ -> { root = r } - - | Some lmax, Some rmin -> - match lmax, rmin with - | Leq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [] r } - - | Geq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min; max] r } - - | Leq _, Leq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [max] r } - - | Geq _, Geq _ -> - { root = FingerTreeNode.concatWithMiddle mm l [min] r } - - let ofSeq (s : seq<__range__>) = - let mutable res = empty - for e in s do res <- insert e res - res - - let inline ofList (l : list<__range__>) = ofSeq l - let inline ofArray (l : __range__[]) = ofSeq l - - let toSeq (r : __rangeset__) = r :> seq<_> - let toList (r : __rangeset__) = r |> Seq.toList - let toArray (r : __rangeset__) = r |> Seq.toArray - - let inline min (t : __rangeset__) = t.Min - let inline max (t : __rangeset__) = t.Max - let inline range (t : __rangeset__) = t.Range - - let window (window : __range__) (set : __rangeset__) = - let rangeMax = window.Max + __one__ - - let (l,rest) = set.root |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo window.Min > 0) minRange - let (inner,r) = rest |> FingerTreeNode.splitFirstRight mm (fun v -> v.Value.CompareTo rangeMax >= 0) minRange - - let inner = - match FingerTreeNode.lastOpt l with - | Some (Geq _) -> FingerTreeNode.prepend mm (geq window.Min) inner - | _ -> inner - - let inner = - match FingerTreeNode.firstOpt r with - | Some (Leq _) -> FingerTreeNode.append mm (leq rangeMax) inner - | _ -> inner - - { root = inner } - -//# } \ No newline at end of file diff --git a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_auto.fs b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_auto.fs index 20320d66b..043c01727 100644 --- a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_auto.fs +++ b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_auto.fs @@ -448,9 +448,6 @@ module RangeSet1i = /// Adds the given range to the set. let inline add (range : Range1i) (set : RangeSet1i) = set.Add range - [] - let inline insert (range : Range1i) (set : RangeSet1i) = set.Add range - /// Removes the given range from the set. let inline remove (range : Range1i) (set : RangeSet1i) = set.Remove range @@ -460,9 +457,6 @@ module RangeSet1i = /// Returns the intersection of the set with the given range. let inline intersect (range : Range1i) (set : RangeSet1i) = set.Intersect range - [] - let inline window (range : Range1i) (set : RangeSet1i) = intersect range set - /// Returns whether the given value is contained in the range set. let inline contains (value : int32) (set : RangeSet1i) = set.Contains value @@ -901,9 +895,6 @@ module RangeSet1ui = /// Adds the given range to the set. let inline add (range : Range1ui) (set : RangeSet1ui) = set.Add range - [] - let inline insert (range : Range1ui) (set : RangeSet1ui) = set.Add range - /// Removes the given range from the set. let inline remove (range : Range1ui) (set : RangeSet1ui) = set.Remove range @@ -913,9 +904,6 @@ module RangeSet1ui = /// Returns the intersection of the set with the given range. let inline intersect (range : Range1ui) (set : RangeSet1ui) = set.Intersect range - [] - let inline window (range : Range1ui) (set : RangeSet1ui) = intersect range set - /// Returns whether the given value is contained in the range set. let inline contains (value : uint32) (set : RangeSet1ui) = set.Contains value @@ -1354,9 +1342,6 @@ module RangeSet1l = /// Adds the given range to the set. let inline add (range : Range1l) (set : RangeSet1l) = set.Add range - [] - let inline insert (range : Range1l) (set : RangeSet1l) = set.Add range - /// Removes the given range from the set. let inline remove (range : Range1l) (set : RangeSet1l) = set.Remove range @@ -1366,9 +1351,6 @@ module RangeSet1l = /// Returns the intersection of the set with the given range. let inline intersect (range : Range1l) (set : RangeSet1l) = set.Intersect range - [] - let inline window (range : Range1l) (set : RangeSet1l) = intersect range set - /// Returns whether the given value is contained in the range set. let inline contains (value : int64) (set : RangeSet1l) = set.Contains value @@ -1807,9 +1789,6 @@ module RangeSet1ul = /// Adds the given range to the set. let inline add (range : Range1ul) (set : RangeSet1ul) = set.Add range - [] - let inline insert (range : Range1ul) (set : RangeSet1ul) = set.Add range - /// Removes the given range from the set. let inline remove (range : Range1ul) (set : RangeSet1ul) = set.Remove range @@ -1819,9 +1798,6 @@ module RangeSet1ul = /// Returns the intersection of the set with the given range. let inline intersect (range : Range1ul) (set : RangeSet1ul) = set.Intersect range - [] - let inline window (range : Range1ul) (set : RangeSet1ul) = intersect range set - /// Returns whether the given value is contained in the range set. let inline contains (value : uint64) (set : RangeSet1ul) = set.Contains value diff --git a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_template.fs b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_template.fs index 412f4e753..e96baaeca 100644 --- a/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_template.fs +++ b/src/Aardvark.Base.FSharp/Datastructures/Immutable/RangeSet_template.fs @@ -462,9 +462,6 @@ module __rangeset__ = /// Adds the given range to the set. let inline add (range : __range__) (set : __rangeset__) = set.Add range - [] - let inline insert (range : __range__) (set : __rangeset__) = set.Add range - /// Removes the given range from the set. let inline remove (range : __range__) (set : __rangeset__) = set.Remove range @@ -474,9 +471,6 @@ module __rangeset__ = /// Returns the intersection of the set with the given range. let inline intersect (range : __range__) (set : __rangeset__) = set.Intersect range - [] - let inline window (range : __range__) (set : __rangeset__) = intersect range set - /// Returns whether the given value is contained in the range set. let inline contains (value : __ltype__) (set : __rangeset__) = set.Contains value diff --git a/src/Aardvark.Base.FSharp/Datastructures/Mutable/Order.fs b/src/Aardvark.Base.FSharp/Datastructures/Mutable/Order.fs deleted file mode 100644 index 251765e51..000000000 --- a/src/Aardvark.Base.FSharp/Datastructures/Mutable/Order.fs +++ /dev/null @@ -1,299 +0,0 @@ -#if INTERACTIVE -#r "..\\..\\Packages\\Rx-Core.2.2.4\\lib\\net45\\System.Reactive.Core.dll" -#r "..\\..\\Packages\\NUnit.2.6.3\\lib\\nunit.framework.dll" -#r "..\\..\\Bin\\Release\\Aardvark.Base.dll" -#r "..\\..\\Bin\\Release\\Aardvark.Preliminary.dll" -#r "..\\..\\Bin\\Release\\Aardvark.Base.FSharp.dll" -open Aardvark.Base -#else -namespace Aardvark.Base -#endif - -#nowarn "44" - -open System - -/// Time represents a order-maintenance structure -/// providing operations "after" and "delete" -/// maintaining O(1) comparisons between times -[] -[] -type Time = - class - /// The representant-time for this tims - val mutable public Representant : Time - - /// The total number of times currently in the time-list - /// NOTE that Count is only valid for the representant-node - val mutable public Count : int - - - val mutable internal m_time : uint64 - val mutable internal NextArray : array - val mutable internal PrevArray : array - - /// gets the direct successor for the time - member x.Next = x.NextArray.[0].Target - - /// gets the direct predecessor for the time - member x.Prev = x.PrevArray.[0].Target - - /// gets the height of the skip-node - member internal x.Height = - assert (x.NextArray.Length = x.PrevArray.Length) - x.NextArray.Length - - /// gets the comparable key for the time (as uint64) - member x.Time = - x.m_time - x.Representant.m_time - - /// gets the n-th time after this one - /// NOTE that this only works on representant-nodes - member x.TryAt (index : int) = - if x <> x.Representant then - failwith "indexing operations can only be performed on the representant-time" - - let rec search (index : int) (level : int) (t : Time) : Option