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

WIP add uint16 (word) string list to example/test #4540

Merged

Conversation

karlnapf
Copy link
Member

@karlnapf karlnapf commented Feb 24, 2019

Tests in/outgoing typemaps for non-char SGStringList

  • C++
  • Python
  • Octave. Fixed bug! outgoing typemap results in vector of doubles where only first int is stored. Reason is since the code was copy pasted from char, but apparently never tested. Never has worked. Also found this lovely comment /* all (strings) must have same length in octave */. The new outgoing typemap now returns a cell array of row vectors for non-char types and a cell array of strings for char. Compatible with ingoing typemap
  • C#. Only added correct type to example generator
  • Java. Fixed crashes. We had
154: Exception in thread "main" java.lang.ArrayStoreException
154: 	at org.shogun.shogunJNI.SGObject_get_word_string_list(Native Method)
154: 	at org.shogun.SGObject.get_word_string_list(SGObject.java:355)
154: 	at string.main(string.java:32)

from the line
32 int[][] word_list = f_word.get_word_string_list("string_list"); which was caused by using the wrong JNI array type in int[][], namely [[I] instead of [I. Also generally cleaned up the method and fixed a memory leak that was introduced in #4423

@karlnapf karlnapf force-pushed the feature/integration_test_strings branch 5 times, most recently from ddb6423 to 8e1f41a Compare February 26, 2019 14:57
Tests in/outgoing typemaps for non-char SGStringList

* fix outgoing typemap in octave, now cell array of row vectors, previously only contained first character of each string
* fix (and clean up) outgoing typemap in java, previously raised ArrayStoreException due to incorrect inner array JNI type
@karlnapf karlnapf force-pushed the feature/integration_test_strings branch from 8e1f41a to c223841 Compare March 1, 2019 14:25
@karlnapf karlnapf merged commit d6e4754 into shogun-toolbox:develop Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant