Lines Matching full:roots

30                     "Invalid test case, up to 3 roots allowed");  in testCubicRootsReal()
43 "Invalid test case root %zu. Roots should be sorted in ascending order", i); in testCubicRootsReal()
51 double roots[3] = {0, 0, 0}; in testCubicRootsReal() local
52 int rootCount = SkDCubic::RootsReal(A, B, C, D, roots); in testCubicRootsReal()
54 "Wrong number of roots returned %zu != %d", expectedRoots.size(), in testCubicRootsReal()
57 // We don't care which order the roots are returned from the algorithm. in testCubicRootsReal()
59 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testCubicRootsReal()
62 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testCubicRootsReal()
63 "0 != %.16f at index %d", roots[i], i); in testCubicRootsReal()
66 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testCubicRootsReal()
67 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testCubicRootsReal()
73 double roots[3] = {0, 0, 0}; in testCubicRootsReal() local
74 int rootCount = SkCubics::RootsReal(A, B, C, D, roots); in testCubicRootsReal()
76 "Wrong number of roots returned %zu != %d", expectedRoots.size(), in testCubicRootsReal()
79 // We don't care which order the roots are returned from the algorithm. in testCubicRootsReal()
81 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testCubicRootsReal()
84 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testCubicRootsReal()
85 "0 != %.16f at index %d", roots[i], i); in testCubicRootsReal()
88 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testCubicRootsReal()
89 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testCubicRootsReal()
110 testCubicRootsReal(reporter, "three roots 10x^3 - 20x^2 - 30x + 40", in DEF_TEST()
119 testCubicRootsReal(reporter, "three roots -10x^3 + 200x^2 + 300x - 400", in DEF_TEST()
147 testCubicRootsReal(reporter, "three roots 2x^3 - 3x^2 - 4x + 0", in DEF_TEST()
163 // This means we don't find all the roots, but usually we only care about roots in DEF_TEST()
165 testCubicRootsReal(reporter, "oss-fuzz:55625 Two roots near zero, one big root", in DEF_TEST()
176 testCubicRootsReal(reporter, "oss-fuzz:55625 Two roots near zero, one big root, near linear", in DEF_TEST()
202 testCubicRootsReal(reporter, "two roots -2x^2 + 3x + 4", in DEF_TEST()
218 testCubicRootsReal(reporter, "no roots x^2 + 2x + 7", in DEF_TEST()
223 testCubicRootsReal(reporter, "two roots one small one big (and ignored)", in DEF_TEST()
251 double roots[3] = {0, 0, 0}; in DEF_TEST() local
253 SkCubics::RootsReal(NAN, 1, 2, 3, roots) == 0, in DEF_TEST()
257 SkCubics::RootsReal(1, NAN, 2, 3, roots) == 0, in DEF_TEST()
261 SkCubics::RootsReal(1, 2, NAN, 3, roots) == 0, in DEF_TEST()
265 SkCubics::RootsReal(1, 2, 3, NAN, roots) == 0, in DEF_TEST()
275 roots); in DEF_TEST()
276 REPORTER_ASSERT(reporter, numRoots == 0, "No finite roots expected, got %d", numRoots); in DEF_TEST()
285 roots); in DEF_TEST()
286 REPORTER_ASSERT(reporter, numRoots == 0, "No finite roots expected, got %d", numRoots); in DEF_TEST()
296 "Invalid test case, up to 3 roots allowed"); in testCubicValidT()
301 "Invalid test case root %zu. Roots must be in [0, 1]", i); in testCubicValidT()
310 "Invalid test case root %zu. Roots should be sorted in ascending order", i); in testCubicValidT()
316 double roots[3] = {0, 0, 0}; in testCubicValidT() local
317 int rootCount = SkDCubic::RootsValidT(A, B, C, D, roots); in testCubicValidT()
319 "Wrong number of roots returned %zu != %d", in testCubicValidT()
322 // We don't care which order the roots are returned from the algorithm. in testCubicValidT()
324 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testCubicValidT()
327 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testCubicValidT()
328 "0 != %.16f at index %d", roots[i], i); in testCubicValidT()
331 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testCubicValidT()
332 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testCubicValidT()
338 double roots[3] = {0, 0, 0}; in testCubicValidT() local
339 int rootCount = SkCubics::RootsValidT(A, B, C, D, roots); in testCubicValidT()
341 "Wrong number of roots returned %zu != %d", in testCubicValidT()
344 // We don't care which order the roots are returned from the algorithm. in testCubicValidT()
346 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testCubicValidT()
349 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testCubicValidT()
350 "0 != %.16f at index %d", roots[i], i); in testCubicValidT()
353 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testCubicValidT()
354 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testCubicValidT()
360 double roots[3] = {0, 0, 0}; in testCubicValidT() local
361 int rootCount = SkCubics::BinarySearchRootsValidT(A, B, C, D, roots); in testCubicValidT()
363 "Wrong number of roots returned %zu != %d", expectedRoots.size(), in testCubicValidT()
366 // We don't care which order the roots are returned from the algorithm. in testCubicValidT()
368 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testCubicValidT()
370 double delta = std::abs(roots[i] - expectedRoots[i]); in testCubicValidT()
375 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testCubicValidT()
383 testCubicValidT(reporter, "three roots 24x^3 - 46x^2 + 29x - 6", in DEF_TEST()
389 testCubicValidT(reporter, "three roots total, two in range 54x^3 - 117x^2 + 45x + 0", in DEF_TEST()
404 testCubicValidT(reporter, "three roots total, two in range -2x^3 - 3x^2 + 4x + 0", in DEF_TEST()
412 testCubicValidT(reporter, "Two roots at exactly 0 and 1", in DEF_TEST()
428 double roots[3] = {0, 0, 0}; in DEF_TEST() local
429 int rootCount = SkDCubic::RootsValidT(A, B, C, D, roots); in DEF_TEST()
432 std::sort(std::begin(roots), std::begin(roots) + rootCount); in DEF_TEST()
433 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[0]), "%.16f != 0", roots[0]); in DEF_TEST()
434 … REPORTER_ASSERT(reporter, sk_doubles_nearly_equal_ulps(roots[1], 1), "%.16f != 1", roots[1]); in DEF_TEST()
437 // Three very small roots, all of them are nearly equal zero in DEF_TEST()
444 double roots[3] = {0, 0, 0}; in DEF_TEST() local
445 int rootCount = SkDCubic::RootsValidT(A, B, C, D, roots); in DEF_TEST()
448 std::sort(std::begin(roots), std::begin(roots) + rootCount); in DEF_TEST()
449 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[0]), "%.16f != 0", roots[0]); in DEF_TEST()