26 #if defined (HAVE_CONFIG_H)
48 #define DO_BESSEL(type, alpha, x, scaled, ierr, result) \
54 result = octave::math::besselj (alpha, x, scaled, ierr); \
58 result = octave::math::bessely (alpha, x, scaled, ierr); \
62 result = octave::math::besseli (alpha, x, scaled, ierr); \
66 result = octave::math::besselk (alpha, x, scaled, ierr); \
70 result = octave::math::besselh1 (alpha, x, scaled, ierr); \
74 result = octave::math::besselh2 (alpha, x, scaled, ierr); \
87 int nargin = args.
length ();
89 if (nargin < 2 || nargin > 3)
98 bool rpt_error =
false;
105 if (opt_val != 0.0 && opt_val != 1.0)
107 scaled = (opt_val == 1.0);
113 error (
"%s: OPT must be 0 (or false) or 1 (or true)", fn);
123 float alpha = args(0).xfloat_value (
"%s: ALPHA must be a scalar or matrix", fn);
157 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
158 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
160 if (args0_is_row_vector && args1_is_col_vector)
162 FloatRowVector ralpha = args(0).xfloat_row_vector_value (
"%s: ALPHA must be a scalar or matrix", fn);
178 FloatNDArray alpha = args(0).xfloat_array_value (
"%s: ALPHA must be a scalar or matrix", fn);
213 double alpha = args(0).xdouble_value (
"%s: ALPHA must be a scalar or matrix", fn);
247 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
248 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
250 if (args0_is_row_vector && args1_is_col_vector)
252 RowVector ralpha = args(0).xrow_vector_value (
"%s: ALPHA must be a scalar or matrix", fn);
268 NDArray alpha = args(0).xarray_value (
"%s: ALPHA must be a scalar or matrix", fn);
525 DEFUN (besselh, args, nargout,
577 int nargin = args.length ();
579 if (nargin < 2 || nargin > 4)
590 octave_idx_type kind = args(1).xint_value (
"besselh: invalid value of K");
595 tmp_args(2) = args(3);
597 tmp_args(1) = args(2);
598 tmp_args(0) = args(0);
605 error (
"besselh: K must be 1 or 2");
662 int nargin = args.length ();
664 if (nargin < 1 || nargin > 3)
672 kind = args(0).xint_value (
"airy: K must be an integer value");
674 if (kind < 0 || kind > 3)
675 error (
"airy: K must be 0, 1, 2, or 3");
678 bool scale = (nargin == 3);
680 int idx = (nargin == 1 ? 0 : 1);
682 if (args(idx).is_single_type ())
684 FloatComplexNDArray z = args(idx).xfloat_complex_array_value (
"airy: Z must be a complex matrix");
700 ComplexNDArray z = args(idx).xcomplex_array_value (
"airy: Z must be a complex matrix");
octave_value_list do_bessel(enum bessel_type type, const char *fn, const octave_value_list &args, int nargout)
#define DO_BESSEL(type, alpha, x, scaled, ierr, result)
Vector representing the dimensions (size) of an Array.
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
octave_idx_type length(void) const
bool bool_value(bool warn=false) const
FloatComplexNDArray xfloat_complex_array_value(const char *fmt,...) const
bool isnumeric(void) const
bool is_scalar_type(void) const
Complex xcomplex_value(const char *fmt,...) const
ComplexNDArray xcomplex_array_value(const char *fmt,...) const
ComplexColumnVector xcomplex_column_vector_value(const char *fmt,...) const
FloatComplex xfloat_complex_value(const char *fmt,...) const
bool is_single_type(void) const
FloatComplexColumnVector xfloat_complex_column_vector_value(const char *fmt,...) const
double double_value(bool frc_str_conv=false) const
bool islogical(void) const
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,...)
void scale(Matrix &m, double x, double y, double z)
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
F77_RET_T const F77_DBLE * x
Complex besselj(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
Complex bessely(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
Complex besseli(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
Complex airy(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
Complex besselk(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
Complex biry(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
std::complex< double > Complex
std::complex< float > FloatComplex
octave_value::octave_value(const Array< char > &chm, char type) return retval