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

Add Sum Method #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

keithdoggett
Copy link

@keithdoggett keithdoggett commented May 25, 2020

Added sum instance method in the elementwise module and associated tests in elementwise_test.

@keithdoggett keithdoggett changed the title added sum method for all data types Add Sum Method May 25, 2020
Copy link

@developerfab developerfab left a comment

Choose a reason for hiding this comment

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

I have left some comments. I have a question, what is the gem that use this project to do the tests?

{
complex double* input_elements = (complex double*)input->elements;
complex double sum = 0 + 0*I;
for(size_t index = 0; index < input->count; index++){

Choose a reason for hiding this comment

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

I have seen that you have this cycle in each case of this condition, I think that you could move this in a function, WDYT?. Also I think that you could create a function that calcule this operation and in each case "cast" the response, but maybe this could be weird 🤔

Data_Get_Struct(self, nmatrix, input);

VALUE result;

Choose a reason for hiding this comment

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

I think that this line isn't necessary

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

2 participants