Skip to content

Commit ae57968

Browse files
committed
cleaning
1 parent 39f749a commit ae57968

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

src/BioGeoTree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ vector<Superdouble> BioGeoTree::conditionals(Node &node, bool marginal, bool spa
249249
}
250250
}
251251
for (unsigned int j = 0; j < distconds.size(); j++) {
252-
distconds[j] = v->at(j);
252+
distconds[j] = v->at(j);
253253
}
254254
if (store_p_matrices == true) {
255255
tsegs->at(i).seg_sp_alphas = distconds;

src/RateMatrixUtils.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ void print_vector_double(vector<double> & in){
186186
}cout << endl;
187187
}
188188

189+
void print_vector_superdouble(vector<Superdouble> & in){
190+
for(unsigned int i=0;i<in.size();i++){
191+
cout << in[i].getMantissa() << "x" << in[i].getExponent() << " ";
192+
}cout << endl;
193+
}
194+
195+
189196
inline bool IsMoreThanZero (double & i) { return (i!=0); }
190197

191198
int get_size_for_coo(vector<vector<double> > & inmatrix, double t){

src/RateMatrixUtils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ void iter_ancsplits_just_int(RateModel *rm, vector<int> & dist,vector<int> & lef
6363
*/
6464
void print_vector_int(vector<int> & in);
6565
void print_vector_double(vector<double> & in);
66+
void print_vector_superdouble(vector<Superdouble> & in);
67+
6668

6769
/*
6870
used for generating all the distributions with maximium number of areas involved

src/superdouble.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,25 @@ double Superdouble::getMantissa(){
2929

3030
void Superdouble::adjustDecimal() {
3131
stilldouble = false;
32+
if (fabs(mantissa) < 1e+100 && fabs(mantissa) > 1e-100){
33+
return;
34+
}
3235
if (mantissa==0 || isinf(mantissa) || isnan(mantissa)) {
3336
exponent=0;
3437
stilldouble = true;
35-
}
36-
else {
38+
}else {
39+
int exa = int(round(log10(mantissa) - 0.5));
40+
mantissa=mantissa / pow(10,exa);
41+
exponent += exa;
42+
/*
3743
while (fabs(mantissa)>=10) {
3844
mantissa*=0.1;
3945
exponent+=1;
4046
}
4147
while (fabs(mantissa)<1) {
4248
mantissa*=10.0;
4349
exponent+=-1;
44-
}
50+
}*/
4551
}
4652
}
4753

0 commit comments

Comments
 (0)