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);
202 F77_FUNC (
cfftb, CFFTB) (
const octave_idx_type&, FloatComplex*,
211 if (dim > dv.
length () || dim < 0)
224 for (
int i = 0; i < dim; i++)
228 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
241 tmp[i] =
elem ((i + k*npts)*stride + j*dist);
246 retval((i + k*npts)*stride + j*dist) = tmp[i];
258 if (dim > dv.
length () || dim < 0)
271 for (
int i = 0; i < dim; i++)
275 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
288 tmp[i] =
elem ((i + k*npts)*stride + j*dist);
293 retval((i + k*npts)*stride + j*dist) = tmp[i] /
294 static_cast<float> (npts);
310 for (
int i = 0; i < rank; i++)
320 howmany = (stride == 1 ? howmany :
321 (howmany > stride ? stride : howmany));
334 prow[l] = retval((l + k*npts)*stride + j*dist);
339 retval((l + k*npts)*stride + j*dist) = prow[l];
358 for (
int i = 0; i < rank; i++)
368 howmany = (stride == 1 ? howmany :
369 (howmany > stride ? stride : howmany));
382 prow[l] = retval((l + k*npts)*stride + j*dist);
387 retval((l + k*npts)*stride + j*dist) =
388 prow[l] / static_cast<float> (npts);
406 for (
int i = 0; i < rank; i++)
416 howmany = (stride == 1 ? howmany :
417 (howmany > stride ? stride : howmany));
430 prow[l] = retval((l + k*npts)*stride + j*dist);
435 retval((l + k*npts)*stride + j*dist) = prow[l];
453 for (
int i = 0; i < rank; i++)
463 howmany = (stride == 1 ? howmany :
464 (howmany > stride ? stride : howmany));
477 prow[l] = retval((l + k*npts)*stride + j*dist);
482 retval((l + k*npts)*stride + j*dist) =
483 prow[l] / static_cast<float> (npts);
503 return do_mx_unary_op<bool, FloatComplex> (*
this,
mx_inline_not);
591 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_all);
597 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_any);
603 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
610 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
617 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_prod);
623 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dprod);
629 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_sum);
635 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dsum);
641 return do_mx_red_op<float, FloatComplex> (*
this, dim,
mx_inline_sumsq);
647 return do_mx_diff_op<FloatComplex> (*
this, dim, order,
mx_inline_diff);
675 retval.
insert (rb, ra_idx);
685 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_max);
691 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_max);
697 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_min);
703 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_min);
715 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
728 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
735 return do_mx_unary_map<float, FloatComplex, std::abs> (*this);
741 return do_mx_unary_map<bool, FloatComplex, xisnan> (*this);
747 return do_mx_unary_map<bool, FloatComplex, xisinf> (*this);
753 return do_mx_unary_map<bool, FloatComplex, xfinite> (*this);
759 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float> > (a);
774 a_ra_idx.
elem (0) = r;
775 a_ra_idx.
elem (1) = c;
777 for (
int i = 0; i < n; i++)
779 if (a_ra_idx (i) < 0 || (a_ra_idx (i) + a_dv (i)) >
dimensions (i))
781 (*current_liboctave_error_handler)
782 (
"Array<T>::insert: range error for insert");
787 a_ra_idx.
elem (0) = 0;
788 a_ra_idx.
elem (1) = 0;
798 ra_idx.
elem (0) = a_ra_idx (0) + r;
799 ra_idx.
elem (1) = a_ra_idx (1) + c;
808 (
"Array<T>::insert: invalid indexing operation");
881 tmp = octave_read_value<FloatComplex> (is);
905 FloatComplexNDArray& operator *= (FloatComplexNDArray& a,
float s)
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)
FloatComplexNDArray ifourier(int dim=1) const
#define NDS_BOOL_OPS(ND, S)
#define NDS_CMP_OPS(ND, S)
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
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
#define SND_CMP_OPS(S, ND)
#define BSXFUN_OP_DEF_MXLOOP(OP, ARRAY, LOOP)
octave_idx_type numel(void) const
Number of elements in the array.
boolNDArray isinf(void) const
FloatComplexNDArray min(int dim=-1) const
static octave_idx_type nn
std::istream & operator>>(std::istream &is, FloatComplexNDArray &a)
FloatNDArray abs(void) const
bool mx_inline_all_finite(size_t n, const T *x)
#define MINMAX_FCNS(T, S)
FloatComplexNDArray fourier2d(void) const
void octave_write_complex(std::ostream &os, const Complex &c)
bool too_large_for_float(void) const
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
FloatComplex & elem(octave_idx_type n)
T mx_inline_sumsq(const T *v, octave_idx_type n)
FloatComplexNDArray sumsq(int dim=-1) const
ComplexNDArray dsum(int dim=-1) const
void mx_inline_max(const T *v, T *r, octave_idx_type n)
subroutine cfftb(n, c, wsave)
bool any_element_is_inf_or_nan(void) const
FloatComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
bool all_integers(float &max_val, float &min_val) const
bool mx_inline_any(const T *v, octave_idx_type n)
FloatComplexNDArray ifourierNd(void) const
FloatComplexNDArray fourier(int dim=1) const
boolNDArray isfinite(void) const
static int fftNd(const double *, Complex *, const int, const dim_vector &)
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.
FloatComplexNDArray cumsum(int dim=-1) const
bool any_element_is_nan(void) const
ComplexNDArray dprod(int dim=-1) const
boolNDArray all(int dim=-1) const
FloatComplexNDArray diag(octave_idx_type k=0) const
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
FloatComplexNDArray cummin(int dim=-1) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
FloatComplexNDArray cummax(int dim=-1) const
subroutine cffti(n, wsave)
liboctave_error_handler current_liboctave_error_handler
std::ostream & operator<<(std::ostream &os, const FloatComplexNDArray &a)
static const FloatComplex FloatComplex_NaN_result((lo_ieee_float_nan_value()),(lo_ieee_float_nan_value()))
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
#define NDND_CMP_OPS(ND1, ND2)
#define NDND_BOOL_OPS(ND1, ND2)
FloatComplexNDArray & operator/=(FloatComplexNDArray &a, float s)
subst_template_param< std::complex, T, double >::type mx_inline_dprod(const T *v, octave_idx_type n)
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)
boolNDArray any(int dim=-1) const
FloatComplexNDArray fourierNd(void) const
FloatComplexNDArray(void)
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
subroutine cfftf(n, c, wsave)
#define SND_BOOL_OPS(S, ND)
boolNDArray operator!(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)
boolNDArray isnan(void) const
bool mx_inline_any_nan(size_t n, const T *x)
subst_template_param< std::complex, T, double >::type mx_inline_dsum(const T *v, octave_idx_type n)
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
FloatComplexNDArray max(int dim=-1) const
FloatComplex & xelem(octave_idx_type n)
T mx_inline_sum(const T *v, octave_idx_type n)
bool all_elements_are_real(void) const
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)
F77_RET_T F77_FUNC(zgemv, ZGEMV)(F77_CONST_CHAR_ARG_DECL
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
FloatComplexNDArray cumprod(int dim=-1) const
FloatComplexNDArray sum(int dim=-1) const
ColumnVector imag(const ComplexColumnVector &a)
std::complex< float > FloatComplex
FloatComplexNDArray ifourier2d(void) const
FloatComplexNDArray prod(int dim=-1) const
bool mx_inline_all(const T *v, octave_idx_type n)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
const FloatComplex * fortran_vec(void) const
void mx_inline_div2(size_t n, R *r, const X *x)
FloatComplexNDArray conj(const FloatComplexNDArray &a)
void mx_inline_not(size_t n, bool *r, const X *x)
ColumnVector real(const ComplexColumnVector &a)
FloatComplexNDArray concat(NDArray &ra, FloatComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
FloatComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
T mx_inline_prod(const T *v, octave_idx_type n)
static void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension=0)
void mx_inline_diff(const T *v, T *r, octave_idx_type n, octave_idx_type order)
FloatComplexNDArray concat(const FloatComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
void mx_inline_min(const T *v, T *r, octave_idx_type n)