26 #if defined (HAVE_CONFIG_H)
50 #define DO_BESSEL(type, alpha, x, scaled, ierr, result) \
56 result = math::besselj (alpha, x, scaled, ierr); \
60 result = math::bessely (alpha, x, scaled, ierr); \
64 result = math::besseli (alpha, x, scaled, ierr); \
68 result = math::besselk (alpha, x, scaled, ierr); \
72 result = math::besselh1 (alpha, x, scaled, ierr); \
76 result = math::besselh2 (alpha, x, scaled, ierr); \
89 int nargin = args.
length ();
91 if (nargin < 2 || nargin > 3)
100 bool rpt_error =
false;
107 if (opt_val != 0.0 && opt_val != 1.0)
109 scaled = (opt_val == 1.0);
115 error (
"%s: OPT must be 0 (or false) or 1 (or true)", fcn);
125 float alpha = args(0).xfloat_value (
"%s: ALPHA must be a scalar or matrix", fcn);
138 retval(1) =
static_cast<float> (
ierr);
159 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
160 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
162 if (args0_is_row_vector && args1_is_col_vector)
164 FloatRowVector ralpha = args(0).xfloat_row_vector_value (
"%s: ALPHA must be a scalar or matrix",
181 FloatNDArray alpha = args(0).xfloat_array_value (
"%s: ALPHA must be a scalar or matrix", fcn);
216 double alpha = args(0).xdouble_value (
"%s: ALPHA must be a scalar or matrix", fcn);
229 retval(1) =
static_cast<double> (
ierr);
250 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
251 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
253 if (args0_is_row_vector && args1_is_col_vector)
255 RowVector ralpha = args(0).xrow_vector_value (
"%s: ALPHA must be a scalar or matrix", fcn);
271 NDArray alpha = args(0).xarray_value (
"%s: ALPHA must be a scalar or matrix", fcn);
536 DEFUN (besselh, args, nargout,
588 int nargin = args.length ();
590 if (nargin < 2 || nargin > 4)
601 octave_idx_type kind = args(1).xint_value (
"besselh: invalid value of K");
606 tmp_args(2) = args(3);
608 tmp_args(1) = args(2);
609 tmp_args(0) = args(0);
616 error (
"besselh: K must be 1 or 2");
680 int nargin = args.length ();
682 if (nargin < 1 || nargin > 3)
690 kind = args(0).xint_value (
"airy: K must be an integer value");
692 if (kind < 0 || kind > 3)
693 error (
"airy: K must be 0, 1, 2, or 3");
696 bool scale = (nargin == 3) && args(2).xbool_value (
"airy: scale option must be a logical value");
698 int idx = (nargin == 1 ? 0 : 1);
703 if (args(idx).is_single_type ())
705 FloatComplexNDArray z = args(idx).xfloat_complex_array_value (
"airy: Z must be a complex matrix");
714 ComplexNDArray z = args(idx).xcomplex_array_value (
"airy: Z must be a complex matrix");
1376 OCTAVE_END_NAMESPACE(
octave)
octave_value_list do_bessel(enum bessel_type type, const char *fcn, 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() const
bool bool_value(bool warn=false) const
FloatComplexNDArray xfloat_complex_array_value(const char *fmt,...) const
bool is_scalar_type() const
Complex xcomplex_value(const char *fmt,...) const
bool is_single_type() 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
FloatComplexColumnVector xfloat_complex_column_vector_value(const char *fmt,...) const
double double_value(bool frc_str_conv=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#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 besselk(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 besseli(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