2019-09-15 19:53:01 +00:00
|
|
|
//
|
|
|
|
// php-armadillo/diagonal.hh
|
|
|
|
//
|
|
|
|
// @Author CismonX
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PHP_ARMA_DIAGONAL_HH
|
|
|
|
#define PHP_ARMA_DIAGONAL_HH
|
|
|
|
|
2019-11-04 09:42:11 +00:00
|
|
|
#include "common/php_arma.hh"
|
|
|
|
#include "common/instantiable.hh"
|
2019-09-15 19:53:01 +00:00
|
|
|
#include "complex.hh"
|
2019-11-04 09:42:11 +00:00
|
|
|
#include "linear_element_access.hh"
|
2019-09-15 19:53:01 +00:00
|
|
|
|
|
|
|
namespace php_arma
|
|
|
|
{
|
|
|
|
template <typename T> struct mat;
|
|
|
|
|
|
|
|
template <typename T, bool IsSparse>
|
2019-09-22 17:22:08 +00:00
|
|
|
struct diagonal : instantiable<diagonal<T, IsSparse>, true>
|
2019-09-15 19:53:01 +00:00
|
|
|
{
|
|
|
|
using native_t = std::conditional_t<IsSparse, arma::spdiagview<T>, arma::diagview<T>>;
|
|
|
|
using orig_t = mat<T>;
|
|
|
|
using subview_t = mat<T>;
|
|
|
|
using with_int_elem_t = mat<zend_long>;
|
|
|
|
|
|
|
|
friend void diagonal_init();
|
|
|
|
|
|
|
|
PHP_ARMA_CE_HANDLRES_DECLARE();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PHP_ARMA_COMMON_DECLARE();
|
|
|
|
|
2019-11-04 09:42:11 +00:00
|
|
|
using linear = linear_element_access<T, diagonal>;
|
2019-09-15 19:53:01 +00:00
|
|
|
|
|
|
|
static void ce_init(zend_class_entry*);
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
using diagview = diagonal<T, false>;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
using spdiagview = diagonal<T, true>;
|
|
|
|
|
|
|
|
void diagonal_init();
|
|
|
|
|
|
|
|
constexpr const char diagonal_php_name[] = "Diagonal";
|
|
|
|
constexpr const char diagview_php_name[] = "DiagView";
|
|
|
|
constexpr const char spdiagview_php_name[] = "SpDiagView";
|
|
|
|
|
|
|
|
inline zend_class_entry *diagonal_ce;
|
|
|
|
inline zend_class_entry *diagview_ce;
|
|
|
|
inline zend_class_entry *spdiagview_ce;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !PHP_ARMA_DIAGONAL_HH
|