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)
211 for (
int i = 0;
i < dim;
i++)
215 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
245 if (dim > dv.
ndims () || dim < 0)
258 for (
int i = 0;
i < dim;
i++)
262 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
281 static_cast<float> (npts);
297 for (
int i = 0;
i < rank;
i++)
307 howmany = (stride == 1 ? howmany :
308 (howmany > stride ? stride : howmany));
321 prow[l] =
retval((l +
k*npts)*stride + j*dist);
326 retval((l +
k*npts)*stride + j*dist) = prow[l];
345 for (
int i = 0;
i < rank;
i++)
355 howmany = (stride == 1 ? howmany :
356 (howmany > stride ? stride : howmany));
369 prow[l] =
retval((l +
k*npts)*stride + j*dist);
374 retval((l +
k*npts)*stride + j*dist) =
375 prow[l] / static_cast<float> (npts);
389 int rank = dv.
ndims ();
393 for (
int i = 0;
i < rank;
i++)
403 howmany = (stride == 1 ? howmany :
404 (howmany > stride ? stride : howmany));
417 prow[l] =
retval((l +
k*npts)*stride + j*dist);
422 retval((l +
k*npts)*stride + j*dist) = prow[l];
436 int rank = dv.
ndims ();
440 for (
int i = 0;
i < rank;
i++)
450 howmany = (stride == 1 ? howmany :
451 (howmany > stride ? stride : howmany));
464 prow[l] =
retval((l +
k*npts)*stride + j*dist);
469 retval((l +
k*npts)*stride + j*dist) =
470 prow[l] / static_cast<float> (npts);
490 return do_mx_unary_op<bool, FloatComplex> (*
this,
mx_inline_not);
528 float r_val = val.real ();
529 float i_val = val.imag ();
547 float r_val = val.real ();
548 float i_val = val.imag ();
579 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_all);
585 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_any);
591 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
598 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
605 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_prod);
611 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dprod);
617 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_sum);
623 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dsum);
629 return do_mx_red_op<float, FloatComplex> (*
this, dim,
mx_inline_sumsq);
635 return do_mx_diff_op<FloatComplex> (*
this, dim, order,
mx_inline_diff);
663 retval.
insert (rb, ra_idx);
673 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_max);
679 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_max);
685 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_min);
691 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_min);
703 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
716 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
723 return do_mx_unary_map<float, FloatComplex, std::abs> (*this);
729 return do_mx_unary_map<bool, FloatComplex, octave::math::isnan> (*this);
735 return do_mx_unary_map<bool, FloatComplex, octave::math::isinf> (*this);
741 return do_mx_unary_map<bool, FloatComplex, octave::math::finite> (*this);
747 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float> > (
a);
756 int n = a_dv.
ndims ();
762 a_ra_idx.
elem (0) = r;
763 a_ra_idx.
elem (1) =
c;
765 for (
int i = 0;
i < n;
i++)
768 (*current_liboctave_error_handler)
769 (
"Array<T>::insert: range error for insert");
772 a_ra_idx.
elem (0) = 0;
773 a_ra_idx.
elem (1) = 0;
783 ra_idx.
elem (0) = a_ra_idx(0) + r;
784 ra_idx.
elem (1) = a_ra_idx(1) +
c;
793 (
"Array<T>::insert: invalid indexing operation");
866 tmp = octave_read_value<FloatComplex> (
is);
888 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
identity matrix If supplied two scalar respectively For allows like xample val
static octave_idx_type nn
std::istream & operator>>(std::istream &is, FloatComplexNDArray &a)
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
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)
Template for N-dimensional array classes with like-type math operators.
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
void err_nan_to_logical_conversion(void)
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.
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
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)
std::ostream & operator<<(std::ostream &os, const FloatComplexNDArray &a)
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)
static const FloatComplex FloatComplex_NaN_result(octave::numeric_limits< float >::NaN(), octave::numeric_limits< float >::NaN())
nd deftypefn *octave_map m
FloatComplexNDArray & operator/=(FloatComplexNDArray &a, float s)
subst_template_param< std::complex, T, double >::type mx_inline_dprod(const T *v, octave_idx_type n)
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
F77_RET_T F77_FUNC(xstopx, XSTOPX) 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
boolNDArray isnan(void) const
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)
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)
=val(i)}if ode{val(i)}occurs in table i
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)
FloatComplexNDArray cumprod(int dim=-1) const
FloatComplexNDArray sum(int dim=-1) const
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)
write the output to stdout if nargout is
Vector representing the dimensions (size) of an Array.
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)
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
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)