Permalink
Browse files

more c++11 windows fixes

  • Loading branch information...
1 parent 4693881 commit 8500fdb732b7da1c7b20b2355f882629180a30ac @sim82 committed Nov 22, 2012
Showing with 46 additions and 44 deletions.
  1. +3 −1 CMakeLists.txt
  2. +1 −1 ivy_mike
  3. +31 −31 math_approx.h
  4. +9 −9 propara.cpp
  5. +2 −2 stepwise_addition_pro.cpp
View
@@ -5,7 +5,9 @@ set( CMAKE_NO_VERBOSE yes )
add_subdirectory(ublasJama-1.0.2.3)
-set( USE_CPP11 yes CACHE BOOL "use c++11 compiler" FORCE )
+if( NOT DEFINED USE_CPP11 )
+ set( USE_CPP11 no CACHE BOOL "use c++11 compiler" FORCE )
+endif()
# add_subdirectory(genassign_blast)
View
@@ -214,18 +214,18 @@ _PI32_CONST(2, 2);
_PI32_CONST(4, 4);
_PI32_CONST(0x7f, 0x7f);
-_PS_CONST(cephes_SQRTHF, 0.707106781186547524);
-_PS_CONST(cephes_log_p0, 7.0376836292E-2);
-_PS_CONST(cephes_log_p1, - 1.1514610310E-1);
-_PS_CONST(cephes_log_p2, 1.1676998740E-1);
-_PS_CONST(cephes_log_p3, - 1.2420140846E-1);
-_PS_CONST(cephes_log_p4, + 1.4249322787E-1);
-_PS_CONST(cephes_log_p5, - 1.6668057665E-1);
-_PS_CONST(cephes_log_p6, + 2.0000714765E-1);
-_PS_CONST(cephes_log_p7, - 2.4999993993E-1);
-_PS_CONST(cephes_log_p8, + 3.3333331174E-1);
-_PS_CONST(cephes_log_q1, -2.12194440e-4);
-_PS_CONST(cephes_log_q2, 0.693359375);
+_PS_CONST(cephes_SQRTHF, 0.707106781186547524f);
+_PS_CONST(cephes_log_p0, 7.0376836292E-2f);
+_PS_CONST(cephes_log_p1, - 1.1514610310E-1f);
+_PS_CONST(cephes_log_p2, 1.1676998740E-1f);
+_PS_CONST(cephes_log_p3, - 1.2420140846E-1f);
+_PS_CONST(cephes_log_p4, + 1.4249322787E-1f);
+_PS_CONST(cephes_log_p5, - 1.6668057665E-1f);
+_PS_CONST(cephes_log_p6, + 2.0000714765E-1f);
+_PS_CONST(cephes_log_p7, - 2.4999993993E-1f);
+_PS_CONST(cephes_log_p8, + 3.3333331174E-1f);
+_PS_CONST(cephes_log_q1, -2.12194440e-4f);
+_PS_CONST(cephes_log_q2, 0.693359375f);
#ifndef USE_SSE2
@@ -340,16 +340,16 @@ v4sf log_ps(v4sf x) {
_PS_CONST(exp_hi, 88.3762626647949f);
_PS_CONST(exp_lo, -88.3762626647949f);
-_PS_CONST(cephes_LOG2EF, 1.44269504088896341);
-_PS_CONST(cephes_exp_C1, 0.693359375);
-_PS_CONST(cephes_exp_C2, -2.12194440e-4);
+_PS_CONST(cephes_LOG2EF, 1.44269504088896341f);
+_PS_CONST(cephes_exp_C1, 0.693359375f);
+_PS_CONST(cephes_exp_C2, -2.12194440e-4f);
-_PS_CONST(cephes_exp_p0, 1.9875691500E-4);
-_PS_CONST(cephes_exp_p1, 1.3981999507E-3);
-_PS_CONST(cephes_exp_p2, 8.3334519073E-3);
-_PS_CONST(cephes_exp_p3, 4.1665795894E-2);
-_PS_CONST(cephes_exp_p4, 1.6666665459E-1);
-_PS_CONST(cephes_exp_p5, 5.0000001201E-1);
+_PS_CONST(cephes_exp_p0, 1.9875691500E-4f);
+_PS_CONST(cephes_exp_p1, 1.3981999507E-3f);
+_PS_CONST(cephes_exp_p2, 8.3334519073E-3f);
+_PS_CONST(cephes_exp_p3, 4.1665795894E-2f);
+_PS_CONST(cephes_exp_p4, 1.6666665459E-1f);
+_PS_CONST(cephes_exp_p5, 5.0000001201E-1f);
v4sf exp_ps(v4sf x) {
v4sf tmp = _mm_setzero_ps(), fx;
@@ -429,16 +429,16 @@ v4sf exp_ps(v4sf x) {
return y;
}
-_PS_CONST(minus_cephes_DP1, -0.78515625);
-_PS_CONST(minus_cephes_DP2, -2.4187564849853515625e-4);
-_PS_CONST(minus_cephes_DP3, -3.77489497744594108e-8);
-_PS_CONST(sincof_p0, -1.9515295891E-4);
-_PS_CONST(sincof_p1, 8.3321608736E-3);
-_PS_CONST(sincof_p2, -1.6666654611E-1);
-_PS_CONST(coscof_p0, 2.443315711809948E-005);
-_PS_CONST(coscof_p1, -1.388731625493765E-003);
-_PS_CONST(coscof_p2, 4.166664568298827E-002);
-_PS_CONST(cephes_FOPI, 1.27323954473516); // 4 / M_PI
+_PS_CONST(minus_cephes_DP1, -0.78515625f);
+_PS_CONST(minus_cephes_DP2, -2.4187564849853515625e-4f);
+_PS_CONST(minus_cephes_DP3, -3.77489497744594108e-8f);
+_PS_CONST(sincof_p0, -1.9515295891E-4f);
+_PS_CONST(sincof_p1, 8.3321608736E-3f);
+_PS_CONST(sincof_p2, -1.6666654611E-1f);
+_PS_CONST(coscof_p0, 2.443315711809948E-005f);
+_PS_CONST(coscof_p1, -1.388731625493765E-003f);
+_PS_CONST(coscof_p2, 4.166664568298827E-002f);
+_PS_CONST(cephes_FOPI, 1.27323954473516f); // 4 / M_PI
View
@@ -439,9 +439,9 @@ class log_odds_viterbi {
// init first rows
- std::fill( m_.begin(), m_.end(), 0.0 );
- std::fill( d_.begin(), d_.end(), 0.0 );
- std::fill( i_.begin(), i_.end(), 0.0 /*neg_inf_*/ );
+ std::fill( m_.begin(), m_.end(), lof_t(0.0) );
+ std::fill( d_.begin(), d_.end(), lof_t(0.0) );
+ std::fill( i_.begin(), i_.end(), lof_t(0.0) /*neg_inf_*/ );
// init first columns
m_[0] = 0.0;
@@ -727,14 +727,14 @@ class log_odds_aligner {
// matrix organization: ref->cols, q->rows
// init first rows
- std::fill( m_.begin1().begin(), m_.begin1().end(), 0.0 );
- std::fill( d_.begin1().begin(), d_.begin1().end(), 0.0 );
+ std::fill( m_.begin1().begin(), m_.begin1().end(), lof_t(0.0) );
+ std::fill( d_.begin1().begin(), d_.begin1().end(), lof_t(0.0) );
std::fill( i_.begin1().begin(), i_.begin1().end(), neg_inf_ );
// init first columns
- std::fill( m_.begin2().begin(), m_.begin2().end(), 0.0 );
+ std::fill( m_.begin2().begin(), m_.begin2().end(), lof_t(0.0) );
std::fill( d_.begin2().begin(), d_.begin2().end(), neg_inf_ );
- std::fill( i_.begin2().begin(), i_.begin2().end(), 0.0 );
+ std::fill( i_.begin2().begin(), i_.begin2().end(), lof_t(0.0) );
}
@@ -1672,7 +1672,7 @@ std::string filename( const std::string &run_name, const char *type ) {
bool file_exists(const char *filename)
{
std::ifstream is(filename);
- return is;
+ return is.good();
}
@@ -1739,7 +1739,7 @@ struct scoring_results {
}
for( size_t i = 0; i < best_score_.size(); ++i ) {
- float other_score = other.best_score_[i];
+ double other_score = other.best_score_[i];
size_t other_ref = other.best_ref_[i];
if( best_score_[i] < other_score || (delta_equal(best_score_[i], other_score) && other_ref < best_ref_[i])) {
@@ -160,8 +160,8 @@ class log_odds_viterbi {
d_(state.size2() + 1),
i_(state.size2() + 1),
max_matrix_height_(0),
- delta_(log(0.01)),
- epsilon_(log(0.1))
+ delta_(lof_t(log(0.01))),
+ epsilon_(lof_t(log(0.1)))
{
ref_gap_prob_log_ = ref_gap_prob_;
{

0 comments on commit 8500fdb

Please sign in to comment.