23 #if defined (HAVE_CONFIG_H) 45 #define DO_BESSEL(type, alpha, x, scaled, ierr, result) \ 51 result = octave::math::besselj (alpha, x, scaled, ierr); \ 55 result = octave::math::bessely (alpha, x, scaled, ierr); \ 59 result = octave::math::besseli (alpha, x, scaled, ierr); \ 63 result = octave::math::besselk (alpha, x, scaled, ierr); \ 67 result = octave::math::besselh1 (alpha, x, scaled, ierr); \ 71 result = octave::math::besselh2 (alpha, x, scaled, ierr); \ 95 bool rpt_error =
false;
102 if (opt_val != 0.0 && opt_val != 1.0)
104 scaled = (opt_val == 1.0);
110 error (
"%s: OPT must be 0 (or false) or 1 (or true)", fn);
120 float alpha = args(0).xfloat_value (
"%s: ALPHA must be a scalar or matrix", fn);
154 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
155 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
157 if (args0_is_row_vector && args1_is_col_vector)
159 FloatRowVector ralpha = args(0).xfloat_row_vector_value (
"%s: ALPHA must be a scalar or matrix", fn);
175 FloatNDArray alpha = args(0).xfloat_array_value (
"%s: ALPHA must be a scalar or matrix", fn);
210 double alpha = args(0).xdouble_value (
"%s: ALPHA must be a scalar or matrix", fn);
244 bool args0_is_row_vector = (dv0(1) == dv0.
numel ());
245 bool args1_is_col_vector = (dv1(0) == dv1.
numel ());
247 if (args0_is_row_vector && args1_is_col_vector)
249 RowVector ralpha = args(0).xrow_vector_value (
"%s: ALPHA must be a scalar or matrix", fn);
265 NDArray alpha = args(0).xarray_value (
"%s: ALPHA must be a scalar or matrix", fn);
574 int nargin = args.length ();
587 octave_idx_type kind = args(1).xint_value (
"besselh: invalid value of K");
592 tmp_args(2) = args(3);
594 tmp_args(1) = args(2);
595 tmp_args(0) = args(0);
602 error (
"besselh: K must be 1 or 2");
659 int nargin = args.length ();
669 kind = args(0).xint_value (
"airy: K must be an integer value");
671 if (kind < 0 || kind > 3)
672 error (
"airy: K must be 0, 1, 2, or 3");
677 int idx = (
nargin == 1 ? 0 : 1);
679 if (args(idx).is_single_type ())
681 FloatComplexNDArray z = args(idx).xfloat_complex_array_value (
"airy: Z must be a complex matrix");
697 ComplexNDArray z = args(idx).xcomplex_array_value (
"airy: Z must be a complex matrix");
ComplexColumnVector xcomplex_column_vector_value(const char *fmt,...) const
FloatComplexColumnVector xfloat_complex_column_vector_value(const char *fmt,...) const
bool islogical(void) const
OCTINTERP_API void print_usage(void)
#define DO_BESSEL(type, alpha, x, scaled, ierr, result)
Complex besselk(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
bool bool_value(bool warn=false) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Complex besseli(double alpha, const Complex &x, bool scaled, octave_idx_type &ierr)
octave_value_list do_bessel(enum bessel_type type, const char *fn, const octave_value_list &args, int nargout)
bool is_single_type(void) const
Complex xcomplex_value(const char *fmt,...) const
FloatComplex xfloat_complex_value(const char *fmt,...) const
ComplexNDArray xcomplex_array_value(const char *fmt,...) const
With real return the complex result
FloatComplexNDArray xfloat_complex_array_value(const char *fmt,...) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
double double_value(bool frc_str_conv=false) const
octave_idx_type length(void) const
void scale(Matrix &m, double x, double y, double z)
std::complex< float > FloatComplex
Complex airy(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)
std::complex< double > Complex
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 const F77_DBLE F77_DBLE const F77_INT F77_INT & ierr
bool is_scalar_type(void) const
bool isnumeric(void) const
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
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 biry(const Complex &z, bool deriv, bool scaled, octave_idx_type &ierr)