Skip to content

Commit

Permalink
Introduce destroy_vector/matrix. This function should be called only be
Browse files Browse the repository at this point in the history
the 'owner' of the vector/matrix object.
  • Loading branch information
Soeren Sonnenburg committed Jul 26, 2011
1 parent 5ee1b7e commit 595aee7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/shogun/lib/DataType.h
Expand Up @@ -52,6 +52,12 @@ template<class T> class SGVector
vlen=0;
}

void destroy_vector()
{
do_free=true;
free_vector();
}

public:
/** vector */
T* vector;
Expand Down Expand Up @@ -94,6 +100,12 @@ template<class T> class SGMatrix
num_cols=0;
}

void destroy_matrix()
{
do_free=true;
free_matrix();
}

public:
/** matrix */
T* matrix;
Expand Down

0 comments on commit 595aee7

Please sign in to comment.