26 #if defined (HAVE_CONFIG_H)
41 #include "mx-fcnda-fs.h"
52 xelem (i) =
static_cast<unsigned char> (a(i));
55 #if defined (HAVE_FFTW)
62 if (dim > dv.
ndims () || dim < 0)
68 for (
int i = 0; i < dim; i++)
72 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
83 n, howmany, stride, dist);
93 if (dim > dv.
ndims () || dim < 0)
99 for (
int i = 0; i < dim; i++)
103 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
114 n, howmany, stride, dist);
163 int rank = dv.
ndims ();
178 int rank = dv.
ndims ();
194 octave_unused_parameter (dim);
196 (*current_liboctave_error_handler)
197 (
"support for FFTW was unavailable or disabled when liboctave was built");
205 octave_unused_parameter (dim);
207 (*current_liboctave_error_handler)
208 (
"support for FFTW was unavailable or disabled when liboctave was built");
216 (*current_liboctave_error_handler)
217 (
"support for FFTW was unavailable or disabled when liboctave was built");
225 (*current_liboctave_error_handler)
226 (
"support for FFTW was unavailable or disabled when liboctave was built");
234 (*current_liboctave_error_handler)
235 (
"support for FFTW was unavailable or disabled when liboctave was built");
243 (*current_liboctave_error_handler)
244 (
"support for FFTW was unavailable or disabled when liboctave was built");
259 return do_mx_unary_op<bool, FloatComplex> (*
this,
mx_inline_not);
297 float r_val = val.real ();
298 float i_val = val.imag ();
316 float r_val = val.real ();
317 float i_val = val.imag ();
348 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_all);
354 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_any);
360 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
367 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
374 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_prod);
380 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dprod);
386 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_sum);
392 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dsum);
398 return do_mx_red_op<float, FloatComplex> (*
this, dim,
mx_inline_sumsq);
404 return do_mx_diff_op<FloatComplex> (*
this, dim, order,
mx_inline_diff);
442 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_max);
448 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_max);
454 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_min);
460 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_min);
472 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
485 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
492 return do_mx_unary_map<float, FloatComplex, std::abs> (*
this);
498 return do_mx_unary_map<bool, FloatComplex, octave::math::isnan> (*
this);
504 return do_mx_unary_map<bool, FloatComplex, octave::math::isinf> (*
this);
510 return do_mx_unary_map<bool, FloatComplex, octave::math::isfinite> (*
this);
516 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float>> (a);
531 a_ra_idx.
elem (0) =
r;
532 a_ra_idx.
elem (1) = c;
534 for (
int i = 0; i <
n; i++)
536 if (a_ra_idx(i) < 0 || (a_ra_idx(i) + a_dv(i)) >
dimensions(i))
537 (*current_liboctave_error_handler)
538 (
"Array<T>::insert: range error for insert");
541 a_ra_idx.
elem (0) = 0;
542 a_ra_idx.
elem (1) = 0;
552 ra_idx.elem (0) = a_ra_idx(0) +
r;
553 ra_idx.elem (1) = a_ra_idx(1) + c;
562 (
"Array<T>::insert: invalid indexing operation");
635 tmp = octave_read_value<FloatComplex> (is);
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel(void) const
Number of elements in the array.
T & elem(octave_idx_type n)
Size of the specified dimension.
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
const T * fortran_vec(void) const
Size of the specified dimension.
bool is_shared(void)
Size of the specified dimension.
FloatNDArray abs(void) const
FloatComplexNDArray max(int dim=-1) const
bool all_integers(float &max_val, float &min_val) const
boolNDArray isnan(void) const
FloatComplexNDArray sum(int dim=-1) const
boolNDArray isinf(void) const
FloatComplexNDArray min(int dim=-1) const
FloatComplexNDArray cumprod(int dim=-1) const
FloatComplexNDArray cummin(int dim=-1) const
FloatComplexNDArray cummax(int dim=-1) const
FloatComplexNDArray sumsq(int dim=-1) const
FloatComplexNDArray ifourierNd(void) const
bool any_element_is_nan(void) const
boolNDArray isfinite(void) const
ComplexNDArray dsum(int dim=-1) const
bool all_elements_are_real(void) const
FloatComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
FloatComplexNDArray fourier2d(void) const
FloatComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
static void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
FloatComplexNDArray prod(int dim=-1) const
FloatComplexNDArray ifourier2d(void) const
FloatComplexNDArray ifourier(int dim=1) const
boolNDArray operator!(void) const
bool any_element_is_inf_or_nan(void) const
FloatComplexNDArray cumsum(int dim=-1) const
boolNDArray all(int dim=-1) const
FloatComplexNDArray(void)
bool too_large_for_float(void) const
FloatComplexNDArray concat(const FloatComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
boolNDArray any(int dim=-1) const
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
FloatComplexNDArray diag(octave_idx_type k=0) const
FloatComplexNDArray fourier(int dim=1) const
FloatComplexNDArray fourierNd(void) const
ComplexNDArray dprod(int dim=-1) const
Template for N-dimensional array classes with like-type math operators.
Vector representing the dimensions (size) of an Array.
octave_idx_type ndims(void) const
Number of dimensions.
static int fft(const double *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
static int ifft(const Complex *in, Complex *out, size_t npts, size_t nsamples=1, octave_idx_type stride=1, octave_idx_type dist=-1)
std::istream & operator>>(std::istream &is, FloatComplexNDArray &a)
std::ostream & operator<<(std::ostream &os, const FloatComplexNDArray &a)
static const FloatComplex FloatComplex_NaN_result(octave::numeric_limits< float >::NaN(), octave::numeric_limits< float >::NaN())
FloatComplexNDArray concat(NDArray &ra, FloatComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
FloatComplexNDArray & operator/=(FloatComplexNDArray &a, float s)
FloatComplexNDArray conj(const FloatComplexNDArray &a)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
void octave_write_complex(std::ostream &os, const Complex &c)
bool mx_inline_all_finite(size_t n, const T *x)
void mx_inline_div2(size_t n, R *r, const X *x)
void mx_inline_any(const T *v, bool *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
void mx_inline_cummin(const T *v, T *r, octave_idx_type n)
void mx_inline_cumprod(const T *v, T *r, octave_idx_type n)
void mx_inline_cumsum(const T *v, T *r, octave_idx_type n)
void mx_inline_not(size_t n, bool *r, const X *x)
void mx_inline_max(const T *v, T *r, octave_idx_type n)
void mx_inline_all(const T *v, bool *r, octave_idx_type m, octave_idx_type n)
void mx_inline_prod(const T *v, T *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
void mx_inline_dprod(const T *v, typename subst_template_param< std::complex, T, double >::type *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
T mx_inline_sumsq(const T *v, octave_idx_type n)
bool mx_inline_any_nan(size_t n, const T *x)
T mx_inline_sum(const T *v, octave_idx_type n)
void mx_inline_min(const T *v, T *r, octave_idx_type n)
void mx_inline_dsum(const T *v, typename subst_template_param< std::complex, T, double >::type *r, octave_idx_type l, octave_idx_type n, octave_idx_type u)
void mx_inline_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
void mx_inline_mul2(size_t n, R *r, const X *x)
void mx_inline_pow(size_t n, R *r, const X *x, const Y *y)
#define NDND_BOOL_OPS(ND1, ND2)
#define NDS_BOOL_OPS(ND, S)
#define NDND_CMP_OPS(ND1, ND2)
#define SND_BOOL_OPS(S, ND)
#define NDS_CMP_OPS(ND, S)
#define SND_CMP_OPS(S, ND)
#define MINMAX_FCNS(T, S)
void err_nan_to_logical_conversion(void)
std::complex< float > FloatComplex
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
const octave_base_value const Array< octave_idx_type > & ra_idx
octave_value::octave_value(const Array< char > &chm, char type) return retval