Skip to content

Commit

Permalink
register factory methods for proper garbage collection
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham808 committed Jun 1, 2018
1 parent 15624ba commit eaa368e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/interfaces/swig/factory.i
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,18 @@
%include <shogun/util/factory.h>

%template(features) shogun::features<float64_t>;

/* These functions return a new Object */
%newobject distance(const std::string& name);
%newobject evaluation(const std::string& name);
%newobject kernel(const std::string& name);
%newobject kernel(SGMatrix<T> kernel_matrix);
%newobject machine(const std::string& name);
%newobject multiclass_strategy(const std::string& name);
%newobject ecoc_encoder(const std::string& name);
%newobject ecoc_decoder(const std::string& name);
%newobject features(SGMatrix<T> mat);
%newobject features(CFile* file, EPrimitiveType primitive_type);
%newobject features_subset(CFeatures* base_features, SGVector<index_t> indices, EPrimitiveType primitive_type);
%newobject labels(CFile* file);
%newobject csv_file(std::string fname, char rw);

0 comments on commit eaa368e

Please sign in to comment.