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

Vectorizer not able to handle data views #342

Open
madsendennis opened this issue Apr 6, 2020 · 1 comment
Open

Vectorizer not able to handle data views #342

madsendennis opened this issue Apr 6, 2020 · 1 comment
Assignees

Comments

@madsendennis
Copy link
Collaborator

The vectorizer fromBreezeVector is not able to handle data views such as Transpose. In Scala, all row vectors are represented as a view, e.g. Transpose[Vector[T]].

Either a check should be implemented to ensure that views are not passed in or we can automatically apply the filter (example solution by @Andreas-Forster ):

if ( breeze.data.size == dim ) {
  EuclideanVector.apply[D](breeze.data)
} else {
  EuclideanVector.apply[D](breeze.copy.data)
}
@Andreas-Forster
Copy link
Member

In the second line breeze.copy.data could be replaced by breeze.toArray.

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

No branches or pull requests

3 participants