{"id":22134594,"url":"https://github.com/ghostjat/np","last_synced_at":"2025-07-31T14:34:23.568Z","repository":{"id":51100665,"uuid":"356935566","full_name":"ghostjat/Np","owner":"ghostjat","description":"A Lite \u0026 Memory Efficient  PHP Library for Scientific Computing","archived":false,"fork":false,"pushed_at":"2024-03-21T13:24:32.000Z","size":1451,"stargazers_count":10,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-26T01:38:37.045Z","etag":null,"topics":["blas","calculus","computing","ffi","lapack","libblas","linear-algebra","lite","math","matrix","memory","np","numphp","php","php-ffi","php8","scientific-computing","statstics","trignometry","vector"],"latest_commit_sha":null,"homepage":"https://ghostjat.github.io/Np/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostjat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-11T17:36:11.000Z","updated_at":"2024-11-15T19:31:55.000Z","dependencies_parsed_at":"2024-11-14T21:32:44.454Z","dependency_job_id":"71fcc7f5-4fb8-4133-b9af-6f38f6e54d08","html_url":"https://github.com/ghostjat/Np","commit_stats":{"total_commits":85,"total_committers":2,"mean_commits":42.5,"dds":0.02352941176470591,"last_synced_commit":"7486185a1199cab18a667c8cf3a31468bd5de518"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ghostjat/Np","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostjat%2FNp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostjat%2FNp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostjat%2FNp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostjat%2FNp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostjat","download_url":"https://codeload.github.com/ghostjat/Np/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostjat%2FNp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268057204,"owners_count":24188617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blas","calculus","computing","ffi","lapack","libblas","linear-algebra","lite","math","matrix","memory","np","numphp","php","php-ffi","php8","scientific-computing","statstics","trignometry","vector"],"created_at":"2024-12-01T19:11:52.065Z","updated_at":"2025-07-31T14:34:23.542Z","avatar_url":"https://github.com/ghostjat.png","language":"PHP","readme":"[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ghostjat/Np/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/ghostjat/Np/?branch=main)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/ghostjat/Np)\n[![Build Status](https://scrutinizer-ci.com/g/ghostjat/Np/badges/build.png?b=main)](https://scrutinizer-ci.com/g/ghostjat/Np/build-status/main)\n[![Code Intelligence Status](https://scrutinizer-ci.com/g/ghostjat/Np/badges/code-intelligence.svg?b=main)](https://scrutinizer-ci.com/code-intelligence)\n![GitHub contributors](https://img.shields.io/github/contributors/ghostjat/Np)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/ghostjat/Np)\n![GitHub last commit](https://img.shields.io/github/last-commit/ghostjat/Np)\n![Packagist Version](https://img.shields.io/packagist/v/ghostjat/Np)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ghostjat/Np)\n![Lines of code](https://img.shields.io/tokei/lines/github/ghostjat/Np)\n![GitHub top language](https://img.shields.io/github/languages/top/ghostjat/Np)\n\n\n![Np](https://github.com/ghostjat/numphp/blob/main/np.png)\n\n## Description\n   -----------\nLite, Fast \u0026amp; Memory Efficient *Mathematical PHP library for scientific computing*\n\nNp(numphp) is a library that provides objects for computing large sets of numbers in [PHP](https://php.net).\n\n## Installation\nInstall [Np](https://packagist.org/packages/ghostjat/np) into your project with [Composer](https://getcomposer.org/):\n\n```sh\n$ composer require ghostjat/np\n```\n##Sample Code\n```php\nrequire __DIR__ . '/../vendor/autoload.php';\nuse Np\\matrix;\n\n$ta = matrix::randn(1000, 1000);    \n$tb = matrix::randn(1000, 1000); // to generate random 2d matrix\n$ta-\u003edot($tb);                  // do a dot operation on given matrix\n$ta-\u003egetMemory();              // get memory use\n$ta-\u003etime();                  // get time\n/**\n * 7.7mb\n * Time-Consumed:- 0.18390893936157\n */\n```\n*Synopsis*\n--------\nWARNING:  \nThis module is in its early stages and should be considered a Work in Progress.The interface is not final and may change in the future. \n\n*Requirements*\n------------\n- [PHP](https://php.net) 8+ 64bit with ffi \u0026 #libblas, #liblapacke   \n\nMake sure you have all the necessary tools installed such as FFI, libblas, liblapacke.\n\n*Performance*\n-----------\n\nSystem Conf:- Intel(R) Core(TM) i3-2370M CPU @ 2.40GHz 64bit \nMemory:- 8GB\nphp:- 8.0.5 64bit\n\n*Current Benchmarks of this library*\n-----------------------------------\n![Benckmark](https://github.com/ghostjat/numphp/blob/main/npbm.png)\n\nData Size :- [500x500] Revolutions:- 5 Iterations:- 5\n\n| subject  | mem_peak | best   | mode   | mean   | worst  | stdev |  \n|----------|----------|--------|--------|--------|--------|-------|\n| sum      | 3.606mb  | 0.014s | 0.014s | 0.015s | 0.015s | 0.000s| \n| multiply | 8.589mb  | 0.070s | 0.071s | 0.071s | 0.071s | 0.000s|\n| lu       | 4.648mb  | 0.064s | 0.065s | 0.065s | 0.068s | 0.001s|\n| eign     | 2.801mb  | 0.085s | 0.086s | 0.086s | 0.088s | 0.001s|\n| cholesky | 1.621mb  | 0.001s | 0.001s | 0.001s | 0.001s | 0.000s|\n| svd      | 3.706mb  | 0.126s | 0.126s | 0.127s | 0.133s | 0.002s|\n| normL2   | 1.621mb  | 0.003s | 0.003s | 0.003s | 0.003s | 0.000s|\n| Pinverse | 4.903mb  | 0.156s | 0.156s | 0.158s | 0.163s | 0.003s|\n| inverse  | 1.819mb  | 0.016s | 0.016s | 0.016s | 0.017s | 0.000s|\n| normL1   | 1.621mb  | 0.001s | 0.001s | 0.001s | 0.001s | 0.000s|\n| dotMatrix| 3.769mb  | 0.006s | 0.006s | 0.006s | 0.006s | 0.000s|\n| det      | 4.662mb  | 0.066s | 0.066s | 0.067s | 0.067s | 0.000s|\n| rref     | 1.529mb  | 9.227s | 9.271s | 9.309s | 9.427s | 0.072s|\n| ref      | 1.818mb  | 0.007s | 0.008s | 0.008s | 0.008s | 0.000s|\n| clip     | 8.516mb  | 0.073s | 0.076s | 0.075s | 0.077s | 0.002s|\n| clipUpper| 8.516mb  | 0.055s | 0.056s | 0.057s | 0.059s | 0.002s|\n| clipLower| 8.516mb  | 0.055s | 0.058s | 0.057s | 0.059s | 0.002s|\n| joinBelow| 4.517mb  | 0.027s | 0.027s | 0.027s | 0.028s | 0.000s|\n| transpose| 8.504mb  | 0.057s | 0.057s | 0.058s | 0.059s | 0.001s|\n| joinLeft | 4.511mb  | 0.025s | 0.025s | 0.026s | 0.027s | 0.001s|\n| poisson  | 1.590mb  | 0.029s | 0.029s | 0.029s | 0.030s | 0.000s|\n| gaussian | 20.203mb | 0.056s | 0.056s | 0.056s | 0.056s | 0.000s|\n| randn    | 1.528mb  | 0.017s | 0.017s | 0.017s | 0.017s | 0.000s|\n| uniform  | 1.528mb  | 0.021s | 0.021s | 0.021s | 0.022s | 0.000s|\n| multiply | 4.507mb  | 0.042s | 0.042s | 0.043s | 0.045s | 0.001s|\n\nPrevious BenchMark\n\n| benchmark                 | subject   | set | revs | its | mem_peak | mode    | rstdev   |\n|---------------------------|-----------|-----|------|-----|----------|---------|----------|\n| eignBench                 | eign      | 0   | 1    | 5   | 2.699mb  | 0.309s  | ±4.51%   |\n| svdBench                  | svd       | 0   | 1    | 5   | 3.604mb  | 0.148s  | ±3.60%   |\n| poissonMatrixBench        | poisson   | 0   | 1    | 5   | 11.738mb | 0.105s  | ±7.07%   |\n| gaussianMatrixBench       | gaussian  | 0   | 1    | 5   | 11.738mb | 0.112s  | ±17.12%  |\n| randMatrixBench           | randn     | 0   | 1    | 5   | 1.429mb  | 0.048s  | ±2.37%   |\n| uniformMatrixBench        | uniform   | 0   | 1    | 5   | 1.429mb  | 0.063s  | ±8.16%   |\n| matrixTransposeBench      | transpose | 0   | 1    | 5   | 8.431mb  | 0.120s  | ±1.32%   |\n| rrefBench                 | rref      | 0   | 1    | 5   | 1.501mb  | 28.513s | ±1.90%   |\n| refBench                  | ref       | 0   | 1    | 5   | 1.731mb  | 0.023s  | ±7.24%   |\n| sumMatrixBench            | sum       | 0   | 1    | 5   | 2.434mb  | 0.051s  | ±3.59%   |\n| matrixPseudoInverseBench  | inverse   | 0   | 1    | 5   | 4.775mb  | 0.222s  | ±13.76%  |\n| matrixInverseBench        | inverse   | 0   | 1    | 5   | 1.731mb  | 0.032s  | ±127.50% |\n| dotMatrixBench            | dotMatrix | 0   | 1    | 5   | 3.656mb  | 0.013s  | ±27.94%  |\n| matrixL1NormBench         | normL1    | 0   | 1    | 10  | 1.525mb  | 0.001s  | ±0.80%   |\n| matrixL2NormBench         | normL2    | 0   | 1    | 10  | 1.525mb  | 0.003s  | ±1.63%   |\n\nLicense\n-------\nThe code is licensed [MIT](LICENSE) and the documentation is licensed [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).\n\nAuthor\n------\nShubham Chaudhary \u003cghost.jat@gmail.com\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostjat%2Fnp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostjat%2Fnp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostjat%2Fnp/lists"}