Skip to content

Commit

Permalink
protocols for CustomKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
gsomix committed Aug 25, 2012
1 parent ab15b5f commit ab6a200
Show file tree
Hide file tree
Showing 7 changed files with 753 additions and 208 deletions.
10 changes: 10 additions & 0 deletions src/interfaces/modular/Kernel.i
Expand Up @@ -23,6 +23,11 @@
}
#endif

#ifndef SWIGPYTHON
#define PROTOCOLS_CUSTOMKERNEL(class_name, type_name, format_str, typecode)
#define EXTEND_CUSTOMKERNEL(class_name, type_name, typecode)
#endif

/* Remove C Prefix */
%rename(Kernel) CKernel;
%rename(KernelNormalizer) CKernelNormalizer;
Expand All @@ -38,7 +43,10 @@
%rename(CommUlongStringKernel) CCommUlongStringKernel;
%rename(CommWordStringKernel) CCommWordStringKernel;
%rename(ConstKernel) CConstKernel;

PROTOCOLS_CUSTOMKERNEL(CustomKernel, float32_t, "f\0", NPY_FLOAT32)
%rename(CustomKernel) CCustomKernel;

%rename(DiagKernel) CDiagKernel;
%rename(DistantSegmentsKernel) CDistantSegmentsKernel;
%rename(WaveKernel) CWaveKernel;
Expand Down Expand Up @@ -204,3 +212,5 @@ namespace shogun
%include <shogun/kernel/MultiquadricKernel.h>
%include <shogun/kernel/RationalQuadraticKernel.h>
%include <shogun/kernel/JensenShannonKernel.h>

EXTEND_CUSTOMKERNEL(CustomKernel, float32_t, NPY_FLOAT32)

0 comments on commit ab6a200

Please sign in to comment.