Hi Joerg, you wrote:
Interesting problem: the naive solution
---------- #include
using namespace boost::numeric::ublas;
template<class Matrix> void ProcessRecursive(Matrix& m) { typedef matrix_range<Matrix> MatrixRange; MatrixRange mr = project(m, range(0,m.size1()/2), range(0,m.size2()/2)); if (mr.size1() > 0 && mr.size2() > 0) ProcessRecursive(mr); }
void StartProcess() { matrix<double> m; ProcessRecursive(m); }
int main() { StartProcess(); }
----------
doesn't terminate to compile ;-)
I'll try to write the code like I want to see:
----------
#include
Which compiler are you using?
VC++ 7.1
Do somebody help my to write this code correctly? Or fix library?
How?
1. Add "typedef self_type matrix_type;" in definition of class matrix 2. Add template<class M> BOOST_UBLAS_INLINE matrix_range<M> project (matrix_range<M> &data, const range &r1, const range &r2) { return data.project (r1, r2); } in matix_proxy.hpp (ver. 1.12) on line 3585. It may be need to add the same code for other proxy types . After those changes my code shown above compiles correctly and even runs. ;) Thanks, Alexey.