Skip to content

Commit

Permalink
LTSA and HLLE fix for pthread generic routines
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 21, 2011
1 parent ed18465 commit 85ce83d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/shogun/preprocessor/HessianLocallyLinearEmbedding.cpp
Expand Up @@ -345,15 +345,15 @@ void* CHessianLocallyLinearEmbedding::run_hessianestimation_thread(void* p)
Pii,m_k,
0.0,q_matrix,m_k);
#ifdef HAVE_PTHREAD
PTHREAD_LOCK(W_matrix_lock);
PTHREAD_LOCK(*W_matrix_lock);
#endif
for (j=0; j<m_k; j++)
{
for (k=0; k<m_k; k++)
W_matrix[N*neighborhood_matrix[k*N+i]+neighborhood_matrix[j*N+i]] += q_matrix[j*m_k+k];
}
#ifdef HAVE_PTHREAD
PTHREAD_UNLOCK(W_matrix_lock);
PTHREAD_UNLOCK(*W_matrix_lock);
#endif
}
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/preprocessor/LocalTangentSpaceAlignment.cpp
Expand Up @@ -290,7 +290,7 @@ void* CLocalTangentSpaceAlignment::run_ltsa_thread(void* p)

// W[neighbors of i, neighbors of i] = I - GG'
#ifdef HAVE_PTHREAD
PTHREAD_LOCK(W_matrix_lock);
PTHREAD_LOCK(*W_matrix_lock);
#endif
for (j=0; j<m_k; j++)
{
Expand All @@ -300,7 +300,7 @@ void* CLocalTangentSpaceAlignment::run_ltsa_thread(void* p)
W_matrix[N*neighborhood_matrix[k*N+i]+neighborhood_matrix[j*N+i]] -= q_matrix[j*m_k+k];
}
#ifdef HAVE_PTHREAD
PTHREAD_UNLOCK(W_matrix_lock);
PTHREAD_UNLOCK(*W_matrix_lock);
#endif
}
return NULL;
Expand Down

0 comments on commit 85ce83d

Please sign in to comment.