Forgot password
 Register account
View 244|Reply 0

/*不如RightComposition快

[Copy link]

3226

Threads

7843

Posts

52

Reputation

Show all posts

hbghlyj posted 2023-4-4 02:48 |Read mode
/*RightComposition
Ken Kang说, 这是因为后缀是静态解析的, 而且/*优先级有点低
HongYang Cao做了性能测试:
image_2021-05-12_13-51-35.png
  1. Range[1000,9999]//
  2. Select[PrimeQ]//
  3. GroupBy[IntegerDigits/*Sort]//
  4. Values//
  5. Map[Subsets[#,{3}]&]//
  6. Catenate//
  7. Select[#.{1,-2,1}==0&]//
  8. AbsoluteTiming
  9. Range[1000,9999]//
  10. RightComposition[
  11. Select[PrimeQ],
  12. GroupBy[IntegerDigits/*Sort],
  13. Values,
  14. Map[Subsets[#,{3}]&],
  15. Catenate,
  16. Select[#.{1,-2,1}==0&],
  17. AbsoluteTiming
  18. ]
Copy the Code

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-23 16:59 GMT+8

Powered by Discuz!

Processed in 0.011591 seconds, 25 queries