Skip to content

Commit

Permalink
SG_CALLOC usage for LLE and HLLE
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 26, 2011
1 parent 5918132 commit 16acbc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/shogun/preprocessor/HessianLocallyLinearEmbedding.cpp
Expand Up @@ -84,10 +84,7 @@ SGMatrix<float64_t> CHessianLocallyLinearEmbedding::apply_to_feature_matrix(CFea
SG_FREE(local_neighbors_idxs);

// init W (weight) matrix
float64_t* W_matrix = SG_MALLOC(float64_t, N*N);
for (i=0; i<N; i++)
for (j=0; j<N; j++)
W_matrix[i*N+j]=0.0;
float64_t* W_matrix = SG_CALLOC(float64_t, N*N);

// init matrices and norm factor to be used
float64_t* local_feature_matrix = SG_MALLOC(float64_t, m_k*dim);
Expand Down
5 changes: 1 addition & 4 deletions src/shogun/preprocessor/LocallyLinearEmbedding.cpp
Expand Up @@ -82,10 +82,7 @@ SGMatrix<float64_t> CLocallyLinearEmbedding::apply_to_feature_matrix(CFeatures*
SG_FREE(local_neighbors_idxs);

// init W (weight) matrix
float64_t* W_matrix = SG_MALLOC(float64_t, N*N);
for (i=0; i<N; i++)
for (j=0; j<N; j++)
W_matrix[i*N+j]=0.0;
float64_t* W_matrix = SG_CALLOC(float64_t, N*N);

// init matrices and norm factor to be used
float64_t* z_matrix = SG_MALLOC(float64_t, m_k*dim);
Expand Down

0 comments on commit 16acbc2

Please sign in to comment.