25 #if defined (HAVE_CONFIG_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 ();
198 if (dim > dv.
ndims () || dim < 0)
205 Complex *pwsave = wsave.fortran_vec ();
211 for (
int i = 0;
i < dim;
i++)
215 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
246 if (dim > dv.
ndims () || dim < 0)
253 Complex *pwsave = wsave.fortran_vec ();
259 for (
int i = 0;
i < dim;
i++)
263 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
283 static_cast<double> (npts);
299 for (
int i = 0;
i < rank;
i++)
304 Complex *pwsave = wsave.fortran_vec ();
309 howmany = (stride == 1 ? howmany :
310 (howmany > stride ? stride : howmany));
323 prow[l] =
retval((l +
k*npts)*stride + j*dist);
329 retval((l +
k*npts)*stride + j*dist) = prow[l];
348 for (
int i = 0;
i < rank;
i++)
353 Complex *pwsave = wsave.fortran_vec ();
358 howmany = (stride == 1 ? howmany :
359 (howmany > stride ? stride : howmany));
372 prow[l] =
retval((l +
k*npts)*stride + j*dist);
378 retval((l +
k*npts)*stride + j*dist) =
379 prow[l] / static_cast<double> (npts);
393 int rank = dv.
ndims ();
397 for (
int i = 0;
i < rank;
i++)
402 Complex *pwsave = wsave.fortran_vec ();
407 howmany = (stride == 1 ? howmany :
408 (howmany > stride ? stride : howmany));
421 prow[l] =
retval((l +
k*npts)*stride + j*dist);
427 retval((l +
k*npts)*stride + j*dist) = prow[l];
441 int rank = dv.
ndims ();
445 for (
int i = 0;
i < rank;
i++)
450 Complex *pwsave = wsave.fortran_vec ();
455 howmany = (stride == 1 ? howmany :
456 (howmany > stride ? stride : howmany));
469 prow[l] =
retval((l +
k*npts)*stride + j*dist);
475 retval((l +
k*npts)*stride + j*dist) =
476 prow[l] / static_cast<double> (npts);
534 double r_val = val.real ();
535 double i_val = val.imag ();
553 double r_val = val.real ();
554 double i_val = val.imag ();
585 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_all);
591 return do_mx_red_op<bool, Complex> (*
this, dim,
mx_inline_any);
609 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_prod);
615 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_sum);
621 return do_mx_red_op<Complex, Complex> (*
this, dim,
mx_inline_xsum);
633 return do_mx_diff_op<Complex> (*
this, dim, order,
mx_inline_diff);
659 retval.
insert (rb, ra_idx);
675 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_max);
687 return do_mx_minmax_op<Complex> (*
this, idx_arg, dim,
mx_inline_min);
717 return do_mx_unary_map<double, Complex, std::abs> (*this);
723 return do_mx_unary_map<bool, Complex, octave::math::isnan> (*this);
729 return do_mx_unary_map<bool, Complex, octave::math::isinf> (*this);
735 return do_mx_unary_map<bool, Complex, octave::math::finite> (*this);
741 return do_mx_unary_map<Complex, Complex, std::conj<double> > (
a);
749 int n = a_dv.
ndims ();
753 (
"Array<T>::insert: invalid indexing operation");
757 a_ra_idx.
elem (0) = r;
758 a_ra_idx.
elem (1) =
c;
760 for (
int i = 0;
i < n;
i++)
763 (*current_liboctave_error_handler)
764 (
"Array<T>::insert: range error for insert");
767 a_ra_idx.
elem (0) = 0;
768 a_ra_idx.
elem (1) = 0;
778 ra_idx.
elem (0) = a_ra_idx(0) + r;
779 ra_idx.
elem (1) = a_ra_idx(1) +
c;
857 tmp = octave_read_value<Complex> (
is);
879 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)
identity matrix If supplied two scalar respectively For allows like xample val
static octave_idx_type nn
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
#define F77_DBLE_CMPLX_ARG(x)
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
Complex & elem(octave_idx_type n)
Template for N-dimensional array classes with like-type math operators.
T mx_inline_sumsq(const T *v, octave_idx_type n)
void mx_inline_max(const T *v, T *r, octave_idx_type n)
void err_nan_to_logical_conversion(void)
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.
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
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
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)
nd deftypefn *octave_map m
ComplexNDArray cummin(int dim=-1) const
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
F77_RET_T F77_FUNC(xstopx, XSTOPX) 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)
void mx_inline_pow(size_t n, R *r, const X *x, const Y *y)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
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)
=val(i)}if ode{val(i)}occurs in table i
boolNDArray isfinite(void) const
octave_idx_type ndims(void) const
Number of dimensions.
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number).NaN is the result of operations which do not produce a well defined 0 result.Common operations which produce a NaN are arithmetic with infinity ex($\infty-\infty $)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
bool xtoo_large_for_float(double x)
ComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
boolNDArray isinf(void) const
static const Complex Complex_NaN_result(octave::numeric_limits< double >::NaN(), octave::numeric_limits< double >::NaN())
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)
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
T mx_inline_prod(const T *v, octave_idx_type n)
ComplexNDArray cummax(int dim=-1) const
boolNDArray any(int dim=-1) const
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
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)