/// @file /// Test vector norms /// \test Test vector norms #include #include int main(int argc, char **argv) { Ceed ceed; CeedVector x; CeedInt n = 10; CeedScalar a[10]; CeedInit(argv[1], &ceed); CeedVectorCreate(ceed, n, &x); for (CeedInt i=0; i 100.*CEED_EPSILON) // LCOV_EXCL_START printf("Error: L1 norm %f != 45.\n", norm); // LCOV_EXCL_STOP CeedVectorNorm(x, CEED_NORM_2, &norm); if (fabs(norm - sqrt(285.)) > 100.*CEED_EPSILON) // LCOV_EXCL_START printf("Error: L2 norm %f != sqrt(285.)\n", norm); // LCOV_EXCL_STOP CeedVectorNorm(x, CEED_NORM_MAX, &norm); if (fabs(norm - 9.) > 100.*CEED_EPSILON) // LCOV_EXCL_START printf("Error: Max norm %f != 9.\n", norm); // LCOV_EXCL_STOP CeedVectorDestroy(&x); CeedDestroy(&ceed); return 0; }