Mercurial > hg > octave-lyh
changeset 6460:fa6312d93730
[project @ 2007-03-26 21:23:00 by dbateman]
author | dbateman |
---|---|
date | Mon, 26 Mar 2007 21:23:00 +0000 |
parents | 5dc550e1f419 |
children | ed17f1c8f720 |
files | liboctave/ChangeLog liboctave/MatrixType.cc liboctave/oct-spparms.cc liboctave/oct-spparms.h |
diffstat | 4 files changed, 39 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,15 @@ +2007-03-26 David Bateman <dbateman@free.fr> + + * MatrixType.cc: Replace all uses of the method + octave_sparse_params::get_key ("bandden") with + octave_sparse_params::get_bandden (void). + (MatrixType::MatrixType (void)): Undo previous change but use + octave_sparse_params::get_bandden (void). + * oct-spparms.cc (get_bandden(void), do_get_bandden(void)): New + methods. + * oct-spparms.h (get_bandden(void), do_get_bandden(void)): + Declare them. + 2007-03-26 Luis Ortiz <lortiz@interactivesupercomputing.com> David Bateman <dbateman@free.fr>
--- a/liboctave/MatrixType.cc +++ b/liboctave/MatrixType.cc @@ -36,7 +36,9 @@ // FIXME There is a large code duplication here MatrixType::MatrixType (void) - : typ (MatrixType::Unknown), sp_bandden (0), bandden (0), upper_band (0), + : typ (MatrixType::Unknown), + sp_bandden (octave_sparse_params::get_bandden()), + bandden (0), upper_band (0), lower_band (0), dense (false), full (false), nperm (0), perm (0) { } MatrixType::MatrixType (const MatrixType &a) @@ -186,7 +188,7 @@ (*current_liboctave_warning_handler) ("Calculating Sparse Matrix Type"); - sp_bandden = octave_sparse_params::get_key ("bandden"); + sp_bandden = octave_sparse_params::get_bandden(); bool maybe_hermitian = false; typ = MatrixType::Full; @@ -512,7 +514,7 @@ (*current_liboctave_warning_handler) ("Calculating Sparse Matrix Type"); - sp_bandden = octave_sparse_params::get_key ("bandden"); + sp_bandden = octave_sparse_params::get_bandden(); bool maybe_hermitian = false; typ = MatrixType::Full; @@ -825,7 +827,7 @@ } MatrixType::MatrixType (const matrix_type t, bool _full) : typ (MatrixType::Unknown), - sp_bandden (octave_sparse_params::get_key ("bandden")), + sp_bandden (octave_sparse_params::get_bandden()), bandden (0), upper_band (0), lower_band (0), dense (false), full (_full), nperm (0), perm (0) { @@ -841,7 +843,7 @@ MatrixType::MatrixType (const matrix_type t, const octave_idx_type np, const octave_idx_type *p, bool _full) : typ (MatrixType::Unknown), - sp_bandden (octave_sparse_params::get_key ("bandden")), + sp_bandden (octave_sparse_params::get_bandden()), bandden (0), upper_band (0), lower_band (0), dense (false), full (_full), nperm (0), perm (0) { @@ -861,7 +863,7 @@ MatrixType::MatrixType (const matrix_type t, const octave_idx_type ku, const octave_idx_type kl, bool _full) : typ (MatrixType::Unknown), - sp_bandden (octave_sparse_params::get_key ("bandden")), + sp_bandden (octave_sparse_params::get_bandden()), bandden (0), upper_band (0), lower_band (0), dense (false), full (_full), nperm (0), perm (0) { @@ -912,7 +914,7 @@ MatrixType::type (bool quiet) { if (typ != MatrixType::Unknown && (full || - sp_bandden == octave_sparse_params::get_key ("bandden"))) + sp_bandden == octave_sparse_params::get_bandden())) { if (!quiet && octave_sparse_params::get_key ("spumoni") != 0.) @@ -936,7 +938,7 @@ MatrixType::type (const SparseMatrix &a) { if (typ != MatrixType::Unknown && (full || - sp_bandden == octave_sparse_params::get_key ("bandden"))) + sp_bandden == octave_sparse_params::get_bandden())) { if (octave_sparse_params::get_key ("spumoni") != 0.) (*current_liboctave_warning_handler) @@ -969,7 +971,7 @@ MatrixType::type (const SparseComplexMatrix &a) { if (typ != MatrixType::Unknown && (full || - sp_bandden == octave_sparse_params::get_key ("bandden"))) + sp_bandden == octave_sparse_params::get_bandden())) { if (octave_sparse_params::get_key ("spumoni") != 0.) (*current_liboctave_warning_handler)
--- a/liboctave/oct-spparms.cc +++ b/liboctave/oct-spparms.cc @@ -94,6 +94,12 @@ return instance_ok () ? instance->do_get_key (key) : octave_NaN; } +double +octave_sparse_params::get_bandden (void) +{ + return instance_ok () ? instance->do_get_bandden () : 0.0; +} + void octave_sparse_params::print_info (std::ostream& os, const std::string& prefix) { @@ -152,6 +158,12 @@ keys(11) = "umfpack"; } +double +octave_sparse_params::do_get_bandden (void) +{ + return params(10); +} + bool octave_sparse_params::do_set_vals (const NDArray& vals) {
--- a/liboctave/oct-spparms.h +++ b/liboctave/oct-spparms.h @@ -66,6 +66,8 @@ static double get_key (const std::string& key); + static double get_bandden (void); + static void print_info (std::ostream& os, const std::string& prefix); private: @@ -90,6 +92,8 @@ double do_get_key (const std::string& key); + double do_get_bandden (void); + void do_print_info (std::ostream& os, const std::string& prefix) const; void init_keys (void);