You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

xsytrf.c 879 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "test.h"
  2. datatype *A[2], *Work;
  3. int *ipiv[2], info;
  4. void pre() {
  5. x2matgen(n, n, A[0], A[1]);
  6. memset(ipiv[0], 0, n * sizeof(int));
  7. memset(ipiv[1], 0, n * sizeof(int));
  8. }
  9. void post() {
  10. error = x2vecerr(n * n, A[0], A[1]) + i2vecerr(n, ipiv[0], ipiv[1]);
  11. }
  12. void tests() {
  13. const int lWork = n * n;
  14. A[0] = xmalloc(n * n);
  15. A[1] = xmalloc(n * n);
  16. ipiv[0] = imalloc(n);
  17. ipiv[1] = imalloc(n);
  18. Work = xmalloc(lWork);
  19. #define ROUTINE XPREF(sytrf)
  20. TEST("L", &n, A[i], &n, ipiv[i], Work, &lWork, &info);
  21. TEST("U", &n, A[i], &n, ipiv[i], Work, &lWork, &info);
  22. #undef ROUTINE
  23. #define ROUTINE XPREF(sytrf_rook)
  24. TEST("L", &n, A[i], &n, ipiv[i], Work, &lWork, &info);
  25. TEST("U", &n, A[i], &n, ipiv[i], Work, &lWork, &info);
  26. free(A[0]);
  27. free(A[1]);
  28. free(ipiv[0]);
  29. free(ipiv[1]);
  30. free(Work);
  31. }