sciphp / numphp
PHP 科学计算库。
0.4.0
2020-10-14 19:37 UTC
Requires
- php: >=7.2
- webmozart/assert: ^1.2
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-21 14:38:11 UTC
README
NumPhp 是 Python 语言中著名的 NumPy(Python)包的 PHP 版本。
目录
要求
NumPhp 支持 PHP 7.2、7.3、7.4 和 8.0。
安装
composer require sciphp/numphp
基本用法
use SciPhp\NumPhp as np; $m = np::ar( [[ 1, 0, 0], [ 0, 1, 0], [ 0, 0, 1]] )->dot(42); echo "m.42 =\n$m";
将输出
m.42 =
[[ 42, 0, 0 ],
[ 0, 42, 0 ],
[ 0, 0, 42 ]]
文档
NdArray 属性
NdArray 方法
- NdArray::copy
- NdArray::negative
- NdArray::ravel
- NdArray::reshape
- NdArray::resize
- NdArray::add
- NdArray::divide
- NdArray::dot
- NdArray::multiply
- NdArray::reciprocal
- NdArray::subtract
- NdArray::sum
- NdArray::trace
- NdArray::trapz
- NdArray::log
- NdArray::log10
- NdArray::log2
- NdArray::exp
- NdArray::expm1
- NdArray::exp2
- NdArray::power
- NdArray::sqrt
- NdArray::square
- NdArray::tril
- NdArray::triu
- NdArray::copysign
- NdArray::signbit
- NdArray::vander
- NdArray::is_square
NumPhp 方法
- NumPhp::ar
- NumPhp::full
- NumPhp::nulls
- NumPhp::ones
- NumPhp::zeros
- NumPhp::full_like
- NumPhp::nulls_like
- NumPhp::zeros_like
- NumPhp::arange
- NumPhp::linspace
- NumPhp::logspace
- NumPhp::loadtxt
- NumPhp::diag
- NumPhp::diagflat
- NumPhp::diagonal
- NumPhp::eye
- NumPhp::negative
- NumPhp::identity
- NumPhp::trace
- NumPhp::tri
- NumPhp::tril
- NumPhp::triu
- NumPhp::vander
- NumPhp::add
- NumPhp::divide
- NumPhp::dot
- NumPhp::multiply
- NumPhp::power
- NumPhp::sqrt
- NumPhp::square
- NumPhp::reciprocal
- NumPhp::subtract
- NumPhp::transpose
- NumPhp::sum
- NumPhp::trapz
- NumPhp::log
- NumPhp::log10
- NumPhp::log2
- NumPhp::exp
- NumPhp::expm1
- NumPhp::exp2
- NumPhp::signbit
- NumPhp::copysign
- NumPhp::broadcast_to
- NumPhp::is_square
在完整文档中,您可以找到所有实现的内容,包括一些线性代数方法,如矩阵范数和Cholesky 变换。
贡献
欢迎提出问题和提交 PR。贡献受到欢迎。
如果您在文档中发现了错误或认为缺少示例,它托管在numphp-doc 存储库中。