SSOR bug under MSVC6?

Sven Olsen <[email protected]> Wed, 10 Dec 2003 20:40:44 -0500
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Hello again, I've run into what seems to be a bug in ITL.
When I try to use SSOR to precondition a dense matrix, MSVC6 gives me a 
compiler error.
Here is code that illustrates the problem:

#ifdef WIN32
#pragma warning(disable: 4786)
#endif

#include <mtl/matrix.h>
#include <mtl/mtl.h>
#include <mtl/utils.h>
#include <itl/interface/mtl.h>
#include "itl/preconditioner/ssor.h"
using namespace mtl;
using namespace itl;

typedef matrix< double, rectangle<>, dense<internal>, row_major >::type Matrix;

int main() {
   Matrix A(2, 2);
   SSOR<Matrix> precond(A);
   return 0;
}




It looks like the problem is happening inside of do_ssor(), the exact line is:

typename Matrix::OneD::IndexArray::const_iterator
	diag_location =
	upper_bound(A_row.nz_struct().begin(), A_row.nz_struct().end(), i);

which MSVC claims is an illegal conversion from 
dense_iterator<double,0,0,unsigned int> to dense_iterator<int,1,0,unsigned 
int>. (From what little I can tell, the 0-1 conversion isn't a problem, but 
the double-int conversion is.)

MSVC also has a problem with the '-' operator on the following line.

Any ideas how I could fix this?

Thanks,
	Sven

The exact compiler errors are:

C:\ITERATIVE\ITL-4.0.0-1\itl/preconditioner/ssor.h(112) : error C2440: 
'initializing' : cannot convert from 'class 
mtl::dense_iterator<double,0,0,unsigned int>' to 'class 
mtl::dense_iterator<int,1,0,unsigned int>'
         No constructor could take the source type, or constructor overload 
resolution was ambiguous
         C:\ITERATIVE\ITL-4.0.0-1\itl/preconditioner/ssor.h(94) : while 
compiling class-template member function 'void __thiscall itl::SSOR<class 
mtl::row_matrix<struct mtl::gen_dense2D<double,struct 
mtl::gen_rect_offset<0,0>,0,0>,struct mtl::gen_rec
t_indexer<struct mtl::row_orien,0,0,unsigned int> > >::do_ssor(const class 
mtl::row_matrix<struct mtl::gen_dense2D<double,struct 
mtl::gen_rect_offset<0,0>,0,0>,struct mtl::gen_rect_indexer<struct 
mtl::row_orien,0,0,unsigned int> > &,struct mtl::row_
tag)'
C:\ITERATIVE\ITL-4.0.0-1\itl/preconditioner/ssor.h(114) : error C2678: 
binary '-' : no operator defined which takes a left-hand operand of type 
'class mtl::dense_iterator<int,1,0,unsigned int>' (or there is no 
acceptable conversion)
         C:\ITERATIVE\ITL-4.0.0-1\itl/preconditioner/ssor.h(94) : while 
compiling class-template member function 'void __thiscall itl::SSOR<class 
mtl::row_matrix<struct mtl::gen_dense2D<double,struct 
mtl::gen_rect_offset<0,0>,0,0>,struct mtl::gen_rec
t_indexer<struct mtl::row_orien,0,0,unsigned int> > >::do_ssor(const class 
mtl::row_matrix<struct mtl::gen_dense2D<double,struct 
mtl::gen_rect_offset<0,0>,0,0>,struct mtl::gen_rect_indexer<struct 
mtl::row_orien,0,0,unsigned int> > &,struct mtl::row_
tag)'

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/