Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
introduce clone() function to SGVector
  • Loading branch information
Soeren Sonnenburg committed Feb 14, 2012
1 parent cda7657 commit a044c79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/shogun/lib/DataType.h
Expand Up @@ -101,6 +101,17 @@ template<class T> class SGVector
randperm(vector, vlen);
}

/** clone vector */
SGVector<T> clone()
{
SGVector<T> c;
c.vector=clone_vector(vector, vlen);
c.vlen=vlen;
c.do_free=true;

return c;
}

/** clone vector */
template <class VT>
static VT* clone_vector(const VT* vec, int32_t len)
Expand Down

0 comments on commit a044c79

Please sign in to comment.