Isprime optimus [FAST]
Versión 1.6 (1,42 KB) por
Nicolas Douillet
Primality test using isprime Matlab(r) stock function, but ~60% faster. Based on Nicolas Douillet 'Christmas eve prime squares expression'.
Once downloaded, typewrite 'help isprime_optimus' in Matlab console for support.
To benefit from the file documentation attached, be sure to download the files, not to just copy and paste them.
Input
- u : a vector of integers sorted in ascending order.
Output
- is_prime : logical vector, result of u primality test. size(is_prime) = size(u).
Please don't forget to rate if this code helped you. Thanks ! ;-)
Citar como
Nicolas Douillet (2024). Isprime optimus [FAST] (https://www.mathworks.com/matlabcentral/fileexchange/156359-isprime-optimus-fast), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2019b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
Versión | Publicado | Notas de la versión | |
---|---|---|---|
1.6 | + fast tag |
||
1.5 | Update overview |
||
1.4 | help / header + comments and description. |
||
1.3 | Sampling expression factorization |
||
1.2 | Minor comment add + copyright year. |
||
1.1 | + CPU time curves comparison picture |
||
1.0.0 |