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 derivative example #205

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yasahi-hpc
Copy link
Collaborator

Resolves #49

@yasahi-hpc yasahi-hpc self-assigned this Dec 2, 2024
@yasahi-hpc yasahi-hpc added the enhancement New feature or request label Dec 2, 2024
examples/09_derivative/09_derivative.cpp Outdated Show resolved Hide resolved
examples/09_derivative/09_derivative.cpp Outdated Show resolved Hide resolved
examples/09_derivative/09_derivative.cpp Outdated Show resolved Hide resolved
@rb214678
Copy link
Contributor

When comparing the derivative of a function using FFT-based methods and the one computed with the analytical solution, in the Python script you use np.testing.assert_allclose with a tolerance. In the C++ code you do it "by hand" with some loop. Do you need these checks to be identical ? If yes it is the case ?

@yasahi-hpc
Copy link
Collaborator Author

Thank you for the review.

When comparing the derivative of a function using FFT-based methods and the one computed with the analytical solution, in the Python script you use np.testing.assert_allclose with a tolerance. In the C++ code you do it "by hand" with some loop. Do you need these checks to be identical ? If yes it is the case ?

They are not exactly the same.
I am currently considering to introduce an additional package for testing like numpy.
Once I introduce it, I can use that for the sanity check in this example.
However, it is out of the scope of this PR, so I keep it as is.

@yasahi-hpc yasahi-hpc requested a review from rb214678 January 25, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write a small example of numpy fft derivative
2 participants