25 #if defined (HAVE_CONFIG_H) 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 (nullptr) { }
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 (nullptr)
103 j < ncols && upper; j++)
106 upper = upper && (
d !=
zero);
107 lower = lower && (
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);
141 template <
typename T>
162 j < ncols && upper; j++)
164 std::complex<T>
d =
a.elem (j,j);
165 upper = upper && (
d !=
zero);
166 lower = lower && (
d !=
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);
191 else if (ncols == nrows)
202 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
203 dense (
false), full (true), nperm (0), perm (nullptr)
210 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
211 dense (
false), full (true), nperm (0), perm (nullptr)
218 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
219 dense (
false), full (true), nperm (0), perm (nullptr)
226 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
227 dense (
false), full (true), nperm (0), perm (nullptr)
233 template <
typename T>
236 sp_bandden (0), bandden (0), upper_band (0), lower_band (0),
237 dense (
false), full (
false), nperm (0), perm (nullptr)
248 bool maybe_hermitian =
false;
256 for (
i = 0;
i <
nm;
i++)
258 if (
a.cidx (
i+1) !=
a.cidx (
i) + 1)
272 std::vector<bool>
found (nrows);
281 if ((
a.cidx (j+1) >
a.cidx (j) + 1)
282 || ((
a.cidx (j+1) ==
a.cidx (j) + 1) &&
found[
a.ridx (j)]))
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)
319 if (
a.cidx (j+1) !=
a.cidx (j))
351 if (nnz_in_band ==
nnz)
364 maybe_hermitian =
true;
387 if ((
a.cidx (j+1) -
a.cidx (j)) > 0
388 && (
a.ridx (
a.cidx (j+1)-1) ==
i))
411 else if (
a.cidx (
nm) ==
a.cidx (ncols))
536 is_herm =
a.data (l) ==
d;
560 bandden (0), upper_band (0), lower_band (0),
561 dense (
false), full (_full), nperm (0), perm (nullptr)
577 bandden (0), upper_band (0), lower_band (0),
578 dense (
false), full (_full), nperm (0), perm (nullptr)
581 && np > 0 &&
p !=
nullptr)
597 bandden (0), upper_band (0), lower_band (0),
598 dense (
false), full (_full), nperm (0), perm (nullptr)
663 (*current_liboctave_warning_with_id_handler)
664 (
"Octave:matrix-type-info",
"invalidating matrix type");
845 (*current_liboctave_warning_with_id_handler)
846 (
"Octave:matrix-type-info",
"unknown matrix type");
848 (*current_liboctave_warning_with_id_handler)
849 (
"Octave:matrix-type-info",
"diagonal sparse matrix");
851 (*current_liboctave_warning_with_id_handler)
852 (
"Octave:matrix-type-info",
"permuted diagonal sparse matrix");
854 (*current_liboctave_warning_with_id_handler)
855 (
"Octave:matrix-type-info",
"upper triangular matrix");
857 (*current_liboctave_warning_with_id_handler)
858 (
"Octave:matrix-type-info",
"lower triangular matrix");
860 (*current_liboctave_warning_with_id_handler)
861 (
"Octave:matrix-type-info",
"permuted upper triangular matrix");
863 (*current_liboctave_warning_with_id_handler)
864 (
"Octave:matrix-type-info",
"permuted lower triangular Matrix");
866 (*current_liboctave_warning_with_id_handler)
867 (
"Octave:matrix-type-info",
868 "banded sparse matrix %d-1-%d (density %f)",
871 (*current_liboctave_warning_with_id_handler)
872 (
"Octave:matrix-type-info",
873 "banded hermitian/symmetric sparse matrix %d-1-%d (density %f)",
876 (*current_liboctave_warning_with_id_handler)
877 (
"Octave:matrix-type-info",
"hermitian/symmetric matrix");
879 (*current_liboctave_warning_with_id_handler)
880 (
"Octave:matrix-type-info",
"tridiagonal sparse matrix");
882 (*current_liboctave_warning_with_id_handler)
883 (
"Octave:matrix-type-info",
884 "hermitian/symmetric tridiagonal sparse matrix");
886 (*current_liboctave_warning_with_id_handler)
887 (
"Octave:matrix-type-info",
"rectangular/singular matrix");
889 (*current_liboctave_warning_with_id_handler)
890 (
"Octave:matrix-type-info",
"full matrix");
907 (
"Can not mark current matrix type as symmetric");
940 (
"Can not mark current matrix type as symmetric");
Template for N-dimensional array classes with like-type math operators.
is already an absolute the name is checked against the file system instead of Octave s loadpath In this if otherwise an empty string is returned If the first argument is a cell array of search each directory of the loadpath for element of the cell array and return the first that matches If the second optional argument return a cell array containing the list of all files that have the same name in the path If no files are found
MArray< T > hermitian(T(*fcn)(const T &)=nullptr) const
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by zero($0/0$)
void mark_as_symmetric(void)
MatrixType & operator=(const MatrixType &a)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
static double get_key(const std::string &key)
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_idx_type lower_band
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 nnz(void) const
Count nonzero elements.
int type(bool quiet=true)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
octave_idx_type upper_band
static void warn_cached(void)
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)
Array< T > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
static void warn_calculating_sparse_type(void)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
MatrixType::matrix_type matrix_complex_probe(const MArray< std::complex< T >> &a)
static void warn_invalid(void)
ColumnVector imag(const ComplexColumnVector &a)
MatrixType transpose(void) const
ColumnVector real(const ComplexColumnVector &a)
MatrixType::matrix_type matrix_real_probe(const MArray< T > &a)
static double get_bandden(void)