47 maxnz = (maxnz < 0 ? A.
nnz () : maxnz);
67 B.
xcidx (j - cst) = nz;
72 if (r >= rst && r < rend)
75 B.
xridx (nz++) = r - rst ;
79 B.
xcidx (cend - cst) = nz ;
90 B.
xcidx (j - cst) = nz;
95 if (r >= rst && r < rend)
97 X[r-rst] = A.
data (p);
98 B.
xridx (nz++) = r - rst ;
105 B.
xcidx (cend - cst) = nz ;
111 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
136 if (r1 > r2) { std::swap (r1, r2); }
137 if (c1 > c2) { std::swap (c1, c2); }
146 result.
xelem (i, j) = m.
elem (r1+i, c1+j);
151 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
182 ax[Q[r + i] + aoff] = bx[i + boff];
187 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
219 if (Qinv[a.
xridx (j)] < r || Qinv[a.
xridx (j)] >= r + b_rows)
243 if (Qinv[tmp.
xridx (j)] < r || Qinv[tmp.
xridx (j)] >= r + b_rows)
274 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
284 template <
class T,
class RT>
299 Btx[p[i] + off] = Bx[ i + off];
304 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
318 template <
class T,
class RT>
350 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)
371 template <
class RT,
class ST,
class T>
382 if (nr < 0 || nc < 0 || nr != b_nr)
383 (*current_liboctave_error_handler)
384 (
"matrix dimension mismatch in solution of minimum norm problem");
385 else if (nr == 0 || nc == 0 || b_nc == 0)
386 retval = RT (nc, b_nc, 0.0);
395 csm.nzmax = a.nnz ();
401 #if defined (CS_VER) && (CS_VER >= 2)
416 retval.resize (nc, b_nc);
419 if (dm->rr[2] < nr && dm->cc[3] < nc)
422 nnz_remaining,
true);
423 nnz_remaining -= m.nnz ();
428 if (dm->rr[2] > 0 && !info)
431 dm->cc[3], nc, nnz_remaining,
true);
432 nnz_remaining -= m.nnz ();
435 btmp.insert (ctmp - m * mtmp, 0, 0);
441 if (dm->rr[1] < dm->rr[2] && dm->cc[2] < dm->cc[3] && !info)
444 dm->cc[2], dm->cc[3], nnz_remaining,
false);
445 nnz_remaining -= m.nnz ();
450 RT mtmp = m.solve (mtyp, btmp2, info, rcond,
455 mtmp =
qrsolve (m, btmp2, info);
459 if (dm->rr[1] > 0 && !info)
462 dm->cc[3], nnz_remaining,
true);
463 nnz_remaining -= m.nnz ();
466 btmp.insert (ctmp - m * mtmp, 0, 0);
471 if (dm->rr[1] > 0 && dm->cc[2] > 0 && !info)
474 dm->cc[2], nnz_remaining,
true);
485 (*current_liboctave_error_handler)
486 (
"CXSPARSE unavailable; cannot solve minimum norm problem");
491 #if !defined (CXX_NEW_FRIEND_TEMPLATE_DECL)