60 lines
1.9 KiB
C++
60 lines
1.9 KiB
C++
//
|
|
// php-armadillo/subview_mat.cc
|
|
//
|
|
// @Author CismonX
|
|
//
|
|
|
|
#include "subview_mat.hh"
|
|
#include "subview.hh"
|
|
#include "base.hh"
|
|
#include "dense.hh"
|
|
#include "matrix.hh"
|
|
#include "dense_matrix.hh"
|
|
#include "non_resizable.hh"
|
|
#include "non_resizable_matrix.hh"
|
|
#include "dense_non_resizable_matrix.hh"
|
|
|
|
#include <armadillo>
|
|
|
|
namespace php_arma
|
|
{
|
|
template <typename T>
|
|
PHP_ARMA_START_ME(subview_mat, T)
|
|
PHP_ARMA_END_ME();
|
|
|
|
template <typename T>
|
|
void subview_mat<T>::ce_init(zend_class_entry *parent_ce)
|
|
{
|
|
ce = class_register<php_name::val>(parent_ce, fentry_list_concat(
|
|
PHP_ARMA_FENTRY((base <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((dense <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((matrix <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((dense_matrix <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((non_resizable <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((non_resizable_matrix <T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY((dense_non_resizable_matrix<T, subview_mat>::me)),
|
|
PHP_ARMA_FENTRY(me)
|
|
));
|
|
ce->create_object = object_non_constructible;
|
|
|
|
object_handlers_init(&handlers);
|
|
handlers.offset = sizeof(native_t);
|
|
handlers.clone_obj = nullptr;
|
|
handlers.count_elements = base<T, subview_mat>::count_elements;
|
|
}
|
|
|
|
PHP_ARMA_NAME_DECLARE(subview_mat, "DSvMat", double);
|
|
PHP_ARMA_NAME_DECLARE(subview_mat, "ISvMat", zend_long);
|
|
PHP_ARMA_NAME_DECLARE(subview_mat, "CxDSvMat", cx_double);
|
|
|
|
void subview_mat_init()
|
|
{
|
|
subview_mat_ce = abstract_class_register<subview_mat_php_name>(
|
|
dense_non_resizable_matrix_ce, subview_ce);
|
|
|
|
subview_mat<double >::ce_init(subview_mat_ce);
|
|
subview_mat<zend_long>::ce_init(subview_mat_ce);
|
|
subview_mat<cx_double>::ce_init(subview_mat_ce);
|
|
}
|
|
}
|