57 lines
1.0 KiB
C++
57 lines
1.0 KiB
C++
//
|
|
// php-armadillo/mat.hh
|
|
//
|
|
// @Author CismonX
|
|
//
|
|
|
|
#ifndef PHP_ARMA_MAT_HH
|
|
#define PHP_ARMA_MAT_HH
|
|
|
|
#include "php_arma.hh"
|
|
#include "complex.hh"
|
|
|
|
// Forward declarations.
|
|
namespace arma
|
|
{
|
|
template <typename T>
|
|
class Mat;
|
|
}
|
|
|
|
namespace php_arma
|
|
{
|
|
template <typename T>
|
|
struct mat
|
|
{
|
|
using native_t = arma::Mat<T>;
|
|
using with_int_elem_t = mat<zend_long>;
|
|
|
|
friend void mat_init();
|
|
|
|
template <typename... Ts>
|
|
zend_always_inline
|
|
static zend_object *create(Ts&&... args)
|
|
{
|
|
return object_create_ctor<native_t>(ce, &handlers, args...);
|
|
}
|
|
|
|
PHP_ARMA_CE_HANDLRES_DECLARE();
|
|
|
|
private:
|
|
PHP_ARMA_COMMON_DECLARE();
|
|
|
|
static PHP_FUNCTION(init);
|
|
static PHP_FUNCTION(fromString);
|
|
static PHP_FUNCTION(fromArray);
|
|
|
|
static void ce_init(zend_class_entry*);
|
|
};
|
|
|
|
void mat_init();
|
|
|
|
constexpr const char mat_php_name[] = "Base";
|
|
|
|
inline zend_class_entry *mat_ce;
|
|
}
|
|
|
|
#endif // !PHP_ARMA_MAT_HH
|