ghostjat / np
Np (numphp) is numerical library with low memory footprint for php language. Suitable for large scale computing. php-8.0+ 64 bit is required!
Requires
- php-64bit: >=8.0
- ext-ffi: *
This package is auto-updated.
Last update: 2024-11-19 19:22:28 UTC
README
Description
Lite, Fast & Memory Efficient Mathematical PHP library for scientific computing
Np(numphp) is a library that provides objects for computing large sets of numbers in PHP.
Installation
Install Np into your project with Composer:
$ composer require ghostjat/np
##Sample Code
require __DIR__ . '/../vendor/autoload.php'; use Np\matrix; $ta = matrix::randn(1000, 1000); $tb = matrix::randn(1000, 1000); // to generate random 2d matrix $ta->dot($tb); // do a dot operation on given matrix $ta->getMemory(); // get memory use $ta->time(); // get time /** * 7.7mb * Time-Consumed:- 0.18390893936157 */
Synopsis
WARNING:
This 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.
Requirements
- PHP 8+ 64bit with ffi & #libblas, #liblapacke
Make sure you have all the necessary tools installed such as FFI, libblas, liblapacke.
Performance
System Conf:- Intel(R) Core(TM) i3-2370M CPU @ 2.40GHz 64bit Memory:- 8GB php:- 8.0.5 64bit
Current Benchmarks of this library
Data Size :- [500x500] Revolutions:- 5 Iterations:- 5
Previous BenchMark
License
The code is licensed MIT and the documentation is licensed CC BY-NC 4.0.
Author
Shubham Chaudhary ghost.jat@gmail.com