# HG changeset patch # User Rik # Date 1523722360 25200 # Node ID db31e068f4db0a9bc8e56e96c4707214bb6a190a # Parent b20d0736f32277134afb5943f4d01f36008fe8bb Rewrite incorrect assert statement in colloc calculation (bug #53653) * colloc.cc (jcobi, dfopr): Correct assert statement to be nt >= 1 to match original Fortran. * CollocWt.cc (Fcolloc): Add a few BIST tests. diff -r b20d0736f322 -r db31e068f4db libinterp/corefcn/colloc.cc --- a/libinterp/corefcn/colloc.cc Sat Apr 14 05:51:42 2018 -0700 +++ b/libinterp/corefcn/colloc.cc Sat Apr 14 09:12:40 2018 -0700 @@ -89,3 +89,12 @@ return ovl (r, A, B, q); } + +/* + +%!assert (colloc (1), 0.5) +%!assert (colloc (1, "left"), [0; 0.5]) +%!assert (colloc (1, "right"), [0.5; 1]) +%!assert (colloc (1, "left", "right"), [0; 0.5; 1]) + +*/ diff -r b20d0736f322 -r db31e068f4db liboctave/numeric/CollocWt.cc --- a/liboctave/numeric/CollocWt.cc Sat Apr 14 05:51:42 2018 -0700 +++ b/liboctave/numeric/CollocWt.cc Sat Apr 14 09:12:40 2018 -0700 @@ -153,7 +153,7 @@ octave_idx_type nt = n + n0 + n1; - assert (nt > 1); + assert (nt >= 1); // -- first evaluation of coefficients in recursion formulas. // -- recursion coefficients are stored in dif1 and dif2. @@ -315,7 +315,7 @@ octave_idx_type nt = n + n0 + n1; - assert (nt > 1); + assert (nt >= 1); assert (id == 1 || id == 2 || id == 3);