Lagrange basis should form a partition of unity: sum_i B_i(t) = 1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_009(id, nfail) use forcolormap_parameters, only: wp use forcolormap_utils, only: lagrange_poly integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "lagrange_poly: partition of unity at t=0.37 (n=6)" logical :: ok real(wp), parameter :: tol = 1.0e-12_wp ok = abs(sum(lagrange_poly(0.37_wp, 6)) - 1.0_wp) <= tol call report_test(name, ok, id, nfail) end subroutine test_009