Skip to content

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

2 participants