23 #if defined (HAVE_CONFIG_H) 70 int nargin = args.length ();
78 error (
"psi: K must be non-negative");
84 #define FLOAT_BRANCH(T, A, M, E) \ 85 if (oct_z.is_ ## T ##_type ()) \ 87 const A ## NDArray z = oct_z.M ## array_value (); \ 88 A ## NDArray psi_z (z.dims ()); \ 90 const E *zv = z.data (); \ 91 E *psi_zv = psi_z.fortran_vec (); \ 92 const octave_idx_type n = z.numel (); \ 93 for (octave_idx_type i = 0; i < n; i++) \ 94 *psi_zv++ = octave::math::psi (*zv++); \ 104 error (
"psi: Z must be a floating point");
111 error (
"psi: Z must be a floating point");
119 error (
"psi: Z must be real value for polygamma (K > 0)");
121 #define FLOAT_BRANCH(T, A, M, E) \ 122 if (oct_z.is_ ## T ##_type ()) \ 124 const A ## NDArray z = oct_z.M ## array_value (); \ 125 A ## NDArray psi_z (z.dims ()); \ 127 const E *zv = z.data (); \ 128 E *psi_zv = psi_z.fortran_vec (); \ 129 const octave_idx_type n = z.numel (); \ 130 for (octave_idx_type i = 0; i < n; i++) \ 133 error ("psi: Z must be non-negative for polygamma (K > 0)"); \ 135 *psi_zv++ = octave::math::psi (k, *zv++); \ 143 error (
"psi: Z must be a floating point for polygamma (K > 0)");
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
#define FLOAT_BRANCH(T, A, M, E)
bool iscomplex(void) const
std::complex< float > FloatComplex
std::complex< double > Complex