26 #if defined (HAVE_CONFIG_H)
40 #include "mx-cnda-s.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));
82 octave::fftw::fft (in + k * stride *
n, out + k * stride *
n,
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));
113 octave::fftw::ifft (in + k * stride *
n, out + k * stride *
n,
114 n, howmany, stride, dist);
134 octave::fftw::fftNd (in + i*dist, out + i*dist, 2, dv2);
154 octave::fftw::ifftNd (in + i*dist, out + i*dist, 2, dv2);
163 int rank = dv.
ndims ();
169 octave::fftw::fftNd (in, out, rank, dv);
178 int rank = dv.
ndims ();
184 octave::fftw::ifftNd (in, out, rank, dv);
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");
297 double r_val = val.real ();
298 double i_val = val.imag ();
316 double r_val = val.real ();
317 double i_val = val.imag ();
348 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_all);
354 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_any);
372 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_prod);
378 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_sum);
384 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_xsum);
396 return do_mx_diff_op<Complex> (*
this, dim, order,
mx_inline_diff);
438 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_max);
450 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_min);
480 return do_mx_unary_map<double, Complex, std::abs> (*
this);
486 return do_mx_unary_map<bool, Complex, octave::math::isnan> (*
this);
492 return do_mx_unary_map<bool, Complex, octave::math::isinf> (*
this);
498 return do_mx_unary_map<bool, Complex, octave::math::isfinite> (*
this);
504 return do_mx_unary_map<Complex, Complex, std::conj<double>> (a);
516 (*current_liboctave_error_handler)
517 (
"Array<T>::insert: invalid indexing operation");
521 a_ra_idx.elem (0) =
r;
522 a_ra_idx.elem (1) = c;
524 for (
int i = 0; i <
n; i++)
526 if (a_ra_idx(i) < 0 || (a_ra_idx(i) + a_dv(i)) > dv(i))
527 (*current_liboctave_error_handler)
528 (
"Array<T>::insert: range error for insert");
531 a_ra_idx.elem (0) = 0;
532 a_ra_idx.elem (1) = 0;
542 ra_idx.elem (0) = a_ra_idx(0) +
r;
543 ra_idx.elem (1) = a_ra_idx(1) + c;
605 octave::write_value<Complex> (os, a.
elem (i));
621 tmp = octave::read_value<Complex> (is);
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
std::ostream & operator<<(std::ostream &os, const ComplexNDArray &a)
ComplexNDArray & operator/=(ComplexNDArray &a, double s)
ComplexNDArray conj(const ComplexNDArray &a)
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
std::istream & operator>>(std::istream &is, ComplexNDArray &a)
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
OCTARRAY_OVERRIDABLE_FUNC_API const T * data(void) const
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
OCTARRAY_OVERRIDABLE_FUNC_API const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
bool test_any(F fcn) const
Simpler calls.
OCTARRAY_API Array< T, Alloc > & insert(const Array< T, Alloc > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API bool is_shared(void) const
Size of the specified dimension.
OCTARRAY_OVERRIDABLE_FUNC_API T & elem(octave_idx_type n)
Size of the specified dimension.
OCTARRAY_API Array< T, Alloc > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
OCTARRAY_OVERRIDABLE_FUNC_API T & xelem(octave_idx_type n)
Size of the specified dimension.
OCTAVE_API ComplexNDArray ifourier2d(void) const
OCTAVE_API ComplexNDArray fourier(int dim=1) const
OCTAVE_API boolNDArray any(int dim=-1) const
OCTAVE_API bool any_element_is_inf_or_nan(void) const
OCTAVE_API ComplexNDArray prod(int dim=-1) const
static OCTAVE_API void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
static OCTAVE_API octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
OCTAVE_API ComplexNDArray cummax(int dim=-1) const
OCTAVE_API ComplexNDArray fourierNd(void) const
OCTAVE_API ComplexNDArray sumsq(int dim=-1) const
OCTAVE_API ComplexNDArray concat(const ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
OCTAVE_API ComplexNDArray diag(octave_idx_type k=0) const
OCTAVE_API ComplexNDArray cumsum(int dim=-1) const
OCTAVE_API bool too_large_for_float(void) const
OCTAVE_API boolNDArray operator!(void) const
OCTAVE_API boolNDArray isnan(void) const
OCTAVE_API ComplexNDArray min(int dim=-1) const
OCTAVE_API ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
OCTAVE_API ComplexNDArray ifourier(int dim=1) const
OCTAVE_API ComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
OCTAVE_API NDArray abs(void) const
OCTAVE_API ComplexNDArray max(int dim=-1) const
OCTAVE_API ComplexNDArray ifourierNd(void) const
OCTAVE_API ComplexNDArray xsum(int dim=-1) const
OCTAVE_API bool all_integers(double &max_val, double &min_val) const
OCTAVE_API ComplexNDArray cumprod(int dim=-1) const
OCTAVE_API boolNDArray all(int dim=-1) const
OCTAVE_API boolNDArray isfinite(void) const
OCTAVE_API ComplexNDArray cummin(int dim=-1) const
OCTAVE_API ComplexNDArray sum(int dim=-1) const
OCTAVE_API boolNDArray isinf(void) const
OCTAVE_API ComplexNDArray fourier2d(void) const
OCTAVE_API bool any_element_is_nan(void) const
OCTAVE_API bool all_elements_are_real(void) 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.
void err_nan_to_logical_conversion(void)
bool too_large_for_float(double x)
void mx_inline_div2(std::size_t n, R *r, const X *x)
T mx_inline_xsum(const T *v, octave_idx_type n)
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)
bool mx_inline_all_real(std::size_t n, const std::complex< T > *x)
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)
bool mx_inline_any_nan(std::size_t n, const T *x)
void mx_inline_max(const T *v, T *r, octave_idx_type n)
void mx_inline_not(std::size_t n, bool *r, const X *x)
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_mul2(std::size_t n, R *r, const X *x)
T mx_inline_sumsq(const T *v, octave_idx_type n)
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_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
bool mx_inline_all_finite(std::size_t n, const T *x)
void mx_inline_pow(std::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)
std::complex< double > Complex
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