Boost logo

Boost Users :

From: Alexey Nikitin (yg-boost-users_at_[hidden])
Date: 2003-06-25 03:37:43


<jhr.walter_at_[hidden]> ???????/???????? ? ???????? ?????????:
news:004301c33a9a$faf76e00$0101a8c0_at_mshome.net...
> Hi Alexey,
>
> you wrote:
>
> [snip]
>
> > > Which compiler are you using?
> >
> > VC++ 7.1
>
> Sorry, I should have concluded that from one of your earlier postings.
>

:)

> > > > 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
>
> I'm unsure about this one: matrix_type currently describes the type of a
> referenced matrix for matrix proxies. What should the new definition be?
>

The general idea is not differ the matrix and matrix proxies in code where
that differ is not nessesory.
The new definition should be next: matrix_type describes the type of a
referenced matrix for matrix proxies or the type of matrix if it is not
proxy.
At addition, if client want to public inherit from class matrix he must
redefine matrix_type as type of new class.

> > 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.
>
> Added that one (the omission is probably a bug).
>

Thank you :)

> > It may be need to add the
> > same code for other proxy types .
>
> And these.
>

And once agane thank you :)

> > After those changes my code shown above compiles correctly and even
runs.
> ;)
>
> My current iteration is:
>
> ----------
> #include <boost/numeric/ublas/matrix.hpp>
>
> using namespace boost::numeric::ublas;
>
> typedef matrix<double> Matrix;
> typedef matrix_range<matrix<double> > MatrixRange;
>
> void ProcessRecursive(MatrixRange& m)
> {
> 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 m;
> MatrixRange mr(m, range::all(), range::all());
> ProcessRecursive(mr);
> }
>
> int main()
> {
> StartProcess();
> }
>
> ----------
>
> Is something like that OK for you?
>

Yes, it is work... but I like my code more ;)

Thanks,
Alexey.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net