Guest User

Untitled

a guest
Dec 6th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. julia> function check_symv(n, Uplo = 'U')
  2. A = randn(n, 2n) |> X -> X * X';
  3. x = rand(n);
  4. gemv = A * x
  5. symv = Base.LinAlg.BLAS.symv(Uplo, A, x)
  6. correct = gemv .≈ symv
  7. correct_count = sum(correct)
  8. eight = min(8,n)
  9. correct_in_first_8 = sum(@view(correct[1:eight]))
  10. n, correct_count, n - correct_count, correct_in_first_8, eight - correct_in_first_8
  11. end
  12. check_symv (generic function with 2 methods)
  13.  
  14. julia> check_symv.(1:20, 'L')
  15. 20-element Array{NTuple{5,Int64},1}:
  16. (1, 1, 0, 1, 0)
  17. (2, 2, 0, 2, 0)
  18. (3, 3, 0, 3, 0)
  19. (4, 4, 0, 4, 0)
  20. (5, 5, 0, 5, 0)
  21. (6, 6, 0, 6, 0)
  22. (7, 7, 0, 7, 0)
  23. (8, 8, 0, 8, 0)
  24. (9, 9, 0, 8, 0)
  25. (10, 10, 0, 8, 0)
  26. (11, 11, 0, 8, 0)
  27. (12, 12, 0, 8, 0)
  28. (13, 13, 0, 8, 0)
  29. (14, 14, 0, 8, 0)
  30. (15, 15, 0, 8, 0)
  31. (16, 16, 0, 8, 0)
  32. (17, 17, 0, 8, 0)
  33. (18, 18, 0, 8, 0)
  34. (19, 19, 0, 8, 0)
  35. (20, 20, 0, 8, 0)
  36.  
  37. julia> check_symv.(149:172, 'L')
  38. 24-element Array{NTuple{5,Int64},1}:
  39. (149, 149, 0, 8, 0)
  40. (150, 150, 0, 8, 0)
  41. (151, 151, 0, 8, 0)
  42. (152, 152, 0, 8, 0)
  43. (153, 153, 0, 8, 0)
  44. (154, 154, 0, 8, 0)
  45. (155, 155, 0, 8, 0)
  46. (156, 156, 0, 8, 0)
  47. (157, 157, 0, 8, 0)
  48. (158, 158, 0, 8, 0)
  49. (159, 159, 0, 8, 0)
  50. (160, 160, 0, 8, 0)
  51. (161, 161, 0, 8, 0)
  52. (162, 162, 0, 8, 0)
  53. (163, 163, 0, 8, 0)
  54. (164, 164, 0, 8, 0)
  55. (165, 165, 0, 8, 0)
  56. (166, 166, 0, 8, 0)
  57. (167, 167, 0, 8, 0)
  58. (168, 168, 0, 8, 0)
  59. (169, 169, 0, 8, 0)
  60. (170, 170, 0, 8, 0)
  61. (171, 171, 0, 8, 0)
  62. (172, 172, 0, 8, 0)
  63.  
  64. julia> versioninfo()
  65. Julia Version 0.7.0-DEV.2513
  66. Commit e36315577f* (2017-11-15 18:17 UTC)
  67. Platform Info:
  68. OS: Linux (x86_64-pc-linux-gnu)
  69. CPU: AMD Ryzen Threadripper 1920X 12-Core Processor
  70. WORD_SIZE: 64
  71. BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Zen)
  72. LAPACK: libopenblas64_
  73. LIBM: libopenlibm
  74. LLVM: libLLVM-3.9.1 (ORCJIT, znver1)
  75. Environment:
Advertisement
Add Comment
Please, Sign In to add comment