36 lines
715 B
C++
36 lines
715 B
C++
|
//
|
||
|
// php-armadillo/functions.cc
|
||
|
//
|
||
|
// @Author CismonX
|
||
|
//
|
||
|
|
||
|
#include "functions.hh"
|
||
|
#include "complex.hh"
|
||
|
|
||
|
#define PHP_ARMA_FE(func) \
|
||
|
ZEND_RAW_FENTRY("Arma\\" #func, ZEND_FN(func), nullptr, 0)
|
||
|
|
||
|
namespace php_arma
|
||
|
{
|
||
|
|
||
|
#ifdef PHP_ARMA_OPERATORS
|
||
|
PHP_FUNCTION(j)
|
||
|
{
|
||
|
double imag = 0.0;
|
||
|
ZEND_PARSE_PARAMETERS_START(0, 1)
|
||
|
Z_PARAM_OPTIONAL
|
||
|
Z_PARAM_DOUBLE_DEREF(imag)
|
||
|
ZEND_PARSE_PARAMETERS_END();
|
||
|
|
||
|
zval_set_scalar(return_value, std::complex<double>(0.0, imag));
|
||
|
}
|
||
|
#endif // PHP_ARMA_OPERATORS
|
||
|
|
||
|
const zend_function_entry functions[] = {
|
||
|
#ifdef PHP_ARMA_OPERATORS
|
||
|
PHP_ARMA_FE(j)
|
||
|
#endif // PHP_ARMA_OPERATORS
|
||
|
PHP_FE_END
|
||
|
};
|
||
|
}
|