More patches for gcc 3-4
Rene van Paassen <[email protected]> Mon, 11 Apr 2005 13:04:47 +0200
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Organization | Delft University of Technology, Aerospace Engineering |
| Message-ID | <[email protected]> |
Hi all,
Please find attached a new patch against mtl-2.1.2.21-6, this time with
also the code in contrib/examples corrected. (see also earlier posts)
With gcc 3.4, usually the include
#include <mtl/mtl.h>
needs to be given as first include statement. Found the same problem in
some of our home-brew code.
Greetings,
René
--
M.M. (René) van Paassen M.M.vanPaassen at LR.TUDelft.nl
Associate Professor tel. +31 15 278 5370
Faculty of Aerospace Engineering fax. +31 15 278 6480
Kluijverweg 1, NL-2629 HS Delft Delft University of Technology
>>>>>>>>>>>> http://www.cs.lr.tudelft.nl <<<<<<<<<<<<
[
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/
mtl-gcc34-050411.patch
(text/x-patch, 47.4 KB)
diff -Naur mtl-2.1.2-21/acconfig.h mtl-2.1.2-21mod/acconfig.h
--- mtl-2.1.2-21/acconfig.h 2002-07-06 17:48:30.000000000 +0200
+++ mtl-2.1.2-21mod/acconfig.h 2005-04-11 10:58:02.641356808 +0200
@@ -34,7 +34,7 @@
#if defined(__sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 730)
# define MTL_NO_TEMPLATE
-#elif defined(__GNUC__) && (__GNUC__ < 9)
+#elif defined(__GNUC__) && (__GNUC__ < 3) && (__GNUC_MINOR__ < 4)
# define MTL_NO_TEMPLATE
#elif defined(__KCC_VERSION) && (__KCC_VERSION < 3400)
# define MTL_NO_TEMPLATE
diff -Naur mtl-2.1.2-21/contrib/examples/abs_sum.cc mtl-2.1.2-21mod/contrib/examples/abs_sum.cc
--- mtl-2.1.2-21/contrib/examples/abs_sum.cc 2002-07-06 17:48:31.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/abs_sum.cc 2005-04-11 11:04:52.938982088 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include "mtl/utils.h"
#include "mtl/mtl.h"
+#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
/*
diff -Naur mtl-2.1.2-21/contrib/examples/banded_matvec_mult.cc mtl-2.1.2-21mod/contrib/examples/banded_matvec_mult.cc
--- mtl-2.1.2-21/contrib/examples/banded_matvec_mult.cc 2002-07-06 17:48:31.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/banded_matvec_mult.cc 2005-04-11 11:05:43.254332992 +0200
@@ -26,8 +26,8 @@
//
#include <iostream>
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/banded_view_test.cc mtl-2.1.2-21mod/contrib/examples/banded_view_test.cc
--- mtl-2.1.2-21/contrib/examples/banded_view_test.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/banded_view_test.cc 2005-04-11 11:23:05.733852016 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
//begin
template <class Matrix>
@@ -15,43 +15,43 @@
print_all_matrix(A);
std::cout << std::endl;
- typedef rows_type<Matrix>::type RowMatrix;
+ typedef typename rows_type<Matrix>::type RowMatrix;
std::cout << "rows banded" << std::endl;
//begin
- band_view<RowMatrix>::type B(2, 1, A);
+ typename band_view<RowMatrix>::type B(2, 1, A);
//end
print_all_banded(B, 2, 1);
print_row(B);
std::cout << std::endl;
std::cout << "columns banded" << std::endl;
- typedef columns_type<Matrix>::type ColMatrix;
- band_view<ColMatrix>::type C(2, 1, columns(A));
+ typedef typename columns_type<Matrix>::type ColMatrix;
+ typename band_view<ColMatrix>::type C(2, 1, columns(A));
print_all_banded(C, 2, 1);
print_column(C);
std::cout << std::endl;
std::cout << "rows lower triangle" << std::endl;
- triangle_view<RowMatrix, lower>::type L(A);
+ typename triangle_view<RowMatrix, lower>::type L(A);
print_all_banded(L, M-1, 0);
print_row(L);
std::cout << std::endl;
std::cout << "rows unit upper triangle" << std::endl;
- triangle_view<RowMatrix, unit_upper>::type U(A);
+ typename triangle_view<RowMatrix, unit_upper>::type U(A);
print_all_banded(U, -1, N-1);
print_row(U);
std::cout << "columns lower triangle" << std::endl;
- triangle_view<ColMatrix, lower>::type CL(columns(A));
+ typename triangle_view<ColMatrix, lower>::type CL(columns(A));
print_all_banded(CL, M-1, 0);
print_column(CL);
std::cout << std::endl;
std::cout << "columns unit upper triangle" << std::endl;
- triangle_view<ColMatrix, unit_upper>::type CU(columns(A));
+ typename triangle_view<ColMatrix, unit_upper>::type CU(columns(A));
print_all_banded(CU, -1, N-1);
print_column(CU);
//begin
diff -Naur mtl-2.1.2-21/contrib/examples/blocked_matrix.cc mtl-2.1.2-21mod/contrib/examples/blocked_matrix.cc
--- mtl-2.1.2-21/contrib/examples/blocked_matrix.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/blocked_matrix.cc 2005-04-11 11:06:10.564181264 +0200
@@ -24,6 +24,7 @@
//
#include <iostream>
+#include <mtl/mtl.h>
#include <mtl/matrix.h>
int
diff -Naur mtl-2.1.2-21/contrib/examples/blocked_vector.cc mtl-2.1.2-21mod/contrib/examples/blocked_vector.cc
--- mtl-2.1.2-21/contrib/examples/blocked_vector.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/blocked_vector.cc 2005-04-11 11:06:40.614612904 +0200
@@ -1,3 +1,4 @@
+#include "mtl/mtl.h"
#include "mtl/mtl_config.h"
#ifdef MTL_DISABLE_BLOCKING
diff -Naur mtl-2.1.2-21/contrib/examples/external_matrix.cc mtl-2.1.2-21mod/contrib/examples/external_matrix.cc
--- mtl-2.1.2-21/contrib/examples/external_matrix.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/external_matrix.cc 2005-04-11 11:00:26.287519272 +0200
@@ -25,6 +25,7 @@
// $Id: external_matrix.cc,v 1.1.1.1 2000/07/12 21:51:42 jsiek Exp $
//
+#include "mtl/mtl.h"
#include "mtl/matrix.h"
#include "mtl/mtl.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/gather_scatter.cc mtl-2.1.2-21mod/contrib/examples/gather_scatter.cc
--- mtl-2.1.2-21/contrib/examples/gather_scatter.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/gather_scatter.cc 2005-04-11 11:07:01.322464832 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/dense1D.h"
#include "mtl/compressed1D.h"
diff -Naur mtl-2.1.2-21/contrib/examples/gecon.cc mtl-2.1.2-21mod/contrib/examples/gecon.cc
--- mtl-2.1.2-21/contrib/examples/gecon.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/gecon.cc 2005-04-11 11:07:22.781202608 +0200
@@ -26,7 +26,7 @@
// $Id: gecon.cc,v 1.3 2000/08/28 15:53:51 jsiek Exp $
//
-
+#include "mtl/mtl.h"
#include "mtl/mtl2lapack.h"
#include "mtl/dense1D.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/geequ.cc mtl-2.1.2-21mod/contrib/examples/geequ.cc
--- mtl-2.1.2-21/contrib/examples/geequ.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/geequ.cc 2005-04-11 11:07:44.500900712 +0200
@@ -26,7 +26,7 @@
// $Id: geequ.cc,v 1.2 2000/08/28 15:22:59 jsiek Exp $
//
-
+#include "mtl/mtl.h"
#include "mtl/mtl2lapack.h"
#include "mtl/dense1D.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/geev.cc mtl-2.1.2-21mod/contrib/examples/geev.cc
--- mtl-2.1.2-21/contrib/examples/geev.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/geev.cc 2005-04-11 11:08:11.415809024 +0200
@@ -28,6 +28,7 @@
#include <complex>
+#include "mtl/mtl.h"
#include "mtl/mtl2lapack.h"
#include "mtl/dense1D.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/general_matvec_mult.cc mtl-2.1.2-21mod/contrib/examples/general_matvec_mult.cc
--- mtl-2.1.2-21/contrib/examples/general_matvec_mult.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/general_matvec_mult.cc 2005-04-11 11:00:48.009217072 +0200
@@ -26,8 +26,8 @@
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
#include <math.h>
diff -Naur mtl-2.1.2-21/contrib/examples/getrf.cc mtl-2.1.2-21mod/contrib/examples/getrf.cc
--- mtl-2.1.2-21/contrib/examples/getrf.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/getrf.cc 2005-04-11 11:08:32.593589512 +0200
@@ -28,6 +28,7 @@
#include <complex>
+#include "mtl/mtl.h"
#include "mtl/mtl2lapack.h"
#include "mtl/dense1D.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/kiester_geev.cc mtl-2.1.2-21mod/contrib/examples/kiester_geev.cc
--- mtl-2.1.2-21/contrib/examples/kiester_geev.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/kiester_geev.cc 2005-04-11 11:08:51.854661384 +0200
@@ -3,6 +3,7 @@
#include <complex>
+#include "mtl/mtl.h"
#include "mtl/mtl2lapack.h"
#include "mtl/dense1D.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/lu_factorization.cc mtl-2.1.2-21mod/contrib/examples/lu_factorization.cc
--- mtl-2.1.2-21/contrib/examples/lu_factorization.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/lu_factorization.cc 2005-04-11 11:09:09.556970224 +0200
@@ -6,6 +6,7 @@
//
//-------------------------------------------------------------------------
+#include "mtl/mtl.h"
#include "mtl/lu.h"
#include "mtl/matrix.h"
#include "mtl/dense1D.h"
diff -Naur mtl-2.1.2-21/contrib/examples/lu_solve.cc mtl-2.1.2-21mod/contrib/examples/lu_solve.cc
--- mtl-2.1.2-21/contrib/examples/lu_solve.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/lu_solve.cc 2005-04-11 11:09:18.001686432 +0200
@@ -1,7 +1,7 @@
/* thanks to Valient Gough for this example program! */
-#include <mtl/matrix.h>
#include <mtl/mtl.h>
+#include <mtl/matrix.h>
#include <mtl/utils.h>
#include <mtl/lu.h>
diff -Naur mtl-2.1.2-21/contrib/examples/neg_stride.cc mtl-2.1.2-21mod/contrib/examples/neg_stride.cc
--- mtl-2.1.2-21/contrib/examples/neg_stride.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/neg_stride.cc 2005-04-11 11:09:35.773984632 +0200
@@ -1,7 +1,7 @@
#include <iostream>
+#include <mtl/mtl.h>
#include <mtl/strided1D.h>
#include <mtl/light1D.h>
-#include <mtl/mtl.h>
int
main()
diff -Naur mtl-2.1.2-21/contrib/examples/partition.cc mtl-2.1.2-21mod/contrib/examples/partition.cc
--- mtl-2.1.2-21/contrib/examples/partition.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/partition.cc 2005-04-11 11:09:50.393762088 +0200
@@ -1,3 +1,4 @@
+#include "mtl/mtl.h"
#include "mtl/matrix.h"
#include "mtl/linalg_vec.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/range.cc mtl-2.1.2-21mod/contrib/examples/range.cc
--- mtl-2.1.2-21/contrib/examples/range.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/range.cc 2005-04-11 11:10:06.533308504 +0200
@@ -1,3 +1,4 @@
+#include "mtl/mtl.h"
#include "mtl/matrix.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/rank_1_gen_mat.cc mtl-2.1.2-21mod/contrib/examples/rank_1_gen_mat.cc
--- mtl-2.1.2-21/contrib/examples/rank_1_gen_mat.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/rank_1_gen_mat.cc 2005-04-11 11:01:10.996722440 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/rank_1_symm_sparse.cc mtl-2.1.2-21mod/contrib/examples/rank_1_symm_sparse.cc
--- mtl-2.1.2-21/contrib/examples/rank_1_symm_sparse.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/rank_1_symm_sparse.cc 2005-04-11 11:10:18.874432368 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/rank_one.cc mtl-2.1.2-21mod/contrib/examples/rank_one.cc
--- mtl-2.1.2-21/contrib/examples/rank_one.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/rank_one.cc 2005-04-11 11:10:25.376443912 +0200
@@ -1,6 +1,6 @@
+#include "mtl/mtl.h"
#include "mtl/matrix.h"
#include "mtl/dense1D.h"
-#include "mtl/mtl.h"
/*
Sample Output
diff -Naur mtl-2.1.2-21/contrib/examples/resize.cc mtl-2.1.2-21mod/contrib/examples/resize.cc
--- mtl-2.1.2-21/contrib/examples/resize.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/resize.cc 2005-04-11 11:10:31.153565656 +0200
@@ -1,5 +1,5 @@
-#include <mtl/matrix.h>
#include <mtl/mtl.h>
+#include <mtl/matrix.h>
using namespace mtl;
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_copy.cc mtl-2.1.2-21mod/contrib/examples/sparse_copy.cc
--- mtl-2.1.2-21/contrib/examples/sparse_copy.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_copy.cc 2005-04-11 11:01:31.615587896 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
/*
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_matrix.cc mtl-2.1.2-21mod/contrib/examples/sparse_matrix.cc
--- mtl-2.1.2-21/contrib/examples/sparse_matrix.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_matrix.cc 2005-04-11 11:01:48.787977296 +0200
@@ -27,6 +27,7 @@
//
+#include "mtl/mtl.h"
#include "mtl/matrix.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_mult.cc mtl-2.1.2-21mod/contrib/examples/sparse_mult.cc
--- mtl-2.1.2-21/contrib/examples/sparse_mult.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_mult.cc 2005-04-11 11:10:43.180737248 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
int random(int range) {
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_mult_col.cc mtl-2.1.2-21mod/contrib/examples/sparse_mult_col.cc
--- mtl-2.1.2-21/contrib/examples/sparse_mult_col.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_mult_col.cc 2005-04-11 11:10:47.713048232 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
//#include "mtl/sparse_mult.h"
#include "mtl/utils.h"
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_tri_solve.cc mtl-2.1.2-21mod/contrib/examples/sparse_tri_solve.cc
--- mtl-2.1.2-21/contrib/examples/sparse_tri_solve.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_tri_solve.cc 2005-04-11 11:10:51.748434760 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/sparse_vec_prod.cc mtl-2.1.2-21mod/contrib/examples/sparse_vec_prod.cc
--- mtl-2.1.2-21/contrib/examples/sparse_vec_prod.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/sparse_vec_prod.cc 2005-04-11 11:02:03.636719944 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/swap_rows.cc mtl-2.1.2-21mod/contrib/examples/swap_rows.cc
--- mtl-2.1.2-21/contrib/examples/swap_rows.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/swap_rows.cc 2005-04-11 11:02:19.565298432 +0200
@@ -25,8 +25,8 @@
// $Id: swap_rows.cc,v 1.2 2000/08/28 15:23:00 jsiek Exp $
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
/*
diff -Naur mtl-2.1.2-21/contrib/examples/symm_banded_vec_prod.cc mtl-2.1.2-21mod/contrib/examples/symm_banded_vec_prod.cc
--- mtl-2.1.2-21/contrib/examples/symm_banded_vec_prod.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/symm_banded_vec_prod.cc 2005-04-11 11:02:36.615706376 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/symm_matvec_mult.cc mtl-2.1.2-21mod/contrib/examples/symm_matvec_mult.cc
--- mtl-2.1.2-21/contrib/examples/symm_matvec_mult.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/symm_matvec_mult.cc 2005-04-11 11:11:08.326914448 +0200
@@ -25,8 +25,8 @@
// $Id: symm_matvec_mult.cc,v 1.2 2000/08/28 15:23:00 jsiek Exp $
//
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/matrix.h>
diff -Naur mtl-2.1.2-21/contrib/examples/symm_packed_vec_prod.cc mtl-2.1.2-21mod/contrib/examples/symm_packed_vec_prod.cc
--- mtl-2.1.2-21/contrib/examples/symm_packed_vec_prod.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/symm_packed_vec_prod.cc 2005-04-11 11:02:56.049751952 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/symm_sparse_vec_prod.cc mtl-2.1.2-21mod/contrib/examples/symm_sparse_vec_prod.cc
--- mtl-2.1.2-21/contrib/examples/symm_sparse_vec_prod.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/symm_sparse_vec_prod.cc 2005-04-11 11:03:10.424566648 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/trans_mult.cc mtl-2.1.2-21mod/contrib/examples/trans_mult.cc
--- mtl-2.1.2-21/contrib/examples/trans_mult.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/trans_mult.cc 2005-04-11 11:11:17.730484888 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
/*
diff -Naur mtl-2.1.2-21/contrib/examples/transpose.cc mtl-2.1.2-21mod/contrib/examples/transpose.cc
--- mtl-2.1.2-21/contrib/examples/transpose.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/transpose.cc 2005-04-11 11:11:22.806713184 +0200
@@ -1,7 +1,7 @@
// -*- C++ -*-
-#include <mtl/matrix.h>
#include <mtl/mtl.h>
+#include <mtl/matrix.h>
#include <mtl/utils.h>
using namespace mtl;
diff -Naur mtl-2.1.2-21/contrib/examples/tri_band_sol.cc mtl-2.1.2-21mod/contrib/examples/tri_band_sol.cc
--- mtl-2.1.2-21/contrib/examples/tri_band_sol.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_band_sol.cc 2005-04-11 11:03:28.036889168 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/tri_band_vect.cc mtl-2.1.2-21mod/contrib/examples/tri_band_vect.cc
--- mtl-2.1.2-21/contrib/examples/tri_band_vect.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_band_vect.cc 2005-04-11 11:03:43.660514016 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/tri_matvec_mult.cc mtl-2.1.2-21mod/contrib/examples/tri_matvec_mult.cc
--- mtl-2.1.2-21/contrib/examples/tri_matvec_mult.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_matvec_mult.cc 2005-04-11 11:03:59.326132480 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/tri_pack_sol.cc mtl-2.1.2-21mod/contrib/examples/tri_pack_sol.cc
--- mtl-2.1.2-21/contrib/examples/tri_pack_sol.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_pack_sol.cc 2005-04-11 11:04:14.805779216 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/tri_pack_vect.cc mtl-2.1.2-21mod/contrib/examples/tri_pack_vect.cc
--- mtl-2.1.2-21/contrib/examples/tri_pack_vect.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_pack_vect.cc 2005-04-11 11:11:36.148684896 +0200
@@ -26,8 +26,8 @@
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/tri_solve.cc mtl-2.1.2-21mod/contrib/examples/tri_solve.cc
--- mtl-2.1.2-21/contrib/examples/tri_solve.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/tri_solve.cc 2005-04-11 11:11:42.787675616 +0200
@@ -25,8 +25,8 @@
// $Id: tri_solve.cc,v 1.2 2000/08/28 15:23:01 jsiek Exp $
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/vec_copy.cc mtl-2.1.2-21mod/contrib/examples/vec_copy.cc
--- mtl-2.1.2-21/contrib/examples/vec_copy.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vec_copy.cc 2005-04-11 11:11:49.236695216 +0200
@@ -26,8 +26,8 @@
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
diff -Naur mtl-2.1.2-21/contrib/examples/vec_max.cc mtl-2.1.2-21mod/contrib/examples/vec_max.cc
--- mtl-2.1.2-21/contrib/examples/vec_max.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vec_max.cc 2005-04-11 11:11:54.669869248 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vec_min.cc mtl-2.1.2-21mod/contrib/examples/vec_min.cc
--- mtl-2.1.2-21/contrib/examples/vec_min.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vec_min.cc 2005-04-11 11:12:01.828780928 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vec_scale.cc mtl-2.1.2-21mod/contrib/examples/vec_scale.cc
--- mtl-2.1.2-21/contrib/examples/vec_scale.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vec_scale.cc 2005-04-11 11:12:07.863863456 +0200
@@ -25,8 +25,8 @@
// $Id: vec_scale.cc,v 1.2 2000/08/28 15:23:01 jsiek Exp $
//
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vec_two_norm.cc mtl-2.1.2-21mod/contrib/examples/vec_two_norm.cc
--- mtl-2.1.2-21/contrib/examples/vec_two_norm.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vec_two_norm.cc 2005-04-11 11:12:13.044075944 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include "dense1D.h"
#include "mtl.h"
+#include "dense1D.h"
/*
example output:
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_add3.cc mtl-2.1.2-21mod/contrib/examples/vecvec_add3.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_add3.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_add3.cc 2005-04-11 11:12:17.394414592 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_add.cc mtl-2.1.2-21mod/contrib/examples/vecvec_add.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_add.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_add.cc 2005-04-11 11:12:23.237526304 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_copy.cc mtl-2.1.2-21mod/contrib/examples/vecvec_copy.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_copy.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_copy.cc 2005-04-11 11:12:27.009952808 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_dot.cc mtl-2.1.2-21mod/contrib/examples/vecvec_dot.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_dot.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_dot.cc 2005-04-11 11:12:34.207858560 +0200
@@ -1,6 +1,6 @@
#include <iostream>
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
/*
example output:
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_ele_div.cc mtl-2.1.2-21mod/contrib/examples/vecvec_ele_div.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_ele_div.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_ele_div.cc 2005-04-11 11:12:43.003521416 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_ele_mult.cc mtl-2.1.2-21mod/contrib/examples/vecvec_ele_mult.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_ele_mult.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_ele_mult.cc 2005-04-11 11:12:47.002913416 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
diff -Naur mtl-2.1.2-21/contrib/examples/vecvec_swap.cc mtl-2.1.2-21mod/contrib/examples/vecvec_swap.cc
--- mtl-2.1.2-21/contrib/examples/vecvec_swap.cc 2002-07-06 17:48:33.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/vecvec_swap.cc 2005-04-11 11:12:50.808334904 +0200
@@ -1,5 +1,5 @@
-#include <mtl/dense1D.h>
#include <mtl/mtl.h>
+#include <mtl/dense1D.h>
#include <mtl/utils.h>
/*
diff -Naur mtl-2.1.2-21/contrib/examples/y_ax_y.cc mtl-2.1.2-21mod/contrib/examples/y_ax_y.cc
--- mtl-2.1.2-21/contrib/examples/y_ax_y.cc 2002-07-06 17:48:32.000000000 +0200
+++ mtl-2.1.2-21mod/contrib/examples/y_ax_y.cc 2005-04-11 11:12:54.475777368 +0200
@@ -1,5 +1,5 @@
-#include "mtl/matrix.h"
#include "mtl/mtl.h"
+#include "mtl/matrix.h"
#include "mtl/utils.h"
/*
diff -Naur mtl-2.1.2-21/mtl/compressed2D.h mtl-2.1.2-21mod/mtl/compressed2D.h
--- mtl-2.1.2-21/mtl/compressed2D.h 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/compressed2D.h 2005-04-11 10:58:02.642356656 +0200
@@ -612,11 +612,11 @@
}
void print() const {
- cout << "values ";
+ std::cout << "values ";
print_vector(*values);
- cout << "indices ";
+ std::cout << "indices ";
print_vector(*indices);
- cout << "starts ";
+ std::cout << "starts ";
print_vector(*starts);
}
@@ -666,8 +666,8 @@
: Base(d, &vals, &inds, &ptrs),
ptrs(d.first() + 1, -IND_OFFSET) /* F to C */
{
- vals.reserve(dim.first() * 5);
- inds.reserve(dim.first() * 5);
+ vals.reserve(this->dim.first() * 5);
+ inds.reserve(this->dim.first() * 5);
}
inline compressed2D(dim_type d, size_type nnz)
@@ -683,8 +683,8 @@
: Base(d, &vals, &inds, &ptrs),
ptrs(d.first() + 1, -IND_OFFSET) /* F to C */
{
- vals.reserve(dim.first() * 5);
- inds.reserve(dim.first() * 5);
+ vals.reserve(this->dim.first() * 5);
+ inds.reserve(this->dim.first() * 5);
}
//: Copy Constructor
@@ -702,8 +702,8 @@
inline self& operator=(const self& x) {
vals = x.vals; ptrs = x.ptrs; inds = x.inds;
/* fill out inhereted part */
- dim = x.dim;
- values = &vals; indices = &inds; starts = &ptrs;
+ this->dim = x.dim;
+ this->values = &vals; this->indices = &inds; this->starts = &ptrs;
return *this;
}
@@ -801,8 +801,8 @@
inline self& operator=(const self& x) {
vals = x.vals; inds = x.inds; ptrs = x.ptrs;
/* fill out inhereted part */
- dim = x.dim;
- values = &vals; indices = &inds; starts = &ptrs;
+ this->dim = x.dim;
+ this->values = &vals; this->indices = &inds; this->starts = &ptrs;
return *this;
}
diff -Naur mtl-2.1.2-21/mtl/dense2D.h mtl-2.1.2-21mod/mtl/dense2D.h
--- mtl-2.1.2-21/mtl/dense2D.h 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/dense2D.h 2005-04-11 10:58:02.643356504 +0200
@@ -641,9 +641,10 @@
inline Iterator base () const { return start + pos; }
inline reference deref(Distance pos, not_strided_tag) const {
- return reference((T*)start + offset.oned_offset(pos),
- offset.oned_length(pos),
- starts.first);
+ return reference(const_cast<T*>(reinterpret_cast<const T*>(start)) +
+ offset.oned_offset(pos),
+ offset.oned_length(pos),
+ starts.first);
}
inline reference deref(Distance pos, strided_tag) const {
InnerOneD vec((T*)start + offset.oned_offset(pos),
@@ -1235,8 +1236,8 @@
inline void resize(size_type m, size_type n) {
rep_ptr newdata = new reptype(Offset::size(m, n, 0, 0));
size_type i, j;
- size_type M = MTL_MIN(m, offset.major());
- size_type N = MTL_MIN(n, offset.minor());
+ size_type M = MTL_MIN(m, this->offset.major());
+ size_type N = MTL_MIN(n, this->offset.minor());
for (i = 0; i < M; ++i)
for (j = 0; j < N; ++j)
(*newdata)[i * n + j] = (*this)(i,j);
@@ -1244,10 +1245,10 @@
for (; j < n; ++j)
(*newdata)[i * n + j] = T();
- data_ = newdata;
- ld_ = n;
- offset.dim = dim_type(m, n);
- offset.ld = n;
+ this->data_ = newdata;
+ this->ld_ = n;
+ this->offset.dim = dim_type(m, n);
+ this->offset.ld = n;
}
};
@@ -1363,7 +1364,7 @@
inline external2D& operator=(const external2D& x) {
rep = x.rep;
super::operator=(x);
- data_ = &rep;
+ this->data_ = &rep;
return *this;
}
diff -Naur mtl-2.1.2-21/mtl/envelope2D.h mtl-2.1.2-21mod/mtl/envelope2D.h
--- mtl-2.1.2-21/mtl/envelope2D.h 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/envelope2D.h 2005-04-11 10:58:02.643356504 +0200
@@ -296,9 +296,9 @@
inline envelope2D() : dim(0,0) { }
//: Constructor from dimension pair
inline envelope2D(dim_type d)
- : dim(d), val(1, T(0)), ptr(m, size_type(0))
+ : dim(d), val(1, T(0)), ptr(this->m, size_type(0))
{
- val.reserve(m * 5);
+ val.reserve(this->m * 5);
}
//: Constructor from dimension abd bandwidth pairs
inline envelope2D(dim_type d, dim_type)
diff -Naur mtl-2.1.2-21/mtl/initialize.h mtl-2.1.2-21mod/mtl/initialize.h
--- mtl-2.1.2-21/mtl/initialize.h 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/initialize.h 2005-04-11 10:58:02.644356352 +0200
@@ -58,7 +58,7 @@
A(row, col) = e.value;
}
} else {
- cout << " matrix type is symmetric but the matrix in the file is not" << endl;
+ std::cout << " matrix type is symmetric but the matrix in the file is not" << std::endl;
assert(0);
}
}
diff -Naur mtl-2.1.2-21/mtl/light_matrix.h mtl-2.1.2-21mod/mtl/light_matrix.h
--- mtl-2.1.2-21/mtl/light_matrix.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/light_matrix.h 2005-04-11 10:58:02.644356352 +0200
@@ -125,12 +125,12 @@
class __iterator {
typedef __iterator self;
public:
- typedef oned::value_type value_type;
- typedef oned::pointer pointer;
- typedef oned::size_type size_type;
- typedef oned::difference_type difference_type;
+ typedef typename oned::value_type value_type;
+ typedef typename oned::pointer pointer;
+ typedef typename oned::size_type size_type;
+ typedef typename oned::difference_type difference_type;
- typedef typename IF<isConst, oned::const_reference, oned::reference>::RET reference;
+ typedef typename IF<isConst, typename oned::const_reference, typename oned::reference>::RET reference;
typedef std::random_access_iterator_tag iterator_category;
diff -Naur mtl-2.1.2-21/mtl/linalg_vec.h mtl-2.1.2-21mod/mtl/linalg_vec.h
--- mtl-2.1.2-21/mtl/linalg_vec.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/linalg_vec.h 2005-04-11 10:58:02.644356352 +0200
@@ -128,6 +128,7 @@
typedef size_type Vec_size_type;
typedef difference_type Vec_difference_type;
+ typedef value_type Vec_value_type;
typedef iterator Vec_iterator;
typedef const_iterator Vec_const_iterator;
@@ -136,7 +137,7 @@
typedef Vec_size_type size_type;
typedef Vec_difference_type difference_type;
- typedef Vec_size_type value_type;
+ typedef Vec_value_type value_type;
class iterator {
public:
diff -Naur mtl-2.1.2-21/mtl/matrix_implementation.h mtl-2.1.2-21mod/mtl/matrix_implementation.h
--- mtl-2.1.2-21/mtl/matrix_implementation.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/matrix_implementation.h 2005-04-11 11:26:10.205808016 +0200
@@ -348,14 +348,14 @@
: twod(m_in, orien()), indexer(orien::map(dim_type(m_in.nrows(),
m_in.ncols())))
{
- mtl::initialize(me, m_in);
+ initialize(me, m_in);
}
template <class Me>
inline matrix_implementation(hbstream& m_in, Me& me)
: twod(m_in, orien()), indexer(orien::map(dim_type(m_in.nrows(),
m_in.ncols())))
{
- mtl::initialize(me, m_in);
+ initialize(me, m_in);
}
template <class Me>
inline matrix_implementation(mmstream& m_in, band_type bw, Me& me)
@@ -366,7 +366,7 @@
indexer(orien::map(dim_type(m_in.nrows(), m_in.ncols())),
orien::map(bw))
{
- mtl::initialize(me, m_in);
+ initialize(me, m_in);
}
template <class Me>
inline matrix_implementation(hbstream& m_in, band_type bw, Me& me)
@@ -377,7 +377,7 @@
indexer(orien::map(dim_type(m_in.nrows(), m_in.ncols())),
orien::map(bw))
{
- mtl::initialize(me, m_in);
+ initialize(me, m_in);
}
inline ~matrix_implementation() { }
@@ -487,6 +487,7 @@
typedef typename Base::reference reference;
typedef typename Base::const_reference const_reference;
typedef typename Base::dim_type dim_type;
+ typedef typename Base::band_type band_type;
typedef typename Base::dyn_dim dyn_dim;
typedef typename Base::TwoD TwoD;
typedef typename Base::OneD OneD;
@@ -624,8 +625,8 @@
inline ~row_matrix() { }
inline void resize(size_type m, size_type n) {
- twod.resize(m, n);
- indexer.dim = dim_type(m, n);
+ this->twod.resize(m, n);
+ this->indexer.dim = dim_type(m, n);
}
/* submatrix */
@@ -654,18 +655,18 @@
inline submatrix_type sub_matrix(size_type row_start, size_type row_finish,
size_type col_start, size_type col_finish) const
{
- dim_type starts = indexer.at(dim_type(row_start, col_start));
+ dim_type starts = this->indexer.at(dim_type(row_start, col_start));
size_type m = row_finish - row_start;
size_type n = col_finish - col_start;
typedef typename TwoD::is_strided IsStrided;
if (IsStrided::id) {
- return submatrix_type((value_type*)twod.data()
- + starts.second() * twod.ld() + starts.first(),
- m, n, twod.ld());
+ return submatrix_type((value_type*) this->twod.data()
+ + starts.second() * this->twod.ld() + starts.first(),
+ m, n, this->twod.ld());
} else {
- return submatrix_type((value_type*)twod.data()
- + starts.first() * twod.ld() + starts.second(),
- m, n, twod.ld());
+ return submatrix_type((value_type*)this->twod.data()
+ + starts.first() * this->twod.ld() + starts.second(),
+ m, n, this->twod.ld());
}
}
@@ -851,8 +852,8 @@
inline ~column_matrix() { }
inline void resize(size_type m, size_type n) {
- twod.resize(n, m);
- indexer.dim = dim_type(n, m);
+ this->twod.resize(n, m);
+ this->indexer.dim = dim_type(n, m);
}
/* submatrix */
@@ -877,18 +878,18 @@
inline submatrix_type sub_matrix(size_type row_start, size_type row_finish,
size_type col_start, size_type col_finish) const
{
- dim_type starts = indexer.at(dim_type(row_start, col_start));
+ dim_type starts = this->indexer.at(dim_type(row_start, col_start));
size_type m = row_finish - row_start;
size_type n = col_finish - col_start;
typedef typename TwoD::is_strided IsStrided;
if (IsStrided::id) {
- return submatrix_type((value_type*)twod.data()
- + starts.second() * twod.ld() + starts.first(),
- m, n, twod.ld());
+ return submatrix_type((value_type*)this->twod.data()
+ + starts.second() * this->twod.ld() + starts.first(),
+ m, n, this->twod.ld());
} else {
- return submatrix_type((value_type*)twod.data()
- + starts.first() * twod.ld() + starts.second(),
- m, n, twod.ld());
+ return submatrix_type((value_type*)this->twod.data()
+ + starts.first() * this->twod.ld() + starts.second(),
+ m, n, this->twod.ld());
}
}
@@ -950,7 +951,7 @@
template<class Matrix>
inline typename rows_type<Matrix>::type
rows(const Matrix& A) {
- return rows_type<Matrix>::type(A, do_strided());
+ return typename rows_type<Matrix>::type(A, do_strided());
}
//: Access the column-wise view of the matrix
@@ -965,7 +966,7 @@
template<class Matrix>
inline typename columns_type<Matrix>::type
columns(const Matrix& A) {
- return columns_type<Matrix>::type(A, do_strided());
+ return typename columns_type<Matrix>::type(A, do_strided());
}
//: Swap the orientation of a matrix.
@@ -1228,11 +1229,11 @@
//: dynamic uplo constructor
inline symmetric_matrix(size_type n, int uplo_, int sub)
- : Base(m, n, Uplo::bandwidth(uplo_, sub, sub)) , uplo(uplo_) { }
+ : Base(this->m, n, Uplo::bandwidth(uplo_, sub, sub)) , uplo(uplo_) { }
//: constructor for external data with dynamic uplo
inline symmetric_matrix(pointer d, size_type n, int uplo_, int sub)
- : Base(d, m, n,
+ : Base(d, this->m, n,
Uplo::bandwidth(uplo_, sub, sub).first,
Uplo::bandwidth(uplo_, sub, sub).second) { }
@@ -1308,10 +1309,10 @@
/* bandwidth (is symmetric too) */
inline int sub() const {
- return MTL_MAX(indexer.super(), indexer.sub());
+ return MTL_MAX(this->indexer.super(), this->indexer.sub());
}
inline int super() const {
- return MTL_MAX(indexer.super(), indexer.sub());
+ return MTL_MAX(this->indexer.super(), this->indexer.sub());
}
};
diff -Naur mtl-2.1.2-21/mtl/mtl2lapack.h mtl-2.1.2-21mod/mtl/mtl2lapack.h
--- mtl-2.1.2-21/mtl/mtl2lapack.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/mtl2lapack.h 2005-04-11 10:58:02.647355896 +0200
@@ -1125,8 +1125,9 @@
int m = a.nrows();
int n = a.ncols();
int info;
+ typedef typename VectorT::value_type VT;
mtl_lapack_dispatch::orgqr(m, n, tau.size(), a.data(), lda,
- tau.data(), info);
+ const_cast<VT*>(tau.data()), info);
return info;
}
diff -Naur mtl-2.1.2-21/mtl/mtl_config.h mtl-2.1.2-21mod/mtl/mtl_config.h
--- mtl-2.1.2-21/mtl/mtl_config.h 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/mtl_config.h 2005-04-11 10:59:37.397951616 +0200
@@ -6,7 +6,7 @@
#define HAVE_COPYSIGN 1
#define HAVE_STD_ABS 1
-#define MTL_EXCEPTIONS 0
+#define MTL_EXCEPTIONS 1
/* #undef USE_BLAIS */
#define MTL_CMPLR_HAS_LIMITS 1
@@ -46,7 +46,7 @@
#if defined(__sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 730)
# define MTL_NO_TEMPLATE
-#elif defined(__GNUC__) && (__GNUC__ < 9)
+#elif defined(__GNUC__) && (__GNUC__ < 3) && (__GNUC_MINOR__ < 4)
# define MTL_NO_TEMPLATE
#elif defined(__KCC_VERSION) && (__KCC_VERSION < 3400)
# define MTL_NO_TEMPLATE
diff -Naur mtl-2.1.2-21/mtl/mtl_config.h.in mtl-2.1.2-21mod/mtl/mtl_config.h.in
--- mtl-2.1.2-21/mtl/mtl_config.h.in 2002-07-06 17:48:34.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/mtl_config.h.in 2005-04-11 10:58:02.648355744 +0200
@@ -45,7 +45,7 @@
#if defined(__sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 730)
# define MTL_NO_TEMPLATE
-#elif defined(__GNUC__) && (__GNUC__ < 9)
+#elif defined(__GNUC__) && (__GNUC__ < 3) && (__GNUC_MINOR__ < 4)
# define MTL_NO_TEMPLATE
#elif defined(__KCC_VERSION) && (__KCC_VERSION < 3400)
# define MTL_NO_TEMPLATE
diff -Naur mtl-2.1.2-21/mtl/mtl.h mtl-2.1.2-21mod/mtl/mtl.h
--- mtl-2.1.2-21/mtl/mtl.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/mtl.h 2005-04-11 10:58:02.650355440 +0200
@@ -114,7 +114,7 @@
typename linalg_traits<Vector>::value_type
sum(const Vector& x)
{
- return sum__(x, dim_n<Vector>::RET());
+ return sum__(x, typename dim_n<Vector>::RET());
}
#include "mtl/mtl_set.h"
@@ -151,7 +151,7 @@
void
scale_dim(Vector& x, const T& alpha, oned_tag)
{
- oned_scale(x, alpha, dim_n<Vector>::RET());
+ oned_scale(x, alpha, typename dim_n<Vector>::RET());
}
template <class Matrix, class T>
@@ -245,7 +245,7 @@
inline typename linalg_traits<Vector>::magnitude_type
one_norm(const Vector& x, oned_tag)
{
- return oned_one_norm(x, dim_n<Vector>::RET());
+ return oned_one_norm(x, typename dim_n<Vector>::RET());
}
@@ -297,7 +297,7 @@
inline typename linalg_traits<Vector>::magnitude_type
two_norm(const Vector& x)
{
- return oned_two_norm(x, dim_n<Vector>::RET());
+ return oned_two_norm(x, typename dim_n<Vector>::RET());
}
//: add square
@@ -1539,7 +1539,7 @@
{
typename VecX::const_iterator xi = x.begin();
for (; xi != x.end(); ++xi) {
- mtl::add(mtl::scaled(A[xi.index()], *xi), y);
+ add(scaled(A[xi.index()], *xi), y);
}
}
@@ -1552,7 +1552,7 @@
{
typename Matrix::const_iterator Ai;
for (Ai = A.begin(); Ai != A.end(); ++Ai) {
- y[Ai.index()] = mtl::dot(*Ai, x); // this is a sparse dot
+ y[Ai.index()] = dot(*Ai, x); // this is a sparse dot
}
}
@@ -1580,9 +1580,9 @@
instead
*/
if (z.size() <= x.size())
- mtl::add(z, x, z);
+ add(z, x, z);
else
- mtl::add(x, z, z);
+ add(x, z, z);
}
}
@@ -1672,7 +1672,7 @@
MTL_THROW_ASSERTION
{
VecZ& z = const_cast<VecZ&>(z_);
- mtl::copy(y, z);
+ copy(y, z);
typedef typename matrix_traits<Matrix>::shape Shape;
mult_shape__(A, x, z, Shape());
}
@@ -1700,7 +1700,7 @@
inline void
mult_dim__(const Matrix& A, const VecX& x, VecY& y, oned_tag) MTL_THROW_ASSERTION
{
- mtl::mult(A, x, mtl::scaled(y, 0), y);
+ mult(A, x, scaled(y, 0), y);
#if 0
typedef typename matrix_traits<Matrix>::shape Shape;
mult_shape__(A, x, y, Shape());
@@ -1782,7 +1782,7 @@
scal = *Aij;
jj = Aij.column();
// add B[jj] and tmp1 into tmp2
- add(mtl::scaled(B[jj], scal), tmp1, tmp2);
+ add(scaled(B[jj], scal), tmp1, tmp2);
tmp1.clear();
// swap tmp1 and tmp2
tmp3 = tmp1; tmp1 = tmp2; tmp2 = tmp3;
@@ -1848,7 +1848,7 @@
scal = *Bjk;
kk = Bjk.row();
// add A[kk] and tmp1 into tmp2
- add(mtl::scaled(A[kk], scal), tmp1, tmp2);
+ add(scaled(A[kk], scal), tmp1, tmp2);
tmp1.clear();
// swap tmp1 and tmp2
tmp3 = tmp1; tmp1 = tmp2; tmp2 = tmp3;
@@ -1987,7 +1987,7 @@
C(i,j) += B(i,j);
}
- simple_mult(A, B, C, mtl::dense_tag(), Orien());
+ simple_mult(A, B, C, dense_tag(), Orien());
}
//: Dispatch to row/column general and banded matrices
@@ -2243,7 +2243,7 @@
/* unoptimized version */
for (int j = 0; j < B.ncols(); ++j)
- mtl::tri_solve(T, columns(B)[j]);
+ tri_solve(T, columns(B)[j]);
/* JGS need to do an optimized version of this
@@ -2445,7 +2445,7 @@
oned_copy(const VecX& x, VecY& y, dense_tag, dense_tag) MTL_THROW_ASSERTION
{
MTL_ASSERT(x.size() <= y.size(), "mtl::copy()");
- copy__(x, y, dim_n<VecX>::RET());
+ copy__(x, y, typename dim_n<VecX>::RET());
}
#if 0
@@ -2478,7 +2478,7 @@
oned_copy(const VecX& x, VecY& y, sparse_tag, dense_tag) MTL_THROW_ASSERTION
{
typedef typename linalg_traits<VecY>::value_type T;
- mtl::set_value(y, T(0));
+ set_value(y, T(0));
typename VecX::const_iterator xi;
for (xi = x.begin(); xi != x.end(); ++xi)
y[xi.index()] = *xi;
@@ -2713,7 +2713,7 @@
{
MTL_ASSERT(x.size() <= y.size(), "mtl::add()");
- add__(x, y, dim_n<VecX>::RET());
+ add__(x, y, typename dim_n<VecX>::RET());
}
@@ -2770,14 +2770,14 @@
++yi;
}
z_.clear();
- mtl::copy(z, z_);
+ copy(z, z_);
}
template <class VecX, class VecY, class VecZ>
inline void
oned_add(const VecX& x, const VecY& y, VecZ& z, dense_tag) MTL_THROW_ASSERTION
{
- oned_add(x, y, z, dim_n<VecX>::RET());
+ oned_add(x, y, z, typename dim_n<VecX>::RET());
}
@@ -3003,7 +3003,7 @@
MTL_ASSERT(x.size() <= y.size(), "mtl::ele_mult()");
MTL_ASSERT(x.size() <= z.size(), "mtl::ele_mult()");
- ele_mult(x, y, z, dim_n<VecX>::RET());
+ ele_mult(x, y, z, typename dim_n<VecX>::RET());
}
@@ -3080,7 +3080,7 @@
swap(VecX& x, VecY& y, oned_tag) MTL_THROW_ASSERTION
{
MTL_ASSERT(x.size() <= y.size(), "mtl::swap()");
- swap(x, y, dim_n<VecX>::RET());
+ swap(x, y, typename dim_n<VecX>::RET());
}
@@ -3153,7 +3153,7 @@
inline T
dot(const VecX& x, const VecY& y, T s, dense_tag, dense_tag)
{
- return dot(x, y, s, dim_n<VecX>::RET());
+ return dot(x, y, s, typename dim_n<VecX>::RET());
}
template <class InputIterator1, class InputIterator2, class T>
@@ -3246,7 +3246,7 @@
dot(const VecX& x, const VecY& y) MTL_THROW_ASSERTION
{
typedef typename VecX::value_type T;
- return mtl::dot(x, y, T(0));
+ return dot(x, y, T(0));
}
#ifdef USE_DOUBLE_DOUBLE
@@ -3305,7 +3305,7 @@
dot_conj(const VecX& x, const VecY& y, T s) MTL_THROW_ASSERTION
{
MTL_ASSERT(x.size() <= y.size(), "mtl::dot_conj()");
- return dot_conj(x, y, s, dim_n<VecX>::RET());
+ return dot_conj(x, y, s, typename dim_n<VecX>::RET());
}
//: Dot Conjugate: <tt>s <- x . conj(y)</tt>
@@ -3319,7 +3319,7 @@
dot_conj(const VecX& x, const VecY& y) MTL_THROW_ASSERTION
{
typedef typename VecX::value_type T;
- return mtl::dot_conj(x, y, T(0));
+ return dot_conj(x, y, T(0));
}
diff -Naur mtl-2.1.2-21/mtl/mtl_set.h mtl-2.1.2-21mod/mtl/mtl_set.h
--- mtl-2.1.2-21/mtl/mtl_set.h 2002-07-06 17:48:35.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/mtl_set.h 2005-04-11 10:58:02.650355440 +0200
@@ -28,7 +28,7 @@
void
set__(Vector x, const T& alpha, oned_tag)
{
- oned_set(x, alpha, dim_n<Vector>::RET());
+ oned_set(x, alpha, typename dim_n<Vector>::RET());
}
@@ -59,7 +59,7 @@
void
set__(Matrix A, const T& alpha, twod_tag)
{
- set__(A, alpha, dim_m<Matrix>::RET());
+ set__(A, alpha, typename dim_m<Matrix>::RET());
}
diff -Naur mtl-2.1.2-21/mtl/reverse_iter.h mtl-2.1.2-21mod/mtl/reverse_iter.h
--- mtl-2.1.2-21/mtl/reverse_iter.h 2002-07-06 17:48:36.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/reverse_iter.h 2005-04-11 10:58:02.650355440 +0200
@@ -68,15 +68,15 @@
reverse_iter(Iter x) : super(x) {}
inline difference_type index() const {
- Iter tmp = current;
+ Iter tmp = this->current;
return (--tmp).index();
}
inline difference_type row() const {
- Iter tmp = current;
+ Iter tmp = this->current;
return (--tmp).row();
}
inline difference_type column() const {
- Iter tmp = current;
+ Iter tmp = this->current;
return (--tmp).column();
}
diff -Naur mtl-2.1.2-21/mtl/stamp-h mtl-2.1.2-21mod/mtl/stamp-h
--- mtl-2.1.2-21/mtl/stamp-h 1970-01-01 01:00:00.000000000 +0100
+++ mtl-2.1.2-21mod/mtl/stamp-h 2005-04-11 10:59:37.401951008 +0200
@@ -0,0 +1 @@
+timestamp
diff -Naur mtl-2.1.2-21/mtl/transform_iterator.h mtl-2.1.2-21mod/mtl/transform_iterator.h
--- mtl-2.1.2-21/mtl/transform_iterator.h 2002-07-06 17:48:36.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/transform_iterator.h 2005-04-11 10:58:02.651355288 +0200
@@ -264,24 +264,24 @@
inline general_stride_iterator(RandomAccessIterator i, StrideGen s)
: super(*this, i), stride_gen(s) { }
inline self& operator++() {
- stride_gen.inc(iter);
+ stride_gen.inc(this->iter);
return *this;
}
inline self& operator--() {
- stride_gen.dec(iter);
+ stride_gen.dec(this->iter);
return *this;
}
inline self& operator+=(Distance n) {
- stride_gen.advance(iter, n);
+ stride_gen.advance(this->iter, n);
return *this;
}
inline self& operator-=(Distance n) {
- stride_gen.advance(iter, -n);
+ stride_gen.advance(this->iter, -n);
return *this;
}
inline Distance diff(const self& y) const {
- return stride_gen.diff(iter, y.iter, y.stride_gen);
+ return stride_gen.diff(this->iter, y.iter, y.stride_gen);
}
inline friend Distance operator-(const self& x, const self& y) {
diff -Naur mtl-2.1.2-21/mtl/utils.h mtl-2.1.2-21mod/mtl/utils.h
--- mtl-2.1.2-21/mtl/utils.h 2002-07-06 17:48:36.000000000 +0200
+++ mtl-2.1.2-21mod/mtl/utils.h 2005-04-11 10:58:02.651355288 +0200
@@ -50,7 +50,7 @@
{
for (typename Vector::iterator i = x.begin();
i != x.end(); ++i) {
- mtl::print_vector(*i);
+ print_vector(*i);
}
}
@@ -63,7 +63,7 @@
Int i,j;
for (i=0; i < A.nrows(); ++i) {
for (j=0; j < A.ncols(); ++j)
- mtl::print_all_matrix( A(i,j) );
+ print_all_matrix( A(i,j) );
std::cout << std::endl;
}
}
@@ -80,7 +80,7 @@
A_i = (*A_kk).begin();
A_iend = (*A_kk).end();
while (not_at(A_i, A_iend)) {
- mtl::print_all_matrix( *A_i );
+ print_all_matrix( *A_i );
++A_i;
}
++A_kk;
@@ -99,7 +99,7 @@
A_i = (*A_kk).begin();
A_iend = (*A_kk).end();
while (not_at(A_i, A_iend)) {
- mtl::print_all_matrix( *A_i );
+ print_all_matrix( *A_i );
++A_i;
}
++A_kk;