This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
gcc 3.0 vs mtl 2.12.2-19
- To: gcc at gcc dot gnu dot org
- Subject: gcc 3.0 vs mtl 2.12.2-19
- From: Peter Schmid <schmid at snake dot iap dot physik dot tu-darmstadt dot de>
- Date: Fri, 15 Jun 2001 16:46:24 +0200 (CEST)
- cc: mtl at lsc dot nd dot edu, libstdc++ at gcc dot gnu dot org
After applying the appended patch, gcc 3.0 version 3.0 20010614 can
compile mtl without a problem. I did not run all of the executables, but
the ones I tried worked fine, as far as I can tell.
The patches to the itl header files are ugly hacks to make it
compile. This is a mtl related problem, since the mtl implementation
assumes that iterators are implemented by pointers.
I could not run the testsuite in the tests directory because of perl
related problems running make_and_test.pl; I do not know how to fix
these.
Hope this helps,
Peter Schmid
diff -cpr alt/mtl-2.1.2-19/contrib/itl/itl/cholesky.h neu/mtl-2.1.2-19/contrib/itl/itl/cholesky.h
*** alt/mtl-2.1.2-19/contrib/itl/itl/cholesky.h Mon Aug 28 18:36:05 2000
--- neu/mtl-2.1.2-19/contrib/itl/itl/cholesky.h Fri Jun 15 15:32:02 2001
*************** namespace itl {
*** 162,169 ****
Tri = TriMatrix(A.nrows(), A.ncols(),
! Tri_loc, Tri_val.begin(), Tri_ptr.begin(),
! Tri_ind.begin());
} else {
cout << "Warning: It is not so efficient as symmetric row-wise upper Matrix" << endl;
assert(0);
--- 162,169 ----
Tri = TriMatrix(A.nrows(), A.ncols(),
! Tri_loc, &(*Tri_val.begin()), &(*Tri_ptr.begin()),
! &(*Tri_ind.begin()));
} else {
cout << "Warning: It is not so efficient as symmetric row-wise upper Matrix" << endl;
assert(0);
*************** namespace itl {
*** 220,227 ****
Tri_val[d] = sqrt(Tri_val[d]);
Tri = TriMatrix(A.nrows(), A.ncols(),
! Tri_loc, Tri_val.begin(), Tri_ptr.begin(),
! Tri_ind.begin());
}
}
--- 220,227 ----
Tri_val[d] = sqrt(Tri_val[d]);
Tri = TriMatrix(A.nrows(), A.ncols(),
! Tri_loc, &(*Tri_val.begin()), &(*Tri_ptr.begin()),
! &(*Tri_ind.begin()));
}
}
diff -cpr alt/mtl-2.1.2-19/contrib/itl/itl/ilu.h neu/mtl-2.1.2-19/contrib/itl/itl/ilu.h
*** alt/mtl-2.1.2-19/contrib/itl/itl/ilu.h Mon Aug 28 18:36:06 2000
--- neu/mtl-2.1.2-19/contrib/itl/itl/ilu.h Fri Jun 15 15:32:02 2001
*************** namespace itl {
*** 157,168 ****
}
L = LUMatrix(A_.nrows(), A_.ncols(),
! L_loc, L_val.begin(), L_ptr.begin(),
! L_ind.begin());
U = LUMatrix(A_.nrows(), A_.ncols(),
! U_loc, U_val.begin(), U_ptr.begin(),
! U_ind.begin());
}
void
--- 157,168 ----
}
L = LUMatrix(A_.nrows(), A_.ncols(),
! L_loc, &(*L_val.begin()), &(*L_ptr.begin()),
! &(*L_ind.begin()));
U = LUMatrix(A_.nrows(), A_.ncols(),
! U_loc, &(*U_val.begin()), &(*U_ptr.begin()),
! &(*U_ind.begin()));
}
void
*************** namespace itl {
*** 232,243 ****
L = LUMatrix(A_.nrows(), A_.ncols(),
! L_loc, L_val.begin(), L_ptr.begin(),
! L_ind.begin());
U = LUMatrix(A_.nrows(), A_.ncols(),
! U_loc, U_val.begin(), U_ptr.begin(),
! U_ind.begin());
}
--- 232,243 ----
L = LUMatrix(A_.nrows(), A_.ncols(),
! L_loc, &(*L_val.begin()), &(*L_ptr.begin()),
! &(*L_ind.begin()));
U = LUMatrix(A_.nrows(), A_.ncols(),
! U_loc, &(*U_val.begin()), &(*U_ptr.begin()),
! &(*U_ind.begin()));
}
diff -cpr alt/mtl-2.1.2-19/contrib/itl/itl/ssor.h neu/mtl-2.1.2-19/contrib/itl/itl/ssor.h
*** alt/mtl-2.1.2-19/contrib/itl/itl/ssor.h Mon Aug 28 18:36:08 2000
--- neu/mtl-2.1.2-19/contrib/itl/itl/ssor.h Fri Jun 15 15:32:02 2001
*************** namespace itl {
*** 144,150 ****
A_ii = T(1)/A_ii;
transform(A_row.begin()+d, A_row.end(), U_val.begin()+U_loc,
! bind2nd(multiplies<T>(), A_ii));
std::copy(A_row.nz_struct().begin()+d, A_row.nz_struct().end(),
U_ind.begin()+U_loc);
--- 144,150 ----
A_ii = T(1)/A_ii;
transform(A_row.begin()+d, A_row.end(), U_val.begin()+U_loc,
! std::bind2nd(std::multiplies<T>(), A_ii));
std::copy(A_row.nz_struct().begin()+d, A_row.nz_struct().end(),
U_ind.begin()+U_loc);
*************** namespace itl {
*** 162,173 ****
L = LUMatrix(A.nrows(), A.ncols(),
! L_loc, L_val.begin(), L_ptr.begin(),
! L_ind.begin());
U = LUMatrix(A.nrows(), A.ncols(),
! U_loc, U_val.begin(), U_ptr.begin(),
! U_ind.begin());
}
void
--- 162,173 ----
L = LUMatrix(A.nrows(), A.ncols(),
! L_loc, &(*L_val.begin()), &(*L_ptr.begin()),
! &(*L_ind.begin()));
U = LUMatrix(A.nrows(), A.ncols(),
! U_loc, &(*U_val.begin()), &(*U_ptr.begin()),
! &(*U_ind.begin()));
}
void
*************** namespace itl {
*** 204,210 ****
A_ii = 1./A_ii;
transform(A_col.begin()+d, A_col.end(), L_val.begin()+L_loc,
! bind2nd(multiplies<T>(), A_ii));
std::copy(A_col.nz_struct().begin()+d, A_col.nz_struct().end(),
L_ind.begin()+L_loc);
--- 204,210 ----
A_ii = 1./A_ii;
transform(A_col.begin()+d, A_col.end(), L_val.begin()+L_loc,
! std::bind2nd(std::multiplies<T>(), A_ii));
std::copy(A_col.nz_struct().begin()+d, A_col.nz_struct().end(),
L_ind.begin()+L_loc);
*************** namespace itl {
*** 222,233 ****
L = LUMatrix(A.nrows(), A.ncols(),
! L_loc, L_val.begin(), L_ptr.begin(),
! L_ind.begin());
U = LUMatrix(A.nrows(), A.ncols(),
! U_loc, U_val.begin(), U_ptr.begin(),
! U_ind.begin());
}
public:
--- 222,233 ----
L = LUMatrix(A.nrows(), A.ncols(),
! L_loc, &(*L_val.begin()), &(*L_ptr.begin()),
! &(*L_ind.begin()));
U = LUMatrix(A.nrows(), A.ncols(),
! U_loc, &(*U_val.begin()), &(*U_ptr.begin()),
! &(*U_ind.begin()));
}
public:
diff -cpr alt/mtl-2.1.2-19/contrib/itl/test/define_matrix.h neu/mtl-2.1.2-19/contrib/itl/test/define_matrix.h
*** alt/mtl-2.1.2-19/contrib/itl/test/define_matrix.h Mon Aug 28 18:36:15 2000
--- neu/mtl-2.1.2-19/contrib/itl/test/define_matrix.h Fri Jun 15 06:19:02 2001
***************
*** 1,4 ****
!
using namespace itl;
typedef double Type;
! typedef mtl::matrix<Type,mtl::rectangle<>, mtl::array<mtl::compressed<> >, mtl::row_major >::type Matrix ;
--- 1,4 ----
! using namespace mtl;
using namespace itl;
typedef double Type;
! typedef mtl::matrix<Type,mtl::rectangle<>, mtl::array<compressed<> >, mtl::column_major >::type Matrix ;
diff -cpr alt/mtl-2.1.2-19/mtl/blais.h neu/mtl-2.1.2-19/mtl/blais.h
*** alt/mtl-2.1.2-19/mtl/blais.h Mon Aug 28 18:36:18 2000
--- neu/mtl-2.1.2-19/mtl/blais.h Thu Jun 14 11:15:36 2001
*************** public:
*** 426,432 ****
add_op(IterY& y_) : y(y_) { }
template <class Col, class T>
IterY operator()(const Col& a, const T& x) {
! #ifdef __GNUC__ /* parse error :( */
blais::blais_scaled_iter<typename Col::const_iterator> scl_a(a.begin(), x);
blais_vv::add<M>(scl_a, y); return y;
#else
--- 426,432 ----
add_op(IterY& y_) : y(y_) { }
template <class Col, class T>
IterY operator()(const Col& a, const T& x) {
! #if (__GNUC__ < 3) /* parse error :( */
blais::blais_scaled_iter<typename Col::const_iterator> scl_a(a.begin(), x);
blais_vv::add<M>(scl_a, y); return y;
#else
diff -cpr alt/mtl-2.1.2-19/mtl/block1D.h neu/mtl-2.1.2-19/mtl/block1D.h
*** alt/mtl-2.1.2-19/mtl/block1D.h Mon Aug 28 18:36:19 2000
--- neu/mtl-2.1.2-19/mtl/block1D.h Thu Jun 14 11:15:36 2001
*************** public:
*** 59,65 ****
inline iterator(T* s, size_type p, size_type bs)
: start(s), pos(p), bsize(bs) { }
! inline iterator( ) : start(0), pos(0), bs(0) { }
inline reference operator*() const {
return Block(start + pos*bsize, bsize);
--- 59,65 ----
inline iterator(T* s, size_type p, size_type bs)
: start(s), pos(p), bsize(bs) { }
! inline iterator( ) : start(0), pos(0), bsize(0) { }
inline reference operator*() const {
return Block(start + pos*bsize, bsize);
diff -cpr alt/mtl-2.1.2-19/mtl/block2D.h neu/mtl-2.1.2-19/mtl/block2D.h
*** alt/mtl-2.1.2-19/mtl/block2D.h Mon Aug 28 18:36:19 2000
--- neu/mtl-2.1.2-19/mtl/block2D.h Thu Jun 14 11:15:36 2001
*************** public:
*** 262,269 ****
protected:
T* start;
- size_type pos;
size_type ld;
Offset offset;
block_dim_type bdim;
};
--- 262,269 ----
protected:
T* start;
size_type ld;
+ size_type pos;
Offset offset;
block_dim_type bdim;
};
diff -cpr alt/mtl-2.1.2-19/mtl/matrix_implementation.h neu/mtl-2.1.2-19/mtl/matrix_implementation.h
*** alt/mtl-2.1.2-19/mtl/matrix_implementation.h Mon Aug 28 18:36:30 2000
--- neu/mtl-2.1.2-19/mtl/matrix_implementation.h Thu Jun 14 11:15:36 2001
*************** public:
*** 503,509 ****
gen_banded_indexer<typename IndexerGen::orienter,M,N,size_type> > banded_view_type;
! #if !defined( __GNUC__ ) && !defined( _MSVCPP_ ) /* internal compiler error */
template <int BM, int BN>
struct blocked_view {
#if 0
--- 503,509 ----
gen_banded_indexer<typename IndexerGen::orienter,M,N,size_type> > banded_view_type;
! #if ( __GNUC__ >= 3) || !defined( _MSVCPP_ ) /* internal compiler error */
template <int BM, int BN>
struct blocked_view {
#if 0
*************** public:
*** 725,731 ****
typedef column_matrix<typename TwoDGen::banded_view_type,
gen_banded_indexer<typename IndexerGen::orienter,M,N,size_type> > banded_view_type;
! #if !defined( __GNUC__) && !defined( _MSVCPP_ ) /* internal compiler error */
template <int BM, int BN>
struct blocked_view {
#if 0
--- 725,731 ----
typedef column_matrix<typename TwoDGen::banded_view_type,
gen_banded_indexer<typename IndexerGen::orienter,M,N,size_type> > banded_view_type;
! #if ( __GNUC__ >= 3) || !defined( _MSVCPP_ ) /* internal compiler error */
template <int BM, int BN>
struct blocked_view {
#if 0
diff -cpr alt/mtl-2.1.2-19/mtl/mtl2lapack.h neu/mtl-2.1.2-19/mtl/mtl2lapack.h
*** alt/mtl-2.1.2-19/mtl/mtl2lapack.h Mon Aug 28 18:36:31 2000
--- neu/mtl-2.1.2-19/mtl/mtl2lapack.h Thu Jun 14 11:37:16 2001
*************** enum GEEV_JOBV {GEEV_CALC_LEFT, GEEV_CAL
*** 836,854 ****
void error_message(int ret_val)
{
if (ret_val==0)
! cout << "No error" << endl;
else if (ret_val > 0)
! cout << "Computational error." << endl;
else if (ret_val > -101)
! cout << "Argument #"
<< -ret_val
<< " of lapack subroutine had an illegal value."
! << endl;
else
! cout << "Argument #"
<< -(ret_val+100)
<< "of mtl_lapack subroutine had an illegal value."
! << endl;
}
//: Equilibrate and reduce condition number.
--- 836,854 ----
void error_message(int ret_val)
{
if (ret_val==0)
! std::cout << "No error" << std::endl;
else if (ret_val > 0)
! std::cout << "Computational error." << std::endl;
else if (ret_val > -101)
! std::cout << "Argument #"
<< -ret_val
<< " of lapack subroutine had an illegal value."
! << std::endl;
else
! std::cout << "Argument #"
<< -(ret_val+100)
<< "of mtl_lapack subroutine had an illegal value."
! << std::endl;
}
//: Equilibrate and reduce condition number.
diff -cpr alt/mtl-2.1.2-19/mtl/mtl_algo.h neu/mtl-2.1.2-19/mtl/mtl_algo.h
*** alt/mtl-2.1.2-19/mtl/mtl_algo.h Mon Aug 28 18:36:31 2000
--- neu/mtl-2.1.2-19/mtl/mtl_algo.h Thu Jun 14 11:15:36 2001
*************** template <class ForwardIterator1, class
*** 87,93 ****
inline void
iter_swap(ForwardIterator1 a, ForwardIterator2 b)
{
! typedef typename iterator_traits <ForwardIterator1>::value_type
Value;
mtl_algo::__iter_swap(a, b, (Value*)0);
}
--- 87,93 ----
inline void
iter_swap(ForwardIterator1 a, ForwardIterator2 b)
{
! typedef typename std::iterator_traits <ForwardIterator1>::value_type
Value;
mtl_algo::__iter_swap(a, b, (Value*)0);
}
*************** OutputIterator
*** 203,209 ****
partial_sum(InputIterator first, InputIterator last,
OutputIterator result)
{
! typedef iterator_traits<InputIterator>::value_type sum_type;
if( mtl::not_at(first, last) ) {
sum_type sum1( *first );
for(;;) {
--- 203,209 ----
partial_sum(InputIterator first, InputIterator last,
OutputIterator result)
{
! typedef std::iterator_traits<InputIterator>::value_type sum_type;
if( mtl::not_at(first, last) ) {
sum_type sum1( *first );
for(;;) {
*************** OutputIterator
*** 226,232 ****
partial_sum (InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation op)
{
! typedef iterator_traits<InputIterator>::value_type sum_type;
if( mtl::not_at(first, last) ) {
sum_type sum1( *first );
for(;;) {
--- 226,232 ----
partial_sum (InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation op)
{
! typedef std::iterator_traits<InputIterator>::value_type sum_type;
if( mtl::not_at(first, last) ) {
sum_type sum1( *first );
for(;;) {
*************** OutputIterator
*** 251,257 ****
adjacent_difference(InputIterator first, InputIterator last,
OutputIterator result)
{
! typedef typename iterator_traits <InputIterator>::value_type
value_type;
if (mtl::not_at(first, last)) {
value_type value0( *first );
--- 251,257 ----
adjacent_difference(InputIterator first, InputIterator last,
OutputIterator result)
{
! typedef typename std::iterator_traits <InputIterator>::value_type
value_type;
if (mtl::not_at(first, last)) {
value_type value0( *first );
*************** adjacent_difference(InputIterator first,
*** 272,278 ****
OutputIterator result,
BinaryOperation binary_op)
{
! typedef typename iterator_traits <InputIterator>::value_type
value_type;
if (mtl::not_at(first, last)) {
value_type value0( *first );
--- 272,278 ----
OutputIterator result,
BinaryOperation binary_op)
{
! typedef typename std::iterator_traits <InputIterator>::value_type
value_type;
if (mtl::not_at(first, last)) {
value_type value0( *first );
diff -cpr alt/mtl-2.1.2-19/test/src/matrix_row_col_test.cc neu/mtl-2.1.2-19/test/src/matrix_row_col_test.cc
*** alt/mtl-2.1.2-19/test/src/matrix_row_col_test.cc Mon Aug 28 18:35:46 2000
--- neu/mtl-2.1.2-19/test/src/matrix_row_col_test.cc Thu Jun 14 11:16:24 2001
*************** bool rows_columns_test(Matrix& A, std::s
*** 74,80 ****
bool ret2 = rows_test(rows(A), test_name, Shape(), Orien());
bool ret3 = columns_test(columns(A), test_name, Shape(), Orien());
if (ret1 && ret2 && ret3)
! std::cout << test_name.c_str() << " passed rows & columns test" << std::std::endl;
return ret1 && ret2 && ret3;
}
--- 74,80 ----
bool ret2 = rows_test(rows(A), test_name, Shape(), Orien());
bool ret3 = columns_test(columns(A), test_name, Shape(), Orien());
if (ret1 && ret2 && ret3)
! std::cout << test_name.c_str() << " passed rows & columns test" << std::endl;
return ret1 && ret2 && ret3;
}