44 (*current_liboctave_warning_with_id_handler)
45 (
"Octave:matrix-type-info",
"using cached matrix type");
51 (*current_liboctave_warning_with_id_handler)
52 (
"Octave:matrix-type-info",
"invalid matrix type");
58 (*current_liboctave_warning_with_id_handler)
59 (
"Octave:matrix-type-info",
"calculating sparse matrix type");
67 bandden (0), upper_band (0),
68 lower_band (0), dense (false), full (false), nperm (0), perm (0) { }
71 : typ (a.typ), sp_bandden (a.sp_bandden), bandden (a.bandden),
72 upper_band (a.upper_band), lower_band (a.lower_band),
73 dense (a.dense), full (a.full), nperm (a.nperm), perm (0)
97 bool hermitian =
true;
103 j < ncols && upper; j++)
106 upper = upper && (d != zero);
107 lower = lower && (d != zero);
108 hermitian = hermitian && (d > zero);
113 j < ncols && (upper || lower || hermitian); j++)
117 double aij = a.
elem (i,j);
118 double aji = a.
elem (j,i);
119 lower = lower && (aij == zero);
120 upper = upper && (aji == zero);
121 hermitian = hermitian && (aij == aji
122 && aij*aij < diag[i]*diag[j]);
156 bool hermitian =
true;
162 j < ncols && upper; j++)
164 std::complex<T>
d = a.elem (j,j);
165 upper = upper && (d != zero);
166 lower = lower && (d != zero);
167 hermitian = hermitian && (d.real () > zero && d.imag () == zero);
172 j < ncols && (upper || lower || hermitian); j++)
176 std::complex<T> aij = a.elem (i,j);
177 std::complex<T> aji = a.elem (j,i);
178 lower = lower && (aij == zero);
179 upper = upper && (aji == zero);
180 hermitian = hermitian && (aij ==
std::conj (aji)
192 else if (ncols == nrows)
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 (true), nperm (0), perm (0)
220 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
221 dense (false), full (true), nperm (0), perm (0)
228 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
229 dense (false), full (true), nperm (0), perm (0)
236 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
237 dense (false), full (false), nperm (0), perm (0)
248 bool maybe_hermitian =
false;
256 for (i = 0; i < nm; i++)
272 std::vector<bool> found (nrows);
282 || ((a.
cidx (j+1) == a.
cidx (j) + 1) && found[a.
ridx (j)]))
287 found[a.
ridx (j)] =
true;
296 bool singular =
false;
301 bool zero_on_diagonal =
false;
304 zero_on_diagonal =
true;
308 zero_on_diagonal =
false;
313 if (zero_on_diagonal)
351 if (nnz_in_band == nnz)
362 maybe_hermitian =
true;
409 else if (a.
cidx (nm) == a.
cidx (ncols))
507 double d = a.
data (i);
525 double d = a.
data (i);
526 if (d*d < diag(j)*diag(k))
532 is_herm = a.
data (l) ==
d;
554 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
555 dense (false), full (false), nperm (0), perm (0)
566 bool maybe_hermitian =
false;
574 for (i = 0; i < nm; i++)
590 std::vector<bool> found (nrows);
600 || ((a.
cidx (j+1) == a.
cidx (j) + 1) && found[a.
ridx (j)]))
605 found[a.
ridx (j)] =
true;
614 bool singular =
false;
619 bool zero_on_diagonal =
false;
622 zero_on_diagonal =
true;
626 zero_on_diagonal =
false;
631 if (zero_on_diagonal)
669 if (nnz_in_band == nnz)
680 maybe_hermitian =
true;
727 else if (a.
cidx (nm) == a.
cidx (ncols))
826 is_herm = d.real () > 0. && d.imag () == 0.;
850 is_herm = a.
data (l) ==
d;
873 bandden (0), upper_band (0), lower_band (0),
874 dense (false), full (_full), nperm (0), perm (0)
890 bandden (0), upper_band (0), lower_band (0),
891 dense (false), full (_full), nperm (0), perm (0)
910 bandden (0), upper_band (0), lower_band (0),
911 dense (false), full (_full), nperm (0), perm (0)
976 (*current_liboctave_warning_with_id_handler)
977 (
"Octave:matrix-type-info",
"invalidating matrix type");
1158 (*current_liboctave_warning_with_id_handler)
1159 (
"Octave:matrix-type-info",
"unknown matrix type");
1161 (*current_liboctave_warning_with_id_handler)
1162 (
"Octave:matrix-type-info",
"diagonal sparse matrix");
1164 (*current_liboctave_warning_with_id_handler)
1165 (
"Octave:matrix-type-info",
"permuted diagonal sparse matrix");
1167 (*current_liboctave_warning_with_id_handler)
1168 (
"Octave:matrix-type-info",
"upper triangular matrix");
1170 (*current_liboctave_warning_with_id_handler)
1171 (
"Octave:matrix-type-info",
"lower triangular matrix");
1173 (*current_liboctave_warning_with_id_handler)
1174 (
"Octave:matrix-type-info",
"permuted upper triangular matrix");
1176 (*current_liboctave_warning_with_id_handler)
1177 (
"Octave:matrix-type-info",
"permuted lower triangular Matrix");
1179 (*current_liboctave_warning_with_id_handler)
1180 (
"Octave:matrix-type-info",
1181 "banded sparse matrix %d-1-%d (density %f)",
1184 (*current_liboctave_warning_with_id_handler)
1185 (
"Octave:matrix-type-info",
1186 "banded hermitian/symmetric sparse matrix %d-1-%d (density %f)",
1189 (*current_liboctave_warning_with_id_handler)
1190 (
"Octave:matrix-type-info",
"hermitian/symmetric matrix");
1192 (*current_liboctave_warning_with_id_handler)
1193 (
"Octave:matrix-type-info",
"tridiagonal sparse matrix");
1195 (*current_liboctave_warning_with_id_handler)
1196 (
"Octave:matrix-type-info",
1197 "hermitian/symmetric tridiagonal sparse matrix");
1199 (*current_liboctave_warning_with_id_handler)
1200 (
"Octave:matrix-type-info",
"rectangular/singular matrix");
1202 (*current_liboctave_warning_with_id_handler)
1203 (
"Octave:matrix-type-info",
"full matrix");
1220 (
"Can not mark current matrix type as symmetric");
1253 (
"Can not mark current matrix type as symmetric");
octave_idx_type cols(void) const
octave_idx_type rows(void) const
void mark_as_symmetric(void)
MatrixType & operator=(const MatrixType &a)
octave_idx_type * cidx(void)
T & elem(octave_idx_type n)
friend OCTAVE_API ColumnVector real(const ComplexColumnVector &a)
static double get_key(const std::string &key)
octave_idx_type rows(void) const
F77_RET_T const double const double double * d
octave_idx_type nnz(void) const
octave_idx_type lower_band
liboctave_error_handler current_liboctave_error_handler
ComplexColumnVector conj(const ComplexColumnVector &a)
int type(bool quiet=true)
octave_idx_type upper_band
static void warn_cached(void)
MatrixType transpose(void) const
void mark_as_permuted(const octave_idx_type np, const octave_idx_type *p)
double norm(const ColumnVector &v)
void mark_as_unpermuted(void)
void mark_as_unsymmetric(void)
octave_idx_type * ridx(void)
static void warn_calculating_sparse_type(void)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
static void warn_invalid(void)
std::complex< double > Complex
octave_idx_type cols(void) const
MatrixType::matrix_type matrix_real_probe(const MArray< T > &a)
static double get_bandden(void)
MatrixType::matrix_type matrix_complex_probe(const MArray< std::complex< T > > &a)