# HG changeset patch # User cannam # Date 1252933304 0 # Node ID 054c384d860d1c99c79e5e0b5c672f5613dc8f59 # Parent 0965d2af521388eef8cb767a09b9f9fdf0b28ac3 * Solaris build fixes diff -r 0965d2af5213 -r 054c384d860d base/Pitch.cpp --- a/base/Pitch.cpp Thu Jun 25 13:35:34 2009 +0000 +++ b/base/Pitch.cpp Mon Sep 14 13:01:44 2009 +0000 @@ -9,7 +9,7 @@ #include "Pitch.h" -#include +#include float Pitch::getFrequencyForPitch(int midiPitch, diff -r 0965d2af5213 -r 054c384d860d dsp/tempotracking/TempoTrackV2.cpp --- a/dsp/tempotracking/TempoTrackV2.cpp Thu Jun 25 13:35:34 2009 +0000 +++ b/dsp/tempotracking/TempoTrackV2.cpp Mon Sep 14 13:01:44 2009 +0000 @@ -87,8 +87,9 @@ void -TempoTrackV2::calculateBeatPeriod(const d_vec_t &df, d_vec_t &beat_period, - d_vec_t &tempi) +TempoTrackV2::calculateBeatPeriod(const vector &df, + vector &beat_period, + vector &tempi) { // to follow matlab.. split into 512 sample frames with a 128 hop size // calculate the acf, @@ -392,8 +393,9 @@ } void -TempoTrackV2::calculateBeats(const d_vec_t &df, const d_vec_t &beat_period, - d_vec_t &beats) +TempoTrackV2::calculateBeats(const vector &df, + const vector &beat_period, + vector &beats) { if (df.empty() || beat_period.empty()) return; diff -r 0965d2af5213 -r 054c384d860d hmm/hmm.c --- a/hmm/hmm.c Thu Jun 25 13:35:34 2009 +0000 +++ b/hmm/hmm.c Mon Sep 14 13:01:44 2009 +0000 @@ -15,6 +15,8 @@ #include /* LAPACK for matrix inversion */ +#include "maths/nan-inf.h" + #ifdef ATLAS_ORDER #define HAVE_ATLAS 1 #endif @@ -216,7 +218,7 @@ fprintf(stderr, "re-estimation...\n"); fflush(stderr); */ - if (isnan(loglik)) { + if (ISNAN(loglik)) { foundnan = 1; continue; } @@ -339,16 +341,16 @@ cov[d][e] /= sum_sum_gamma; - if (isnan(cov[d][e])) + if (ISNAN(cov[d][e])) { printf("cov[%d][%d] was nan\n", d, e); for (j = 0; j < N; j++) for (i = 0; i < L; i++) - if (isnan(mu[j][i])) + if (ISNAN(mu[j][i])) printf("mu[%d][%d] was nan\n", j, i); for (t = 0; t < T; t++) for (j = 0; j < N; j++) - if (isnan(gamma[t][j])) + if (ISNAN(gamma[t][j])) printf("gamma[%d][%d] was nan\n", t, j); exit(-1); } @@ -783,11 +785,11 @@ /* // TEST - if (isinf(ret) > 0) + if (ISINF(ret) > 0) printf("loggauss returning infinity\n"); - if (isinf(ret) < 0) + if (ISINF(ret) < 0) printf("loggauss returning -infinity\n"); - if (isnan(ret)) + if (ISNAN(ret)) printf("loggauss returning nan\n"); */ diff -r 0965d2af5213 -r 054c384d860d maths/MathUtilities.cpp --- a/maths/MathUtilities.cpp Thu Jun 25 13:35:34 2009 +0000 +++ b/maths/MathUtilities.cpp Mon Sep 14 13:01:44 2009 +0000 @@ -41,7 +41,7 @@ { temp = data[ i ]; - a += ::pow( fabs(temp), alpha ); + a += ::pow( fabs(temp), double(alpha) ); } a /= ( double )len; a = ::pow( a, ( 1.0 / (double) alpha ) ); @@ -60,7 +60,7 @@ { temp = data[ i ]; - a += ::pow( fabs(temp), alpha ); + a += ::pow( fabs(temp), double(alpha) ); } a /= ( double )len; a = ::pow( a, ( 1.0 / (double) alpha ) ); diff -r 0965d2af5213 -r 054c384d860d maths/MathUtilities.h --- a/maths/MathUtilities.h Thu Jun 25 13:35:34 2009 +0000 +++ b/maths/MathUtilities.h Mon Sep 14 13:01:44 2009 +0000 @@ -13,6 +13,8 @@ #include +#include "nan-inf.h" + class MathUtilities { public: diff -r 0965d2af5213 -r 054c384d860d maths/nan-inf.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/maths/nan-inf.h Mon Sep 14 13:01:44 2009 +0000 @@ -0,0 +1,20 @@ + +#ifndef NAN_INF_H +#define NAN_INF_H + +#include + +#ifdef sun + +#include +#define ISNAN(x) ((sizeof(x)==sizeof(float))?isnanf(x):isnand(x)) +#define ISINF(x) (!finite(x)) + +#else + +#define ISNAN(x) isnan(x) +#define ISINF(x) isinf(x) + +#endif + +#endif diff -r 0965d2af5213 -r 054c384d860d qm-dsp.pro --- a/qm-dsp.pro Thu Jun 25 13:35:34 2009 +0000 +++ b/qm-dsp.pro Mon Sep 14 13:01:44 2009 +0000 @@ -31,6 +31,12 @@ QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden } +solaris* { + QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -fast + INCLUDEPATH += /opt/ATLAS3.9.14/include + DEFINES += USE_PTHREADS +} + INCLUDEPATH += . # Input