Commit cbd51e77 authored by Ben Gamari's avatar Ben Gamari 🐢

real/hartel/nucleic2: Detabify

parent 134512b7
...@@ -26,24 +26,24 @@ import RU ...@@ -26,24 +26,24 @@ import RU
atan2Float# :: Float# -> Float# -> Float# atan2Float# :: Float# -> Float# -> Float#
atan2Float# y x = atan2Float# y x =
if x `geFloat#` 0.0# then if x `geFloat#` 0.0# then
if y `eqFloat#` 0.0# then if y `eqFloat#` 0.0# then
0.0# 0.0#
else else
atanFloat# (y `divideFloat#` x) atanFloat# (y `divideFloat#` x)
else if x `ltFloat#` 0.0# then else if x `ltFloat#` 0.0# then
if y `eqFloat#` 0.0# then if y `eqFloat#` 0.0# then
pi# pi#
else else
atanFloat# (y `divideFloat#` x) `plusFloat#` pi# atanFloat# (y `divideFloat#` x) `plusFloat#` pi#
else if y `gtFloat#` 0.0# then else if y `gtFloat#` 0.0# then
pi# `divideFloat#` 2.0# pi# `divideFloat#` 2.0#
else else
negpi# `divideFloat#` 2.0# negpi# `divideFloat#` 2.0#
where pi# = 3.1415926536# where pi# = 3.1415926536#
negpi# = -3.1415926536# negpi# = -3.1415926536#
#endif #endif
-- File: "nucleic2.m" -- File: "nucleic2.m"
...@@ -553,7 +553,7 @@ search partial_inst [] constraint = [partial_inst] ...@@ -553,7 +553,7 @@ search partial_inst [] constraint = [partial_inst]
search partial_inst (h:t) constraint = try_assignments (h partial_inst) search partial_inst (h:t) constraint = try_assignments (h partial_inst)
where try_assignments [] = [] where try_assignments [] = []
try_assignments (v:vs) | constraint v partial_inst = (search (v:partial_inst) t constraint) ++ (try_assignments vs) try_assignments (v:vs) | constraint v partial_inst = (search (v:partial_inst) t constraint) ++ (try_assignments vs)
| otherwise = try_assignments vs | otherwise = try_assignments vs
-- -- DOMAINS ----------------------------------------------------------------- -- -- DOMAINS -----------------------------------------------------------------
...@@ -602,18 +602,18 @@ dgf_base tfo v@(Var i t n) nuc ...@@ -602,18 +602,18 @@ dgf_base tfo v@(Var i t n) nuc
(tfo_combine tfo (tfo_inv_ortho x)) (tfo_combine tfo (tfo_inv_ortho x))
where where
x | is_A n x | is_A n
= tfo_align (atom_pos nuc_C1XXX v) = tfo_align (atom_pos nuc_C1XXX v)
(atom_pos rA_N9 v) (atom_pos rA_N9 v)
(atom_pos nuc_C4 v) (atom_pos nuc_C4 v)
| is_C n | is_C n
= tfo_align (atom_pos nuc_C1XXX v) = tfo_align (atom_pos nuc_C1XXX v)
(atom_pos nuc_N1 v) (atom_pos nuc_N1 v)
(atom_pos nuc_C2 v) (atom_pos nuc_C2 v)
| is_G n | is_G n
= tfo_align (atom_pos nuc_C1XXX v) = tfo_align (atom_pos nuc_C1XXX v)
(atom_pos rG_N9 v) (atom_pos rG_N9 v)
(atom_pos nuc_C4 v) (atom_pos nuc_C4 v)
| otherwise | otherwise
= tfo_align (atom_pos nuc_C1XXX v) = tfo_align (atom_pos nuc_C1XXX v)
(atom_pos nuc_N1 v) (atom_pos nuc_N1 v)
(atom_pos nuc_C2 v) (atom_pos nuc_C2 v)
...@@ -853,8 +853,8 @@ var_most_distant_atom v@(Var i t n) ...@@ -853,8 +853,8 @@ var_most_distant_atom v@(Var i t n)
#ifdef USE_UNBOXED_FLOATS #ifdef USE_UNBOXED_FLOATS
-- partain: can't do lazy pattern-match if x y z are unboxed... -- partain: can't do lazy pattern-match if x y z are unboxed...
where distance p = case (absolute_pos v p) of { Pt x y z -> where distance p = case (absolute_pos v p) of { Pt x y z ->
_SQRT_ ((x _MUL_ x) _ADD_ (y _MUL_ y) _ADD_ (z _MUL_ z)) _SQRT_ ((x _MUL_ x) _ADD_ (y _MUL_ y) _ADD_ (z _MUL_ z))
} }
#else #else
-- original (partain) -- original (partain)
where distance p = BOX_FLOAT(_SQRT_ ((x _MUL_ x) _ADD_ (y _MUL_ y) _ADD_ (z _MUL_ z))) where distance p = BOX_FLOAT(_SQRT_ ((x _MUL_ x) _ADD_ (y _MUL_ y) _ADD_ (z _MUL_ z)))
...@@ -874,10 +874,10 @@ most_distant_atom sols = maximum (map sol_most_distant_atom sols) ...@@ -874,10 +874,10 @@ most_distant_atom sols = maximum (map sol_most_distant_atom sols)
#ifdef USE_GLASGOW_HACKS #ifdef USE_GLASGOW_HACKS
maximum_map :: (a->Float#) -> [a]->Float# maximum_map :: (a->Float#) -> [a]->Float#
maximum_map f (h:t) = maximum_map f (h:t) =
max f t (f h) max f t (f h)
where max f (x:xs) m = max f xs (let fx = f x in if fx `gtFloat#` m then fx else m) where max f (x:xs) m = max f xs (let fx = f x in if fx `gtFloat#` m then fx else m)
max f [] m = m max f [] m = m
max :: (a->Float#) -> [a] -> Float# -> Float# max :: (a->Float#) -> [a] -> Float# -> Float#
#endif #endif
check = length (pseudoknot "") check = length (pseudoknot "")
...@@ -889,13 +889,13 @@ check = length (pseudoknot "") ...@@ -889,13 +889,13 @@ check = length (pseudoknot "")
#ifdef USE_GLASGOW_HACKS #ifdef USE_GLASGOW_HACKS
mainPrimIO = mainPrimIO =
let most_distant = most_distant_atom pseudoknot in let most_distant = most_distant_atom pseudoknot in
_ccall_ printf ``"%f\n"'' (F# most_distant) `seqPrimIO` _ccall_ printf ``"%f\n"'' (F# most_distant) `seqPrimIO`
returnPrimIO () returnPrimIO ()
#else #else
main = do main = do
[n] <- getArgs [n] <- getArgs
replicateM_ (read n) $ do replicateM_ (read n) $ do
[n] <- getArgs [n] <- getArgs
most_distant_atom (pseudoknot n) `seq` return () most_distant_atom (pseudoknot n) `seq` return ()
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment