Mercurial > hg > octave-jordi
changeset 10506:bdf5d85cfc5e
replace nzmax by nnz where appropriate in liboctave
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 10 Apr 2010 21:04:55 +0200 |
parents | 82ee24bf783c |
children | 424795ef82b8 |
files | liboctave/ChangeLog liboctave/MatrixType.cc liboctave/Sparse.cc liboctave/SparseCmplxQR.cc liboctave/SparseQR.cc liboctave/boolSparse.cc |
diffstat | 6 files changed, 32 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2010-04-09 Jaroslav Hajek <highegg@gmail.com> + + * Sparse.cc (Sparse<T>::diag): Change nzmax to nnz where appropriate. + * MatrixType.cc (MatrixType::MatrixType): Ditto. + * SparseQR.cc: Ditto. + * SparseCmplxQR.cc: Ditto. + * boolSparse.cc: Ditto. + 2010-04-08 Jaroslav Hajek <highegg@gmail.com> * Sparse.cc (Sparse<T>::resize (octave_idx_type, octave_idx_type)):
--- a/liboctave/MatrixType.cc +++ b/liboctave/MatrixType.cc @@ -212,7 +212,7 @@ octave_idx_type nrows = a.rows (); octave_idx_type ncols = a.cols (); octave_idx_type nm = (ncols < nrows ? ncols : nrows); - octave_idx_type nnz = a.nzmax (); + octave_idx_type nnz = a.nnz (); if (octave_sparse_params::get_key ("spumoni") != 0.) (*current_liboctave_warning_handler) @@ -533,7 +533,7 @@ octave_idx_type nrows = a.rows (); octave_idx_type ncols = a.cols (); octave_idx_type nm = (ncols < nrows ? ncols : nrows); - octave_idx_type nnz = a.nzmax (); + octave_idx_type nnz = a.nnz (); if (octave_sparse_params::get_key ("spumoni") != 0.) (*current_liboctave_warning_handler)
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -2050,7 +2050,7 @@ if (nnr == 1) { octave_idx_type n = nnc + std::abs (k); - octave_idx_type nz = nzmax (); + octave_idx_type nz = nnz (); d = Sparse<T> (n, n, nz); @@ -2076,7 +2076,7 @@ else { octave_idx_type n = nnr + std::abs (k); - octave_idx_type nz = nzmax (); + octave_idx_type nz = nnz (); d = Sparse<T> (n, n, nz);
--- a/liboctave/SparseCmplxQR.cc +++ b/liboctave/SparseCmplxQR.cc @@ -435,9 +435,9 @@ SparseComplexQR q (a, 2); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc)); OCTAVE_C99_COMPLEX (buf, q.S()->m2); @@ -502,9 +502,9 @@ SparseComplexQR q (at, 2); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc)); @@ -730,9 +730,9 @@ SparseComplexQR q (a, 2); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc)); OCTAVE_C99_COMPLEX (buf, q.S()->m2); @@ -797,9 +797,9 @@ SparseComplexQR q (at, 2); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); OCTAVE_LOCAL_BUFFER (Complex, Xx, (b_nr > nc ? b_nr : nc));
--- a/liboctave/SparseQR.cc +++ b/liboctave/SparseQR.cc @@ -33,7 +33,7 @@ { #ifdef HAVE_CXSPARSE CXSPARSE_DNAME () A; - A.nzmax = a.nzmax (); + A.nzmax = a.nnz (); A.m = a.rows (); A.n = a.cols (); nrows = A.m; @@ -392,9 +392,9 @@ SparseQR q (a, 3); if (! q.ok ()) return SparseMatrix(); - x = SparseMatrix (nc, b_nc, b.nzmax()); + x = SparseMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; OCTAVE_LOCAL_BUFFER (double, Xx, (b_nr > nc ? b_nr : nc)); OCTAVE_LOCAL_BUFFER (double, buf, q.S()->m2); @@ -455,9 +455,9 @@ SparseQR q (at, 3); if (! q.ok ()) return SparseMatrix(); - x = SparseMatrix (nc, b_nc, b.nzmax()); + x = SparseMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); OCTAVE_LOCAL_BUFFER (double, Xx, (b_nr > nc ? b_nr : nc)); @@ -710,9 +710,9 @@ SparseQR q (a, 3); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; OCTAVE_LOCAL_BUFFER (double, Xx, (b_nr > nc ? b_nr : nc)); OCTAVE_LOCAL_BUFFER (double, Xz, (b_nr > nc ? b_nr : nc)); @@ -802,9 +802,9 @@ SparseQR q (at, 3); if (! q.ok ()) return SparseComplexMatrix(); - x = SparseComplexMatrix (nc, b_nc, b.nzmax()); + x = SparseComplexMatrix (nc, b_nc, b.nnz()); x.xcidx(0) = 0; - x_nz = b.nzmax(); + x_nz = b.nnz(); ii = 0; volatile octave_idx_type nbuf = (nc > q.S()->m2 ? nc : q.S()->m2); OCTAVE_LOCAL_BUFFER (double, Xx, (b_nr > nc ? b_nr : nc));
--- a/liboctave/boolSparse.cc +++ b/liboctave/boolSparse.cc @@ -42,10 +42,10 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - octave_idx_type nz = nzmax (); + octave_idx_type nz = nnz (); octave_idx_type nr_a = a.rows (); octave_idx_type nc_a = a.cols (); - octave_idx_type nz_a = a.nzmax (); + octave_idx_type nz_a = a.nnz (); if (nr != nr_a || nc != nc_a || nz != nz_a) return false; @@ -97,7 +97,7 @@ { octave_idx_type nr = rows (); octave_idx_type nc = cols (); - octave_idx_type nz1 = nzmax (); + octave_idx_type nz1 = nnz (); octave_idx_type nz2 = nr*nc - nz1; SparseBoolMatrix r (nr, nc, nz2);