24 #if defined (HAVE_CONFIG_H)
50 maxnz = (maxnz < 0 ? A.
nnz () : maxnz);
75 B.
xcidx (j - cst) = nz;
83 if (r >= rst && r < rend)
86 B.
xridx (nz++) = r - rst;
91 B.
xcidx (cend - cst) = nz;
106 B.
xcidx (j - cst) = nz;
114 if (r >= rst && r < rend)
116 X[r-rst] = A.
data (
p);
117 B.
xridx (nz++) = r - rst;
127 B.
xcidx (cend - cst) = nz;
133 template <
typename T>
163 template <
typename T>
185 ax[Q[r +
i] + aoff] = bx[
i + boff];
190 template <
typename T>
216 if (Qinv[a.
xridx (j)] < r || Qinv[a.
xridx (j)] >= r + b_rows)
248 if (Qinv[tmp.
xridx (j)] < r || Qinv[tmp.
xridx (j)] >= r + b_rows)
283 template <
typename T,
typename RT>
302 Btx[p[
i] + off] = Bx[
i + off];
307 template <
typename T,
typename RT>
347 #if defined (HAVE_CXSPARSE)
358 template <
typename RT,
typename ST,
typename T>
364 #if defined (HAVE_CXSPARSE)
372 if (nr < 0 || nc < 0 || nr != b_nr)
373 (*current_liboctave_error_handler)
374 (
"matrix dimension mismatch in solution of minimum norm problem");
376 if (nr == 0 || nc == 0 || b_nc == 0)
377 retval = RT (nc, b_nc, 0.0);
388 csm.nzmax = a.nnz ();
408 retval.resize (nc, b_nc);
411 if (dm->rr[2] < nr && dm->cc[3] < nc)
414 nnz_remaining,
true);
415 nnz_remaining -= m.nnz ();
417 b_nr, 0, b_nc), info);
420 if (dm->rr[2] > 0 && ! info)
423 dm->cc[3], nc, nnz_remaining,
true);
424 nnz_remaining -= m.nnz ();
426 btmp.insert (ctmp - m * mtmp, 0, 0);
432 if (dm->rr[1] < dm->rr[2] && dm->cc[2] < dm->cc[3] && ! info)
435 dm->cc[2], dm->cc[3], nnz_remaining,
false);
436 nnz_remaining -= m.nnz ();
441 RT mtmp = m.solve (mtyp, btmp2, info, rcond,
450 if (dm->rr[1] > 0 && ! info)
453 dm->cc[3], nnz_remaining,
true);
454 nnz_remaining -= m.nnz ();
456 btmp.insert (ctmp - m * mtmp, 0, 0);
461 if (dm->rr[1] > 0 && dm->cc[2] > 0 && ! info)
464 dm->cc[2], nnz_remaining,
true);
475 octave_unused_parameter (a);
476 octave_unused_parameter (b);
477 octave_unused_parameter (info);
479 (*current_liboctave_error_handler)
480 (
"support for CXSparse was unavailable or disabled when liboctave was built");
template Matrix dmsolve< Matrix, SparseMatrix, Matrix >(const SparseMatrix &, const Matrix &, octave_idx_type &)
octave_idx_type * xridx(void)
octave_int< uint64_t > octave_uint64
octave_idx_type cols(void) const
Matrix qrsolve(const SparseMatrix &a, const MArray< double > &b, octave_idx_type &info)
octave_idx_type rows(void) const
static void solve_singularity_warning(double)
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseComplexMatrix, SparseMatrix >(const SparseComplexMatrix &, const SparseMatrix &, octave_idx_type &)
template SparseMatrix dmsolve< SparseMatrix, SparseMatrix, SparseMatrix >(const SparseMatrix &, 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)
octave_idx_type * xcidx(void)
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseMatrix, SparseComplexMatrix >(const SparseMatrix &, const SparseComplexMatrix &, octave_idx_type &)
octave_idx_type * cidx(void)
T & elem(octave_idx_type n)
Template for N-dimensional array classes with like-type math operators.
octave_idx_type rows(void) const
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
octave_idx_type nnz(void) const
Actual number of nonzero terms.
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
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
template ComplexMatrix dmsolve< ComplexMatrix, SparseComplexMatrix, ComplexMatrix >(const SparseComplexMatrix &, const ComplexMatrix &, octave_idx_type &)
nd deftypefn *octave_map m
Sparse< T > sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
void resize(const dim_vector &dv, const T &rfv)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
With real return the complex result
static void dmsolve_permute(MArray< RT > &a, const MArray< T > &b, const octave_idx_type *p)
T & xelem(octave_idx_type n)
#define CXSPARSE_DNAME(name)
void sort(T *data, octave_idx_type nel)
octave_idx_type * ridx(void)
=val(i)}if ode{val(i)}occurs in table i
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
template ComplexMatrix dmsolve< ComplexMatrix, SparseMatrix, ComplexMatrix >(const SparseMatrix &, const ComplexMatrix &, octave_idx_type &)
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 SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseComplexMatrix, SparseComplexMatrix >(const SparseComplexMatrix &, const SparseComplexMatrix &, octave_idx_type &)
const T * fortran_vec(void) const
octave_idx_type cols(void) const
Vector representing the dimensions (size) of an Array.
template ComplexMatrix dmsolve< ComplexMatrix, SparseComplexMatrix, Matrix >(const SparseComplexMatrix &, const Matrix &, octave_idx_type &)
RT dmsolve(const ST &a, const T &b, octave_idx_type &info)
F77_RET_T const F77_INT F77_CMPLX * A
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