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

Vector math operations #32

Open
kiliakis opened this issue Nov 3, 2016 · 1 comment
Open

Vector math operations #32

kiliakis opened this issue Nov 3, 2016 · 1 comment

Comments

@kiliakis
Copy link
Collaborator

kiliakis commented Nov 3, 2016

Simple vector math operations are available through vector_math.h library. Operations supported:

  • vector (+,-, *, /) vector
  • vector (+,-,,/) scalar or scalar (+,-,,/) vector
  • vector (+,-,*,/)= vector/scalar
  • apply_f(vector, op) --> apply unary op to every element of vector and return the result
  • apply_f(vector1, vector2, op) --> apply binary op to every pair of elements from vector1, vector2 and return the result
  • apply_f_in_place(vector, op) --> apply unary op to every element of vector and store the result back to vector. Returns nothing
  • apply_f_in_place(vector1, vector2, op) --> apply binary op to every pair from vecto1, vector2 and store the result back to vector1. Returns nothing
@kiliakis
Copy link
Collaborator Author

kiliakis commented Nov 3, 2016

A small but important issue has to be fixed. If you look at apply_f function, the return type should be std::vector<return type of F>. I tried to extract F's return type (using result_of<F(T)>::type) but I'm missing something. @dpiparo Could you please advise?

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

1 participant