24 #if defined (HAVE_CONFIG_H) 39 #include "mx-fcnda-fs.h" 50 xelem (
i) =
static_cast<unsigned char> (
a(
i));
53 #if defined (HAVE_FFTW) 60 if (dim >
dv.
ndims () || dim < 0)
66 for (
int i = 0;
i < dim;
i++)
70 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
81 n, howmany, stride, dist);
91 if (dim >
dv.
ndims () || dim < 0)
97 for (
int i = 0;
i < dim;
i++)
101 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
112 n, howmany, stride, dist);
196 if (dim >
dv.
ndims () || dim < 0)
209 for (
int i = 0;
i < dim;
i++)
213 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
243 if (dim >
dv.
ndims () || dim < 0)
256 for (
int i = 0;
i < dim;
i++)
260 howmany = (stride == 1 ? howmany : (howmany > stride ? stride : howmany));
279 static_cast<float> (npts);
295 for (
int i = 0;
i < rank;
i++)
305 howmany = (stride == 1 ? howmany
306 : (howmany > stride ? stride : howmany));
319 prow[l] =
retval((l +
k*npts)*stride + j*dist);
324 retval((l +
k*npts)*stride + j*dist) = prow[l];
343 for (
int i = 0;
i < rank;
i++)
353 howmany = (stride == 1 ? howmany
354 : (howmany > stride ? stride : howmany));
367 prow[l] =
retval((l +
k*npts)*stride + j*dist);
372 retval((l +
k*npts)*stride + j*dist) =
373 prow[l] / static_cast<float> (npts);
391 for (
int i = 0;
i < rank;
i++)
401 howmany = (stride == 1 ? howmany
402 : (howmany > stride ? stride : howmany));
415 prow[l] =
retval((l +
k*npts)*stride + j*dist);
420 retval((l +
k*npts)*stride + j*dist) = prow[l];
438 for (
int i = 0;
i < rank;
i++)
448 howmany = (stride == 1 ? howmany
449 : (howmany > stride ? stride : howmany));
462 prow[l] =
retval((l +
k*npts)*stride + j*dist);
467 retval((l +
k*npts)*stride + j*dist) =
468 prow[l] / static_cast<float> (npts);
488 return do_mx_unary_op<bool, FloatComplex> (*
this,
mx_inline_not);
526 float r_val =
val.real ();
527 float i_val =
val.imag ();
545 float r_val =
val.real ();
546 float i_val =
val.imag ();
577 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_all);
583 return do_mx_red_op<bool, FloatComplex> (*
this, dim,
mx_inline_any);
589 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
596 return do_mx_cum_op<FloatComplex, FloatComplex> (*
this, dim,
603 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_prod);
609 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dprod);
615 return do_mx_red_op<FloatComplex, FloatComplex> (*
this, dim,
mx_inline_sum);
621 return do_mx_red_op<Complex, FloatComplex> (*
this, dim,
mx_inline_dsum);
627 return do_mx_red_op<float, FloatComplex> (*
this, dim,
mx_inline_sumsq);
633 return do_mx_diff_op<FloatComplex> (*
this, dim, order,
mx_inline_diff);
671 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_max);
677 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_max);
683 return do_mx_minmax_op<FloatComplex> (*
this, dim,
mx_inline_min);
689 return do_mx_minmax_op<FloatComplex> (*
this, idx_arg, dim,
mx_inline_min);
701 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
714 return do_mx_cumminmax_op<FloatComplex> (*
this, idx_arg, dim,
721 return do_mx_unary_map<float, FloatComplex, std::abs> (*this);
727 return do_mx_unary_map<bool, FloatComplex, octave::math::isnan> (*this);
733 return do_mx_unary_map<bool, FloatComplex, octave::math::isinf> (*this);
739 return do_mx_unary_map<bool, FloatComplex, octave::math::isfinite> (*this);
745 return do_mx_unary_map<FloatComplex, FloatComplex, std::conj<float>> (
a);
754 int n = a_dv.
ndims ();
760 a_ra_idx.
elem (0) = r;
761 a_ra_idx.
elem (1) =
c;
763 for (
int i = 0;
i < n;
i++)
766 (*current_liboctave_error_handler)
767 (
"Array<T>::insert: range error for insert");
770 a_ra_idx.
elem (0) = 0;
771 a_ra_idx.
elem (1) = 0;
781 ra_idx.elem (0) = a_ra_idx(0) + r;
782 ra_idx.elem (1) = a_ra_idx(1) +
c;
791 (
"Array<T>::insert: invalid indexing operation");
864 tmp = octave_read_value<FloatComplex> (
is);
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 sumsq(int dim=-1) const
boolNDArray operator!(void) const
FloatComplexNDArray cumsum(int dim=-1) const
#define NDS_BOOL_OPS(ND, S)
#define NDS_CMP_OPS(ND, S)
bool all_integers(float &max_val, float &min_val) const
Template for N-dimensional array classes with like-type math operators.
void mx_inline_cummax(const T *v, T *r, octave_idx_type n)
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)
FloatComplexNDArray max(int dim=-1) const
identity matrix If supplied two scalar respectively For allows like xample val
std::istream & operator>>(std::istream &is, FloatComplexNDArray &a)
FloatComplexNDArray cumprod(int dim=-1) const
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
bool mx_inline_all_finite(size_t n, const T *x)
FloatNDArray abs(void) const
boolNDArray all(int dim=-1) const
const FloatComplex * fortran_vec(void) const
#define MINMAX_FCNS(T, S)
bool any_element_is_nan(void) const
void octave_write_complex(std::ostream &os, const Complex &c)
bool all_elements_are_real(void) const
FloatComplexNDArray diag(octave_idx_type k=0) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
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)
static int fftNd(const double *, Complex *, const int, const dim_vector &)
FloatComplexNDArray sum(int dim=-1) const
FloatComplex & 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)
subroutine cfftb(n, c, wsave)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
boolNDArray isinf(void) const
void err_nan_to_logical_conversion(void)
ComplexNDArray dprod(int dim=-1) const
FloatComplexNDArray ifourier(int dim=1) const
FloatComplexNDArray & insert(const NDArray &a, octave_idx_type r, octave_idx_type c)
bool mx_inline_any(const T *v, octave_idx_type n)
bool any_element_is_inf_or_nan(void) const
FloatComplexNDArray cummin(int dim=-1) 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
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
subroutine cffti(n, wsave)
std::ostream & operator<<(std::ostream &os, const FloatComplexNDArray &a)
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)
static octave_idx_type compute_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions)
#define NDND_CMP_OPS(ND1, ND2)
ComplexNDArray dsum(int dim=-1) const
FloatComplexNDArray fourierNd(void) const
#define NDND_BOOL_OPS(ND1, ND2)
static const FloatComplex FloatComplex_NaN_result(octave::numeric_limits< float >::NaN(), octave::numeric_limits< float >::NaN())
FloatComplexNDArray prod(int dim=-1) const
boolNDArray any(int dim=-1) const
FloatComplexNDArray & operator/=(FloatComplexNDArray &a, float s)
subst_template_param< std::complex, T, double >::type mx_inline_dprod(const T *v, octave_idx_type n)
bool too_large_for_float(void) const
boolNDArray isnan(void) const
FloatComplexNDArray(void)
FloatComplexNDArray fourier(int dim=1) const
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)
FloatComplexNDArray ifourierNd(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 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)
F77_RET_T F77_FUNC(xerbla, XERBLA)
FloatComplexNDArray min(int dim=-1) const
#define BSXFUN_STDREL_DEFS_MXLOOP(ARRAY)
FloatComplex & xelem(octave_idx_type n)
T mx_inline_sum(const T *v, octave_idx_type n)
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)
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$)
FloatComplexNDArray cummax(int dim=-1) const
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
static int ifftNd(const Complex *, Complex *, const int, const dim_vector &)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
std::complex< float > FloatComplex
FloatComplexNDArray diff(octave_idx_type order=1, int dim=-1) const
boolNDArray isfinite(void) const
octave_idx_type ndims(void) const
Number of dimensions.
bool mx_inline_all(const T *v, octave_idx_type n)
#define BSXFUN_STDOP_DEFS_MXLOOP(ARRAY)
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)
octave_idx_type numel(void) const
Number of elements in the array.
write the output to stdout if nargout is
FloatComplexNDArray fourier2d(void) const
Vector representing the dimensions (size) of an Array.
FloatComplexNDArray concat(NDArray &ra, FloatComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
FloatComplexNDArray ifourier2d(void) 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)