25 #if defined (HAVE_CONFIG_H) 32 DEFUN (__gammainc__, args, ,
38 int nargin = args.length ();
43 bool is_single = args(0).is_single_type () || args(1).is_single_type ();
46 int numel_x = args(0).numel ();
47 int numel_a = args(1).numel ();
48 int len =
std::max (numel_x, numel_a);
64 x = args(0).float_array_value ();
69 a = args(1).float_array_value ();
73 static const float eps = std::numeric_limits<float>::epsilon();
74 float y, Cj, Dj, bj, aj, Deltaj;
94 while ((
std::abs ((Deltaj - 1) /
y) >
eps) && (j < maxit))
97 Dj = 1 / (bj + aj*Dj);
117 x =
NDArray (output_dv, args(0).scalar_value ());
119 x = args(0).array_value ();
122 a =
NDArray (output_dv, args(1).scalar_value ());
124 a = args(1).array_value ();
128 static const double eps = std::numeric_limits<double>::epsilon();
129 double y, Cj, Dj, bj, aj, Deltaj;
143 bj =
x(
i) -
a(
i) + 1;
149 while ((
std::abs ((Deltaj - 1) /
y) >
eps) && (j < maxit))
152 Dj = 1 / (bj + aj*Dj);
OCTINTERP_API void print_usage(void)
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE * f
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
charNDArray max(char d, const charNDArray &m)
the element is set to zero In other the statement xample y
Vector representing the dimensions (size) of an Array.
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x