|
||
---|---|---|
src | ||
stubs | ||
tests | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
EXPERIMENTAL | ||
LICENSE | ||
README.md | ||
config.m4 |
README.md
php-armadillo
PHP bindings for Armadillo.
1. Introduction
This extension aims at providing a high-performance and easy-to-use native linear algebra library for PHP, which contains PHP bindings for major functionalities of the Armadillo library.
This extension is currently under development. Many funtionalities are not yet implemented, or otherwise may change greatly in the future.
2. Requirements
Dependency | Requirements |
---|---|
Operating system | Unix-like (Linux, macOS, ...) |
PHP | version 7.1 and above |
C++ compiler | has C++17 support (gcc 7, clang 5, ...) |
Armadillo | latest stable release |
3. Documentation
The documentation for php-armadillo is coming soon. Before that, the following items may help you understand how to use this extension.
- API documentation for Armadillo
- Stubs (can be used as IDE helper)
4. Examples
Here is a simple example for using php-armadillo.
// Create a 3x3 dense matrix with random complex numbers as elements.
$mat = Arma\CxDMat::init(3, 3, Arma\Fill::RANDN);
// Print the matrix to STDOUT.
$mat->print();
// Set the value of element at row 2 col 2 to 1.0+j2.0.
$mat->at(1, 1)->setTo(Arma\cx_double(1., 2.));
// Calculate the matrix inverse and save to file in HDF5 format.
$mat->i()->save('mat.hdf5', Arma\FileType::HDF5_BINARY);