Replace enorm with intrinsic norm2#45
Conversation
The tests run for the C API by meson should give you some minimal safety. But we really need better tests than manual comparison on the Fortran side. |
|
Okay, I've removed |
awvwgk
left a comment
There was a problem hiding this comment.
I'm always happy to see negative line count patches.
|
Do you want to pull the latest |
|
I'll see to locate some for time this in the following day or two. |
|
I've pulled and merged the new main branch, but I have several failed test cases. In the main branch however, all tests appear to pass. I'll have to investigate a bit. Edit: I've tried inserting pure real(wp) function enorm(n, x)
implicit none
integer, intent(in) :: n !! a positive integer input variable.
real(wp), intent(in) :: x(n) !! an input array of length n.
enorm = norm2(x(1:n))
end function enorm
Edit: I revisited this, and it seems like I didn't save my editor buffer, or some other silly error. |
It looks like some of the cases which are failing are affected by symmetry. One of the tests that fails after switching to As you can see in the third test invocation of problem 7, the expected and computed x contain the same values but in different order. This is the Chebyquad function which I can only assume is somehow symmetric. Also the solution of the previous iteration is just another permutation. Another case which fails is Problem 6 in The expected values are "hardwired" here: Line 220 in 4717189 After switching to
At the following line Line 116 in 4717189 the logical expression should probably be info_original(ic) < 4 or even info_original(ic) == 1. The error codes for hybrj are:
After fixing this, also |
|
Here's another one that failed, Problem 14 in The current output (I've increased the precision of printing the L2-norm): After switching to but according to the L2-norm the solution is actually slightly more accurate, which is a good reason to prefer I guess we have to amend |

Closes #36.
Was not sure whether I should remove
enormentirely, so I put it in a separate file for now.I also haven't run any tests to analyze if the output remains the same.