Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta example facility for director classes #3897

Open
karlnapf opened this issue Jul 3, 2017 · 2 comments
Open

Add meta example facility for director classes #3897

karlnapf opened this issue Jul 3, 2017 · 2 comments

Comments

@karlnapf
Copy link
Member

karlnapf commented Jul 3, 2017

This allows testing #3894 #3893 #3892

@vigsterkr vigsterkr changed the title Add meta example facility for directory classes Add meta example facility for director classes Jul 3, 2017
@sorig
Copy link
Member

sorig commented Oct 15, 2017

Can you write a bit more context on this? How does the language need to be extended?

@karlnapf
Copy link
Member Author

If we could extend the meta language so that it allows for overloading of a method of an object, then we could test director classes functionality without extending the current test infrastructure.

Also, these examples should illustrate why Director classes are cool.

The only problem is that we cannot really write code in the meta language, only Shogun API.
I think one of the nicest things to overload is a method of CKernel, so maybe we go for CKernel::kernel and explicitly return something like the product of the indices (we would need product of basic types for that :/ )? The example then could call get_kernel_matrix, which is C++ code which then runs the kernel code from inside. Maybe there is a better example, it has to be catchy.

Steps

  • Read on Python's SWIG director classes here
  • The first step would be to compile Shogun with Director classes enabled -DUSE_SWIG_DIRECTORS=On
  • then try to overload a method in an explicitly written Python example, see if it works
  • Then do it for other languages (including C++)
  • Think how we can modify the grammar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants