24 #if defined (HAVE_CONFIG_H) 65 if (nr == 0 || nc == 0 || nr != nc)
66 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
68 if (static_cast<int> (
b) !=
b)
69 error (
"use full(a) ^ full(b)");
71 int btmp =
static_cast<int> (
b);
96 atmp =
a.inverse (mattyp, info, rcond, 1);
99 warning (
"inverse: matrix singular to machine precision, rcond = %g", rcond);
133 if (nr == 0 || nc == 0 || nr != nc)
134 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
136 if (static_cast<int> (
b) !=
b)
137 error (
"use full(a) ^ full(b)");
139 int btmp =
static_cast<int> (
b);
164 atmp =
a.inverse (mattyp, info, rcond, 1);
167 warning (
"inverse: matrix singular to machine precision, rcond = %g", rcond);
228 template <
typename S,
typename SM>
234 if (
val.iscomplex ())
256 if (
a < 0.0 && !
b.all_integers (d1, d2))
330 if (static_cast<int> (
b) !=
b &&
a.any_element_is_negative ())
364 else if (static_cast<int> (
b) !=
b &&
a.any_element_is_negative ())
381 result.maybe_compress (
true);
395 result.maybe_compress (
true);
415 if (
a.numel () == 1 &&
b.numel () > 1)
421 int convert_to_complex = 0;
427 double btmp =
b (
a.ridx (
i), j);
428 if (static_cast<int> (btmp) != btmp)
430 convert_to_complex = 1;
443 if (convert_to_complex)
452 complex_result.
xelem (
a.ridx (
i), j) =
472 result.maybe_compress (
true);
499 result.maybe_compress (
true);
517 if (
a.numel () == 1 &&
b.numel () > 1)
533 result.maybe_compress (
true);
552 double btmp =
b (
i, j);
639 result.maybe_compress (
true);
657 if (
a.numel () == 1 &&
b.numel () > 1)
669 double btmp =
b(
a.ridx (
i), j);
673 static_cast<int> (btmp));
679 result.maybe_compress (
true);
706 result.maybe_compress (
true);
724 if (
a.numel () == 1 &&
b.numel () > 1)
740 result.maybe_compress (
true);
octave_value xpow(const SparseMatrix &a, double b)
octave_value scalar_xpow(const S &a, const SM &b)
static int xisint(double x)
identity matrix If supplied two scalar respectively For allows like xample val
T & xelem(octave_idx_type n)
void error(const char *fmt,...)
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
octave_value elem_xpow(double a, const SparseMatrix &b)
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
void err_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
With real return the complex result
void warning(const char *fmt,...)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
charNDArray max(char d, const charNDArray &m)
Sparse< T > maybe_compress(bool remove_zeros=false)
std::complex< double > Complex
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
charNDArray min(char d, const charNDArray &m)