53 xelem (i) =
static_cast<unsigned char> (a(i));
56 #if defined (HAVE_FFTW)
63 if (dim > dv.
length () || dim < 0)
69 for (
int i = 0; i < dim; i++)
73 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
84 n, howmany, stride, dist);
94 if (dim > dv.
length () || dim < 0)
100 for (
int i = 0; i < dim; i++)
104 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
115 n, howmany, stride, dist);
206 F77_FUNC (
zfftb, ZFFTB) (
const octave_idx_type&, Complex*, Complex*);
214 if (dim > dv.
length () || dim < 0)
221 Complex *pwsave = wsave.fortran_vec ();
227 for (
int i = 0; i < dim; i++)
231 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
244 tmp[i] =
elem ((i + k*npts)*stride + j*dist);
249 retval((i + k*npts)*stride + j*dist) = tmp[i];
261 if (dim > dv.
length () || dim < 0)
268 Complex *pwsave = wsave.fortran_vec ();
274 for (
int i = 0; i < dim; i++)
278 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
291 tmp[i] =
elem ((i + k*npts)*stride + j*dist);
296 retval((i + k*npts)*stride + j*dist) = tmp[i] /
297 static_cast<double> (npts);
313 for (
int i = 0; i < rank; i++)
318 Complex *pwsave = wsave.fortran_vec ();
323 howmany = (stride == 1 ? howmany :
324 (howmany > stride ? stride : howmany));
337 prow[l] = retval((l + k*npts)*stride + j*dist);
342 retval((l + k*npts)*stride + j*dist) = prow[l];
361 for (
int i = 0; i < rank; i++)
366 Complex *pwsave = wsave.fortran_vec ();
371 howmany = (stride == 1 ? howmany :
372 (howmany > stride ? stride : howmany));
385 prow[l] = retval((l + k*npts)*stride + j*dist);
390 retval((l + k*npts)*stride + j*dist) =
391 prow[l] / static_cast<double> (npts);
409 for (
int i = 0; i < rank; i++)
414 Complex *pwsave = wsave.fortran_vec ();
419 howmany = (stride == 1 ? howmany :
420 (howmany > stride ? stride : howmany));
433 prow[l] = retval((l + k*npts)*stride + j*dist);
438 retval((l + k*npts)*stride + j*dist) = prow[l];
456 for (
int i = 0; i < rank; i++)
461 Complex *pwsave = wsave.fortran_vec ();
466 howmany = (stride == 1 ? howmany :
467 (howmany > stride ? stride : howmany));
480 prow[l] = retval((l + k*npts)*stride + j*dist);
485 retval((l + k*npts)*stride + j*dist) =
486 prow[l] / static_cast<double> (npts);
594 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_all);
600 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_any);
618 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_prod);
624 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_sum);
630 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_xsum);
642 return do_mx_diff_op<Complex> (*
this, dim, order,
mx_inline_diff);
668 retval.
insert (rb, ra_idx);
683 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_max);
695 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_min);
725 return do_mx_unary_map<double, Complex, std::abs> (*this);
731 return do_mx_unary_map<bool, Complex, xisnan> (*this);
737 return do_mx_unary_map<bool, Complex, xisinf> (*this);
743 return do_mx_unary_map<bool, Complex, xfinite> (*this);
749 return do_mx_unary_map<Complex, Complex, std::conj<double> > (a);
763 a_ra_idx.
elem (0) = r;
764 a_ra_idx.
elem (1) = c;
766 for (
int i = 0; i < n; i++)
768 if (a_ra_idx (i) < 0 || (a_ra_idx (i) + a_dv (i)) >
dimensions (i))
770 (*current_liboctave_error_handler)
771 (
"Array<T>::insert: range error for insert");
776 a_ra_idx.
elem (0) = 0;
777 a_ra_idx.
elem (1) = 0;
787 ra_idx.
elem (0) = a_ra_idx (0) + r;
788 ra_idx.
elem (1) = a_ra_idx (1) + c;
797 (
"Array<T>::insert: invalid indexing operation");
870 tmp = octave_read_value<Complex> (is);
894 ComplexNDArray& operator *= (ComplexNDArray& a,
double s)
T mx_inline_xsum(const T *v, octave_idx_type n)
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
void mx_inline_mul2(size_t n, R *r, const X *x)
ComplexNDArray concat(const ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
std::istream & operator>>(std::istream &is, ComplexNDArray &a)
#define NDS_BOOL_OPS(ND, S)
#define NDS_CMP_OPS(ND, S)
bool all_integers(double &max_val, double &min_val) const
ComplexNDArray conj(const ComplexNDArray &a)
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
ComplexNDArray ifourier2d(void) const
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)
const octave_base_value const Array< octave_idx_type > & ra_idx
bool any_element_is_nan(void) const
#define SND_CMP_OPS(S, ND)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
ComplexNDArray diag(octave_idx_type k=0) const
octave_idx_type numel(void) const
Number of elements in the array.
subroutine zffti(n, wsave)
static octave_idx_type nn
ComplexNDArray & operator/=(ComplexNDArray &a, double s)
bool mx_inline_all_finite(size_t n, const T *x)
ComplexNDArray fourier(int dim=1) const
#define MINMAX_FCNS(T, S)
void octave_write_complex(std::ostream &os, const Complex &c)
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
ComplexNDArray ifourierNd(void) const
ComplexRowVector row(octave_idx_type i) const
Complex & elem(octave_idx_type n)
T mx_inline_sumsq(const T *v, octave_idx_type n)
void mx_inline_max(const T *v, T *r, octave_idx_type n)
bool mx_inline_any(const T *v, octave_idx_type n)
subroutine zfftb(n, c, wsave)
ComplexNDArray fourier2d(void) const
static void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
bool too_large_for_float(void) const
Array< T > & insert(const Array< T > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
octave_idx_type nelem(void) const
Number of elements in the array.
ComplexNDArray sumsq(int dim=-1) const
ComplexNDArray ifourier(int dim=1) const
ComplexNDArray min(int dim=-1) const
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
boolNDArray operator!(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
ComplexNDArray cumprod(int dim=-1) const
liboctave_error_handler current_liboctave_error_handler
ComplexNDArray prod(int dim=-1) const
#define NDND_CMP_OPS(ND1, ND2)
ComplexNDArray sum(int dim=-1) const
bool all_elements_are_real(void) const
bool test_any(F fcn) const
Simpler calls.
ComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
#define NDND_BOOL_OPS(ND1, ND2)
ComplexNDArray cummin(int dim=-1) const
void gripe_nan_to_logical_conversion(void)
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)
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
#define SND_BOOL_OPS(S, ND)
boolNDArray all(int dim=-1) const
ComplexNDArray xsum(int dim=-1) const
bool any_element_is_inf_or_nan(void) const
void mx_inline_cummin(const T *v, T *r, octave_idx_type n)
OCTAVE_API double D_NINT(double x)
void mx_inline_pow(size_t n, R *r, const X *x, const Y *y)
bool mx_inline_any_nan(size_t n, const T *x)
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
ComplexNDArray fourierNd(void) const
Complex & xelem(octave_idx_type n)
T mx_inline_sum(const T *v, octave_idx_type n)
ComplexNDArray cumsum(int dim=-1) const
ComplexNDArray max(int dim=-1) const
void mx_inline_cumprod(const T *v, T *r, octave_idx_type n)
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
void mx_inline_cumsum(const T *v, T *r, octave_idx_type n)
std::ostream & operator<<(std::ostream &os, const ComplexNDArray &a)
boolNDArray isfinite(void) const
F77_RET_T F77_FUNC(zgemv, ZGEMV)(F77_CONST_CHAR_ARG_DECL
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
static const Complex Complex_NaN_result((lo_ieee_nan_value()),(lo_ieee_nan_value()))
bool xtoo_large_for_float(double x)
ComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
ColumnVector imag(const ComplexColumnVector &a)
boolNDArray isinf(void) const
bool mx_inline_all(const T *v, octave_idx_type n)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
std::complex< double > Complex
const Complex * fortran_vec(void) const
void mx_inline_div2(size_t n, R *r, const X *x)
void mx_inline_not(size_t n, bool *r, const X *x)
ColumnVector real(const ComplexColumnVector &a)
T mx_inline_prod(const T *v, octave_idx_type n)
ComplexNDArray cummax(int dim=-1) const
boolNDArray any(int dim=-1) const
subroutine zfftf(n, c, wsave)
boolNDArray isnan(void) const
void mx_inline_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
void mx_inline_min(const T *v, T *r, octave_idx_type n)