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

suggestion to vectorize Functions #7

Open
a-kramer opened this issue Jan 30, 2022 · 1 comment
Open

suggestion to vectorize Functions #7

a-kramer opened this issue Jan 30, 2022 · 1 comment

Comments

@a-kramer
Copy link

a-kramer commented Jan 30, 2022

Hello,
I suggest to create a vector valued function that calculates all user defined Functions in one go, to not repeat unnecessary calculations (when all of them are needed), and most importantly: for convenience.

Specifically, I would like that in the gsl_odeiv(2) module. To use the Function names productively, one could define an enum:

enum Function_names {Name_1, Name_2}; /* etc */

and later on, in the unified output function:

/*  User defined functions */
int SYSTEM_out(double t, const double y_[], void *params, double *Function)
{
 /* assignments 
  * and 
  * expression calculations 
  */
 Function[Name_1] = Value_1;
 Function[Name_2] = Value_2;
 /* etc. */
 return GSL_SUCCESS;
}

This function could also exist in addition to the scalar functions. That would be neat, in most languages, I guess.
Thank you for all the hard work!

@WarrenWeckesser
Copy link
Owner

WarrenWeckesser commented Mar 11, 2022

@a-kramer, (a belated) thanks for the suggestion!

This is certainly possible. I've been doing some work on vfgen lately; I'll look into adding this.

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

No branches or pull requests

2 participants