Skip to content

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

Merged
9prady9 merged 4 commits intoarrayfire:develfrom
9prady9:Array_arith_traits
Feb 15, 2017
Merged

Additional arithmetic ops/traits implementations for Array and &Array#104
9prady9 merged 4 commits intoarrayfire:develfrom
9prady9:Array_arith_traits

Conversation

@9prady9
Copy link
Copy Markdown
Member

@9prady9 9prady9 commented Feb 15, 2017

Fixes #103

pradeep added 2 commits February 15, 2017 16:52
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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