26#if defined (HAVE_CONFIG_H)
48 else if (
f.numel () == 1)
51 octave::err_nonconformant (
"pow2",
f.dims (), e.
dims ());
57 y.
xelem (i) = std::ldexp (
f.xelem (i * f_inc),
58 static_cast<int> (e.
xelem (i * e_inc)));
67 int ee =
static_cast<int> (e.
data (0));
69 y.
data (i) = std::ldexp (
f.data (i), ee);
71 else if (
f.numel () == e.
numel ())
77 while (i >=
f.cidx (col))
79 int ee =
static_cast<int> (e.
xelem (
f.ridx (i), col - 1));
80 y.
data (i) = std::ldexp (
f.data (i), ee);
84 octave::err_nonconformant (
"pow2",
f.dims (), e.
dims ());
115 if (args.length () < 1 || args.length () > 2)
118 if (! args(0).isfloat ())
122 if (args.length () == 1)
124 if (args(0).iscomplex ())
133 if (args(0).issparse ())
138 else if (args(0).is_single_type ())
143 y.
xelem (i) = std::exp2 (
x.xelem (i));
151 y.
xelem (i) = std::exp2 (
x.xelem (i));
155 if (args(0).issparse ())
167 if (! args(1).isfloat ())
170 if (args(0).iscomplex () || args(1).iscomplex ())
172 "pow2: imaginary part is ignored");
177 if (args(0).issparse ())
182 if ((
f.numel () == 1) && (
f.nnz () == 0))
197 if (args(0).is_single_type () || args(1).is_single_type ())
208 NDArray e = args(1).array_value ();
214 if (args(0).issparse ())
325OCTAVE_END_NAMESPACE(octave)
N Dimensional Array with copy-on-write semantics.
const dim_vector & dims() const
Return a const-reference so that dims ()(i) works efficiently.
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type numel() const
Number of elements in the array.
octave_idx_type numel() const
octave_idx_type nnz() const
Actual number of nonzero terms.
T & xelem(octave_idx_type n)
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning_with_id(const char *id, const char *fmt,...)
void err_wrong_type_arg(const char *name, const char *s)
F77_RET_T const F77_DBLE * x
F77_RET_T const F77_DBLE const F77_DBLE * f
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
void map_2_xldexp(Array< T > &y, const Array< T > &f, const Array< T > &e)
void map_2_xldexp_sparse(SparseMatrix &y, const SparseMatrix &f, const SparseMatrix &e)