48 maxnz = (maxnz < 0 ? A.
nnz () : maxnz);
68 B.
xcidx (j - cst) = nz;
73 if (r >= rst && r < rend)
76 B.
xridx (nz++) = r - rst ;
80 B.
xcidx (cend - cst) = nz ;
91 B.
xcidx (j - cst) = nz;
96 if (r >= rst && r < rend)
98 X[r-rst] = A.
data (p);
99 B.
xridx (nz++) = r - rst ;
106 B.
xcidx (cend - cst) = nz ;
112 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
137 if (r1 > r2) { std::swap (r1, r2); }
138 if (c1 > c2) { std::swap (c1, c2); }
147 result.
xelem (i, j) = m.
elem (r1+i, c1+j);
152 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
183 ax[Q[r + i] + aoff] = bx[i + boff];
188 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
220 if (Qinv[a.
xridx (j)] < r || Qinv[a.
xridx (j)] >= r + b_rows)
244 if (Qinv[tmp.
xridx (j)] < r || Qinv[tmp.
xridx (j)] >= r + b_rows)
275 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
285 template <
class T,
class RT>
300 Btx[p[i] + off] = Bx[ i + off];
305 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
319 template <
class T,
class RT>
351 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
372 template <
class RT,
class ST,
class T>
383 if (nr < 0 || nc < 0 || nr != b_nr)
384 (*current_liboctave_error_handler)
385 (
"matrix dimension mismatch in solution of minimum norm problem");
386 else if (nr == 0 || nc == 0 || b_nc == 0)
387 retval = RT (nc, b_nc, 0.0);
396 csm.nzmax = a.nnz ();
402 #if defined (CS_VER) && (CS_VER >= 2)
417 retval.resize (nc, b_nc);
420 if (dm->rr[2] < nr && dm->cc[3] < nc)
423 nnz_remaining,
true);
424 nnz_remaining -= m.nnz ();
429 if (dm->rr[2] > 0 && !info)
432 dm->cc[3], nc, nnz_remaining,
true);
433 nnz_remaining -= m.nnz ();
436 btmp.insert (ctmp - m * mtmp, 0, 0);
442 if (dm->rr[1] < dm->rr[2] && dm->cc[2] < dm->cc[3] && !info)
445 dm->cc[2], dm->cc[3], nnz_remaining,
false);
446 nnz_remaining -= m.nnz ();
451 RT mtmp = m.solve (mtyp, btmp2, info, rcond,
456 mtmp =
qrsolve (m, btmp2, info);
460 if (dm->rr[1] > 0 && !info)
463 dm->cc[3], nnz_remaining,
true);
464 nnz_remaining -= m.nnz ();
467 btmp.insert (ctmp - m * mtmp, 0, 0);
472 if (dm->rr[1] > 0 && dm->cc[2] > 0 && !info)
475 dm->cc[2], nnz_remaining,
true);
486 (*current_liboctave_error_handler)
487 (
"CXSPARSE unavailable; cannot solve minimum norm problem");
492 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
octave_idx_type * xridx(void)
octave_idx_type cols(void) const
octave_idx_type rows(void) const
static void solve_singularity_warning(double)
F77_RET_T const octave_idx_type Complex * A
octave_idx_type * xcidx(void)
octave_idx_type * cidx(void)
T & elem(octave_idx_type n)
octave_idx_type rows(void) const
F77_RET_T const double const double double * d
octave_idx_type nnz(void) const
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type r2
#define CXSPARSE_DNAME(name)
Sparse< T > sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
void resize(const dim_vector &dv, const T &rfv)
octave_int< uint64_t > octave_uint64
static void dmsolve_permute(MArray< RT > &a, const MArray< T > &b, const octave_idx_type *p)
T & xelem(octave_idx_type n)
void sort(T *data, octave_idx_type nel)
octave_idx_type * ridx(void)
F77_RET_T const octave_idx_type Complex const octave_idx_type Complex * B
ComplexMatrix qrsolve(const SparseComplexMatrix &a, const Matrix &b, octave_idx_type &info)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
F77_RET_T const octave_idx_type const octave_idx_type const octave_idx_type double const octave_idx_type double const octave_idx_type double * Q
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)
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type octave_idx_type c1
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type r1
const T * fortran_vec(void) const
octave_idx_type cols(void) const
static MArray< double > const octave_idx_type const octave_idx_type octave_idx_type octave_idx_type octave_idx_type octave_idx_type static c2 void dmsolve_insert(MArray< T > &a, const MArray< T > &b, const octave_idx_type *Q, octave_idx_type r, octave_idx_type c)
RT dmsolve(const ST &a, const T &b, octave_idx_type &info)