Skip to content

Additional arithmetic ops/traits implementations for Array and &Array #104

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

Merged
merged 4 commits into from
Feb 15, 2017

Conversation

9prady9
Copy link
Member

@9prady9 9prady9 commented Feb 15, 2017

Fixes #103

Earlier to this commit, arithmetic ops/traits were implemented for
only &Array type.
Earlier to this change, the arithmetic trait implementations used to
call the C-API directly.
src/arith/mod.rs Outdated
type Output = Array;

fn $fn_name(self, rhs: &'a Array) -> Array {
add(&self, rhs, false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template always calls add? Did you mean to do something like fn_name ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, forgot to replace it with $fn_name after testing with Add trait.

src/arith/mod.rs Outdated
type Output = Array;

fn $fn_name(self, rhs: Array) -> Array {
add(self, &rhs, false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment. arith_func is used for all of these:

arith_func!(Add   , add   );
arith_func!(Sub   , sub   );
arith_func!(Mul   , mul   );
...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix. Thanks.

@9prady9 9prady9 requested a review from jramapuram February 15, 2017 12:45
@9prady9 9prady9 merged commit d6fc0c3 into arrayfire:devel Feb 15, 2017
@9prady9 9prady9 deleted the Array_arith_traits branch February 15, 2017 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants