78 const octave_idx_type&,
const octave_idx_type&,
79 Complex*,
const octave_idx_type&,
80 octave_idx_type*, octave_idx_type&);
84 const octave_idx_type&,
const octave_idx_type&,
85 const octave_idx_type&,
const octave_idx_type&,
86 const Complex*,
const octave_idx_type&,
87 const octave_idx_type*, Complex*,
88 const octave_idx_type&, octave_idx_type&
93 const octave_idx_type&,
const octave_idx_type&,
94 const octave_idx_type&, Complex*,
95 const octave_idx_type&,
const octave_idx_type*,
96 const double&,
double&, Complex*,
double*,
102 const octave_idx_type&,
const octave_idx_type&,
103 Complex*,
const octave_idx_type&, octave_idx_type&
108 const octave_idx_type&,
const octave_idx_type&,
109 const octave_idx_type&, Complex*,
110 const octave_idx_type&, Complex*,
111 const octave_idx_type&, octave_idx_type&
116 const octave_idx_type&,
const octave_idx_type&,
117 Complex*,
const octave_idx_type&,
const double&,
118 double&, Complex*,
double*, octave_idx_type&
122 F77_FUNC (zgttrf, ZGTTRF) (
const octave_idx_type&, Complex*, Complex*,
123 Complex*, Complex*, octave_idx_type*,
128 const octave_idx_type&,
const octave_idx_type&,
129 const Complex*,
const Complex*,
const Complex*,
130 const Complex*,
const octave_idx_type*,
131 Complex *,
const octave_idx_type&,
136 F77_FUNC (zptsv, ZPTSV) (
const octave_idx_type&,
const octave_idx_type&,
137 double*, Complex*, Complex*,
138 const octave_idx_type&, octave_idx_type&);
141 F77_FUNC (zgtsv, ZGTSV) (
const octave_idx_type&,
const octave_idx_type&,
142 Complex*, Complex*, Complex*, Complex*,
143 const octave_idx_type&, octave_idx_type&);
195 if (nr != nr_a || nc != nc_a || nz != nz_a)
212 return !(*
this == a);
221 if (nr == nc && nr > 0)
261 return max (dummy_idx, dim);
286 if (nr == 0 || nc == 0 || dim >= dv.
length ())
297 if (
ridx (i) != idx_j)
318 if (
xisnan (abs_max) || abs_tmp > abs_max)
326 idx_arg.
elem (j) =
xisnan (tmp_max) ? 0 : idx_j;
334 result.
xcidx (0) = 0;
340 result.
xdata (ii) = tmp;
341 result.
xridx (ii++) = 0;
343 result.
xcidx (j+1) = ii;
350 if (nr == 0 || nc == 0 || dim >= dv.
length ())
360 if (found[
ridx (i)] == -j)
361 found[
ridx (i)] = -j - 1;
364 if (found[i] > -nc && found[i] < 0)
365 idx_arg.
elem (i) = -found[i];
378 idx_arg.
elem (ir) = j;
384 if (idx_arg.
elem (j) == -1 ||
elem (j, idx_arg.
elem (j)) != 0.)
390 result.
xcidx (0) = 0;
391 result.
xcidx (1) = nel;
394 if (idx_arg(j) == -1)
398 result.
xridx (ii++) = j;
405 result.
xdata (ii) = tmp;
406 result.
xridx (ii++) = j;
419 return min (dummy_idx, dim);
443 if (nr == 0 || nc == 0 || dim >= dv.
length ())
454 if (
ridx (i) != idx_j)
475 if (
xisnan (abs_min) || abs_tmp < abs_min)
483 idx_arg.
elem (j) =
xisnan (tmp_min) ? 0 : idx_j;
491 result.
xcidx (0) = 0;
497 result.
xdata (ii) = tmp;
498 result.
xridx (ii++) = 0;
500 result.
xcidx (j+1) = ii;
507 if (nr == 0 || nc == 0 || dim >= dv.
length ())
517 if (found[
ridx (i)] == -j)
518 found[
ridx (i)] = -j - 1;
521 if (found[i] > -nc && found[i] < 0)
522 idx_arg.
elem (i) = -found[i];
535 idx_arg.
elem (ir) = j;
541 if (idx_arg.
elem (j) == -1 ||
elem (j, idx_arg.
elem (j)) != 0.)
547 result.
xcidx (0) = 0;
548 result.
xcidx (1) = nel;
551 if (idx_arg(j) == -1)
555 result.
xridx (ii++) = j;
562 result.
xdata (ii) = tmp;
563 result.
xridx (ii++) = j;
598 retval(j) =
data (k);
625 return insert (tmp , r, c);
641 return insert (tmp , indx);
657 if (rb.
rows () > 0 && rb.
cols () > 0)
667 if (rb.
rows () > 0 && rb.
cols () > 0)
693 retval.
xcidx (i) = nz;
702 retval.
xridx (q) = j;
705 assert (
nnz () == retval.
xcidx (nr));
738 return inverse (mattype, info, rcond, 0, 0);
746 return inverse (mattype, info, rcond, 0, 0);
753 return inverse (mattype, info, rcond, 0, 0);
758 double& rcond,
const bool,
759 const bool calccond)
const
767 if (nr == 0 || nc == 0 || nr != nc)
768 (*current_liboctave_error_handler) (
"inverse requires square matrix");
772 int typ = mattyp.
type ();
812 double& rcond,
const bool,
813 const bool calccond)
const
821 if (nr == 0 || nc == 0 || nr != nc)
822 (*current_liboctave_error_handler) (
"inverse requires square matrix");
826 int typ = mattyp.
type ();
833 double ainvnorm = 0.;
867 retval.
xcidx (i) = cx;
868 retval.
xridx (cx) = i;
869 retval.
xdata (cx) = 1.0;
883 (*current_liboctave_error_handler)
884 (
"division by zero");
885 goto inverse_singular;
891 rpX = retval.
xridx (colXp);
900 v -= retval.
xdata (colXp) *
data (colUp);
905 while (rpX < j && rpU < j && colXp < cx && colUp < nz);
910 colUp =
cidx (j+1) - 1;
914 if (pivot == 0. ||
ridx (colUp) != j)
916 (*current_liboctave_error_handler)
917 (
"division by zero");
918 goto inverse_singular;
929 retval.
xridx (cx) = j;
930 retval.
xdata (cx) = v / pivot;
938 colUp =
cidx (i+1) - 1;
942 if (pivot == 0. ||
ridx (colUp) != i)
944 (*current_liboctave_error_handler) (
"division by zero");
945 goto inverse_singular;
950 retval.
xdata (j) /= pivot;
952 retval.
xcidx (nr) = cx;
997 k <
cidx (jidx+1); k++)
1006 pivot =
data (cidx (jidx+1) - 1);
1008 pivot =
data (cidx (jidx));
1011 (*current_liboctave_error_handler)
1012 (
"division by zero");
1013 goto inverse_singular;
1016 work[j] = v / pivot;
1022 colUp =
cidx (perm[iidx]+1) - 1;
1024 colUp =
cidx (perm[iidx]);
1029 (*current_liboctave_error_handler)
1030 (
"division by zero");
1031 goto inverse_singular;
1045 nz2 = (2*nz2 < new_cx ? new_cx : 2*nz2);
1049 retval.
xcidx (i) = cx;
1053 retval.
xridx (cx) = j;
1054 retval.
xdata (cx++) = work[j];
1058 retval.
xcidx (nr) = cx;
1069 i < retval.
cidx (j+1); i++)
1071 if (atmp > ainvnorm)
1075 rcond = 1. / ainvnorm / anorm;
1090 double& rcond,
int,
int calc_cond)
const
1092 int typ = mattype.
type (
false);
1096 typ = mattype.
type (*
this);
1099 ret =
dinverse (mattype, info, rcond,
true, calc_cond);
1113 rcond = fact.
rcond ();
1139 rcond = fact.
rcond ();
1179 if (nr == 0 || nc == 0 || nr != nc)
1188 Matrix Control (UMFPACK_CONTROL, 1);
1194 Control (UMFPACK_PRL) = tmp;
1199 Control (UMFPACK_SYM_PIVOT_TOLERANCE) = tmp;
1200 Control (UMFPACK_PIVOT_TOLERANCE) = tmp;
1206 Control (UMFPACK_FIXQ) = tmp;
1209 Control (UMFPACK_SCALE) = UMFPACK_SCALE_NONE;
1218 reinterpret_cast<const double *
> (Ax),
1222 Matrix Info (1, UMFPACK_INFO);
1225 (nr, nc, Ap, Ai,
reinterpret_cast<const double *
> (Ax), 0,
1226 0, &Symbolic, control, info);
1230 (*current_liboctave_error_handler)
1231 (
"SparseComplexMatrix::determinant symbolic factorization failed");
1245 reinterpret_cast<const double *
> (Ax),
1246 0, Symbolic, &Numeric, control, info);
1249 rcond = Info (UMFPACK_RCOND);
1253 (*current_liboctave_error_handler)
1254 (
"SparseComplexMatrix::determinant numeric factorization failed");
1272 (*current_liboctave_error_handler)
1273 (
"SparseComplexMatrix::determinant error calculating determinant");
1286 (*current_liboctave_error_handler) (
"UMFPACK not installed");
1295 solve_singularity_handler,
bool calc_cond)
const
1304 if (nr != b.
rows ())
1306 (
"matrix dimension mismatch solution of linear equations");
1307 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1312 int typ = mattype.
type ();
1321 retval(i,j) = b(i,j) /
data (i);
1326 retval(k,j) = b(
ridx (i),j) /
data (i);
1340 rcond = dmin / dmax;
1355 solve_singularity_handler,
1356 bool calc_cond)
const
1365 if (nr != b.
rows ())
1367 (
"matrix dimension mismatch solution of linear equations");
1368 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1373 int typ = mattype.
type ();
1382 retval.
xcidx (0) = 0;
1389 if (b.
ridx (i) >= nm)
1394 retval.
xcidx (j+1) = ii;
1404 for (k = b.
cidx (j); k < b.
cidx (j+1); k++)
1412 retval.
xridx (ii) = l;
1416 retval.
xcidx (j+1) = ii;
1431 rcond = dmin / dmax;
1446 solve_singularity_handler,
1447 bool calc_cond)
const
1456 if (nr != b.
rows ())
1458 (
"matrix dimension mismatch solution of linear equations");
1459 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1464 int typ = mattype.
type ();
1473 retval(i,j) = b(i,j) /
data (i);
1478 retval(k,j) = b(
ridx (i),j) /
data (i);
1492 rcond = dmin / dmax;
1507 solve_singularity_handler,
1508 bool calc_cond)
const
1517 if (nr != b.
rows ())
1519 (
"matrix dimension mismatch solution of linear equations");
1520 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1525 int typ = mattype.
type ();
1534 retval.
xcidx (0) = 0;
1541 if (b.
ridx (i) >= nm)
1546 retval.
xcidx (j+1) = ii;
1556 for (k = b.
cidx (j); k < b.
cidx (j+1); k++)
1564 retval.
xridx (ii) = l;
1568 retval.
xcidx (j+1) = ii;
1583 rcond = dmin / dmax;
1598 solve_singularity_handler sing_handler,
1599 bool calc_cond)
const
1608 if (nr != b.
rows ())
1610 (
"matrix dimension mismatch solution of linear equations");
1611 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1616 int typ = mattype.
type ();
1622 double ainvnorm = 0.;
1641 retval.
resize (nc, b_nc);
1662 goto triangular_error;
1668 i <
cidx (kidx+1)-1; i++)
1671 work[iidx] = work[iidx] - tmp *
data (i);
1677 retval(perm[i], j) = work[i];
1699 i <
cidx (iidx+1)-1; i++)
1702 work[idx2] = work[idx2] - tmp *
data (i);
1712 if (atmp > ainvnorm)
1715 rcond = 1. / ainvnorm / anorm;
1721 retval.
resize (nc, b_nc);
1738 goto triangular_error;
1746 work[iidx] = work[iidx] - tmp *
data (i);
1752 retval.
xelem (i, j) = work[i];
1772 i <
cidx (k+1)-1; i++)
1775 work[iidx] = work[iidx] - tmp *
data (i);
1785 if (atmp > ainvnorm)
1788 rcond = 1. / ainvnorm / anorm;
1797 sing_handler (rcond);
1804 volatile double rcond_plus_one = rcond + 1.0;
1806 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
1812 sing_handler (rcond);
1829 solve_singularity_handler sing_handler,
1830 bool calc_cond)
const
1839 if (nr != b.
rows ())
1841 (
"matrix dimension mismatch solution of linear equations");
1842 else if (nr == 0 || nc == 0 || b.
cols () == 0)
1847 int typ = mattype.
type ();
1853 double ainvnorm = 0.;
1872 retval.
xcidx (0) = 0;
1902 goto triangular_error;
1908 i <
cidx (kidx+1)-1; i++)
1911 work[iidx] = work[iidx] - tmp *
data (i);
1923 if (ii + new_nnz > x_nz)
1932 if (work[rperm[i]] != 0.)
1934 retval.
xridx (ii) = i;
1935 retval.
xdata (ii++) = work[rperm[i]];
1937 retval.
xcidx (j+1) = ii;
1961 i <
cidx (iidx+1)-1; i++)
1964 work[idx2] = work[idx2] - tmp *
data (i);
1974 if (atmp > ainvnorm)
1977 rcond = 1. / ainvnorm / anorm;
1999 goto triangular_error;
2007 work[iidx] = work[iidx] - tmp *
data (i);
2019 if (ii + new_nnz > x_nz)
2030 retval.
xridx (ii) = i;
2031 retval.
xdata (ii++) = work[i];
2033 retval.
xcidx (j+1) = ii;
2055 i <
cidx (k+1)-1; i++)
2058 work[iidx] = work[iidx] - tmp *
data (i);
2068 if (atmp > ainvnorm)
2071 rcond = 1. / ainvnorm / anorm;
2080 sing_handler (rcond);
2087 volatile double rcond_plus_one = rcond + 1.0;
2089 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
2095 sing_handler (rcond);
2111 solve_singularity_handler sing_handler,
2112 bool calc_cond)
const
2121 if (nr != b.
rows ())
2123 (
"matrix dimension mismatch solution of linear equations");
2124 else if (nr == 0 || nc == 0 || b.
cols () == 0)
2129 int typ = mattype.
type ();
2135 double ainvnorm = 0.;
2154 retval.
resize (nc, b_nc);
2175 goto triangular_error;
2181 i <
cidx (kidx+1)-1; i++)
2184 work[iidx] = work[iidx] - tmp *
data (i);
2190 retval(perm[i], j) = work[i];
2212 i <
cidx (iidx+1)-1; i++)
2215 work[idx2] = work[idx2] - tmp *
data (i);
2225 if (atmp > ainvnorm)
2228 rcond = 1. / ainvnorm / anorm;
2234 retval.
resize (nc, b_nc);
2251 goto triangular_error;
2259 work[iidx] = work[iidx] - tmp *
data (i);
2265 retval.
xelem (i, j) = work[i];
2285 i <
cidx (k+1)-1; i++)
2288 work[iidx] = work[iidx] - tmp *
data (i);
2298 if (atmp > ainvnorm)
2301 rcond = 1. / ainvnorm / anorm;
2310 sing_handler (rcond);
2317 volatile double rcond_plus_one = rcond + 1.0;
2319 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
2325 sing_handler (rcond);
2342 solve_singularity_handler sing_handler,
2343 bool calc_cond)
const
2352 if (nr != b.
rows ())
2354 (
"matrix dimension mismatch solution of linear equations");
2355 else if (nr == 0 || nc == 0 || b.
cols () == 0)
2360 int typ = mattype.
type ();
2366 double ainvnorm = 0.;
2385 retval.
xcidx (0) = 0;
2415 goto triangular_error;
2421 i <
cidx (kidx+1)-1; i++)
2424 work[iidx] = work[iidx] - tmp *
data (i);
2436 if (ii + new_nnz > x_nz)
2445 if (work[rperm[i]] != 0.)
2447 retval.
xridx (ii) = i;
2448 retval.
xdata (ii++) = work[rperm[i]];
2450 retval.
xcidx (j+1) = ii;
2474 i <
cidx (iidx+1)-1; i++)
2477 work[idx2] = work[idx2] - tmp *
data (i);
2487 if (atmp > ainvnorm)
2490 rcond = 1. / ainvnorm / anorm;
2512 goto triangular_error;
2520 work[iidx] = work[iidx] - tmp *
data (i);
2532 if (ii + new_nnz > x_nz)
2543 retval.
xridx (ii) = i;
2544 retval.
xdata (ii++) = work[i];
2546 retval.
xcidx (j+1) = ii;
2568 i <
cidx (k+1)-1; i++)
2571 work[iidx] = work[iidx] - tmp *
data (i);
2581 if (atmp > ainvnorm)
2584 rcond = 1. / ainvnorm / anorm;
2593 sing_handler (rcond);
2600 volatile double rcond_plus_one = rcond + 1.0;
2602 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
2608 sing_handler (rcond);
2625 solve_singularity_handler sing_handler,
2626 bool calc_cond)
const
2635 if (nr != b.
rows ())
2637 (
"matrix dimension mismatch solution of linear equations");
2638 else if (nr == 0 || nc == 0 || b.
cols () == 0)
2643 int typ = mattype.
type ();
2649 double ainvnorm = 0.;
2668 retval.
resize (nc, b_nc);
2677 work[perm[i]] = b(i,j);
2687 if (perm[
ridx (i)] < minr)
2689 minr = perm[
ridx (i)];
2693 if (minr != k ||
data (mini) == 0.)
2696 goto triangular_error;
2707 work[iidx] = work[iidx] - tmp *
data (i);
2713 retval(i, j) = work[i];
2734 i <
cidx (k+1); i++)
2735 if (perm[
ridx (i)] < minr)
2737 minr = perm[
ridx (i)];
2744 i <
cidx (k+1); i++)
2750 work[iidx] = work[iidx] - tmp *
data (i);
2761 if (atmp > ainvnorm)
2764 rcond = 1. / ainvnorm / anorm;
2770 retval.
resize (nc, b_nc, 0.);
2785 goto triangular_error;
2793 work[iidx] = work[iidx] - tmp *
data (i);
2798 retval.
xelem (i, j) = work[i];
2819 i <
cidx (k+1); i++)
2822 work[iidx] = work[iidx] - tmp *
data (i);
2832 if (atmp > ainvnorm)
2835 rcond = 1. / ainvnorm / anorm;
2843 sing_handler (rcond);
2850 volatile double rcond_plus_one = rcond + 1.0;
2852 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
2858 sing_handler (rcond);
2875 solve_singularity_handler sing_handler,
2876 bool calc_cond)
const
2886 if (nr != b.
rows ())
2888 (
"matrix dimension mismatch solution of linear equations");
2889 else if (nr == 0 || nc == 0 || b.
cols () == 0)
2894 int typ = mattype.
type ();
2900 double ainvnorm = 0.;
2919 retval.
xcidx (0) = 0;
2933 work[perm[b.
ridx (i)]] = b.
data (i);
2943 if (perm[
ridx (i)] < minr)
2945 minr = perm[
ridx (i)];
2949 if (minr != k ||
data (mini) == 0.)
2952 goto triangular_error;
2963 work[iidx] = work[iidx] - tmp *
data (i);
2975 if (ii + new_nnz > x_nz)
2986 retval.
xridx (ii) = i;
2987 retval.
xdata (ii++) = work[i];
2989 retval.
xcidx (j+1) = ii;
3012 i <
cidx (k+1); i++)
3013 if (perm[
ridx (i)] < minr)
3015 minr = perm[
ridx (i)];
3022 i <
cidx (k+1); i++)
3028 work[iidx] = work[iidx] - tmp *
data (i);
3039 if (atmp > ainvnorm)
3042 rcond = 1. / ainvnorm / anorm;
3063 goto triangular_error;
3071 work[iidx] = work[iidx] - tmp *
data (i);
3083 if (ii + new_nnz > x_nz)
3094 retval.
xridx (ii) = i;
3095 retval.
xdata (ii++) = work[i];
3097 retval.
xcidx (j+1) = ii;
3120 i <
cidx (k+1); i++)
3123 work[iidx] = work[iidx] - tmp *
data (i);
3133 if (atmp > ainvnorm)
3136 rcond = 1. / ainvnorm / anorm;
3145 sing_handler (rcond);
3152 volatile double rcond_plus_one = rcond + 1.0;
3154 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
3160 sing_handler (rcond);
3177 solve_singularity_handler sing_handler,
3178 bool calc_cond)
const
3187 if (nr != b.
rows ())
3189 (
"matrix dimension mismatch solution of linear equations");
3190 else if (nr == 0 || nc == 0 || b.
cols () == 0)
3195 int typ = mattype.
type ();
3201 double ainvnorm = 0.;
3220 retval.
resize (nc, b_nc);
3229 work[perm[i]] = b(i,j);
3239 if (perm[
ridx (i)] < minr)
3241 minr = perm[
ridx (i)];
3245 if (minr != k ||
data (mini) == 0.)
3248 goto triangular_error;
3259 work[iidx] = work[iidx] - tmp *
data (i);
3265 retval(i, j) = work[i];
3286 i <
cidx (k+1); i++)
3287 if (perm[
ridx (i)] < minr)
3289 minr = perm[
ridx (i)];
3296 i <
cidx (k+1); i++)
3302 work[iidx] = work[iidx] - tmp *
data (i);
3313 if (atmp > ainvnorm)
3316 rcond = 1. / ainvnorm / anorm;
3322 retval.
resize (nc, b_nc, 0.);
3339 goto triangular_error;
3347 work[iidx] = work[iidx] - tmp *
data (i);
3353 retval.
xelem (i, j) = work[i];
3374 i <
cidx (k+1); i++)
3377 work[iidx] = work[iidx] - tmp *
data (i);
3387 if (atmp > ainvnorm)
3390 rcond = 1. / ainvnorm / anorm;
3399 sing_handler (rcond);
3406 volatile double rcond_plus_one = rcond + 1.0;
3408 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
3414 sing_handler (rcond);
3431 solve_singularity_handler sing_handler,
3432 bool calc_cond)
const
3441 if (nr != b.
rows ())
3443 (
"matrix dimension mismatch solution of linear equations");
3444 else if (nr == 0 || nc == 0 || b.
cols () == 0)
3449 int typ = mattype.
type ();
3455 double ainvnorm = 0.;
3474 retval.
xcidx (0) = 0;
3488 work[perm[b.
ridx (i)]] = b.
data (i);
3498 if (perm[
ridx (i)] < minr)
3500 minr = perm[
ridx (i)];
3504 if (minr != k ||
data (mini) == 0.)
3507 goto triangular_error;
3518 work[iidx] = work[iidx] - tmp *
data (i);
3530 if (ii + new_nnz > x_nz)
3541 retval.
xridx (ii) = i;
3542 retval.
xdata (ii++) = work[i];
3544 retval.
xcidx (j+1) = ii;
3567 i <
cidx (k+1); i++)
3568 if (perm[
ridx (i)] < minr)
3570 minr = perm[
ridx (i)];
3577 i <
cidx (k+1); i++)
3583 work[iidx] = work[iidx] - tmp *
data (i);
3594 if (atmp > ainvnorm)
3597 rcond = 1. / ainvnorm / anorm;
3618 goto triangular_error;
3626 work[iidx] = work[iidx] - tmp *
data (i);
3638 if (ii + new_nnz > x_nz)
3649 retval.
xridx (ii) = i;
3650 retval.
xdata (ii++) = work[i];
3652 retval.
xcidx (j+1) = ii;
3675 i <
cidx (k+1); i++)
3678 work[iidx] = work[iidx] - tmp *
data (i);
3688 if (atmp > ainvnorm)
3691 rcond = 1. / ainvnorm / anorm;
3700 sing_handler (rcond);
3707 volatile double rcond_plus_one = rcond + 1.0;
3709 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
3715 sing_handler (rcond);
3732 solve_singularity_handler sing_handler,
3733 bool calc_cond)
const
3741 if (nr != nc || nr != b.
rows ())
3743 (
"matrix dimension mismatch solution of linear equations");
3744 else if (nr == 0 || b.
cols () == 0)
3747 (*current_liboctave_error_handler)
3748 (
"calculation of condition number not implemented");
3752 volatile int typ = mattype.
type ();
3786 else if (
ridx (i) == j + 1)
3795 F77_XFCN (zptsv, ZPTSV, (nr, b_nc, D, DL, result,
3821 DL[j] =
data (ii++);
3822 DU[j] =
data (ii++);
3824 D[nc-1] =
data (ii);
3841 else if (
ridx (i) == j + 1)
3843 else if (
ridx (i) == j - 1)
3852 F77_XFCN (zgtsv, ZGTSV, (nr, b_nc, DL, D, DU, result,
3862 sing_handler (rcond);
3873 (*current_liboctave_error_handler) (
"incorrect matrix type");
3882 solve_singularity_handler sing_handler,
3883 bool calc_cond)
const
3891 if (nr != nc || nr != b.
rows ())
3893 (
"matrix dimension mismatch solution of linear equations");
3894 else if (nr == 0 || b.
cols () == 0)
3897 (*current_liboctave_error_handler)
3898 (
"calculation of condition number not implemented");
3902 int typ = mattype.
type ();
3923 DL[j] =
data (ii++);
3924 DU[j] =
data (ii++);
3926 D[nc-1] =
data (ii);
3943 else if (
ridx (i) == j + 1)
3945 else if (
ridx (i) == j - 1)
3950 F77_XFCN (zgttrf, ZGTTRF, (nr, DL, D, DU, DU2, pipvt, err));
3959 sing_handler (rcond);
3971 retval.
xcidx (0) = 0;
3986 nr, 1, DL, D, DU, DU2, pipvt,
3987 work, b.
rows (), err
3997 if (ii + new_nnz > x_nz)
4008 retval.
xridx (ii) = i;
4009 retval.
xdata (ii++) = work[i];
4011 retval.
xcidx (j+1) = ii;
4018 (*current_liboctave_error_handler) (
"incorrect matrix type");
4027 solve_singularity_handler sing_handler,
4028 bool calc_cond)
const
4036 if (nr != nc || nr != b.
rows ())
4038 (
"matrix dimension mismatch solution of linear equations");
4039 else if (nr == 0 || b.
cols () == 0)
4042 (*current_liboctave_error_handler)
4043 (
"calculation of condition number not implemented");
4047 volatile int typ = mattype.
type ();
4081 else if (
ridx (i) == j + 1)
4093 F77_XFCN (zptsv, ZPTSV, (nr, b_nc, D, DL, result,
4117 DL[j] =
data (ii++);
4118 DU[j] =
data (ii++);
4120 D[nc-1] =
data (ii);
4137 else if (
ridx (i) == j + 1)
4139 else if (
ridx (i) == j - 1)
4151 F77_XFCN (zgtsv, ZGTSV, (nr, b_nc, DL, D, DU, result,
4161 sing_handler (rcond);
4169 (*current_liboctave_error_handler) (
"incorrect matrix type");
4179 solve_singularity_handler sing_handler,
4180 bool calc_cond)
const
4188 if (nr != nc || nr != b.
rows ())
4190 (
"matrix dimension mismatch solution of linear equations");
4191 else if (nr == 0 || b.
cols () == 0)
4194 (*current_liboctave_error_handler)
4195 (
"calculation of condition number not implemented");
4199 int typ = mattype.
type ();
4220 DL[j] =
data (ii++);
4221 DU[j] =
data (ii++);
4223 D[nc-1] =
data (ii);
4240 else if (
ridx (i) == j + 1)
4242 else if (
ridx (i) == j - 1)
4247 F77_XFCN (zgttrf, ZGTTRF, (nr, DL, D, DU, DU2, pipvt, err));
4256 sing_handler (rcond);
4276 retval.
xcidx (0) = 0;
4285 nr, 1, DL, D, DU, DU2, pipvt,
4291 (*current_liboctave_error_handler)
4292 (
"SparseComplexMatrix::solve solve failed");
4305 if (ii + new_nnz > x_nz)
4316 retval.
xridx (ii) = i;
4317 retval.
xdata (ii++) = Bx[i];
4320 retval.
xcidx (j+1) = ii;
4327 (*current_liboctave_error_handler) (
"incorrect matrix type");
4336 solve_singularity_handler sing_handler,
4337 bool calc_cond)
const
4345 if (nr != nc || nr != b.
rows ())
4347 (
"matrix dimension mismatch solution of linear equations");
4348 else if (nr == 0 || b.
cols () == 0)
4353 volatile int typ = mattype.
type ();
4369 tmp_data[ii++] = 0.;
4377 m_band(ri - j, j) =
data (i);
4387 nr, n_lower, tmp_data, ldm, err
4410 nr, n_lower, tmp_data, ldm,
4411 anorm, rcond, pz, piz, err
4417 volatile double rcond_plus_one = rcond + 1.0;
4419 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
4425 sing_handler (rcond);
4444 nr, n_lower, b_nc, tmp_data,
4445 ldm, result, b.
rows (), err
4450 (*current_liboctave_error_handler)
4451 (
"SparseMatrix::solve solve failed");
4474 tmp_data[ii++] = 0.;
4479 m_band(
ridx (i) - j + n_lower + n_upper, j) =
data (i);
4498 F77_XFCN (zgbtrf, ZGBTRF, (nr, nc, n_lower, n_upper, tmp_data,
4510 sing_handler (rcond);
4528 nc, n_lower, n_upper, tmp_data, ldm, pipvt,
4529 anorm, rcond, pz, piz, err
4535 volatile double rcond_plus_one = rcond + 1.0;
4537 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
4543 sing_handler (rcond);
4563 nr, n_lower, n_upper, b_nc, tmp_data,
4564 ldm, pipvt, result, b.
rows (), err
4570 (*current_liboctave_error_handler) (
"incorrect matrix type");
4579 solve_singularity_handler sing_handler,
4580 bool calc_cond)
const
4588 if (nr != nc || nr != b.
rows ())
4590 (
"matrix dimension mismatch solution of linear equations");
4591 else if (nr == 0 || b.
cols () == 0)
4596 volatile int typ = mattype.
type ();
4613 tmp_data[ii++] = 0.;
4621 m_band(ri - j, j) =
data (i);
4631 nr, n_lower, tmp_data, ldm, err
4652 nr, n_lower, tmp_data, ldm,
4653 anorm, rcond, pz, piz, err
4659 volatile double rcond_plus_one = rcond + 1.0;
4661 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
4667 sing_handler (rcond);
4689 retval.
xcidx (0) = 0;
4693 Bx[i] = b.
elem (i, j);
4697 nr, n_lower, 1, tmp_data,
4703 (*current_liboctave_error_handler)
4704 (
"SparseComplexMatrix::solve solve failed");
4719 sz = (sz > 10 ? sz : 10) + x_nz;
4723 retval.
xdata (ii) = tmp;
4724 retval.
xridx (ii++) = i;
4727 retval.
xcidx (j+1) = ii;
4751 tmp_data[ii++] = 0.;
4756 m_band(
ridx (i) - j + n_lower + n_upper, j) =
data (i);
4775 F77_XFCN (zgbtrf, ZGBTRF, (nr, nr, n_lower, n_upper, tmp_data,
4785 sing_handler (rcond);
4803 nc, n_lower, n_upper, tmp_data, ldm, pipvt,
4804 anorm, rcond, pz, piz, err
4810 volatile double rcond_plus_one = rcond + 1.0;
4812 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
4818 sing_handler (rcond);
4834 retval.
xcidx (0) = 0;
4844 i < b.
cidx (j+1); i++)
4849 nr, n_lower, n_upper, 1, tmp_data,
4850 ldm, pipvt, work, b.
rows (), err
4860 if (ii + new_nnz > x_nz)
4871 retval.
xridx (ii) = i;
4872 retval.
xdata (ii++) = work[i];
4874 retval.
xcidx (j+1) = ii;
4882 (*current_liboctave_error_handler) (
"incorrect matrix type");
4891 solve_singularity_handler sing_handler,
4892 bool calc_cond)
const
4900 if (nr != nc || nr != b.
rows ())
4902 (
"matrix dimension mismatch solution of linear equations");
4903 else if (nr == 0 || b.
cols () == 0)
4908 volatile int typ = mattype.
type ();
4925 tmp_data[ii++] = 0.;
4933 m_band(ri - j, j) =
data (i);
4943 nr, n_lower, tmp_data, ldm, err
4966 nr, n_lower, tmp_data, ldm,
4967 anorm, rcond, pz, piz, err
4973 volatile double rcond_plus_one = rcond + 1.0;
4975 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
4981 sing_handler (rcond);
5000 nr, n_lower, b_nc, tmp_data,
5001 ldm, result, b_nr, err
5006 (*current_liboctave_error_handler)
5007 (
"SparseComplexMatrix::solve solve failed");
5030 tmp_data[ii++] = 0.;
5035 m_band(
ridx (i) - j + n_lower + n_upper, j) =
data (i);
5054 F77_XFCN (zgbtrf, ZGBTRF, (nr, nr, n_lower, n_upper, tmp_data,
5064 sing_handler (rcond);
5082 nc, n_lower, n_upper, tmp_data, ldm, pipvt,
5083 anorm, rcond, pz, piz, err
5089 volatile double rcond_plus_one = rcond + 1.0;
5091 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
5097 sing_handler (rcond);
5116 nr, n_lower, n_upper, b_nc, tmp_data,
5117 ldm, pipvt, result, b.
rows (), err
5123 (*current_liboctave_error_handler) (
"incorrect matrix type");
5132 solve_singularity_handler sing_handler,
5133 bool calc_cond)
const
5141 if (nr != nc || nr != b.
rows ())
5143 (
"matrix dimension mismatch solution of linear equations");
5144 else if (nr == 0 || b.
cols () == 0)
5149 volatile int typ = mattype.
type ();
5166 tmp_data[ii++] = 0.;
5174 m_band(ri - j, j) =
data (i);
5184 nr, n_lower, tmp_data, ldm, err
5208 nr, n_lower, tmp_data, ldm,
5209 anorm, rcond, pz, piz, err
5215 volatile double rcond_plus_one = rcond + 1.0;
5217 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
5223 sing_handler (rcond);
5245 retval.
xcidx (0) = 0;
5254 nr, n_lower, 1, tmp_data,
5260 (*current_liboctave_error_handler)
5261 (
"SparseMatrix::solve solve failed");
5273 if (ii + new_nnz > x_nz)
5284 retval.
xridx (ii) = i;
5285 retval.
xdata (ii++) = Bx[i];
5288 retval.
xcidx (j+1) = ii;
5312 tmp_data[ii++] = 0.;
5317 m_band(
ridx (i) - j + n_lower + n_upper, j) =
data (i);
5336 F77_XFCN (zgbtrf, ZGBTRF, (nr, nr, n_lower, n_upper, tmp_data,
5346 sing_handler (rcond);
5364 nc, n_lower, n_upper, tmp_data, ldm, pipvt,
5365 anorm, rcond, pz, piz, err
5371 volatile double rcond_plus_one = rcond + 1.0;
5373 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
5379 sing_handler (rcond);
5395 retval.
xcidx (0) = 0;
5406 i < b.
cidx (j+1); i++)
5411 nr, n_lower, n_upper, 1, tmp_data,
5412 ldm, pipvt, Bx, b.
rows (), err
5422 if (ii + new_nnz > x_nz)
5433 retval.
xridx (ii) = i;
5434 retval.
xdata (ii++) = Bx[i];
5436 retval.
xcidx (j+1) = ii;
5444 (*current_liboctave_error_handler) (
"incorrect matrix type");
5453 solve_singularity_handler sing_handler,
5454 bool calc_cond)
const
5462 Control =
Matrix (UMFPACK_CONTROL, 1);
5468 Control (UMFPACK_PRL) = tmp;
5472 Control (UMFPACK_SYM_PIVOT_TOLERANCE) = tmp;
5473 Control (UMFPACK_PIVOT_TOLERANCE) = tmp;
5479 Control (UMFPACK_FIXQ) = tmp;
5490 reinterpret_cast<const double *
> (Ax),
5494 Info =
Matrix (1, UMFPACK_INFO);
5497 reinterpret_cast<const double *
> (Ax),
5498 0, 0, &Symbolic, control, info);
5502 (*current_liboctave_error_handler)
5503 (
"SparseComplexMatrix::solve symbolic factorization failed");
5516 reinterpret_cast<const double *
> (Ax),
5517 0, Symbolic, &Numeric, control, info);
5521 rcond = Info (UMFPACK_RCOND);
5524 volatile double rcond_plus_one = rcond + 1.0;
5526 if (status == UMFPACK_WARNING_singular_matrix
5527 || rcond_plus_one == 1.0 ||
xisnan (rcond))
5534 sing_handler (rcond);
5538 else if (status < 0)
5540 (*current_liboctave_error_handler)
5541 (
"SparseComplexMatrix::solve numeric factorization failed");
5557 (*current_liboctave_error_handler) (
"UMFPACK not installed");
5566 solve_singularity_handler sing_handler,
5567 bool calc_cond)
const
5575 if (nr != nc || nr != b.
rows ())
5577 (
"matrix dimension mismatch solution of linear equations");
5578 else if (nr == 0 || b.
cols () == 0)
5583 volatile int typ = mattype.
type ();
5589 cholmod_common Common;
5590 cholmod_common *cm = &Common;
5593 CHOLMOD_NAME(start) (cm);
5594 cm->prefer_zomplex =
false;
5600 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, 0);
5604 cm->print =
static_cast<int> (spu) + 2;
5605 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &
SparseCholPrint);
5609 SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex);
5610 SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot);
5612 cm->final_ll =
true;
5614 cholmod_sparse Astore;
5615 cholmod_sparse *
A = &Astore;
5626 #ifdef USE_64_BIT_IDX_T
5627 A->itype = CHOLMOD_LONG;
5629 A->itype = CHOLMOD_INT;
5631 A->dtype = CHOLMOD_DOUBLE;
5633 A->xtype = CHOLMOD_COMPLEX;
5640 cholmod_dense Bstore;
5641 cholmod_dense *
B = &Bstore;
5642 B->nrow = b.
rows ();
5643 B->ncol = b.
cols ();
5645 B->nzmax = B->nrow * B->ncol;
5646 B->dtype = CHOLMOD_DOUBLE;
5647 B->xtype = CHOLMOD_REAL;
5648 if (nc < 1 || b.
cols () < 1)
5656 L = CHOLMOD_NAME(analyze) (
A, cm);
5659 rcond = CHOLMOD_NAME(rcond)(L, cm);
5672 volatile double rcond_plus_one = rcond + 1.0;
5674 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
5680 sing_handler (rcond);
5691 X = CHOLMOD_NAME(
solve) (CHOLMOD_A, L,
B, cm);
5699 retval.
xelem (i,j) =
static_cast<Complex *
>(X->x)[jr + i];
5703 CHOLMOD_NAME(free_dense) (&X, cm);
5704 CHOLMOD_NAME(free_factor) (&L, cm);
5705 CHOLMOD_NAME(finish) (cm);
5706 static char tmp[] =
" ";
5707 CHOLMOD_NAME(print_common) (tmp, cm);
5711 (*current_liboctave_warning_with_id_handler)
5712 (
"Octave:missing-dependency",
"CHOLMOD not installed");
5723 void *Numeric =
factorize (err, rcond, Control, Info,
5724 sing_handler, calc_cond);
5736 #ifdef UMFPACK_SEPARATE_SPLIT
5744 retval.
resize (b_nr, b_nc);
5749 #ifdef UMFPACK_SEPARATE_SPLIT
5752 reinterpret_cast<const double *
> (Ax),
5754 reinterpret_cast<double *> (&Xx[iidx]),
5756 &Bx[iidx], Bz, Numeric,
5760 Bz[i] = b.
elem (i, j);
5764 reinterpret_cast<const double *
> (Ax),
5766 reinterpret_cast<double *> (&Xx[iidx]),
5768 reinterpret_cast<const double *
> (Bz),
5775 (*current_liboctave_error_handler)
5776 (
"SparseComplexMatrix::solve solve failed");
5794 (*current_liboctave_error_handler) (
"UMFPACK not installed");
5798 (*current_liboctave_error_handler) (
"incorrect matrix type");
5807 solve_singularity_handler sing_handler,
5808 bool calc_cond)
const
5816 if (nr != nc || nr != b.
rows ())
5818 (
"matrix dimension mismatch solution of linear equations");
5819 else if (nr == 0 || b.
cols () == 0)
5824 volatile int typ = mattype.
type ();
5830 cholmod_common Common;
5831 cholmod_common *cm = &Common;
5834 CHOLMOD_NAME(start) (cm);
5835 cm->prefer_zomplex =
false;
5841 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, 0);
5845 cm->print =
static_cast<int> (spu) + 2;
5846 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &
SparseCholPrint);
5850 SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex);
5851 SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot);
5853 cm->final_ll =
true;
5855 cholmod_sparse Astore;
5856 cholmod_sparse *
A = &Astore;
5867 #ifdef USE_64_BIT_IDX_T
5868 A->itype = CHOLMOD_LONG;
5870 A->itype = CHOLMOD_INT;
5872 A->dtype = CHOLMOD_DOUBLE;
5874 A->xtype = CHOLMOD_COMPLEX;
5881 cholmod_sparse Bstore;
5882 cholmod_sparse *
B = &Bstore;
5883 B->nrow = b.
rows ();
5884 B->ncol = b.
cols ();
5887 B->nzmax = b.
nnz ();
5891 #ifdef USE_64_BIT_IDX_T
5892 B->itype = CHOLMOD_LONG;
5894 B->itype = CHOLMOD_INT;
5896 B->dtype = CHOLMOD_DOUBLE;
5898 B->xtype = CHOLMOD_REAL;
5900 if (b.
rows () < 1 || b.
cols () < 1)
5907 L = CHOLMOD_NAME(analyze) (
A, cm);
5910 rcond = CHOLMOD_NAME(rcond)(L, cm);
5923 volatile double rcond_plus_one = rcond + 1.0;
5925 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
5931 sing_handler (rcond);
5942 X = CHOLMOD_NAME(spsolve) (CHOLMOD_A, L,
B, cm);
5946 (static_cast<octave_idx_type>(X->nrow),
5947 static_cast<octave_idx_type>(X->ncol),
5948 static_cast<octave_idx_type>(X->nzmax));
5950 j <= static_cast<octave_idx_type>(X->ncol); j++)
5953 j < static_cast<octave_idx_type>(X->nzmax); j++)
5960 CHOLMOD_NAME(free_sparse) (&X, cm);
5961 CHOLMOD_NAME(free_factor) (&L, cm);
5962 CHOLMOD_NAME(finish) (cm);
5963 static char tmp[] =
" ";
5964 CHOLMOD_NAME(print_common) (tmp, cm);
5968 (*current_liboctave_warning_with_id_handler)
5969 (
"Octave:missing-dependency",
"CHOLMOD not installed");
5980 void *Numeric =
factorize (err, rcond, Control, Info,
5981 sing_handler, calc_cond);
5994 #ifdef UMFPACK_SEPARATE_SPLIT
6011 retval.
xcidx (0) = 0;
6015 #ifdef UMFPACK_SEPARATE_SPLIT
6017 Bx[i] = b.
elem (i, j);
6021 reinterpret_cast<const double *
> (Ax),
6023 reinterpret_cast<double *> (Xx),
6025 Bx, Bz, Numeric, control,
6029 Bz[i] = b.
elem (i, j);
6032 reinterpret_cast<const double *
> (Ax),
6034 reinterpret_cast<double *> (Xx),
6036 reinterpret_cast<double *
> (Bz),
6043 (*current_liboctave_error_handler)
6044 (
"SparseComplexMatrix::solve solve failed");
6062 sz = (sz > 10 ? sz : 10) + x_nz;
6066 retval.
xdata (ii) = tmp;
6067 retval.
xridx (ii++) = i;
6070 retval.
xcidx (j+1) = ii;
6083 (*current_liboctave_error_handler) (
"UMFPACK not installed");
6087 (*current_liboctave_error_handler) (
"incorrect matrix type");
6096 solve_singularity_handler sing_handler,
6097 bool calc_cond)
const
6105 if (nr != nc || nr != b.
rows ())
6107 (
"matrix dimension mismatch solution of linear equations");
6108 else if (nr == 0 || b.
cols () == 0)
6113 volatile int typ = mattype.
type ();
6119 cholmod_common Common;
6120 cholmod_common *cm = &Common;
6123 CHOLMOD_NAME(start) (cm);
6124 cm->prefer_zomplex =
false;
6130 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, 0);
6134 cm->print =
static_cast<int> (spu) + 2;
6135 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &
SparseCholPrint);
6139 SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex);
6140 SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot);
6142 cm->final_ll =
true;
6144 cholmod_sparse Astore;
6145 cholmod_sparse *
A = &Astore;
6156 #ifdef USE_64_BIT_IDX_T
6157 A->itype = CHOLMOD_LONG;
6159 A->itype = CHOLMOD_INT;
6161 A->dtype = CHOLMOD_DOUBLE;
6163 A->xtype = CHOLMOD_COMPLEX;
6170 cholmod_dense Bstore;
6171 cholmod_dense *
B = &Bstore;
6172 B->nrow = b.
rows ();
6173 B->ncol = b.
cols ();
6175 B->nzmax = B->nrow * B->ncol;
6176 B->dtype = CHOLMOD_DOUBLE;
6177 B->xtype = CHOLMOD_COMPLEX;
6178 if (nc < 1 || b.
cols () < 1)
6186 L = CHOLMOD_NAME(analyze) (
A, cm);
6189 rcond = CHOLMOD_NAME(rcond)(L, cm);
6202 volatile double rcond_plus_one = rcond + 1.0;
6204 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
6210 sing_handler (rcond);
6221 X = CHOLMOD_NAME(
solve) (CHOLMOD_A, L,
B, cm);
6229 retval.
xelem (i,j) =
static_cast<Complex *
>(X->x)[jr + i];
6233 CHOLMOD_NAME(free_dense) (&X, cm);
6234 CHOLMOD_NAME(free_factor) (&L, cm);
6235 CHOLMOD_NAME(finish) (cm);
6236 static char tmp[] =
" ";
6237 CHOLMOD_NAME(print_common) (tmp, cm);
6241 (*current_liboctave_warning_with_id_handler)
6242 (
"Octave:missing-dependency",
"CHOLMOD not installed");
6253 void *Numeric =
factorize (err, rcond, Control, Info,
6254 sing_handler, calc_cond);
6268 retval.
resize (b_nr, b_nc);
6275 reinterpret_cast<const double *
> (Ax),
6277 reinterpret_cast<double *> (&Xx[iidx]),
6279 reinterpret_cast<const double *
> (&Bx[iidx]),
6280 0, Numeric, control, info);
6284 (*current_liboctave_error_handler)
6285 (
"SparseComplexMatrix::solve solve failed");
6303 (*current_liboctave_error_handler) (
"UMFPACK not installed");
6307 (*current_liboctave_error_handler) (
"incorrect matrix type");
6316 solve_singularity_handler sing_handler,
6317 bool calc_cond)
const
6325 if (nr != nc || nr != b.
rows ())
6327 (
"matrix dimension mismatch solution of linear equations");
6328 else if (nr == 0 || b.
cols () == 0)
6333 volatile int typ = mattype.
type ();
6339 cholmod_common Common;
6340 cholmod_common *cm = &Common;
6343 CHOLMOD_NAME(start) (cm);
6344 cm->prefer_zomplex =
false;
6350 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, 0);
6354 cm->print =
static_cast<int> (spu) + 2;
6355 SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &
SparseCholPrint);
6359 SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex);
6360 SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot);
6362 cm->final_ll =
true;
6364 cholmod_sparse Astore;
6365 cholmod_sparse *
A = &Astore;
6376 #ifdef USE_64_BIT_IDX_T
6377 A->itype = CHOLMOD_LONG;
6379 A->itype = CHOLMOD_INT;
6381 A->dtype = CHOLMOD_DOUBLE;
6383 A->xtype = CHOLMOD_COMPLEX;
6390 cholmod_sparse Bstore;
6391 cholmod_sparse *
B = &Bstore;
6392 B->nrow = b.
rows ();
6393 B->ncol = b.
cols ();
6396 B->nzmax = b.
nnz ();
6400 #ifdef USE_64_BIT_IDX_T
6401 B->itype = CHOLMOD_LONG;
6403 B->itype = CHOLMOD_INT;
6405 B->dtype = CHOLMOD_DOUBLE;
6407 B->xtype = CHOLMOD_COMPLEX;
6409 if (b.
rows () < 1 || b.
cols () < 1)
6416 L = CHOLMOD_NAME(analyze) (
A, cm);
6419 rcond = CHOLMOD_NAME(rcond)(L, cm);
6432 volatile double rcond_plus_one = rcond + 1.0;
6434 if (rcond_plus_one == 1.0 ||
xisnan (rcond))
6440 sing_handler (rcond);
6451 X = CHOLMOD_NAME(spsolve) (CHOLMOD_A, L,
B, cm);
6455 (static_cast<octave_idx_type>(X->nrow),
6456 static_cast<octave_idx_type>(X->ncol),
6457 static_cast<octave_idx_type>(X->nzmax));
6459 j <= static_cast<octave_idx_type>(X->ncol); j++)
6462 j < static_cast<octave_idx_type>(X->nzmax); j++)
6469 CHOLMOD_NAME(free_sparse) (&X, cm);
6470 CHOLMOD_NAME(free_factor) (&L, cm);
6471 CHOLMOD_NAME(finish) (cm);
6472 static char tmp[] =
" ";
6473 CHOLMOD_NAME(print_common) (tmp, cm);
6477 (*current_liboctave_warning_with_id_handler)
6478 (
"Octave:missing-dependency",
"CHOLMOD not installed");
6489 void *Numeric =
factorize (err, rcond, Control, Info,
6490 sing_handler, calc_cond);
6513 retval.
xcidx (0) = 0;
6521 reinterpret_cast<const double *
> (Ax),
6523 reinterpret_cast<double *> (Xx),
6525 reinterpret_cast<double *
> (Bx),
6526 0, Numeric, control, info);
6530 (*current_liboctave_error_handler)
6531 (
"SparseComplexMatrix::solve solve failed");
6549 sz = (sz > 10 ? sz : 10) + x_nz;
6553 retval.
xdata (ii) = tmp;
6554 retval.
xridx (ii++) = i;
6557 retval.
xcidx (j+1) = ii;
6562 rcond = Info (UMFPACK_RCOND);
6563 volatile double rcond_plus_one = rcond + 1.0;
6565 if (status == UMFPACK_WARNING_singular_matrix
6566 || rcond_plus_one == 1.0 ||
xisnan (rcond))
6571 sing_handler (rcond);
6584 (*current_liboctave_error_handler) (
"UMFPACK not installed");
6588 (*current_liboctave_error_handler) (
"incorrect matrix type");
6599 return solve (mattype, b, info, rcond, 0);
6607 return solve (mattype, b, info, rcond, 0);
6614 return solve (mattype, b, info, rcond, 0);
6620 solve_singularity_handler sing_handler,
6621 bool singular_fallback)
const
6624 int typ = mattype.
type (
false);
6627 typ = mattype.
type (*
this);
6630 retval =
dsolve (mattype, b, err, rcond, sing_handler,
false);
6632 retval =
utsolve (mattype, b, err, rcond, sing_handler,
false);
6634 retval =
ltsolve (mattype, b, err, rcond, sing_handler,
false);
6636 retval =
bsolve (mattype, b, err, rcond, sing_handler,
false);
6639 retval =
trisolve (mattype, b, err, rcond, sing_handler,
false);
6641 retval =
fsolve (mattype, b, err, rcond, sing_handler,
true);
6644 (*current_liboctave_error_handler) (
"unknown matrix type");
6652 retval =
qrsolve (*
this, b, err);
6654 retval = dmsolve<ComplexMatrix, SparseComplexMatrix, Matrix>
6667 return solve (mattype, b, info, rcond, 0);
6675 return solve (mattype, b, info, rcond, 0);
6682 return solve (mattype, b, info, rcond, 0);
6688 solve_singularity_handler sing_handler,
6689 bool singular_fallback)
const
6692 int typ = mattype.
type (
false);
6695 typ = mattype.
type (*
this);
6698 retval =
dsolve (mattype, b, err, rcond, sing_handler,
false);
6700 retval =
utsolve (mattype, b, err, rcond, sing_handler,
false);
6702 retval =
ltsolve (mattype, b, err, rcond, sing_handler,
false);
6704 retval =
bsolve (mattype, b, err, rcond, sing_handler,
false);
6707 retval =
trisolve (mattype, b, err, rcond, sing_handler,
false);
6709 retval =
fsolve (mattype, b, err, rcond, sing_handler,
true);
6712 (*current_liboctave_error_handler) (
"unknown matrix type");
6720 retval =
qrsolve (*
this, b, err);
6722 retval = dmsolve<SparseComplexMatrix, SparseComplexMatrix, SparseMatrix>
6735 return solve (mattype, b, info, rcond, 0);
6743 return solve (mattype, b, info, rcond, 0);
6750 return solve (mattype, b, info, rcond, 0);
6756 solve_singularity_handler sing_handler,
6757 bool singular_fallback)
const
6760 int typ = mattype.
type (
false);
6763 typ = mattype.
type (*
this);
6766 retval =
dsolve (mattype, b, err, rcond, sing_handler,
false);
6768 retval =
utsolve (mattype, b, err, rcond, sing_handler,
false);
6770 retval =
ltsolve (mattype, b, err, rcond, sing_handler,
false);
6772 retval =
bsolve (mattype, b, err, rcond, sing_handler,
false);
6775 retval =
trisolve (mattype, b, err, rcond, sing_handler,
false);
6777 retval =
fsolve (mattype, b, err, rcond, sing_handler,
true);
6780 (*current_liboctave_error_handler) (
"unknown matrix type");
6788 retval =
qrsolve (*
this, b, err);
6790 retval = dmsolve<ComplexMatrix, SparseComplexMatrix, ComplexMatrix>
6804 return solve (mattype, b, info, rcond, 0);
6812 return solve (mattype, b, info, rcond, 0);
6819 return solve (mattype, b, info, rcond, 0);
6825 solve_singularity_handler sing_handler,
6826 bool singular_fallback)
const
6829 int typ = mattype.
type (
false);
6832 typ = mattype.
type (*
this);
6835 retval =
dsolve (mattype, b, err, rcond, sing_handler,
false);
6837 retval =
utsolve (mattype, b, err, rcond, sing_handler,
false);
6839 retval =
ltsolve (mattype, b, err, rcond, sing_handler,
false);
6841 retval =
bsolve (mattype, b, err, rcond, sing_handler,
false);
6844 retval =
trisolve (mattype, b, err, rcond, sing_handler,
false);
6846 retval =
fsolve (mattype, b, err, rcond, sing_handler,
true);
6849 (*current_liboctave_error_handler) (
"unknown matrix type");
6857 retval =
qrsolve (*
this, b, err);
6860 SparseComplexMatrix> (*
this, b, err);
6871 return solve (mattype, b, info, rcond);
6879 return solve (mattype, b, info, rcond);
6886 return solve (mattype, b, info, rcond, 0);
6892 solve_singularity_handler sing_handler)
const
6895 return solve (mattype, tmp, info, rcond,
6896 sing_handler).
column (static_cast<octave_idx_type> (0));
6905 return solve (mattype, b, info, rcond, 0);
6913 return solve (mattype, b, info, rcond, 0);
6920 return solve (mattype, b, info, rcond, 0);
6926 solve_singularity_handler sing_handler)
const
6929 return solve (mattype, tmp, info, rcond,
6930 sing_handler).
column (static_cast<octave_idx_type> (0));
6938 return solve (b, info, rcond, 0);
6945 return solve (b, info, rcond, 0);
6950 double& rcond)
const
6952 return solve (b, info, rcond, 0);
6958 solve_singularity_handler sing_handler)
const
6961 return solve (mattype, b, err, rcond, sing_handler);
6969 return solve (b, info, rcond, 0);
6977 return solve (b, info, rcond, 0);
6984 return solve (b, info, rcond, 0);
6990 solve_singularity_handler sing_handler)
const
6993 return solve (mattype, b, err, rcond, sing_handler);
7001 return solve (b, info, rcond, 0);
7008 return solve (b, info, rcond, 0);
7014 solve_singularity_handler sing_handler)
const
7017 return solve (mattype, b, err, rcond, sing_handler);
7025 return solve (b, info, rcond, 0);
7033 return solve (b, info, rcond, 0);
7040 return solve (b, info, rcond, 0);
7046 solve_singularity_handler sing_handler)
const
7049 return solve (mattype, b, err, rcond, sing_handler);
7056 return solve (b, info, rcond);
7063 return solve (b, info, rcond);
7068 double& rcond)
const
7070 return solve (b, info, rcond, 0);
7076 solve_singularity_handler sing_handler)
const
7079 return solve (tmp, info, rcond,
7080 sing_handler).
column (static_cast<octave_idx_type> (0));
7088 return solve (b, info, rcond, 0);
7096 return solve (b, info, rcond, 0);
7101 double& rcond)
const
7103 return solve (b, info, rcond, 0);
7109 solve_singularity_handler sing_handler)
const
7112 return solve (tmp, info, rcond,
7113 sing_handler).
column (static_cast<octave_idx_type> (0));
7137 if (jj <
cidx (i+1) &&
ridx (jj) == j)
7237 if (r_val > max_val)
7240 if (i_val > max_val)
7243 if (r_val < min_val)
7246 if (i_val < min_val)
7249 if (
D_NINT (r_val) != r_val ||
D_NINT (i_val) != i_val)
7291 if ((
rows () == 1 && dim == -1) || dim == 1)
7296 (
cidx (j+1) -
cidx (j) < nr ? 0.0 : 1.0), 1.0);
7310 Complex d = data (i); \
7311 tmp[ridx (i)] += d * conj (d)
7314 Complex d = data (i); \
7315 tmp[j] += d * conj (d)
7361 os << a.
ridx (i) + 1 <<
" " << j + 1 <<
" ";
7375 return read_sparse_matrix<elt_type> (is, a, octave_read_value<Complex>);
7460 return do_mul_dm_sm<SparseComplexMatrix> (
d, a);
7465 return do_mul_sm_dm<SparseComplexMatrix> (a,
d);
7471 return do_mul_dm_sm<SparseComplexMatrix> (
d, a);
7476 return do_mul_sm_dm<SparseComplexMatrix> (a,
d);
7482 return do_mul_dm_sm<SparseComplexMatrix> (
d, a);
7487 return do_mul_sm_dm<SparseComplexMatrix> (a,
d);
7493 return do_add_dm_sm<SparseComplexMatrix> (
d, a);
7498 return do_add_dm_sm<SparseComplexMatrix> (
d, a);
7503 return do_add_dm_sm<SparseComplexMatrix> (
d, a);
7508 return do_add_sm_dm<SparseComplexMatrix> (a,
d);
7513 return do_add_sm_dm<SparseComplexMatrix> (a,
d);
7518 return do_add_sm_dm<SparseComplexMatrix> (a,
d);
7524 return do_sub_dm_sm<SparseComplexMatrix> (
d, a);
7529 return do_sub_dm_sm<SparseComplexMatrix> (
d, a);
7534 return do_sub_dm_sm<SparseComplexMatrix> (
d, a);
7539 return do_sub_sm_dm<SparseComplexMatrix> (a,
d);
7544 return do_sub_sm_dm<SparseComplexMatrix> (a,
d);
7549 return do_sub_sm_dm<SparseComplexMatrix> (a,
d);
7568 #define EMPTY_RETURN_CHECK(T) \
7569 if (nr == 0 || nc == 0) \
7612 if (a_nr == b_nr && a_nc == b_nc)
7622 bool ja_lt_max= ja < ja_max;
7626 bool jb_lt_max = jb < jb_max;
7628 while (ja_lt_max || jb_lt_max)
7631 if ((! jb_lt_max) || (ja_lt_max && (a.
ridx (ja) < b.
ridx (jb))))
7641 ja_lt_max= ja < ja_max;
7643 else if ((! ja_lt_max)
7644 || (jb_lt_max && (b.
ridx (jb) < a.
ridx (ja))))
7654 jb_lt_max= jb < jb_max;
7666 ja_lt_max= ja < ja_max;
7668 jb_lt_max= jb < jb_max;
7678 if (a_nr == 0 || a_nc == 0)
7680 else if (b_nr == 0 || b_nc == 0)
7700 if (
xmax (c, 0.) != 0.)
7729 if (a_nr == b_nr && a_nc == b_nc)
7739 bool ja_lt_max= ja < ja_max;
7743 bool jb_lt_max = jb < jb_max;
7745 while (ja_lt_max || jb_lt_max)
7748 if ((! jb_lt_max) || (ja_lt_max && (a.
ridx (ja) < b.
ridx (jb))))
7758 ja_lt_max= ja < ja_max;
7760 else if ((! ja_lt_max)
7761 || (jb_lt_max && (b.
ridx (jb) < a.
ridx (ja))))
7771 jb_lt_max= jb < jb_max;
7783 ja_lt_max= ja < ja_max;
7785 jb_lt_max= jb < jb_max;
7795 if (a_nr == 0 || a_nc == 0)
7797 else if (b_nr == 0 || b_nc == 0)
friend SparseComplexMatrix conj(const SparseComplexMatrix &a)
SparseComplexMatrix cumsum(int dim=-1) const
octave_idx_type * xridx(void)
ComplexMatrix bsolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
octave_idx_type cols(void) const
bool operator==(const SparseComplexMatrix &a) const
#define F77_CHAR_ARG_LEN(l)
void gripe_nonconformant(const char *op, octave_idx_type op1_len, octave_idx_type op2_len)
std::istream & operator>>(std::istream &is, SparseComplexMatrix &a)
SparseComplexMatrix reshape(const dim_vector &new_dims) const
bool any_element_is_inf_or_nan(void) const
SparseComplexMatrix cumprod(int dim=-1) const
octave_idx_type rows(void) const
#define SPARSE_CUMPROD(RET_TYPE, ELT_TYPE, FCN)
ComplexMatrix solve(MatrixType &typ, const Matrix &b) const
ComplexMatrix matrix_value(void) const
const octave_base_value const Array< octave_idx_type > & ra_idx
SparseComplexMatrix max(const Complex &c, const SparseComplexMatrix &m)
Complex & elem(octave_idx_type n)
SparseComplexMatrix permute(const Array< octave_idx_type > &vec, bool inv=false) const
SparseMatrix transpose(void) const
F77_RET_T const octave_idx_type const octave_idx_type const octave_idx_type Complex const octave_idx_type octave_idx_type octave_idx_type &F77_RET_T const octave_idx_type const octave_idx_type const octave_idx_type const octave_idx_type const Complex const octave_idx_type const octave_idx_type Complex const octave_idx_type octave_idx_type & F77_CHAR_ARG_LEN_DECL
dim_vector dims(void) const
#define SPARSE_BASE_REDUCTION_OP(RET_TYPE, EL_TYPE, ROW_EXPR, COL_EXPR, INIT_VAL, MT_RESULT)
std::ostream & operator<<(std::ostream &os, const SparseComplexMatrix &a)
ComplexMatrix dsolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
SparseComplexMatrix inverse(void) const
void SparseCholError(int status, char *file, int line, char *message)
F77_RET_T const octave_idx_type Complex * A
SM octinternal_do_mul_pm_sm(const PermMatrix &p, const SM &a)
SparseBoolMatrix operator!(void) const
ComplexColumnVector column(octave_idx_type i) const
Complex xmax(const Complex &x, const Complex &y)
#define SPARSE_SMSM_BOOL_OPS(M1, M2, ZERO)
void octave_write_complex(std::ostream &os, const Complex &c)
octave_idx_type * xcidx(void)
SparseComplexMatrix prod(int dim=-1) const
RowVector row(octave_idx_type i) const
SparseComplexMatrix concat(const SparseComplexMatrix &rb, const Array< octave_idx_type > &ra_idx)
SM octinternal_do_mul_sm_pm(const SM &a, const PermMatrix &p)
#define SPARSE_FULL_TRANS_MUL(RET_TYPE, EL_TYPE, ZERO, CONJ_OP)
SparseComplexMatrix operator*(const SparseComplexMatrix &m, const SparseMatrix &a)
Complex xmin(const Complex &x, const Complex &y)
octave_idx_type * cidx(void)
F77_RET_T F77_FUNC(zgbtrf, ZGBTRF)(const octave_idx_type &
T & elem(octave_idx_type n)
bool is_hermitian(void) const
#define SPARSE_REDUCTION_OP(RET_TYPE, EL_TYPE, OP, INIT_VAL, MT_RESULT)
octave_idx_type columns(void) const
bool is_dense(void) const
void * factorize(octave_idx_type &err, double &rcond, Matrix &Control, Matrix &Info, solve_singularity_handler sing_handler, bool calc_cond) const
SparseBoolMatrix any(int dim=-1) const
#define FULL_SPARSE_MUL(RET_TYPE, EL_TYPE, ZERO)
#define F77_XFCN(f, F, args)
static double get_key(const std::string &key)
SparseComplexMatrix max(int dim=-1) const
SparseComplexMatrix min(int dim=-1) const
int first_non_singleton(int def=0) const
octave_idx_type rows(void) const
#define SPARSE_SMS_CMP_OPS(M, MZ, CM, S, SZ, CS)
F77_RET_T const double const double double * d
#define SPARSE_FULL_MUL(RET_TYPE, EL_TYPE, ZERO)
ComplexMatrix mul_trans(const ComplexMatrix &m, const SparseComplexMatrix &a)
#define F77_CONST_CHAR_ARG2(x, l)
octave_idx_type * triangular_perm(void) const
octave_idx_type nnz(void) const
SparseComplexMatrix squeeze(void) const
SparseComplexMatrix transpose(void) const
#define SPARSE_ALL_OP(DIM)
SparseComplexMatrix(void)
static const Complex Complex_NaN_result((lo_ieee_nan_value()),(lo_ieee_nan_value()))
MSparse< T > squeeze(void) const
bool mx_inline_all_real(size_t n, const std::complex< T > *x)
SparseComplexMatrix operator-(const ComplexDiagMatrix &d, const SparseMatrix &a)
#define SPARSE_ANY_OP(DIM)
bool is_hermitian(void) const
liboctave_error_handler current_liboctave_error_handler
int type(bool quiet=true)
ComplexRowVector row(octave_idx_type i) const
#define SPARSE_CUMSUM(RET_TYPE, ELT_TYPE, FCN)
#define FULL_SPARSE_MUL_TRANS(RET_TYPE, EL_TYPE, ZERO, CONJ_OP)
ComplexMatrix herm_mul(const SparseComplexMatrix &m, const ComplexMatrix &a)
void change_capacity(octave_idx_type nz)
SparseComplexMatrix dinverse(MatrixType &mattyp, octave_idx_type &info, double &rcond, const bool force=false, const bool calccond=true) const
MatrixType transpose(void) const
#define SPARSE_SPARSE_MUL(RET_TYPE, RET_EL_TYPE, EL_TYPE)
Sparse< T > maybe_compress(bool remove_zeros=false)
void gripe_nan_to_logical_conversion(void)
void resize(octave_idx_type r, octave_idx_type c)
MSparse< T > & insert(const Sparse< T > &a, octave_idx_type r, octave_idx_type c)
SparseMatrix abs(void) const
ComplexMatrix trisolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
ComplexDET determinant(void) const
void resize(const dim_vector &dv, const T &rfv)
ComplexMatrix mul_herm(const ComplexMatrix &m, const SparseComplexMatrix &a)
#define EMPTY_RETURN_CHECK(T)
bool too_large_for_float(void) const
void mark_as_unsymmetric(void)
SparseComplexMatrix sumsq(int dim=-1) const
MSparse< T > permute(const Array< octave_idx_type > &vec, bool inv=false) const
void gripe_singular_matrix(double rcond)
SparseComplexMatrix min(const Complex &c, const SparseComplexMatrix &m)
SparseComplexMatrix hermitian(void) const
MSparse< T > ipermute(const Array< octave_idx_type > &vec) const
SparseComplexMatrix tinverse(MatrixType &mattyp, octave_idx_type &info, double &rcond, const bool force=false, const bool calccond=true) const
SparseComplexMatrix & insert(const SparseComplexMatrix &a, octave_idx_type r, octave_idx_type c)
OCTAVE_API double D_NINT(double x)
void mark_as_rectangular(void)
octave_idx_type nnz(void) const
Count nonzero elements.
SparseBoolMatrix all(int dim=-1) const
#define SPARSE_SMSM_CMP_OPS(M1, Z1, C1, M2, Z2, C2)
T & xelem(octave_idx_type n)
friend class ComplexMatrix
bool all_elements_are_real(void) const
octave_idx_type cols(void) const
SparseComplexMatrix operator+(const ComplexDiagMatrix &d, const SparseMatrix &a)
SparseComplexMatrix L(void) const
int SparseCholPrint(const char *fmt,...)
octave_idx_type * ridx(void)
F77_RET_T const octave_idx_type Complex const octave_idx_type Complex * B
ComplexMatrix utsolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
#define END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE
bool any_element_is_nan(void) const
void resize(octave_idx_type nr, octave_idx_type nc, const Complex &rfv=Complex(0))
ComplexMatrix fsolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
ComplexMatrix qrsolve(const SparseComplexMatrix &a, const Matrix &b, octave_idx_type &info)
#define F77_CONST_CHAR_ARG_DECL
ComplexMatrix trans_mul(const SparseComplexMatrix &m, const ComplexMatrix &a)
#define SPARSE_SSM_CMP_OPS(S, SZ, SC, M, MZ, MC)
bool test_any(F fcn) const
SparseComplexMatrix sum(int dim=-1) const
#define UMFPACK_ZNAME(name)
SparseComplexMatrix conj(const SparseComplexMatrix &a)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
SparseComplexMatrix diag(octave_idx_type k=0) const
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
bool xtoo_large_for_float(double x)
ColumnVector imag(const ComplexColumnVector &a)
base_det< Complex > ComplexDET
#define SPARSE_SMS_BOOL_OPS(M, S, ZERO)
ComplexMatrix ltsolve(MatrixType &typ, const Matrix &b, octave_idx_type &info, double &rcond, solve_singularity_handler sing_handler, bool calc_cond=false) const
#define BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE
Matrix sum(int dim=-1) const
std::complex< double > Complex
const T * fortran_vec(void) const
MSparse< T > diag(octave_idx_type k=0) const
#define SPARSE_SSM_BOOL_OPS(S, M, ZERO)
ColumnVector real(const ComplexColumnVector &a)
octave_idx_type cols(void) const
SparseComplexMatrix ipermute(const Array< octave_idx_type > &vec) const
bool operator!=(const SparseComplexMatrix &a) const
bool all_integers(double &max_val, double &min_val) const
ComplexColumnVector column(octave_idx_type i) const
RT dmsolve(const ST &a, const T &b, octave_idx_type &info)
octave_idx_type length(void) const
MSparse< T > reshape(const dim_vector &new_dims) const
Array< T > array_value(void) const
SparseMatrix Q(void) const