44 bandden (0), upper_band (0),
45 lower_band (0), dense (false), full (false), nperm (0), perm (0) { }
48 : typ (a.typ), sp_bandden (a.sp_bandden), bandden (a.bandden),
49 upper_band (a.upper_band), lower_band (a.lower_band),
50 dense (a.dense), full (a.full), nperm (a.nperm), perm (0)
74 bool hermitian =
true;
80 j < ncols && upper; j++)
83 upper = upper && (d != zero);
84 lower = lower && (d != zero);
85 hermitian = hermitian && (d > zero);
90 j < ncols && (upper || lower || hermitian); j++)
94 double aij = a.
elem (i,j), aji = a.
elem (j,i);
95 lower = lower && (aij == zero);
96 upper = upper && (aji == zero);
97 hermitian = hermitian && (aij == aji
98 && aij*aij < diag[i]*diag[j]);
132 bool hermitian =
true;
138 j < ncols && upper; j++)
140 std::complex<T>
d = a.elem (j,j);
141 upper = upper && (d != zero);
142 lower = lower && (d != zero);
143 hermitian = hermitian && (d.real () > zero && d.imag () == zero);
148 j < ncols && (upper || lower || hermitian); j++)
152 std::complex<T> aij = a.elem (i,j), aji = a.elem (j,i);
153 lower = lower && (aij == zero);
154 upper = upper && (aji == zero);
155 hermitian = hermitian && (aij ==
std::conj (aji)
167 else if (ncols == nrows)
178 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
179 dense (false), full (true), nperm (0), perm (0)
186 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
187 dense (false), full (true), nperm (0), perm (0)
195 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
196 dense (false), full (true), nperm (0), perm (0)
203 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
204 dense (false), full (true), nperm (0), perm (0)
211 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
212 dense (false), full (false), nperm (0), perm (0)
220 (*current_liboctave_warning_handler)
221 (
"Calculating Sparse Matrix Type");
224 bool maybe_hermitian =
false;
232 for (i = 0; i < nm; i++)
248 std::vector<bool> found (nrows);
257 if ((a.
cidx (j+1) > a.
cidx (j) + 1) ||
258 ((a.
cidx (j+1) == a.
cidx (j) + 1) && found[a.
ridx (j)]))
263 found[a.
ridx (j)] =
true;
272 bool singular =
false;
277 bool zero_on_diagonal =
false;
280 zero_on_diagonal =
true;
284 zero_on_diagonal =
false;
289 if (zero_on_diagonal)
316 if (nrows == ncols && sp_bandden != 1. &&
bandden > sp_bandden)
327 if (nnz_in_band == nnz)
338 maybe_hermitian =
true;
361 if ((a.
cidx (j+1) - a.
cidx (j)) > 0 &&
385 else if (a.
cidx (nm) == a.
cidx (ncols))
483 double d = a.
data (i);
501 double d = a.
data (i);
502 if (d*d < diag(j)*diag(k))
508 is_herm = a.
data (l) ==
d;
530 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
531 dense (false), full (false), nperm (0), perm (0)
539 (*current_liboctave_warning_handler)
540 (
"Calculating Sparse Matrix Type");
543 bool maybe_hermitian =
false;
551 for (i = 0; i < nm; i++)
567 std::vector<bool> found (nrows);
576 if ((a.
cidx (j+1) > a.
cidx (j) + 1) ||
577 ((a.
cidx (j+1) == a.
cidx (j) + 1) && found[a.
ridx (j)]))
582 found[a.
ridx (j)] =
true;
591 bool singular =
false;
596 bool zero_on_diagonal =
false;
599 zero_on_diagonal =
true;
603 zero_on_diagonal =
false;
608 if (zero_on_diagonal)
635 if (nrows == ncols && sp_bandden != 1. &&
bandden > sp_bandden)
646 if (nnz_in_band == nnz)
657 maybe_hermitian =
true;
680 if ((a.
cidx (j+1) - a.
cidx (j)) > 0 &&
704 else if (a.
cidx (nm) == a.
cidx (ncols))
803 is_herm = d.real () > 0. && d.imag () == 0.;
827 is_herm = a.
data (l) ==
d;
850 bandden (0), upper_band (0), lower_band (0),
851 dense (false), full (_full), nperm (0), perm (0)
867 bandden (0), upper_band (0), lower_band (0),
868 dense (false), full (_full), nperm (0), perm (0)
887 bandden (0), upper_band (0), lower_band (0),
888 dense (false), full (_full), nperm (0), perm (0)
947 (*current_liboctave_warning_handler)
948 (
"Using Cached Matrix Type");
955 (*current_liboctave_warning_handler)
956 (
"Invalidating Matrix Type");
970 (*current_liboctave_warning_handler)
971 (
"Using Cached Matrix Type");
1003 (*current_liboctave_warning_handler)
1004 (
"Using Cached Matrix Type");
1035 (*current_liboctave_warning_handler)
1036 (
"Using Cached Matrix Type");
1062 (*current_liboctave_warning_handler)
1063 (
"Using Cached Matrix Type");
1089 (*current_liboctave_warning_handler)
1090 (
"Using Cached Matrix Type");
1116 (*current_liboctave_warning_handler)
1117 (
"Using Cached Matrix Type");
1143 (*current_liboctave_warning_handler)
1144 (
"Unknown Matrix Type");
1146 (*current_liboctave_warning_handler)
1147 (
"Diagonal Sparse Matrix");
1149 (*current_liboctave_warning_handler)
1150 (
"Permuted Diagonal Sparse Matrix");
1152 (*current_liboctave_warning_handler)
1153 (
"Upper Triangular Matrix");
1155 (*current_liboctave_warning_handler)
1156 (
"Lower Triangular Matrix");
1158 (*current_liboctave_warning_handler)
1159 (
"Permuted Upper Triangular Matrix");
1161 (*current_liboctave_warning_handler)
1162 (
"Permuted Lower Triangular Matrix");
1164 (*current_liboctave_warning_handler)
1165 (
"Banded Sparse Matrix %d-1-%d (Density %f)",
lower_band,
1168 (*current_liboctave_warning_handler)
1169 (
"Banded Hermitian/Symmetric Sparse Matrix %d-1-%d (Density %f)",
1172 (*current_liboctave_warning_handler)
1173 (
"Hermitian/Symmetric Matrix");
1175 (*current_liboctave_warning_handler)
1176 (
"Tridiagonal Sparse Matrix");
1178 (*current_liboctave_warning_handler)
1179 (
"Hermitian/Symmetric Tridiagonal Sparse Matrix");
1181 (*current_liboctave_warning_handler)
1182 (
"Rectangular/Singular Matrix");
1184 (*current_liboctave_warning_handler)
1203 (
"Can not mark current matrix type as symmetric");
1237 (
"Can not mark current matrix type as symmetric");