X-Git-Url: http://git.euphorik.ch/?p=master-thesis.git;a=blobdiff_plain;f=Parasitemia%2FParasitemiaCore%2FEEOver.fs;h=9a77f48ab44d95f6fc5a0787d89c8abc06c6030f;hp=6862dc523d09f80039b4054f3bae69ecb83bcfbd;hb=1b8e45987bde692ab5602c281f878707f70459b7;hpb=32ef4bbb0381f822c4df124595d401ad2f502c1b diff --git a/Parasitemia/ParasitemiaCore/EEOver.fs b/Parasitemia/ParasitemiaCore/EEOver.fs index 6862dc5..9a77f48 100644 --- a/Parasitemia/ParasitemiaCore/EEOver.fs +++ b/Parasitemia/ParasitemiaCore/EEOver.fs @@ -184,7 +184,7 @@ let private twointpts (x: float[]) (y: float[]) (a1: float) (b1: float) (phi_1: let private threeintpts (xint: float[]) (yint: float[]) (a1: float) (b1: float) (phi_1: float) (a2: float) (b2: float) (h2_tr: float) (k2_tr: float) (phi_2: float) (aa: float) (bb: float) (cc: float) (dd: float) (ee: float) (ff: float) : float = let mutable tanpts = 0 let mutable tanindex = 0 - for i in 0..2 do + for i = 0 to 2 do if istanpt xint.[i] yint.[i] a1 b2 aa bb cc dd ee ff = TANGENT_POINT then tanpts <- tanpts + 1 @@ -216,18 +216,18 @@ let private fourintpts (xint: float[]) (yint: float[]) (a1: float) (b1: float) ( let theta = Array.zeroCreate 4 - for i in 0 .. 3 do + for i = 0 to 3 do if abs xint.[i] > a1 then xint.[i] <- if xint.[i] < 0.0 then -a1 else a1 theta.[i] <- if yint.[i] < 0.0 then 2.0 * Math.PI - acos (xint.[i] / a1) else acos (xint.[i] / a1) #if DEBUG_LOG - for k in 0..3 do + for k = 0 to 3 do printf "k=%d: Theta = %f, xint=%f, yint=%f\n" k theta.[k] xint.[k] yint.[k] #endif - for j in 1 .. 3 do + for j = 1 to 3 do let tmp0 = theta.[j] let tmp1 = xint.[j] let tmp2 = yint.[j] @@ -253,7 +253,7 @@ let private fourintpts (xint: float[]) (yint: float[]) (a1: float) (b1: float) ( #if DEBUG_LOG printf "AFTER sorting\n" - for k in 0..3 do + for k = 0 to 3 do printf "k=%d: Theta = %f, xint=%f, yint=%f\n" k theta.[k] xint.[k] yint.[k] #endif @@ -266,7 +266,7 @@ let private fourintpts (xint: float[]) (yint: float[]) (a1: float) (b1: float) ( let xint_tr = Array.zeroCreate 4 let yint_tr = Array.zeroCreate 4 - for i in 0..3 do + for i = 0 to 3 do xint_tr.[i] <- (xint.[i] - h2_tr) * cosphi + (yint.[i] - k2_tr) * -sinphi yint_tr.[i] <- (xint.[i] - h2_tr) * sinphi + (yint.[i] - k2_tr) * cosphi @@ -358,7 +358,7 @@ let private quadroots (p: float[]) (r: float[,]) = let private cubicroots (p: float[]) (r: float[,]) = if p.[0] <> 1.0 then - for k in 1..3 do + for k = 1 to 3 do p.[k] <- p.[k] / p.[0] p.[0] <- 1.0 let s = p.[1] / 3.0 @@ -423,13 +423,13 @@ let private cubicroots (p: float[]) (r: float[,]) = t <- d r.[1, 1] <- t - for k in 1..3 do + for k = 1 to 3 do r.[2, k] <- 0.0 let private biquadroots (p: float[]) (r: float[,]) = if p.[0] <> 1.0 then - for k in 1..4 do + for k = 1 to 4 do p.[k] <- p.[k] / p.[0] p.[0] <- 1.0 let e = 0.25 * p.[1] @@ -447,13 +447,13 @@ let private biquadroots (p: float[]) (r: float[,]) = then p.[2] <- c / b quadroots p r - for k in 1..2 do - for j in 1..2 do + for k = 1 to 2 do + for j = 1 to 2 do r.[j, k+2] <- r.[j, k] p.[1] <- -p.[1] p.[2] <- b quadroots p r - for k in 1..4 do + for k = 1 to 4 do r.[1,k] <- r.[1,k] - e quadExecuted <- true @@ -502,7 +502,7 @@ let private biquadroots (p: float[]) (r: float[,]) = then p.[1] <- 0.0 else - for k in 1..4 do + for k = 1 to 4 do r.[1, k] <- -e r.[2, k] <- 0.0 quadExecuted <- true @@ -559,7 +559,7 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] |] #if DEBUG_LOG - for i in 0..4 do + for i = 0 to 4 do printf "cy[%d]=%f\n" i cy.[i] #endif @@ -569,11 +569,11 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] let nroots = if abs cy.[4] > EPS then - for i in 0 .. 3 do + for i = 0 to 3 do py.[4-i] <- cy.[i] / cy.[4] py.[0] <- 1.0 #if DEBUG_LOG - for i in 0..4 do + for i to 0 to 4 do printf "py[%d]=%f\n" i py.[i] #endif biquadroots py r @@ -581,7 +581,7 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] elif abs cy.[3] > EPS then - for i in 0..2 do + for i = 0 to 2 do py.[3 - i] <- cy.[i] / cy.[3] py.[0] <- 1.0 cubicroots py r @@ -589,7 +589,7 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] elif abs cy.[2] > EPS then - for i in 0..1 do + for i = 0 to 1 do py.[2-i] <- cy.[i] / cy.[2] py.[0] <- 1.0 quadroots py r @@ -610,7 +610,7 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] let ychk = Array.init nroots (fun _ -> Double.MaxValue) let mutable nychk = 0 - for i in 1 .. nroots do + for i = 1 to nroots do if abs r.[2, i] < EPS then ychk.[nychk] <- r.[1, i] * b1 @@ -622,7 +622,7 @@ let EEOverlapArea (e1: Types.Ellipse) (e2: Types.Ellipse) : (float32 * float32[] #if DEBUG_LOG printf "nychk=%d\n" ychk.Length - for j in 0 .. ychk.Length - 1 do + for j = 0 to ychk.Length - 1 do printf "\t j=%d, ychk=%f\n" j ychk.[j] #endif