-
Notifications
You must be signed in to change notification settings - Fork 4
/
dump_anc_probs.cpp
52 lines (34 loc) · 1.28 KB
/
dump_anc_probs.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <algorithm>
#include <iterator>
#include <iomanip>
#include <boost/numeric/ublas/matrix.hpp>
#include "raxml_interface.h"
int main( int argc, char * argv[] ) {
if( argc != 2 ) {
std::cerr << "missing parameters: file name\n";
return 1;
}
char *file_name = argv[1];
std::ifstream is( file_name, std::ios::binary );
auto pvecs = read_binary_anc_probs(is);
for( auto & pv : pvecs )
// auto &pv = pvecs.at(7);
{
// std::cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n";
for( auto it = pv.begin2(); it != pv.end2(); ++it ) {
size_t num = std::count_if(it.begin(), it.end(), [](double a){return a > 0.255;} );
if( !true ) {
if( num > 1 ) {
std::cout << "meeeep\n";
}
} else {
//std::cout << num << " ";
std::cout << std::distance( pv.begin2(), it ) << " ";
std::for_each( it.begin(), it.end(), [&](double v) { std::cout << std::setw(14) << v; } );
std::cout << "\n";
}
}
// break; // stop after first vector
}
}