MTL: Hello dear MTL-developers

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown MTL: Hello dear MTL-developers

by Сергей Авдеев :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good day.

My name Sergey Avdeev. And I'm a student of Novosibirsk State University (Russia). In my research work I need to manage with big matrices and vectors and I wanted it faster, then my own BLAS did this. That is why I decided to download and use your library. According to the site (http://www.osl.iu.edu/research/mtl/) MTL have many matrix/vector types and basic operators implementation. Only one problem I had, this is Microsoft Visual Studio 2005 Express Edition (I develop my project with it). I downloaded and installed mtl-2.1.2-21 (For Visual C++ 7 .NET, I know that I have VC8). So, when I try to compile the simplest code like:

#include "mtl/mtl.h"
void main()
{}

I have got a long list of compile errors in MTL's files (Error list 1.txt file in the attachment).
The first and probably the most important error was
   mtl-2.1.2-21\mtl\light1d.h(87) : error C2039: '_Ptrit' : is not a member of 'std'

Then I download mtl-2.1.2-22ForVS2005.zip and patch the library with this files.
Try the same code again. And I got another long list of errors (Error list 2.txt)

I was very upset, because I did not know what to do with this error. Did not find the answer, I try to search it in the Internet. And I found something:
http://osdir.com/ml/lib.mtl.devel/2004-06/msg00004.html on this web-page one user asked, and one another answered him by posting some files, which was corrected by him to compile under .NET 2003.
List of files: mtl.h , dense2D.h , linalg_vec.h , dense_iterator.h , light_matrix.h , ligth1D.h .
I patched the library by this files and try to compile again.
That time I got much shorter error list than all previous (Error list 3.txt). I was inspired and try to eliminate errors (by my self). After light_matrix.h was a little bit changed (ligth_matrix.h in the attachment, new lines have now comment // Changed by SergeyAvd ...), then the simplest code was compiled successfully(!!!).
Next I try to compile ITL(4.0.0-1) examples with MTL. Got some errors. Change one file (gmres.h) from ITL. Only then I was able to use libraries.

I write this letter for probably improve MTL and ITL for MS VS 2005 . If my information are urgent, post it on your site to help new MS VS 2005/2008 users to start with MTL, ITL..

In the end of my letter I want to note that your library is not on top of perfection in field of documentation (manual) and have mistakes in pseudo-code (concept files). So, I can help project to improve this things.

If you are interested in my proposal answer me.

Good bye.

*****************************************************************************
**                                                                         **
** WARNING:  This email contains an attachment of a very suspicious type.  **
** You are urged NOT to open this attachment unless you are absolutely     **
** sure it is legitimate.  Opening this attachment may cause irreparable   **
** damage to your computer and your files.  If you have any questions      **
** about the validity of this message, PLEASE SEEK HELP BEFORE OPENING IT. **
**                                                                         **
** This warning was added by the IU Computer Science Dept. mail scanner.   **
*****************************************************************************


1>------ Build started: Project: TryITL2, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(87) : error C2039: '_Ptrit' : is not a member of 'std'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(200) : see reference to class template instantiation 'mtl::light1D<T,NN,IND_OFFSET>' being compiled
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(87) : error C2143: syntax error : missing ';' before '<'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(87) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(87) : error C2238: unexpected token(s) preceding ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(88) : error C2039: '_Ptrit' : is not a member of 'std'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(88) : error C2059: syntax error : '<'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(88) : error C2238: unexpected token(s) preceding ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(90) : error C2065: 'ptr_iterator' : undeclared identifier
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(92) : error C2065: 'ptr_const_iterator' : undeclared identifier
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(102) : error C3203: 'dense_iterator' : unspecialized class template can't be used as a template argument for template parameter 'Iter', expected a real type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light1d.h(104) : error C3203: 'dense_iterator' : unspecialized class template can't be used as a template argument for template parameter 'Iter', expected a real type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(415) : error C2039: '_Ptrit' : is not a member of 'std'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(570) : see reference to class template instantiation 'mtl::external_vec<T,NN,SizeType>' being compiled
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(415) : error C2143: syntax error : missing ';' before '<'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(415) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(415) : error C2238: unexpected token(s) preceding ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(416) : error C2039: '_Ptrit' : is not a member of 'std'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(416) : error C2059: syntax error : '<'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(416) : error C2238: unexpected token(s) preceding ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(428) : error C3203: 'dense_iterator' : unspecialized class template can't be used as a template argument for template parameter 'Iter', expected a real type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\linalg_vec.h(430) : error C3203: 'dense_iterator' : unspecialized class template can't be used as a template argument for template parameter 'Iter', expected a real type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(177) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(106) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(414) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>' being compiled
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2208: 'T' : no members defined using this type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(111) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2208: 'SizeType' : no members defined using this type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(113) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' is not a valid template type argument for parameter 'A'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a valid template type argument for parameter 'B'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(137) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2805: binary 'operator +=' has too few parameters
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator +=' : error in function declaration; skipping function body
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2805: binary 'operator -=' has too few parameters
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator -=' : error in function declaration; skipping function body
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2146: syntax error : missing ';' before identifier 'index'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : warning C4183: 'index': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2143: syntax error : missing ';' before '&'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2143: syntax error : missing ';' before '&'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2086: 'oned::size_type size_type' : redefinition
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2146: syntax error : missing ';' before identifier 'row'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : warning C4183: 'row': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2146: syntax error : missing ';' before identifier 'column'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : warning C4183: 'column': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C2146: syntax error : missing ';' before identifier 'i'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C2146: syntax error : missing ';' before identifier 'offset'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C2146: syntax error : missing ';' before identifier 'stride'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\dense2d.h(200) : error C2065: 'x' : undeclared identifier
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\dense2d.h(201) : error C2433: 'mtl::rect_offset<size_t,MM,NN>::{ctor}' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\dense2d.h(201) : warning C4346: 'mtl::rect_offset<size_t,MM,NN>::transpose_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\dense2d.h(201) : error C2350: 'mtl::rect_offset<size_t,MM,NN>::{ctor}' is not a static member
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\utils.h(477) : warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\mtl.h(1046) : error C2906: 'mtl::givens_rotation<std::complex<double>>' : explicit specialization requires 'template <>'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\mtl.h(1155) : error C2906: 'mtl::givens_rotation<std::complex<float>>' : explicit specialization requires 'template <>'
1>Build log was saved at "file://f:\Sergey\Work\Current projects\Try BLAS\TryITL2\TryITL2\Debug\BuildLog.htm"
1>TryITL2 - 75 error(s), 13 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

1>------ Build started: Project: TryITL2, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(177) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(106) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(414) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>' being compiled
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2208: 'T' : no members defined using this type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(111) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2208: 'SizeType' : no members defined using this type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(113) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' is not a valid template type argument for parameter 'A'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a valid template type argument for parameter 'B'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2039: 'RET' : is not a member of 'mtl::IF'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\meta_if.h(31) : see declaration of 'mtl::IF'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2146: syntax error : missing ';' before identifier 'reference'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(108) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(137) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2805: binary 'operator +=' has too few parameters
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator +=' : error in function declaration; skipping function body
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2061: syntax error : identifier 'size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2805: binary 'operator -=' has too few parameters
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator -=' : error in function declaration; skipping function body
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2146: syntax error : missing ';' before identifier 'index'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : warning C4183: 'index': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2143: syntax error : missing ';' before '&'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2143: syntax error : missing ';' before '&'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2086: 'oned::size_type size_type' : redefinition
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator size_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2146: syntax error : missing ';' before identifier 'row'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : warning C4183: 'row': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2146: syntax error : missing ';' before identifier 'column'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : warning C4183: 'column': missing return type; assumed to be a member function returning 'int'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C2146: syntax error : missing ';' before identifier 'i'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C2146: syntax error : missing ';' before identifier 'offset'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C2146: syntax error : missing ';' before identifier 'stride'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>Build log was saved at "file://f:\Sergey\Work\Current projects\Try BLAS\TryITL2\TryITL2\Debug\BuildLog.htm"
1>TryITL2 - 55 error(s), 11 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


1>------ Build started: Project: TryITL2, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(177) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(106) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned' being compiled
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(414) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>' being compiled
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(111) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' should be preceded by ';'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(113) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : illegal syntax for using-declaration; expected qualified-name
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' is not a valid template type argument for parameter 'A'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : dependent name is not a type
1>        prefix with 'typename' to indicate a type
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a valid template type argument for parameter 'B'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2039: 'RET' : is not a member of 'mtl::IF'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\meta_if.h(31) : see declaration of 'mtl::IF'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2146: syntax error : missing ';' before identifier 'reference'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
1>        f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(108) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference'
1>f:\sergey\work\current projects\try blas\iterative template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : illegal syntax for using-declaration; expected qualified-name
1>Build log was saved at "file://f:\Sergey\Work\Current projects\Try BLAS\TryITL2\TryITL2\Debug\BuildLog.htm"
1>TryITL2 - 13 error(s), 4 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

#ifndef MTL_LIGHT_MATRIX_H
#define MTL_LIGHT_MATRIX_H

#include "mtl/matrix_traits.h"
#include "mtl/dimension.h"
#include "mtl/meta_if.h"
#include "mtl/meta_equal.h"

namespace mtl {


template <int Orien>
struct TRANS {
  enum { RET = 0 };
};

template<>
struct TRANS<ROW_MAJOR> {
  enum { RET = COL_MAJOR };
};

template<>
struct TRANS<COL_MAJOR> {
  enum { RET = ROW_MAJOR };
};


template <class T, class SizeType, int Orien, int Strided>
class light_matrix {
public:
  typedef light_matrix self;
  typedef light_matrix light_matrix_t; // VC++ workaround
  typedef T* DataPtr;

  typedef rectangle_tag shape;
  typedef typename IF< EQUAL<Orien,ROW_MAJOR>::RET,
              row_tag, column_tag>::RET orientation; // mostly wrong

  typedef typename IF< EQUAL<Orien,ROW_MAJOR>::RET,
              row_orien, column_orien>::RET orien;

  typedef light_matrix<T, SizeType, TRANS<Orien>::RET, Strided> transpose_type;
  typedef light_matrix<T, SizeType, Orien, !Strided> strided_type;
  typedef light_matrix<T, SizeType, Orien, Strided> scaled_type;// wrong

  typedef light_matrix<T, SizeType, Orien, Strided> submatrix_type;

  typedef int DiffType;

  //: The size type
  typedef SizeType size_type;
  //: The type for differences between iterators
  typedef DiffType difference_type;

  typedef T value_type;
  typedef value_type& reference;
  typedef const value_type& const_reference;
  typedef value_type* pointer;

  enum { M = 0, N = 0 };

protected:

  static inline size_type& twod_pos(size_type& i, size_type& j) {
    if (Orien == ROW_MAJOR)
        return i;
    else
        return j;
  }

  static inline const size_type& twod_pos(const size_type& i,
                                          const size_type& j) {
    if (Orien == ROW_MAJOR)
        return i;
    else
        return j;
  }

  static inline size_type& oned_pos(size_type& i, size_type& j) {
    if (Orien == ROW_MAJOR)
        return j;
    else
        return i;
  }

  static inline const size_type& oned_pos(const size_type& i,
                                          const size_type& j) {
    if (Orien == ROW_MAJOR)
        return j;
    else
        return i;
  }

  // idea: completely separate stride/offset/positioning from indexing
  //  but encapsulate both somehow

public:

  //: This is a dense 2D container
  typedef dense_tag sparsity;
  //: This has external storage
  typedef external_tag storage_loc;
  //: This is strideable
  typedef strideable strideability;

  class oned {
  public:
    typedef T& reference;
    typedef const T& const_reference;
    typedef T value_type;
    typedef T* pointer;
    typedef SizeType size_type;
    typedef int difference_type;

    enum { M = 0, N = 0 };

    typedef oned subrange_type;
    typedef dense_tag sparsity;
    typedef oned IndexArray; /* bogus */
    typedef oned IndexArrayRef; /* bogus */

    typedef oned_tag dimension; /* bogus */

    template <int isConst>
    class __iterator {
      typedef __iterator self;
    public:
      typedef typename oned::value_type value_type;
      typedef typename oned::pointer pointer; // changed by SergeyAvd, old version: typedef oned::pointer pointer;
      typedef typename oned::size_type size_type;
      typedef typename oned::difference_type difference_type; // changed by SergeyAvd, old version: typedef oned::difference_type difference_type;

      typedef typename IF<isConst, typename oned::const_reference, typename oned::reference>::RET reference; // changed by SergeyAvd, old version: typedef typename IF<isConst, oned::const_reference, oned::reference>::RET reference;

      typedef std::random_access_iterator_tag iterator_category;

      inline __iterator(DataPtr d,
                        size_type ii, size_type jj,
                        size_type os, size_type s)
        : data(d), i(ii), j(jj), offset(os), stride(s) { }

      inline __iterator(const self& x)
        : data(x.data), i(x.i), j(x.j), offset(x.offset), stride(x.stride) { }

      inline self& operator=(const self& x) {
        data = x.data; i = x.i; j = x.j; offset = x.offset; stride = x.stride;
        return *this;
      }

      inline __iterator() : data(0), i(0), j(0), offset(0), stride(0) { }

      inline reference operator*() const { return data[offset]; }
      inline self& operator++() { ++pos(); offset += stride; return *this; }
      inline self& operator+=(size_type n) {
        pos() += n; offset += stride*n; return *this;
      }
      inline self operator++(int) { self t = *this; ++(*this); return t; }
      inline self& operator--() { --pos(); offset -= stride; return *this; }
      inline self& operator-=(size_type n) {
        pos() -= n; offset -= stride*n; return *this; }
      inline self operator--(int) { self t = *this; --(*this); return t; }
      inline bool operator!=(const self& x) const { return pos() != x.pos(); }
      inline bool operator==(const self& x) const { return pos() == x.pos(); }
      inline bool operator<(const self& x) const { return pos() < x.pos(); }
      inline size_type index() const { return pos(); }

      inline size_type& pos() { return oned_pos(i,j); }
      inline const size_type& pos() const { return oned_pos(i,j); }

      inline size_type row() const { return i; }
      inline size_type column() const { return j; }
    protected:
      DataPtr data;
      size_type i, j;
      size_type offset;
      size_type stride;
    };

    typedef __iterator<0> iterator;
    typedef __iterator<1> const_iterator;

    inline oned(DataPtr d, size_type ii, size_type jj,
                size_type ie, size_type je,
                size_type os, size_type ld)
      : data(d), i(ii), j(jj), iend(ie), jend(je),
        offset(os), ldim(ld) { }

    inline oned(const oned& x)
      : data(x.data), i(x.i), j(x.j),
        iend(x.iend), jend(x.jend),
        offset(x.offset), ldim(x.ldim) { }

    inline oned& operator=(const oned& x) {
      data = x.data; i = x.i; j = x.j;
      iend = x.iend; jend = x.jend;
      offset = x.offset; ldim = x.ldim;
      return *this;
    }
    inline oned()
      : data(0), i(0), j(0), iend(0), jend(0), offset(0), ldim(0) { }

    inline ~oned() { }

    inline reference operator[](size_type n) {
      return data[ Strided ? offset + n * ldim : offset + n];
    }

    inline const_reference operator[](size_type n) const {
      return data[ Strided ? offset + n * ldim : offset + n];
    }

    inline iterator begin() {
      return iterator(data, i, j, offset, Strided ? ldim : 1);
    }
    inline iterator end() {
      size_type iiend, jjend;
      if (Orien == ROW_MAJOR) { iiend = i; jjend = jend; }
      else { iiend = iend; jjend = j; }

      return iterator(data, iiend, jjend, offset, Strided ? ldim: 1);
    }

    inline const_iterator begin() const {
      return const_iterator(data, i, j, offset, Strided ? ldim : 1);
    }
    inline const_iterator end() const {
      size_type iiend, jjend;
      if (Orien == ROW_MAJOR) { iiend = i; jjend = jend; }
      else { iiend = iend; jjend = j; }

      return const_iterator(data, iiend, jjend, offset, Strided ? ldim : 1);
    }

  protected:
    DataPtr data;
    size_type i, j;
    size_type iend, jend;
    size_type offset;
    size_type ldim;
  };

  typedef oned OneD;
  typedef OneD OneDRef;
  typedef OneD Row;
  typedef OneD RowRef;
  typedef OneD Column;
  typedef OneD ColumnRef;

  //: The iterator type
  template <int Const>
  class __iterator {
    typedef __iterator self;
  public:
    typedef std::random_access_iterator_tag iterator_category;
    typedef oned value_type;
    typedef value_type* pointer;

#if defined(_MSVCPP_)
    typedef typename light_matrix_t::size_type size_type;
    typedef typename light_matrix_t::difference_type difference_type;
#else
    typedef SizeType size_type;
    typedef DiffType difference_type;
#endif

    typedef typename IF<Const, const oned, oned>::RET reference;

    inline __iterator(DataPtr d, size_type ii, size_type jj,
                      size_type ie, size_type je, size_type ld)
      : data(d), i(ii), j(jj), iend(ie), jend(je), offset(0), ldim(ld) {
        if (Strided) stride = 1; else stride = ldim;
    }

    inline __iterator() : data(0), i(0), j(0), iend(0), jend(0),
        offset(0), stride(0), ldim(0) { }

    inline __iterator(const self& x)
      : data(x.data), i(x.i), j(x.j),
        iend(x.iend), jend(x.jend), offset(x.offset),
        stride(x.stride), ldim(x.ldim) { }

    inline self& operator=(const self& x) {
      data = x.data; i = x.i; j = x.j;
      iend = x.iend; jend = x.jend;
      offset = x.offset; stride = x.stride; ldim = x.ldim;
      return *this;
    }
    inline reference operator*() const {
      return oned(data, i, j, iend, jend, offset, ldim);
    }

    inline self& operator++() { ++pos(); offset += stride; return *this; }
    inline self& operator+=(size_type n) {
      pos() += n; offset += stride*n; return *this; }
    inline self operator++(int) { self t = *this; ++(*this); return t; }
    inline self& operator--() { --pos(); offset -= stride; return *this; }
    inline self& operator-=(size_type n) {
      pos() -= n; offset -= stride*n; return *this; }
    inline self operator--(int) { self t = *this; --(*this); return t; }
    inline bool operator!=(const self& x) const { return pos() != x.pos(); }
    inline bool operator==(const self& x) const { return pos() == x.pos(); }
    inline bool operator<(const self& x) const { return pos() < x.pos(); }
    inline size_type index() const { return pos(); }

    inline size_type& pos() { return twod_pos(i,j); }
    inline const size_type& pos() const { return twod_pos(i,j); }

    inline size_type row() const { return i; }
    inline size_type column() const { return j; }

  protected:
    DataPtr data;
    size_type i, j;
    size_type iend, jend;
    size_type offset;
    size_type stride;
    size_type ldim;
  };

  typedef __iterator<0> iterator;
  typedef __iterator<1> const_iterator;

  //: Standard Constructor
  inline light_matrix(DataPtr d, size_type m, size_type n, size_type ld)
    : data_(d), nrows_(m), ncols_(n), ldim(ld) { }

  inline light_matrix(DataPtr d, size_type m, size_type n)
    : data_(d), nrows_(m), ncols_(n), ldim(Orien == ROW_MAJOR ? n : m) { }

  //: Copy Constructor
  inline light_matrix(const light_matrix& x)
    : data_(x.data_), nrows_(x.nrows_), ncols_(x.ncols_), ldim(x.ldim) { }

  //: Assignment Operator
  inline const light_matrix& operator=(const light_matrix& x) {
    data_ = x.data_; nrows_ = x.nrows_; ncols_ = x.ncols_; ldim = x.ldim;
    return *this;
  }
  //: Default Constructor
  inline light_matrix() : data_(0), nrows_(0), ncols_(0), ldim(0) { }

  inline light_matrix(const strided_type& x, do_strided s)
    : data_(x.data_), nrows_(x.nrows_), ncols_(x.ncols_), ldim(x.ldim) { }

  template <class StridedType>
  inline light_matrix(const StridedType& x, do_strided s)
    : data_(x.data_), nrows_(x.nrows_), ncols_(x.ncols_), ldim(x.ldim) { }

  //: Destructor
  inline ~light_matrix() { }

  //: Return an iterator pointing to the first 1D container
  inline iterator begin() {
    return iterator(data_, 0, 0, nrows_, ncols_, ldim);
  }
  //: Return an iterator pointing past the end of the 2D container
  inline iterator end() {
    return iterator(data_, nrows_, ncols_, nrows_, ncols_, ldim);
  }

  //: Return a const iterator pointing to the first 1D container
  inline const_iterator begin() const {
    return const_iterator(data_, 0, 0, nrows_, ncols_, ldim);
  }
  //: Return a const iterator pointing past the end of the 2D container
  inline const_iterator end() const {
    return const_iterator(data_, nrows_, ncols_, nrows_, ncols_, ldim);
  }

  //: Return a reference to the ith 1D container
  inline oned operator[](size_type n) {
    if (Orien == ROW_MAJOR)
      return oned(data_, n, 0, nrows_, ncols_, Strided ? n : ldim * n, ldim);
    else
      return oned(data_, 0, n, nrows_, ncols_, Strided ? n : ldim * n, ldim);
  }

  inline const oned operator[](size_type n) const {
    if (Orien == ROW_MAJOR)
      return oned(data_, n, 0, nrows_, ncols_, Strided ? n : ldim * n, ldim);
    else
      return oned(data_, 0, n, nrows_, ncols_, Strided ? n : ldim * n, ldim);
  }

  //: Return a reference to the (i,j) element, where (i,j) is in the 2D coordinate system
  inline reference operator()(size_type i, size_type j) {
    return Orien == ROW_MAJOR ? operator[](i)[j] : operator[](j)[i];
  }

  //: Return a const reference to the (i,j) element, where (i,j) is in the 2D coordinate system
  inline const_reference operator()(size_type i, size_type j) const {
    return Orien == ROW_MAJOR ? operator[](i)[j] : operator[](j)[i];
  }

  inline size_type nrows() const { return nrows_; }
  inline size_type ncols() const { return ncols_; }


  inline submatrix_type sub_matrix(size_type i, size_type iend,
                                   size_type j, size_type jend) const
  {
    if (Strided)
      return submatrix_type(data_ + oned_pos(i,j) * ldim + twod_pos(iend,jend),
                            iend - i, jend - j, ldim);
    else
      return submatrix_type(data_ + twod_pos(i,j) * ldim + oned_pos(iend,jend),
                            iend - i, jend - j, ldim);
  }


  DataPtr data_;
  size_type nrows_, ncols_;
  size_type ldim;
};


} /* namespace mtl */

#endif /* MTL_LIGHT_MATRIX_H */

// -*- c++ -*-
// $COPYRIGHT$
//

#ifndef ITL_KRYLOV_GMRES_H
#define ITL_KRYLOV_GMRES_H

#include <vector>
#include <algorithm>
#include "itl/itl.h"
#include "itl/givens_rotation.h"
#include "itl/number_traits.h"
#include <itl/modified_gram_schmidt.h>

namespace itl {

  // Generalized Minimum Residual
  //
  //   This solve the unsymmetric linear system Ax = b using restarted GMRES.
  //
  //   A return value of 0 indicates convergence within the
  //   maximum number of iterations (determined by the iter object).
  //   A return value of 1 indicates a failure to converge.
  //
  //   On instantiating Iteration object outer, the first parameter
  //   Vector w must be the precondtioned one, i.e., solve(M, b, w) where
  //   b is right side of linear system. See test_gmres.cc for example.
  //
  //   See: Y. Saad and M. Schulter. GMRES: A generalized minimum residual
  //   algorithm for solving nonsysmmetric linear systems, SIAM
  //   J. Sci. Statist. Comp.  7(1986), pp, 856-869
  //
  /* required operations: mult,copy,dot_conj,add,scaled,two_norm,tri_solve */
template < class Matrix, class Vector, class VectorB, class Preconditioner,
           class Iter, class Basis >
int
gmres(const Matrix &A, Vector &x, const VectorB &b,
      const Preconditioner &M, int restart, Iter& outer, Basis& KS)
{
  typedef typename itl_traits<Vector>::value_type T;
  typedef typename itl_traits<Vector>::size_type size_type;

  typedef mtl::dense1D<T> TmpVec; // Changed by SergeyAvd, old version: typedef std::vector<T> TmpVec;
  typedef Vector internal_vector;

  //These must be arithmetically compatible with x
  internal_vector w(size(x)), r(size(x)), u(size(x));

  typedef typename number_traits<T>::magnitude_type Real;
  typedef typename internal_matrix_traits<T>::Matrix HMat;
  HMat H(restart+1, restart); //Elements in H must be real type

  TmpVec s(restart+1);
   
  std::vector< itl::givens_rotation<T> > rotations(restart+1);

  itl::mult(A, itl::scaled(x, -1.0), b, w);

  itl::solve(M, w, r);
  Real beta = std::abs(itl::two_norm(r));

  while (! outer.finished(beta)) {

    itl::copy(itl::scaled(r, 1./beta), KS[0]);
    std::fill(s.begin(), s.end(), 0.0);
    s[0] = beta;

    size_type i = 0;
    Iter inner(outer.normb(), restart, outer.tol(), outer.atol());

    do {
      size_type k;
      itl::mult(A, KS[i], u);
      itl::solve(M, u, KS[i+1]);

      itl::orthogonalize(KS, H[i], i);

      Real H_ip1_i = itl::two_norm(KS[i+1]);
      H(i+1, i) = H_ip1_i;
      itl::scale(KS[i+1], 1./H_ip1_i);

      for (k = 0; k < i; k++)
        rotations[k].scalar_apply(H(k,i), H(k+1,i));

      rotations[i] = itl::givens_rotation<T>(H(i,i), H(i+1,i));
      rotations[i].scalar_apply(H(i,i), H(i+1,i));
      rotations[i].scalar_apply(s[i], s[i+1]);
     
      ++inner, ++outer, ++i;

    } while (! inner.finished(std::abs(s[i])));

    itl::upper_tri_solve(H, s, i);

    itl::combine(KS, s, x, i);

    itl::mult(A, itl::scaled(x, -1.0), b, w);
    itl::solve(M, w, r);
    beta = std::abs(itl::two_norm(r));
  }
 
  return outer.error_code();
}


template < class Matrix, class Vector, class VectorB, class Preconditioner,
           class Iter >
int
gmres(const Matrix &A, Vector &x, const VectorB &b,
      const Preconditioner &M, int restart, Iter& outer)
{
  itl::modified_gram_schmidt<Vector> orth(restart, size(x));
  return itl::gmres(A, x, b, M, restart, outer, orth);
}

}

#endif

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

Aaron patch.zip (49K) Download Attachment