Boost logo

Boost :

From: nisha kannookadan (nishak44_at_[hidden])
Date: 2007-11-20 14:36:20

Wow, Im very impressed, I already got so much answers. Thanks a lot.
I didnt realize, that there are different lists, sorry.

The Code is quite huge. But I post here, a part, which takes quite a lot of time: These are two methods for wavelet transformations:

matrix Wavelet::ttrans(matrix At, int level)
        matrix cfe1, cfe2, cfo, cfe, c, d;
        int N,s2;
        N = (At.size1()+1)/2;
        s2 = At.size2();
        zero_matrix zer(N,s2);
        for (int ii = 1; ii <= level; ii++)
                cfo.assign(subslice(At, 0,2,N, 0,1,s2));
                cfe.assign(subslice(At, 1,2,N-1, 0,1,s2));
                c.assign(cfe + (subrange(cfo, 0,N-1, 0,s2)+subrange(cfo, 1,N, 0,s2))*0.5);
                (subrange(cfe1, 0,N-1, 0,s2)).assign(cfe);
                (subrange(cfe2, 1,N, 0,s2)).assign(cfe);
            (subrange(At, 0,N-1, 0,At.size2())).assign(c);
            (subrange(At, N-1,2*N-1, 0,At.size2())).assign(d);
            N = N/2;
        return At;

matrix Wavelet::itrans(matrix At,int level)
        matrix inv_M,tmp;
        vector f1,f2;
        int N,m;
        N = (At.size1()+1)/2;
        scalar_vector e(2*N-1,1);
        scalar_vector f(2*N-2,0.5);
        m = At.size2();
        for (int ii=1; ii<=level; ii++)
           f1 = f;
           f2 = f;
           for(int jj = 0; jj < 2*N-3; jj = jj+2)
                   f2(jj) = -0.5;
                   f1(jj+1) = -0.5;
           inv_M = MVHF::tri_inverse(e,f1,f2);
           tmp.assign(prod(inv_M,subrange(At, 0,2*N-1, 0,m)));
           (subrange(At, 0,N-1, 0,At.size2())).assign(subslice(tmp, 1,2,N-1, 0,1,tmp.size2()));
           (subrange(At, N-1,2*N-1, 0,At.size2())).assign(subslice(tmp, 0,2,N, 0,1,tmp.size2()));
           N = N/2;

        return At;

I did it like that, bcuz I realized that using 'assign' does it make a bit faster,though a lot of resize is needed. I use Eclipse, so is it possible to adapt the Debugging stuff there? Or does it need to be in a makefile...yeah, I know, I dont know the basic stuff :). I read about the library binding, but I actually dont need things like svd, lu..all I need is prod,solve,element_div and the methods above. So not to freaky things, so I probabaly dont need the bindings, right?

Anyways, I thank you all very much..I never got answers so fast in a forum..I appreciate it.

Discover the new Windows Vista

Boost list run by bdawes at, gregod at, cpdaniel at, john at