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

Integrand needs zero defined #66

Open
3f6a opened this issue May 1, 2024 · 2 comments
Open

Integrand needs zero defined #66

3f6a opened this issue May 1, 2024 · 2 comments

Comments

@3f6a
Copy link

3f6a commented May 1, 2024

From the readme:

the integrand f(x) can return any vector-like object (technically, any type supporting +, -, * real, and norm: a Banach space)

However it seems we also need to have zero(f(x)) defined. This should be mentioned in the readme.

@3f6a
Copy link
Author

3f6a commented May 1, 2024

For example, this means currently we cannot have vector of vectors integrand (which define a valid Banach space):

f(x) = [[1,2], [3,4,5]]

for which norm, +, -, and *real are all defined:

julia> 2 * [[1,2], [3,4,5]]
2-element Vector{Vector{Int64}}:
 [2, 4]
 [6, 8, 10]

julia> norm([[1,2], [3,4,5]])
7.416198487095664

...

However, zero([[1,2], [3,4,5]]) is not defined (there was an issue about this but I can't find it now), and this implies that integrating this function fails.

This particular issue should be fixed in Julia 1.11, JuliaLang/julia#38064.

But for more other spaces, the fact that zero is needed should be mentioned IMO.

@stevengj
Copy link
Member

stevengj commented May 2, 2024

Yes, please feel free to submit a PR to clarify 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