Skip to content
Commits on Source (4)
......@@ -58,7 +58,7 @@ before_install:
- if [ -n "${C_COMPILER}" ]; then export CC="${C_COMPILER}"; fi
- if [ -n "${CXX_COMPILER}" ]; then export CXX="${CXX_COMPILER}"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install meson; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip && unzip -q ninja-linux.zip -d ~/bin && pyenv local 3.6 && pip3 install meson; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip && unzip -q ninja-linux.zip -d ~/bin && pyenv local 3.7 && pip3 install meson; fi
script:
- meson build --prefix=$HOME/local
......
bali-phy (3.4.1+dfsg-1) UNRELEASED; urgency=medium
* New upstream version 3.4.1+dfsg
* Update Standards-Version to 4.3.0
-- Benjamin Redelings <benjamin.redelings@gmail.com> Tue, 22 Jan 2019 14:04:09 -0500
bali-phy (3.4+dfsg-1) unstable; urgency=medium
* New upstream version
......
......@@ -15,7 +15,7 @@ Build-Depends: debhelper (>= 11),
libboost-system-dev,
libboost-filesystem-dev,
libboost-chrono-dev
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/med-team/bali-phy
Vcs-Git: https://salsa.debian.org/med-team/bali-phy.git
Homepage: http://www.bali-phy.org
......
project('bali-phy', ['cpp','c'],
version: '3.4',
version: '3.4.1',
default_options : [
'buildtype=release',
'cpp_std=c++14'
......
......@@ -35,7 +35,7 @@ struct Edge
};
struct edge_comp {
bool operator()(const Edge& E1, const Edge& E2) {
bool operator()(const Edge& E1, const Edge& E2) const {
return E1.p > E2.p;
}
};
......
#include "tree/tree.H"
#include "TreeInterface.H"
#include "models/parameters.H"
......@@ -482,7 +483,7 @@ std::string write(const TreeInterface& T, int root, const std::vector<double>& L
for(int b: branches)
{
int n = T.target(b);
names2[n] = "'" + names2[n] + "':" + std::to_string(L[T.undirected(b)]);
names2[n] = names2[n] +":" + std::to_string(L[T.undirected(b)]);
}
return write(T, root, names2);
}
......@@ -491,15 +492,18 @@ std::string write(const TreeInterface& T, int root, const std::vector<double>& L
std::string write(const TreeInterface& T, const std::vector<std::string>& names, bool print_lengths)
{
int root = 0; // T.target(0);
vector<string> names2;
for(auto& name: names)
names2.push_back(escape_for_newick(name));
if (print_lengths)
{
vector<double> L;
for(int i=0;i<T.n_branches();i++)
L.push_back(T.branch_length(i));
return write(T, root, L, names);
return write(T, root, L, names2);
}
else
return write(T, root, names);
return write(T, root, names2);
}
vector<int> edges_connecting_to_node(const Tree& T, int n);
......
......@@ -289,7 +289,7 @@ failable_expression desugar_state::match_empty(const vector<expression_ref>& x,
failable_expression E = fail_identity();
for(auto& e: std::reverse(equations))
E = combine(E, e.rhs);
E = combine(e.rhs, E);
return E;
}
......
......@@ -408,7 +408,7 @@ void help_topics(std::ostream& o, const ptree& help)
auto subtopics = get_subtopics(help);
subtopics.push_back("functions");
o<<"To help on one of the following topics, run `bali-phy help "<<underline("topic")<<"`\n\n";
o<<"To see help on one of the following topics, run `bali-phy help "<<underline("topic")<<"`\n\n";
o<<show_options(subtopics);
o<<"\n";
o<<"\n";
......@@ -440,15 +440,17 @@ void show_help(const string& topic, const vector<fs::path>& package_paths)
Rules R(package_paths);
if (topic == "functions")
{
vector<string> func_names;
for(auto& rule: R.get_rules())
{
if (rule.second.get_child_optional("name"))
{
string name = rule.second.get_child("name").get_value<string>();
string result_type = unparse_type(rule.second.get_child("result_type"));
std::cout<<name<<" :: "<<result_type << std::endl;
func_names.push_back(name);
}
}
std::cout<<show_options(func_names)<<std::endl;
return;
}
......
......@@ -23,6 +23,10 @@
#include <vector>
#include <fstream>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// FIXME - Add a command-line option to turn on clouds.
// - Actually draw arrows on type 2 edges.
// - Figure out how to use boost's Kamada-Kawai layout.
......
......@@ -28,7 +28,10 @@
#include <boost/optional.hpp>
using boost::optional;
using namespace std;
using std::string;
using std::vector;
using std::pair;
using boost::dynamic_bitset;
......@@ -68,7 +71,7 @@ void write_header(std::ostream& o, const vector<string>& headers)
{
for(int i=0;i<headers.size();i++)
{
cout<<headers[i];
std::cout<<headers[i];
if (i == headers.size()-1)
o<<"\n";
......@@ -102,8 +105,8 @@ optional<pair<unsigned,unsigned>> is_numeric_range(const string& s, unsigned n)
return boost::none;
}
start = max(1U,start);
end = min(n,end);
start = std::max(1U,start);
end = std::min(n,end);
return pair<unsigned,unsigned>{start,end};
}
......@@ -172,7 +175,7 @@ bool read_entries(const string& line, const vector<int>& indices, char delim, ve
template<>
void Table<string>::load_file(istream& file,int skip,int subsample, int max,
void Table<string>::load_file(std::istream& file,int skip,int subsample, int max,
const vector<string>& ignore, const vector<string>& select)
{
// Read in headers from file
......
......@@ -40,9 +40,16 @@
namespace po = boost::program_options;
using po::variables_map;
using namespace std;
using namespace statistics;
using std::vector;
using std::valarray;
using std::string;
using std::endl;
using std::cout;
using std::cerr;
using boost::optional;
template <typename T>
......@@ -739,7 +746,7 @@ int main(int argc,char* argv[])
// set the window size
int max_lag = int( double(trees.size()/10.0 + 1.0 ) );
if (args.count("max-lag"))
max_lag = min(max_lag,args["max-lag"].as<int>());
max_lag = std::min(max_lag,args["max-lag"].as<int>());
// bound the max_lag
if (max_lag >= trees.size()/2)
......@@ -875,7 +882,7 @@ int main(int argc,char* argv[])
for(;t<trees1.size() and required_hits;t++)
{
double d = distance(trees1[t],trees2,metric_fn);
closest = min(closest,d);
closest = std::min(closest,d);
if (direction == 0 and d < x1) {
if (required_hits ==4)
......
......@@ -31,7 +31,6 @@
#include "tree/tree-util.H"
#include "statistics.H"
using namespace std;
#include <boost/program_options.hpp>
namespace po = boost::program_options;
......@@ -40,7 +39,10 @@ using po::variables_map;
using std::cout;
using std::cerr;
using std::endl;
using std::string;
using std::vector;
using std::valarray;
using boost::optional;
......
......@@ -725,4 +725,6 @@ void remove_sub_branches(Tree& T);
bool same_topology_and_node_and_branch_numbers(const Tree& T1, const Tree& T2);
std::string escape_for_newick(const std::string& s);
std::string unescape_from_newick(const std::string& s);
#endif
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#11
size = 1 Test.#10 = Test.#4:Test.#3
size = 1 Test.#10 = Test.#8:Test.#3
size = 1 Test.#11 = "case: failed pattern match"
size = 1 Test.#1145 = Test.#13:Test.#10
size = 1 Test.#1145 = Test.#7:Test.#10
size = 1 Test.#1151 = 10
size = 1 Test.#1153 = 2
size = 1 Test.#13 = 'y'
size = 1 Test.#2 = '!'
size = 1 Test.#3 = Test.#2:[]
size = 1 Test.#4 = 'o'
size = 1 Test.#5 = Prelude:error Test.#1145
size = 1 Test.#6 = Prelude:error Test.#0
size = 1 Test.f = \#8 -> case #8 of {#1148:#1149 -> #1148,[] -> Test.#5,_ -> Test.#6}
size = 3 Test.g = \#1149 -> let {#1150 = 10} in let {#1152 = case #1149 of {#1148:#1153 -> #1148,[] -> Test.#5,_ -> Test.#6}} in Prelude:add #1150 #1152
size = 1 Test.#4 = Prelude:error Test.#0
size = 1 Test.#7 = 'y'
size = 1 Test.#8 = 'o'
size = 1 Test.#9 = Prelude:error Test.#1145
size = 1 Test.f = \#6 -> case #6 of {#1148:#1149 -> #1148,[] -> Test.#9,_ -> Test.#4}
size = 3 Test.g = \#1149 -> let {#1150 = 10} in let {#1152 = case #1149 of {#1148:#1153 -> #1148,[] -> Test.#9,_ -> Test.#4}} in Prelude:add #1150 #1152
size = 1 Test.h = Prelude:add Test.#1151 Test.#1153
size = 2 Test.f = \#9 -> let {#1 = case #9 of {#166:#167 -> #166,[] -> Data.List.#22,_ -> Data.List.#23}} in \#10 #11 -> case #1 of {Data.Bool.True -> #10,_ -> #11}
size = 2 Test.g = \#13 #14 #15 -> case #15 of {#166:#167 -> case #166 of {Data.Bool.True -> #13,_ -> #14},[] -> case Data.List.#22 of {Data.Bool.True -> #13,_ -> #14},_ -> case Data.List.#23 of {Data.Bool.True -> #13,_ -> #14}}
size = 2 Test.f = \#7 -> let {#1 = case #7 of {#166:#167 -> #166,[] -> Data.List.#55,_ -> Data.List.#17}} in \#8 #9 -> case #1 of {Data.Bool.True -> #8,_ -> #9}
size = 2 Test.g = \#10 #11 #12 -> case #12 of {#166:#167 -> case #166 of {Data.Bool.True -> #10,_ -> #11},[] -> case Data.List.#55 of {Data.Bool.True -> #10,_ -> #11},_ -> case Data.List.#17 of {Data.Bool.True -> #10,_ -> #11}}
size = 1 Main.#0 = Main.#18:[]
size = 1 Main.#0 = Main.#25:[]
size = 1 Main.#1 = 'f'
size = 1 Main.#1141 = Foreign.Vector.listFromString Main.#17
size = 1 Main.#1144 = Foreign.Vector.listFromString Main.#33
size = 1 Main.#1141 = Foreign.Vector.listFromString Main.#12
size = 1 Main.#1144 = Foreign.Vector.listFromString Main.#24
size = 1 Main.#1148 = Main.#1:[]
size = 1 Main.#1151 = "Main.f3: pattern match failure"
size = 1 Main.#1152 = Foreign.Vector.listFromString Main.#1151
size = 1 Main.#13 = Prelude:error Main.#1141
size = 1 Main.#17 = "case: failed pattern match"
size = 1 Main.#18 = 'f'
size = 1 Main.#33 = "case: failed pattern match"
size = 1 Main.#45 = Prelude:error Main.#1148
size = 1 Main.#59 = Prelude:error Main.#1152
size = 1 Main.#6 = Prelude:error Main.#1144
size = 7 Main.f = \#29 #30 -> let {fail1 = case #29 of {[] -> Main.fail2#0,#10:#11 -> case #30 of {[] -> #10:[],#3:#4 -> Main.fail2#0,_ -> Main.#6},_ -> Main.#13}} in case #29 of {#24:#25 -> case #30 of {#1151:#1152 -> Data.List.++ #25 #1152,_ -> fail1},_ -> fail1}
size = 4 Main.f2 = \#1150 #1151 -> case #1150 of {#35:#36 -> case #1151 of {#37:#38 -> Data.List.++ #36 #38,[] -> #35:[],_ -> Main.#45},_ -> Main.#45}
size = 4 Main.f3 = \#47 #48 -> case #47 of {#49:#50 -> case #48 of {#51:#52 -> Data.List.++ #50 #52,[] -> #49:[],_ -> Main.#59},_ -> Main.#59}
size = 1 Main.#12 = "case: failed pattern match"
size = 1 Main.#24 = "case: failed pattern match"
size = 1 Main.#25 = 'f'
size = 1 Main.#33 = Prelude:error Main.#1148
size = 1 Main.#4 = Prelude:error Main.#1144
size = 1 Main.#45 = Prelude:error Main.#1152
size = 1 Main.#9 = Prelude:error Main.#1141
size = 7 Main.f = \#21 #22 -> let {fail1 = case #21 of {[] -> Main.fail2#0,#7:#8 -> case #22 of {[] -> #7:[],#1151:#3 -> Main.fail2#0,_ -> Main.#4},_ -> Main.#9}} in case #21 of {#17:#18 -> case #22 of {#1151:#1152 -> Data.List.++ #18 #1152,_ -> fail1},_ -> fail1}
size = 4 Main.f2 = \#1150 #1151 -> case #1150 of {#1152:#26 -> case #1151 of {#27:#28 -> Data.List.++ #26 #28,[] -> #1152:[],_ -> Main.#33},_ -> Main.#33}
size = 4 Main.f3 = \#35 #36 -> case #35 of {#37:#38 -> case #36 of {#39:#40 -> Data.List.++ #38 #40,[] -> #37:[],_ -> Main.#45},_ -> Main.#45}
size = 1 Main.fail2#0 = Prelude:error Main.#0
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#9
size = 1 Test.#5 = Prelude:error Test.#0
size = 1 Test.#9 = "case: failed pattern match"
size = 2 Test.f = \#7 -> case #7 of {(#1142, #3) -> 2,_ -> Test.#5}
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#7
size = 1 Test.#4 = Prelude:error Test.#0
size = 1 Test.#7 = "case: failed pattern match"
size = 2 Test.f = \#6 -> case #6 of {(#1142, #3) -> 2,_ -> Test.#4}
size = 1 Test.#0 = 10
size = 1 Test.#1142 = 3
size = 1 Test.#4 = Prelude:add Test.#0 Test.#1142
size = 0 Test.f = \#3 -> Test.#4
size = 1 Test.#3 = Prelude:add Test.#0 Test.#1142
size = 0 Test.f = \#2 -> Test.#3
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#12
size = 1 Test.#12 = "case: failed pattern match"
size = 1 Test.#8 = Prelude:error Test.#0
size = 2 Test.f = \#10 -> case #10 of {0 -> 1,2 -> 3,_ -> Test.#8}
size = 1 Test.#5 = Prelude:error Test.#0
size = 2 Test.f = \#7 -> case #7 of {0 -> 1,2 -> 3,_ -> Test.#5}
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#18
size = 1 Test.#12 = Prelude:error Test.#0
size = 1 Test.#18 = "case: failed pattern match"
size = 2 Test.f = \#14 -> case #14 of {#8:#9 -> #9,[] -> [],_ -> Test.#12}
size = 1 Test.#0 = Foreign.Vector.listFromString Test.#13
size = 1 Test.#13 = "case: failed pattern match"
size = 1 Test.#9 = Prelude:error Test.#0
size = 2 Test.f = \#11 -> case #11 of {#7:#8 -> #8,[] -> [],_ -> Test.#9}