Skip to content

Commit

Permalink
Fixed sparse matrix handling in octave interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 1, 2012
1 parent 7ef9212 commit 6637f20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/interfaces/octave_modular/swig_typemaps.i
Expand Up @@ -326,6 +326,8 @@ TYPEMAP_STRINGFEATURES_OUT(float64_t, Matrix)
int64_t nnz=sm.nelem();

SGSparseVector<type>* matrix = SG_MALLOC(SGSparseVector<type>, num_vec);
for (int32_t i=0; i<num_vec; i++)
new (&matrix[i]) SGSparseVector<type>();

int64_t offset=0;
for (int32_t i=0; i<num_vec; i++)
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/octave_static/OctaveInterface.cpp
Expand Up @@ -344,6 +344,8 @@ void COctaveInterface::get_sparse_matrix(SGSparseVector<float64_t>*& matrix, int
int64_t nnz=sm.nelem();

matrix=SG_MALLOC(SGSparseVector<float64_t>, num_vec);
for (int32_t i=0; i<num_vec; i++)
new (&matrix[i]) SGSparseVector<float64_t>();

int64_t offset=0;
for (int32_t i=0; i<num_vec; i++)
Expand Down

0 comments on commit 6637f20

Please sign in to comment.