# HG changeset patch # User jwe # Date 1152987413 0 # Node ID 13aa80fc78398dff9acc52227419f21b6b1ce8a2 # Parent beae0c02f101cf6df44a759e413468cedad32648 [project @ 2006-07-15 18:15:58 by jwe] diff -r beae0c02f101 -r 13aa80fc7839 liboctave/ChangeLog --- a/liboctave/ChangeLog Sat Jul 15 14:19:58 2006 +0000 +++ b/liboctave/ChangeLog Sat Jul 15 18:16:53 2006 +0000 @@ -1,3 +1,10 @@ +2006-07-15 John W. Eaton + + * data-conv.cc: Instantiante swap_bytes templates here. + + * MatrixType.cc (MatrixType::MatrixType): + Use complete initializer lists in constructors. + 2006-07-06 John W. Eaton * str-vec.cc (string_vector::string_vector (std::list&)): diff -r beae0c02f101 -r 13aa80fc7839 liboctave/MatrixType.cc --- a/liboctave/MatrixType.cc Sat Jul 15 14:19:58 2006 +0000 +++ b/liboctave/MatrixType.cc Sat Jul 15 18:16:53 2006 +0000 @@ -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; diff -r beae0c02f101 -r 13aa80fc7839 liboctave/data-conv.cc --- a/liboctave/data-conv.cc Sat Jul 15 14:19:58 2006 +0000 +++ b/liboctave/data-conv.cc Sat Jul 15 18:16:53 2006 +0000 @@ -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 \