projects
/
master-thesis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use float32 to reduce memory footprint.
[master-thesis.git]
/
Parasitemia
/
Parasitemia
/
Utils.fs
diff --git
a/Parasitemia/Parasitemia/Utils.fs
b/Parasitemia/Parasitemia/Utils.fs
index
58e914f
..
b30e9ac
100644
(file)
--- a/
Parasitemia/Parasitemia/Utils.fs
+++ b/
Parasitemia/Parasitemia/Utils.fs
@@
-4,7
+4,7
@@
open System.Diagnostics
open Types
open Types
-let
roundInt = int << round
+let
inline roundInt v = v |> round |> int
let inline dprintfn fmt =
Printf.ksprintf System.Diagnostics.Debug.WriteLine fmt
let inline dprintfn fmt =
Printf.ksprintf System.Diagnostics.Debug.WriteLine fmt
@@
-35,7
+35,7
@@
let inline linePassThroughSegment (l: Line) (p1: PointD) (p2: PointD) : bool =
sign (p.X - p1.X) <> sign (p.X - p2.X)
let inline squaredDistanceTwoPoints (p1: PointD) (p2: PointD) =
sign (p.X - p1.X) <> sign (p.X - p2.X)
let inline squaredDistanceTwoPoints (p1: PointD) (p2: PointD) =
- (p1.X - p2.X) ** 2.
0 + (p1.Y - p2.Y) ** 2.0
+ (p1.X - p2.X) ** 2.
f + (p1.Y - p2.Y) ** 2.f
let distanceTwoPoints (p1: PointD) (p2: PointD) =
squaredDistanceTwoPoints p1 p2 |> sqrt
let distanceTwoPoints (p1: PointD) (p2: PointD) =
squaredDistanceTwoPoints p1 p2 |> sqrt