• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision0ea264aff68f7ed684d29045d69242ebb498b40e (tree)
Time2010-09-14 07:18:41
Authorlorenzo
Commiterlorenzo

Log Message

I cleaned up a bit the code and removed unnecessary tests/calculations
carried out on a single tag id.

Change Summary

Incremental Difference

diff -r cfc149abd38c -r 0ea264aff68f haskell/visibility-haskell.hs
--- a/haskell/visibility-haskell.hs Mon Sep 13 15:29:04 2010 +0000
+++ b/haskell/visibility-haskell.hs Mon Sep 13 22:18:41 2010 +0000
@@ -15,36 +15,36 @@
1515
1616 let dat :: [[Integer]]
1717
18- dat = convert txt
18+ dat = convert txt -- Now dat is a list where every element is a row of the original data table
1919
20- let dat_col = transpose dat
20+ let dat_col = transpose dat -- now every entry of data_col is a column of the original data table
2121
2222 let tag_list = get_tag_list dat_col
2323
2424 -- putStrLn "tag_list is, "
2525 -- print tag_list
2626
27- let tag_1080_pos = get_single_tag_story dat_col 1080
27+ -- let tag_1080_pos = get_single_tag_story dat_col 1080
2828
2929 -- putStrLn "positions of tag 1080, "
3030 -- print tag_1080_pos
3131
32- let t_1080= get_sel (dat_col!!1) tag_1080_pos
32+ -- let t_1080= get_sel (dat_col!!1) tag_1080_pos
3333
3434 -- writeFile "ini_1080.dat" t_1080
3535
3636
3737
38- putStrLn "the times of the begin of the contacts of tag 1080 are, "
39- print (take 30 t_1080 )
38+ -- putStrLn "the times of the begin of the contacts of tag 1080 are, "
39+ -- print (take 30 t_1080 )
4040
41- let t_1080_2 = single_tag_unique_contact_times dat_col 1080
41+ -- let t_1080_2 = single_tag_unique_contact_times dat_col 1080
4242
43- putStrLn "or also "
44- print (take 30 t_1080_2 )
43+ -- putStrLn "or also "
44+ -- print (take 30 t_1080_2 )
4545
4646
47- save "1080_hs.dat" t_1080
47+ -- save "1080_hs.dat" t_1080
4848
4949 -- putStrLn "nub t_1080==nub (sort t_1080) is,"
5050 -- print (( t_1080)==( (sort t_1080) ))
@@ -58,36 +58,36 @@
5858
5959 -- print (unique_time_long)
6060
61- let ctime = count t_1080
61+ -- let ctime = count t_1080
6262
6363 -- putStrLn "the repeated times are, "
6464 -- print (take 10 ctime )
6565
6666
67- let n_occ = count_occurrencies t_1080
67+ -- let n_occ = count_occurrencies t_1080
6868 -- putStrLn "the occurrencies are, "
6969 -- print ( n_occ )
7070
7171
72- let times_multi_contacts = find_repeated_times n_occ t_1080
72+ -- let times_multi_contacts = find_repeated_times n_occ t_1080
7373
7474 -- putStrLn "the times at which multiple contacts are established are, "
7575 -- print ( times_multi_contacts )
7676
7777
78- let duration_times = get_single_tag_contact_durations dat_col tag_1080_pos
78+ -- let duration_times = get_single_tag_contact_durations dat_col tag_1080_pos
7979
80- putStrLn "contact durations are"
81- print (take 30 duration_times )
80+ -- putStrLn "contact durations are"
81+ -- print (take 30 duration_times )
8282
83- let summed_times = sum_corresponding_unique t_1080 duration_times
83+ -- let summed_times = sum_corresponding_unique t_1080 duration_times
8484
85- putStrLn "the summed duration times for multiple contacts starting at the same time are"
86- print (take 30 summed_times )
85+ -- putStrLn "the summed duration times for multiple contacts starting at the same time are"
86+ -- print (take 30 summed_times )
8787
88- let summed_times_2 = single_tag_unique_contact_durations dat_col 1080
89- putStrLn "or also"
90- print (take 30 summed_times_2 )
88+ -- let summed_times_2 = single_tag_unique_contact_durations dat_col 1080
89+ -- putStrLn "or also"
90+ -- print (take 30 summed_times_2 )
9191
9292
9393 let summed_durations_long = map (single_tag_unique_contact_durations dat_col) tag_list
@@ -113,9 +113,9 @@
113113
114114 let data_comb = zip unique_time_long summed_durations_long
115115
116- let summed_durations_long_ordered = genericIndex data_comb 2
116+ -- let summed_durations_long_ordered = genericIndex data_comb 2
117117
118- let ms = argsort_only (unique_time_long!!1) (summed_durations_long!!1)
118+ -- let ms = argsort_only (unique_time_long!!1) (summed_durations_long!!1)
119119
120120
121121 let summed_durations_long_ordered = map (argsort_tuple . genericIndex data_comb) [0,1..length(data_comb)-1]
@@ -126,8 +126,8 @@
126126 putStrLn "summed_durations_long_ordered is, "
127127 print (summed_durations_long_ordered )
128128
129- putStrLn "ms is, "
130- print (ms)
129+ -- putStrLn "ms is, "
130+ -- print (ms)
131131
132132
133133
@@ -251,6 +251,6 @@
251251 save_vector_flat filename list = writeFile filename $ unlines (map show $ concat list)
252252
253253
254--- Now I need a function which combines several ones
255254
256255
256+