66 if (nr == 0 || nc == 0 || nr != nc)
67 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
70 if (static_cast<int> (b) == b)
72 int btmp =
static_cast<int> (b);
97 atmp = a.
inverse (mattyp, info, rcond, 1);
100 warning (
"inverse: matrix singular to machine\
101 precision, rcond = %g", rcond);
113 result = result * atmp;
125 error (
"use full(a) ^ full(b)");
139 if (nr == 0 || nc == 0 || nr != nc)
140 error (
"for A^b, A must be a square matrix. Use .^ for elementwise power.");
143 if (static_cast<int> (b) == b)
145 int btmp =
static_cast<int> (b);
170 atmp = a.
inverse (mattyp, info, rcond, 1);
173 warning (
"inverse: matrix singular to machine\
174 precision, rcond = %g", rcond);
186 result = result * atmp;
198 error (
"use full(a) ^ full(b)");
239 template <
class S,
class SM>
277 result(i, j) =
std::pow (atmp, b(i,j));
292 result(i, j) =
std::pow (a, b(i,j));
317 result(i, j) =
std::pow (atmp, b(i,j));
429 if (nr != b_nr || nc != b_nc)
435 int convert_to_complex = 0;
441 double btmp = b (a.
ridx (i), j);
442 if (static_cast<int> (btmp) != btmp)
444 convert_to_complex = 1;
457 if (convert_to_complex)
471 retval = complex_result;
534 if (nr != b_nr || nc != b_nc)
569 double btmp = b (i, j);
571 result (i, j) =
std::pow (a, static_cast<int> (btmp));
592 result (i, j) =
std::pow (a, b (i, j));
617 result (a.
ridx (i), j) =
677 if (nr != b_nr || nc != b_nc)
689 double btmp = b(a.
ridx (i), j);
694 static_cast<int> (btmp));
748 if (nr != b_nr || nc != b_nc)
octave_idx_type cols(void) const
octave_value xpow(const SparseMatrix &a, double b)
void gripe_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
octave_value scalar_xpow(const S &a, const SM &b)
octave_idx_type rows(void) const
octave_idx_type numel(void) const
static int xisint(double x)
dim_vector dims(void) const
T & xelem(octave_idx_type n)
SparseComplexMatrix inverse(void) const
SparseMatrix inverse(void) const
void error(const char *fmt,...)
octave_idx_type * cidx(void)
octave_idx_type nnz(void) const
bool all_integers(double &max_val, double &min_val) const
Sparse< T > maybe_compress(bool remove_zeros=false)
bool any_element_is_negative(bool=false) const
octave_value elem_xpow(double a, const SparseMatrix &b)
bool is_complex_type(void) const
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
OCTAVE_API double D_NINT(double x)
Matrix matrix_value(bool frc_str_conv=false) const
void warning(const char *fmt,...)
charNDArray max(char d, const charNDArray &m)
octave_idx_type * ridx(void)
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
std::complex< double > Complex
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
F77_RET_T const double * x
charNDArray min(char d, const charNDArray &m)