26 #if defined (HAVE_CONFIG_H)
58 maxnz = (maxnz < 0 ?
A.nnz () : maxnz);
83 B.xcidx (j - cst) = nz;
91 if (
r >= rst &&
r < rend)
93 B.xdata (nz) =
A.data (p);
94 B.xridx (nz++) =
r - rst;
99 B.xcidx (cend - cst) = nz;
114 B.xcidx (j - cst) = nz;
122 if (
r >= rst &&
r < rend)
124 X[
r-rst] =
A.data (p);
125 B.xridx (nz++) =
r - rst;
129 sort.
sort (ri +
B.xcidx (j - cst), nz -
B.xcidx (j - cst));
132 B.xdata (p) = X[
B.xridx (p)];
135 B.xcidx (cend - cst) = nz;
141 template <
typename T>
165 result.
xelem (i, j) =
m.elem (r1+i, c1+j);
171 template <
typename T>
193 ax[
Q[
r + i] + aoff] = bx[i + boff];
198 template <
typename T>
224 if (Qinv[a.
xridx (j)] <
r || Qinv[a.
xridx (j)] >=
r + b_rows)
256 if (Qinv[tmp.
xridx (j)] <
r || Qinv[tmp.
xridx (j)] >=
r + b_rows)
291 template <
typename T,
typename RT>
310 Btx[p[i] + off] = Bx[ i + off];
315 template <
typename T,
typename RT>
355 #if defined (HAVE_CXSPARSE)
366 template <
typename RT,
typename ST,
typename T>
372 #if defined (HAVE_CXSPARSE)
380 if (nr < 0 || nc < 0 || nr != b_nr)
381 (*current_liboctave_error_handler)
382 (
"matrix dimension mismatch in solution of minimum norm problem");
384 if (nr == 0 || nc == 0 || b_nc == 0)
385 retval = RT (nc, b_nc, 0.0);
396 csm.nzmax = a.nnz ();
421 if (dm->rr[2] < nr && dm->cc[3] < nc)
424 nnz_remaining,
true);
425 nnz_remaining -=
m.nnz ();
433 if (dm->rr[2] > 0 && ! info)
436 dm->cc[3], nc, nnz_remaining,
true);
437 nnz_remaining -=
m.nnz ();
439 0, dm->rr[2], 0, b_nc);
440 btmp.insert (ctmp -
m * mtmp, 0, 0);
446 if (dm->rr[1] < dm->rr[2] && dm->cc[2] < dm->cc[3] && ! info)
449 dm->cc[2], dm->cc[3], nnz_remaining,
false);
450 nnz_remaining -=
m.nnz ();
452 dm->rr[1], dm->rr[2],
456 RT mtmp =
m.solve (mtyp, btmp2, info, rcond,
465 if (dm->rr[1] > 0 && ! info)
468 dm->cc[3], nnz_remaining,
true);
469 nnz_remaining -=
m.nnz ();
471 0, dm->rr[1], 0, b_nc);
472 btmp.insert (ctmp -
m * mtmp, 0, 0);
477 if (dm->rr[1] > 0 && dm->cc[2] > 0 && ! info)
480 dm->cc[2], nnz_remaining,
true);
494 octave_unused_parameter (a);
495 octave_unused_parameter (b);
496 octave_unused_parameter (info);
498 (*current_liboctave_error_handler)
499 (
"support for CXSparse was unavailable or disabled when liboctave was built");
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
T & xelem(octave_idx_type n)
Size of the specified dimension.
octave_idx_type cols(void) const
octave_idx_type rows(void) const
const T * fortran_vec(void) const
Size of the specified dimension.
Template for N-dimensional array classes with like-type math operators.
octave_idx_type cols(void) const
octave_idx_type * xridx(void)
octave_idx_type * cidx(void)
octave_idx_type nnz(void) const
Actual number of nonzero terms.
octave_idx_type rows(void) const
octave_idx_type * xcidx(void)
octave_idx_type * ridx(void)
Vector representing the dimensions (size) of an Array.
void sort(T *data, octave_idx_type nel)
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
F77_RET_T const F77_INT const F77_INT const F77_INT F77_DBLE const F77_INT F77_DBLE const F77_INT F77_DBLE * Q
F77_RET_T const F77_INT F77_CMPLX * A
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
Matrix qrsolve(const SparseMatrix &a, const MArray< double > &b, octave_idx_type &info)
octave_idx_type * to_octave_idx_type_ptr(suitesparse_integer *i)
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)
octave_int< uint64_t > octave_uint64
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
#define CXSPARSE_DNAME(name)
octave_value::octave_value(const Array< char > &chm, char type) return retval
template SparseMatrix dmsolve< SparseMatrix, SparseMatrix, SparseMatrix >(const SparseMatrix &, const SparseMatrix &, octave_idx_type &)
template Matrix dmsolve< Matrix, SparseMatrix, Matrix >(const SparseMatrix &, const Matrix &, octave_idx_type &)
static void dmsolve_permute(MArray< RT > &a, const MArray< T > &b, const octave_idx_type *p)
static MSparse< T > dmsolve_extract(const MSparse< T > &A, const octave_idx_type *Pinv, const octave_idx_type *Q, octave_idx_type rst, octave_idx_type rend, octave_idx_type cst, octave_idx_type cend, octave_idx_type maxnz=-1, bool lazy=false)
template ComplexMatrix dmsolve< ComplexMatrix, SparseComplexMatrix, ComplexMatrix >(const SparseComplexMatrix &, const ComplexMatrix &, octave_idx_type &)
template ComplexMatrix dmsolve< ComplexMatrix, SparseComplexMatrix, Matrix >(const SparseComplexMatrix &, const Matrix &, octave_idx_type &)
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseComplexMatrix, SparseComplexMatrix >(const SparseComplexMatrix &, const SparseComplexMatrix &, octave_idx_type &)
template ComplexMatrix dmsolve< ComplexMatrix, SparseMatrix, ComplexMatrix >(const SparseMatrix &, const ComplexMatrix &, octave_idx_type &)
static void solve_singularity_warning(double)
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseMatrix, SparseComplexMatrix >(const SparseMatrix &, const SparseComplexMatrix &, octave_idx_type &)
RT dmsolve(const ST &a, const T &b, octave_idx_type &info)
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseComplexMatrix, SparseMatrix >(const SparseComplexMatrix &, const SparseMatrix &, octave_idx_type &)
static void dmsolve_insert(MArray< T > &a, const MArray< T > &b, const octave_idx_type *Q, octave_idx_type r, octave_idx_type c)