Commit 67bed18
Define values for ArraySpace (#688)
`values(f)` errored for an array-valued `Fun`, which broke `iszero`
since it started consulting `values` in #635. Three separate causes:
* `itransform` was only defined for `VectorSpace`, so a `MatrixSpace`
fell through to the generic `Space` method and hit
`checkcanonicalspace`, which errors as an `ArraySpace` of canonical
spaces is its own canonical space. Widen the method to `ArraySpace`
and reshape the values to the shape of the space.
* The component coefficients may be views, so `pad!` may not resize
them. Use `pad` instead.
* `_values` asserted a `Vector{float(T)}` return for any space over a
numeric domain, which includes array-valued ones. Restrict the
assertion to spaces with a scalar range type.
Also fix `points(f::Fun{<:ArraySpace})`, which passed the total number
of interlaced coefficients where a per-component count is expected, so
that `values(f) == f.(points(f))`.
Fixes #647
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent e7b41cc commit 67bed18
3 files changed
Lines changed: 36 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
| 430 | + | |
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | | - | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
398 | 423 | | |
399 | 424 | | |
0 commit comments