Skip to content

Commit

Permalink
#ifndef WIN32 to #ifdef HAVE_LAPACK transition
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 27, 2011
1 parent 5599548 commit 417d6c9
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/shogun/base/Parallel.h
Expand Up @@ -61,7 +61,7 @@ class Parallel
*/
inline void set_num_threads(int32_t n)
{
#ifdef WIN32
#ifndef HAVE_PTHREAD
ASSERT(n==1);
#endif
num_threads=n;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/SVM.cpp
Expand Up @@ -18,7 +18,7 @@

#include <string.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/shogun/classifier/svm/SVMLight.cpp
Expand Up @@ -42,7 +42,7 @@

#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -1043,7 +1043,7 @@ void CSVMLight::compute_matrices_for_optimization_parallel(
chosen, active2dnum, key, a, lin, c,
varnum, totdoc, aicache, qp) ;
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
register int32_t ki,kj,i,j;
Expand Down Expand Up @@ -1452,7 +1452,7 @@ void CSVMLight::update_linear_component(
lin[j]+=kernel->compute_optimized(docs[j]);
}
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
int32_t num_elem = 0 ;
Expand Down Expand Up @@ -1626,7 +1626,7 @@ void CSVMLight::update_linear_component_mkl_linadd(
for (int32_t i=0; i<num; i++)
kernel->compute_by_subkernel(i,&W[i*num_kernels]);
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
pthread_t* threads = SG_MALLOC(pthread_t, parallel->get_num_threads()-1);
Expand Down Expand Up @@ -2134,7 +2134,7 @@ void CSVMLight::reactivate_inactive_examples(
params.end=totdoc;
reactivate_inactive_examples_linadd_helper((void*) &params);
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
pthread_t* threads = SG_MALLOC(pthread_t, num_threads-1);
Expand Down Expand Up @@ -2266,7 +2266,7 @@ void CSVMLight::reactivate_inactive_examples(
lin[j]+=(a[i]-a_old[i])*aicache[j]*(float64_t)label[i];
}
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
//find number of the changed ones
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/classifier/svm/SVMLightOneClass.cpp
Expand Up @@ -30,7 +30,7 @@ extern "C" {

#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/shogun/clustering/Hierarchical.cpp
Expand Up @@ -15,7 +15,7 @@
#include <shogun/mathematics/Math.h>
#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/shogun/clustering/KMeans.cpp
Expand Up @@ -16,7 +16,7 @@
#include <shogun/mathematics/Math.h>
#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down
10 changes: 5 additions & 5 deletions src/shogun/features/DotFeatures.cpp
Expand Up @@ -14,7 +14,7 @@
#include <shogun/base/Parallel.h>
#include <shogun/base/Parameter.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -83,7 +83,7 @@ void CDotFeatures::dense_dot_range(float64_t* output, int32_t start, int32_t sto

CSignal::clear_cancel();

#ifndef WIN32
#ifdef HAVE_PTHREAD
if (num_threads < 2)
{
#endif
Expand All @@ -99,7 +99,7 @@ void CDotFeatures::dense_dot_range(float64_t* output, int32_t start, int32_t sto
params.bias=b;
params.progress=false; //true;
dense_dot_range_helper((void*) &params);
#ifndef WIN32
#ifdef HAVE_PTHREAD
}
else
{
Expand Down Expand Up @@ -161,7 +161,7 @@ void CDotFeatures::dense_dot_range_subset(int32_t* sub_index, int32_t num, float

CSignal::clear_cancel();

#ifndef WIN32
#ifdef HAVE_PTHREAD
if (num_threads < 2)
{
#endif
Expand All @@ -177,7 +177,7 @@ void CDotFeatures::dense_dot_range_subset(int32_t* sub_index, int32_t num, float
params.bias=b;
params.progress=false; //true;
dense_dot_range_helper((void*) &params);
#ifndef WIN32
#ifdef HAVE_PTHREAD
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions src/shogun/features/HashedWDFeaturesTransposed.cpp
Expand Up @@ -13,7 +13,7 @@
#include <shogun/lib/Signal.h>
#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -213,7 +213,7 @@ void CHashedWDFeaturesTransposed::dense_dot_range(float64_t* output, int32_t sta
if (dim != w_dim)
SG_ERROR("Dimensions don't match, vec_len=%d, w_dim=%d\n", dim, w_dim);

#ifndef WIN32
#ifdef HAVE_PTHREAD
if (num_threads < 2)
{
#endif
Expand All @@ -229,7 +229,7 @@ void CHashedWDFeaturesTransposed::dense_dot_range(float64_t* output, int32_t sta
params.progress=false; //true;
params.index=index;
dense_dot_range_helper((void*) &params);
#ifndef WIN32
#ifdef HAVE_PTHREAD
}
else
{
Expand Down Expand Up @@ -297,7 +297,7 @@ void CHashedWDFeaturesTransposed::dense_dot_range_subset(int32_t* sub_index, int
if (dim != w_dim)
SG_ERROR("Dimensions don't match, vec_len=%d, w_dim=%d\n", dim, w_dim);

#ifndef WIN32
#ifdef HAVE_PTHREAD
if (num_threads < 2)
{
#endif
Expand All @@ -313,7 +313,7 @@ void CHashedWDFeaturesTransposed::dense_dot_range_subset(int32_t* sub_index, int
params.progress=false; //true;
params.index=index;
dense_dot_range_helper((void*) &params);
#ifndef WIN32
#ifdef HAVE_PTHREAD
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions src/shogun/kernel/Kernel.cpp
Expand Up @@ -32,7 +32,7 @@
#include <unistd.h>
#include <math.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -355,13 +355,13 @@ void* CKernel::cache_multiple_kernel_row_helper(void* p)
// Fills cache for the rows in key
void CKernel::cache_multiple_kernel_rows(int32_t* rows, int32_t num_rows)
{
#ifndef WIN32
#ifdef HAVE_PTHREAD
if (parallel->get_num_threads()<2)
{
#endif
for(int32_t i=0;i<num_rows;i++)
cache_kernel_row(rows[i]);
#ifndef WIN32
#ifdef HAVE_PTHREAD
}
else
{
Expand Down
18 changes: 9 additions & 9 deletions src/shogun/kernel/SpectrumRBFKernel.cpp
Expand Up @@ -29,7 +29,7 @@

#include <assert.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -121,13 +121,13 @@ void CSpectrumRBFKernel::read_profiles_and_sequences()
SG_DEBUG("initializing background\n");
double background[20]; // profile
background[0]=0.0799912015849807; //A
background[1]=0.0484482507611578;//R
background[2]=0.044293531582512;//N
background[3]=0.0578891399707563;//D
background[4]=0.0171846021407367;//C
background[5]=0.0380578923048682;//Q
background[6]=0.0638169929675978;//E
background[7]=0.0760659374742852;//G
background[1]=0.0484482507611578;//R
background[2]=0.044293531582512;//N
background[3]=0.0578891399707563;//D
background[4]=0.0171846021407367;//C
background[5]=0.0380578923048682;//Q
background[6]=0.0638169929675978;//E
background[7]=0.0760659374742852;//G
background[8]=0.0223465499452473;//H
background[9]=0.0550905793661343;//I
background[10]=0.0866897071203864;//L
Expand All @@ -151,7 +151,7 @@ void CSpectrumRBFKernel::read_profiles_and_sequences()

SG_DEBUG("Reading profiles from %s\n", filename);
std::string line;
while (!fin.eof())
while (!fin.eof())
{
std::getline(fin, line);

Expand Down
4 changes: 2 additions & 2 deletions src/shogun/kernel/WeightedDegreePositionStringKernel.cpp
Expand Up @@ -22,7 +22,7 @@

#include <shogun/classifier/svm/SVM.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -1277,7 +1277,7 @@ void CWeightedDegreePositionStringKernel::compute_batch(
SG_PROGRESS(j,0,num_feat);
}
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{

Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/DistanceMachine.cpp
Expand Up @@ -67,7 +67,7 @@ void CDistanceMachine::distances_lhs(float64_t* result,int32_t idx_a1,int32_t id

run_distance_thread_lhs((void*) &param);
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
pthread_t* threads = SG_MALLOC(pthread_t, num_threads-1);
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/KernelMachine.cpp
Expand Up @@ -150,7 +150,7 @@ CLabels* CKernelMachine::apply()
params.verbose=true;
apply_helper((void*) &params);
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
pthread_t* threads = SG_MALLOC(pthread_t, num_threads-1);
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/regression/svr/SVRLight.cpp
Expand Up @@ -30,7 +30,7 @@ extern "C" {

#include <shogun/base/Parallel.h>

#ifndef WIN32
#ifdef HAVE_PTHREAD
#include <pthread.h>
#endif

Expand Down Expand Up @@ -399,7 +399,7 @@ void CSVRLight::update_linear_component(
lin[j]+=kernel->compute_optimized(regression_fix_index(docs[j]));
}
}
#ifndef WIN32
#ifdef HAVE_PTHREAD
else
{
int32_t num_elem = 0 ;
Expand Down

0 comments on commit 417d6c9

Please sign in to comment.