24 #if defined (HAVE_CONFIG_H) 56 maxnz = (maxnz < 0 ?
A.nnz () : maxnz);
81 B.xcidx (j - cst) = nz;
89 if (r >= rst && r < rend)
91 B.xdata (nz) =
A.data (
p);
92 B.xridx (nz++) = r - rst;
97 B.xcidx (cend - cst) = nz;
112 B.xcidx (j - cst) = nz;
120 if (r >= rst && r < rend)
122 X[r-rst] =
A.data (
p);
123 B.xridx (nz++) = r - rst;
127 sort.
sort (ri +
B.xcidx (j - cst), nz -
B.xcidx (j - cst));
130 B.xdata (
p) = X[
B.xridx (
p)];
133 B.xcidx (cend - cst) = nz;
139 template <
typename T>
169 template <
typename T>
174 T *ax =
a.fortran_vec ();
176 const T *bx =
b.fortran_vec ();
191 ax[
Q[r +
i] + aoff] = bx[
i + boff];
196 template <
typename T>
216 nel +=
a.xcidx (nc) -
a.xcidx (
c + b_cols);
222 if (Qinv[
a.xridx (j)] < r || Qinv[
a.xridx (j)] >= r + b_rows)
239 a.xdata (
i) =
tmp.xdata (
i);
240 a.xridx (
i) =
tmp.xridx (
i);
244 a.xcidx (
i) =
tmp.xcidx (
i);
254 if (Qinv[
tmp.xridx (j)] < r || Qinv[
tmp.xridx (j)] >= r + b_rows)
256 X[
tmp.xridx (j)] =
tmp.xdata (j);
257 a.xridx (ii++) =
tmp.xridx (j);
265 X[
Q[r +
b.ridx (j)]] =
b.data (j);
266 a.xridx (ii++) =
Q[r +
b.ridx (j)];
269 sort.
sort (ri +
a.xcidx (
i), ii -
a.xcidx (
i));
272 a.xdata (
p) = X[
a.xridx (
p)];
281 a.xdata (ii) =
tmp.xdata (j);
282 a.xridx (ii++) =
tmp.xridx (j);
289 template <
typename T,
typename RT>
296 const T *Bx =
b.fortran_vec ();
300 RT *Btx =
a.fortran_vec ();
308 Btx[
p[
i] + off] = Bx[
i + off];
313 template <
typename T,
typename RT>
338 a.xridx (nz++) =
p[
b.ridx (
i)];
341 sort.
sort (ri +
a.xcidx (j), nz -
a.xcidx (j));
346 a.xdata (
i) = X[
a.xridx (
i)];
353 #if defined (HAVE_CXSPARSE) 364 template <
typename RT,
typename ST,
typename T>
370 #if defined (HAVE_CXSPARSE) 378 if (nr < 0 || nc < 0 || nr !=
b_nr)
379 (*current_liboctave_error_handler)
380 (
"matrix dimension mismatch in solution of minimum norm problem");
382 if (nr == 0 || nc == 0 ||
b_nc == 0)
394 csm.nzmax =
a.nnz ();
419 if (dm->rr[2] < nr && dm->cc[3] < nc)
422 nnz_remaining,
true);
423 nnz_remaining -= m.nnz ();
431 if (dm->rr[2] > 0 && ! info)
434 dm->cc[3], nc, nnz_remaining,
true);
435 nnz_remaining -= m.nnz ();
437 0, dm->rr[2], 0,
b_nc);
438 btmp.insert (ctmp - m * mtmp, 0, 0);
444 if (dm->rr[1] < dm->rr[2] && dm->cc[2] < dm->cc[3] && ! info)
447 dm->cc[2], dm->cc[3], nnz_remaining,
false);
448 nnz_remaining -= m.nnz ();
450 dm->rr[1], dm->rr[2],
454 RT mtmp = m.solve (mtyp, btmp2, info, rcond,
463 if (dm->rr[1] > 0 && ! info)
466 dm->cc[3], nnz_remaining,
true);
467 nnz_remaining -= m.nnz ();
469 0, dm->rr[1], 0,
b_nc);
470 btmp.insert (ctmp - m * mtmp, 0, 0);
475 if (dm->rr[1] > 0 && dm->cc[2] > 0 && ! info)
478 dm->cc[2], nnz_remaining,
true);
492 octave_unused_parameter (
a);
493 octave_unused_parameter (
b);
494 octave_unused_parameter (info);
496 (*current_liboctave_error_handler)
497 (
"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_int< uint64_t > octave_uint64
Template for N-dimensional array classes with like-type math operators.
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
Matrix qrsolve(const SparseMatrix &a, const MArray< double > &b, octave_idx_type &info)
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)
Sparse< T > sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
template SparseComplexMatrix dmsolve< SparseComplexMatrix, SparseMatrix, SparseComplexMatrix >(const SparseMatrix &, const SparseComplexMatrix &, octave_idx_type &)
T & elem(octave_idx_type n)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
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 const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
octave_value resize(const dim_vector &dv, bool fill=false) const
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
octave_idx_type * to_octave_idx_type_ptr(suitesparse_integer *i)
template ComplexMatrix dmsolve< ComplexMatrix, SparseComplexMatrix, ComplexMatrix >(const SparseComplexMatrix &, const ComplexMatrix &, octave_idx_type &)
F77_RET_T const F77_INT F77_CMPLX * A
With real return the complex result
static void dmsolve_permute(MArray< RT > &a, const MArray< T > &b, const octave_idx_type *p)
#define CXSPARSE_DNAME(name)
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
void sort(T *data, octave_idx_type nel)
#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 &)
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)
suitesparse_integer * to_suitesparse_intptr(octave_idx_type *i)