This repository has been archived on 2020-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
php-armadillo/src/php_arma.cc

95 lines
2.4 KiB
C++
Raw Normal View History

//
2019-03-14 15:23:21 +00:00
// php-armadillo/php_arma.cc
//
// @Author CismonX
//
2019-03-14 15:23:21 +00:00
#include "php_arma.hh"
2019-03-22 08:30:44 +00:00
#include "constants.hh"
#include "complex.hh"
2019-07-07 16:57:25 +00:00
#include "subview.hh"
2019-04-02 08:16:11 +00:00
#include "base.hh"
2019-05-25 18:21:48 +00:00
#include "dense.hh"
#include "matrix.hh"
#include "dense_matrix.hh"
#include "resizable.hh"
#include "resizable_matrix.hh"
2019-07-07 16:57:25 +00:00
#include "non_resizable.hh"
#include "non_resizable_matrix.hh"
2019-05-25 18:21:48 +00:00
#include "dense_resizable_matrix.hh"
2019-07-07 16:57:25 +00:00
#include "dense_non_resizable_matrix.hh"
2019-03-24 08:59:29 +00:00
#include "mapval.hh"
#include "functions.hh"
2019-05-25 18:21:48 +00:00
#include "mat.hh"
2019-07-07 16:57:25 +00:00
#include "subview_mat.hh"
2019-09-15 19:53:01 +00:00
#include "diagonal.hh"
2019-04-16 11:00:50 +00:00
#ifdef PHP_ARMA_OPERATORS
#include "operators.hh"
#endif // PHP_ARMA_OPERATORS
2019-03-25 07:14:53 +00:00
#include <ext/standard/info.h>
namespace php_arma
{
int module_init(INIT_FUNC_ARGS)
{
constants_init();
complex_init();
2019-07-07 16:57:25 +00:00
subview_init();
base_init();
mapval_init();
2019-05-25 18:21:48 +00:00
dense_init();
matrix_init();
dense_matrix_init();
resizable_init();
resizable_matrix_init();
2019-07-07 16:57:25 +00:00
non_resizable_init();
non_resizable_matrix_init();
2019-05-25 18:21:48 +00:00
dense_resizable_matrix_init();
2019-07-07 16:57:25 +00:00
dense_non_resizable_matrix_init();
2019-05-25 18:21:48 +00:00
mat_init();
2019-07-07 16:57:25 +00:00
subview_mat_init();
2019-09-15 19:53:01 +00:00
diagonal_init();
2019-04-16 11:00:50 +00:00
#ifdef PHP_ARMA_OPERATORS
operators_init();
2019-04-16 11:00:50 +00:00
#endif // PHP_ARMA_OPERATORS
2019-06-07 19:00:03 +00:00
arma::arma_rng::set_seed_random();
return SUCCESS;
}
void module_info(ZEND_MODULE_INFO_FUNC_ARGS)
{
php_info_print_table_start();
2019-09-16 15:42:38 +00:00
php_info_print_table_row(2, "php-armadillo version", PHP_ARMA_VERSION);
php_info_print_table_row(2, "Armadillo version", arma::arma_version::as_string().c_str());
php_info_print_table_row(1, "");
php_info_print_table_row(2, "Operator overloading", features::operators ? "enabled" : "disabled");
php_info_print_table_row(2, "HDF5 file format support", features::hdf5 ? "true" : "false");
php_info_print_table_row(2, "Stream resource support", features::stream_res ? "true" : "false");
php_info_print_table_end();
}
zend_module_entry module_entry = {
STANDARD_MODULE_HEADER,
"arma",
functions,
module_init,
nullptr,
nullptr,
nullptr,
module_info,
PHP_ARMA_VERSION,
STANDARD_MODULE_PROPERTIES
};
}
#ifdef COMPILE_DL_ARMA
extern "C" ZEND_DLEXPORT zend_module_entry *get_module()
{
return &php_arma::module_entry;
}
#endif // COMPILE_DL_ARMA