Mercurial > hg > octave-lyh
changeset 5892:13aa80fc7839
[project @ 2006-07-15 18:15:58 by jwe]
author | jwe |
---|---|
date | Sat, 15 Jul 2006 18:16:53 +0000 |
parents | beae0c02f101 |
children | d73ffe42f2c8 |
files | liboctave/ChangeLog liboctave/MatrixType.cc liboctave/data-conv.cc |
diffstat | 3 files changed, 45 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +2006-07-15 John W. Eaton <jwe@octave.org> + + * data-conv.cc: Instantiante swap_bytes templates here. + + * MatrixType.cc (MatrixType::MatrixType): + Use complete initializer lists in constructors. + 2006-07-06 John W. Eaton <jwe@octave.org> * str-vec.cc (string_vector::string_vector (std::list<std::string>&)):
--- a/liboctave/MatrixType.cc +++ b/liboctave/MatrixType.cc @@ -35,14 +35,14 @@ // FIXME There is a large code duplication here -MatrixType::MatrixType (void) : typ (MatrixType::Unknown), full (false), - nperm (0) -{ - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); -} +MatrixType::MatrixType (void) + : typ (MatrixType::Unknown), + sp_bandden (Voctave_sparse_controls.get_key ("bandden")), + bandden (0), upper_band (0), lower_band (0), dense (false), + full (false), nperm (0), perm (0) { } -MatrixType::MatrixType (const MatrixType &a) : typ (a.typ), - sp_bandden (a.sp_bandden), bandden (a.bandden), +MatrixType::MatrixType (const MatrixType &a) + : typ (a.typ), sp_bandden (a.sp_bandden), bandden (a.bandden), upper_band (a.upper_band), lower_band (a.lower_band), dense (a.dense), full (a.full), nperm (a.nperm) { @@ -55,11 +55,12 @@ } MatrixType::MatrixType (const Matrix &a) + : typ (MatrixType::Unknown), + sp_bandden (0), bandden (0), upper_band (0), lower_band (0), + dense (false), full (true), nperm (0), perm (0) { octave_idx_type nrows = a.rows (); octave_idx_type ncols = a.cols (); - nperm = 0; - full = true; if (ncols == nrows) { @@ -112,11 +113,12 @@ } MatrixType::MatrixType (const ComplexMatrix &a) + : typ (MatrixType::Unknown), + sp_bandden (0), bandden (0), upper_band (0), lower_band (0), + dense (false), full (true), nperm (0), perm (0) { octave_idx_type nrows = a.rows (); octave_idx_type ncols = a.cols (); - nperm = 0; - full = true; if (ncols == nrows) { @@ -173,19 +175,19 @@ } MatrixType::MatrixType (const SparseMatrix &a) + : typ (MatrixType::Unknown), + sp_bandden (0), bandden (0), upper_band (0), lower_band (0), + dense (false), full (false), nperm (0), perm (0) { 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 (); - full = false; if (Voctave_sparse_controls.get_key ("spumoni") != 0.) (*current_liboctave_warning_handler) ("Calculating Sparse Matrix Type"); - nperm = 0; - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); bool maybe_hermitian = false; typ = MatrixType::Full; @@ -499,20 +501,20 @@ } MatrixType::MatrixType (const SparseComplexMatrix &a) + : typ (MatrixType::Unknown), + sp_bandden (0), bandden (0), upper_band (0), lower_band (0), + dense (false), full (false), nperm (0), perm (0) { 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 (); - full = false; if (Voctave_sparse_controls.get_key ("spumoni") != 0.) full = true; (*current_liboctave_warning_handler) ("Calculating Sparse Matrix Type"); - nperm = 0; - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); bool maybe_hermitian = false; typ = MatrixType::Full; @@ -824,12 +826,12 @@ } } } -MatrixType::MatrixType (const matrix_type t, bool _full) : - typ (MatrixType::Unknown), nperm (0) +MatrixType::MatrixType (const matrix_type t, bool _full) + : typ (MatrixType::Unknown), + sp_bandden (Voctave_sparse_controls.get_key ("bandden")), + bandden (0), upper_band (0), lower_band (0), + dense (false), full (_full), nperm (0), perm (0) { - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); - full = _full; - if (t == MatrixType::Full || t == MatrixType::Diagonal || t == MatrixType::Permuted_Diagonal || t == MatrixType::Upper || t == MatrixType::Lower || t == MatrixType::Tridiagonal || @@ -840,12 +842,12 @@ } MatrixType::MatrixType (const matrix_type t, const octave_idx_type np, - const octave_idx_type *p, bool _full) : - typ (MatrixType::Unknown), nperm (0) + const octave_idx_type *p, bool _full) + : typ (MatrixType::Unknown), + sp_bandden (Voctave_sparse_controls.get_key ("bandden")), + bandden (0), upper_band (0), lower_band (0), + dense (false), full (_full), nperm (0), perm (0) { - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); - full = _full; - if (t == MatrixType::Permuted_Upper || t == MatrixType::Permuted_Lower) { typ = t; @@ -859,12 +861,12 @@ } MatrixType::MatrixType (const matrix_type t, const octave_idx_type ku, - const octave_idx_type kl, bool _full) : - typ (MatrixType::Unknown), nperm (0) + const octave_idx_type kl, bool _full) + : typ (MatrixType::Unknown), + sp_bandden (Voctave_sparse_controls.get_key ("bandden")), + bandden (0), upper_band (0), lower_band (0), + dense (false), full (_full), nperm (0), perm (0) { - sp_bandden = Voctave_sparse_controls.get_key ("bandden"); - full = _full; - if (t == MatrixType::Banded || t == MatrixType::Banded_Hermitian) { typ = t;
--- a/liboctave/data-conv.cc +++ b/liboctave/data-conv.cc @@ -34,6 +34,10 @@ #include "data-conv.h" #include "lo-error.h" +template void swap_bytes<2> (volatile void *, int); +template void swap_bytes<4> (volatile void *, int); +template void swap_bytes<8> (volatile void *, int); + #if defined HAVE_LONG_LONG_INT #define FIND_SIZED_INT_TYPE(VAL, BITS, TQ, Q) \ do \