Bugfix: testvalue for LinearAlgera.Diagonal#1290
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1290 +/- ##
==========================================
+ Coverage 88.83% 88.84% +0.01%
==========================================
Files 227 227
Lines 29775 29799 +24
==========================================
+ Hits 26451 26476 +25
+ Misses 3324 3323 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Antoinemarteau we have an issue... This is quite horrible, and I do not see a way out other than removing the diagonals in favor of plain matrices, or implementing our own flavor of diagonal coefficients that allows for non-square matrices. What do you think? |
|
Or, change testvalue of |
|
Alternatively, testvalue of LinearCombinationFieldVector could simply be consistent with the length of the basis returned by testvalue(F)? |
| facet_range = get_dimrange(p,D-1) | ||
| face_own_funs = get_face_own_funs(b,p,conf) | ||
| sign_flip = MVector(tfill(1, Val(length(b)))...) | ||
| sign_flip = fill(1, length(b)) |
There was a problem hiding this comment.
@Antoinemarteau Not only you are using Diagonal, you were using Diagonal of weird stuff, like MVectors and Ones. The worse part is that you can't even use similar on those, because they return sregular arrays. Its a mess... is it really worth it the optimisation? If you want to keep it like this, could you have a look on how to make it viable? I guess this will only appear for linear combinations, but the amount of possibilities is quite bad right now.
There was a problem hiding this comment.
It's probably not worth it to use MVectors at evaluation time, and might not change anything if the evaluation of LinearCombination[...] uses @inbounds, as the size can be determined from the field...
The downside would be allocations when building the reffes (only an issue if many are build).
There was a problem hiding this comment.
Also, unless you have MVectors everywhere I dont think there is any loop unrolling
| function testvalue(::Type{LinearCombinationField{V,F}}) where {V,F} | ||
| fields = testvalue(F) | ||
| values = testvalue(V) | ||
| values = zeros(eltype(V), length(fields), 0) |
There was a problem hiding this comment.
This still looks weird to me, V is ignored so the returned testvalue isn't necessary of the same type as the argument, same with the FieldVector version (if V isn't Diagonal). Doesn't this break the API of testvalue ?
…idap.jl into bugfix-empty-trians
…dap.jl into bugfix-empty-trians
…dap.jl into bugfix-empty-trians
No description provided.