Loading ...
Sorry, an error occurred while loading the content.
 

Why not uLAPACK ?

Expand Messages
  • Jonathan de Halleux
    uBLAS official link to LAPACK is made through ATLAS. However, for Windows users, it is quite difficult to use ATLAS due to overly complex compilation
    Message 1 of 10 , Jul 1, 2003
      uBLAS "official link" to LAPACK is made through ATLAS. However, for Windows
      users, it is quite difficult to use ATLAS due to overly complex compilation
      settings.
      Moreover, relying on an external library breaks Boost library guidelines
      (see http://www.boost.org/more/library_reuse.htm ).

      It would be much more useful (that my point of view) to have a uLAPACK
      coming with uBLAS without having to use ATLAS.




      -----------------------------------------------------------------------------------
      Jonathan de Halleux, Research Assistant
      Center for Systems Engineering and Applied Mechanics (CESAME)
      Universite catholique de Louvain
      Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
      B-1348 Louvain-la-Neuve Belgium
      E-mail : dehalleux@...
      -----------------------------------------------------------------------------------
    • Matt Hurd
      uLAPACK would be nice but impractical I would guess. LAPACK shouldn t require ATLAS but will require BLAS from somewhere. The alternative is to either makes a
      Message 2 of 10 , Jul 1, 2003
        uLAPACK would be nice but impractical I would guess.

        LAPACK shouldn't require ATLAS but will require BLAS from somewhere.

        The alternative is to either makes a BLAS interface from uBLA or port
        and maintain the LAPACK code. This would raise the issue of all the
        other libraries out there that rely on BLAS.

        The best option is both I would guess.

        If the objective of uBLA is to foster C++ numerics then I would guess
        both would be a requirement to leverage existing libraries, to enable
        the advances in uBLA into other libraries, and to motivate the numerical
        community to develop against uBLA.

        Another issue is perhaps developing distributable object libraries from
        uBLA to enable performance for people without the latest vectorising
        compilers.

        $0.0002

        matt.

        -----Original Message-----
        From: Jonathan de Halleux [mailto:dehalleux@...]
        Sent: Wednesday, 2 July 2003 1:00 AM
        To: ublas-dev@yahoogroups.com
        Subject: [ublas-dev] Why not uLAPACK ?

        uBLAS "official link" to LAPACK is made through ATLAS. However, for
        Windows
        users, it is quite difficult to use ATLAS due to overly complex
        compilation
        settings.
        Moreover,  relying on an external library breaks Boost library
        guidelines
        (see http://www.boost.org/more/library_reuse.htm ).

        It would be much more useful (that my point of view) to have a uLAPACK
        coming with uBLAS without having to use ATLAS.




        ------------------------------------------------------------------------
        -----------
        Jonathan de Halleux, Research Assistant
        Center for Systems Engineering and Applied Mechanics (CESAME)
        Universite catholique de Louvain
        Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
        B-1348 Louvain-la-Neuve Belgium
        E-mail : dehalleux@...
        ------------------------------------------------------------------------
        -----------


        To unsubscribe from this group, send an email to:
        ublas-dev-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      • Peter Schmitteckert
        Salut, ... [...] ... in case someone is interested in writing a uLaPack, one should take a look at http://www.cs.utexas.edu/users/flame, especially the
        Message 3 of 10 , Jul 1, 2003
          Salut,

          On Wed, 2 Jul 2003, Matt Hurd wrote:

          > uLAPACK would be nice but impractical I would guess.
          >
          > LAPACK shouldn't require ATLAS but will require BLAS from somewhere.
          >
          [...]
          > If the objective of uBLA is to foster C++ numerics then I would guess
          > both would be a requirement to leverage existing libraries, to enable
          > the advances in uBLA into other libraries, and to motivate the numerical
          > community to develop against uBLA.
          >
          > Another issue is perhaps developing distributable object libraries from
          > uBLA to enable performance for people without the latest vectorising
          > compilers.

          in case someone is interested in writing a uLaPack, one should take
          a look at http://www.cs.utexas.edu/users/flame,
          especially the comments on parallelizing the code, which seems to be
          fairly simple. It might be an interesting (longterm) project.

          The advantage of an uLaPack would be the greate flexibility and the
          possibility to use more data-types compared to
          double/float/complex/zomplex.

          On the other hand, even writing a generic diagonalization, that works for
          arbitrary data-types is non-trivial. Jacobi method is quiet stable even
          for some weired data-type (I've once done it), but is to slow for normal
          floats/doubles. (*)
          What I needed was an extra trait-class, that defined the diagonalization
          of 2x2 matrices for the more advanced types.

          Best wishes,
          Peter


          P.S. What I'd implemented was a diagonaliation of a matrix over
          taylor series, e.g.

          template < typename F>
          struct TpMatrixElement
          {
          F x0;
          F x1;
          F x2;
          };

          The main problems lies in dealing with the branch cuts of sqrt(...).

          P.P.S: This kind of LA routines is really fun.
        • Jonathan de Halleux
          Hi Peter, I think you have misunderstood my point: I just want to have a wrapper around (C)Lapack methods that is compatible with uBLAS. I do not want at all
          Message 4 of 10 , Jul 2, 2003
            Hi Peter,

            I think you have misunderstood my point: I just want to have a wrapper around (C)Lapack methods that is compatible with
            uBLAS. I do not want at all to rewrite Lapack, I leave that for matrix theory people.


            Here a snipet of code that will give you an idea:

            namespace lapack
            {
                    // first we get the headers we want from clapack
                    
            extern "C"
                     {
                             
            // computes SVD from double dense matrix (double precision)
                             int dgesvd_(
                                      
            char *jobu,
                                      
            char *jobvt,
                                      
            long *m,
                                      
            long *n,
                                      
            double *a,
                                      
            long *lda,
                                      
            double *s,
                                      
            double *u,
                                      
            long * ldu,
                                      
            double* vt,
                                      
            long* ldvt,
                                      
            double* work,
                                      
            long*lwork,
                                      
            long*info);
                             
            // computes SVD from float dense matrix (single precision)
                             int sgesvd_(
                                      
            char *jobu,
                                      
            char *jobvt,
                                      
            long *m,
                                      
            long *n,
                                      
            float *a,
                                      
            long *lda,
                                      
            float *s,
                                      
            float *u,
                                      
            long * ldu,
                                      
            float* vt,
                                      
            long* ldvt,
                                      
            float* work,
                                      
            long*lwork,
                                      
            long*info);
                     };
            };

            namespace ulapack
            {
                    
            using namespace boost::numeric::ublas;   

                     // this is the main template function for svd
                    
            template<
                             
            typename T,
                             
            template <class T_> class Matrix,
                     >
                    
            long svd(Matrix<T>& a_, vector<T>& s_, Matrix<T>& u_, Matrix<T>& vt_)
                     {
                              std::cerr<<"no svd defined ???";
                             
            return 0;
                     };

                      // we do partial template specialization for a given matrix type
                      // in this case for dense matrix
                    
            template<typename T>
                    
            long svd< T, matrix<T,column_major> >(
                              matrix<
            T,column_major>& a_,
                              vector<
            T>& s_,
                              matrix<
            T,column_major>& u_,
                              matrix<
            T,column_major>& vt_)
                     {
                                 // handling clapack...
                                // the choice of the method (single precision, double precision, complex single, complex double precision)
                                // could be done using MPL thecniques
                                 ...
                     };
                    
            }

            int main ()
            {   
                    
                     matrix<
            double,column_major> m (2, 2),u,vt;   
                    
                     m(0,0)=1;         m(0,1)=0;
                     m(1,0)=0;         m(1,1)=2;
                             
                     std::cout << m << std::endl;


                     vector<
            double> s;
                    
            // on inverse
                    int info= svd( m, s, u, vt);

                     std::cout<< "info: "<<info<<std::endl
                              <<"u: "<<u << std::endl
                              <<"s: "<<s << std::endl
                              <<"vt: "<<vt << std::endl;

                    
            return 0;
             }



            >The advantage of an uLaPack would be the greate flexibility and the
            >possibility to use more data-types compared to
            >double/float/complex/zomplex.
            >
            >On the other hand, even writing a generic diagonalization, that works for
            >arbitrary data-types is non-trivial. Jacobi method is quiet stable even
            >for some weired data-type (I've once done it), but is to slow for normal
            >floats/doubles. (*)
            >What I needed was an extra trait-class, that defined the diagonalization
            >of 2x2 matrices for the more advanced types.
            >
            >Best wishes,
            >Peter



            -----------------------------------------------------------------------------------
            Jonathan de Halleux, Research Assistant
            Center for Systems Engineering and Applied Mechanics (CESAME)
            Universite catholique de Louvain
            Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
            B-1348 Louvain-la-Neuve Belgium
            E-mail : dehalleux@...
            -----------------------------------------------------------------------------------

          • Kresimir Fresl
            ... [...] Browse through the message archive of this ml and read messages with the word `bindings in the subject. fres
            Message 5 of 10 , Jul 3, 2003
              Jonathan de Halleux wrote:

              > Hi Peter,
              >
              > I think you have misunderstood my point: I just want to have a wrapper
              > around (C)Lapack methods that is compatible with uBLAS.
              [...]

              Browse through the message archive of this ml and read messages
              with the word `bindings' in the subject.

              fres
            • Jonathan de Halleux
              Cool, the bindings package is just what I was looking for. Too bad it is not documentated in the uBLAS doc. I think doc. should be updated about that. By the
              Message 6 of 10 , Jul 3, 2003
                Cool, the bindings package is just what I was looking for. Too bad it is not documentated in the uBLAS doc. I think doc. should be updated about that.

                By the way, is bindings still progressing ? I can see that svd is not supported ?

                ps: I have tried to compile (msvc, vc7) the examples but the jamfiles don't work: pointing to list directory ?


                At 10:36 3/07/2003 +0200, you wrote:

                Jonathan de Halleux wrote:

                > Hi Peter,
                >
                > I think you have misunderstood my point: I just want to have a wrapper
                > around (C)Lapack methods that is compatible with uBLAS.
                [...]

                Browse through the message archive of this ml and read messages
                with the word `bindings' in the subject.

                fres



                Yahoo! Groups Sponsor

                To unsubscribe from this group, send an email to:
                ublas-dev-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

                -----------------------------------------------------------------------------------
                Jonathan de Halleux, Research Assistant
                Center for Systems Engineering and Applied Mechanics (CESAME)
                Universite catholique de Louvain
                Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
                B-1348 Louvain-la-Neuve Belgium
                E-mail : dehalleux@...
                -----------------------------------------------------------------------------------

              • Kresimir Fresl
                ... bindings are in fact separate library, although uBLAS vectors and matrices are main `playground (almost all examples use them). And ... well ... we are
                Message 7 of 10 , Jul 3, 2003
                  Jonathan de Halleux wrote:

                  > Cool, the bindings package is just what I was looking for. Too bad it is
                  > not documentated in the uBLAS doc. I think doc. should be updated about
                  > that.

                  bindings are in fact separate library, although uBLAS vectors
                  and matrices are main `playground' (almost all examples use
                  them). And ... well ... we are working on the documenation.

                  > By the way, is bindings still progressing ?

                  Yes.

                  > I can see that svd is not supported ?

                  Not yet.

                  > ps: I have tried to compile (msvc, vc7) the examples but the jamfiles
                  > don't work: pointing to list directory ?

                  Unfortunately, here I can't help. Jam is on my `to learn' list
                  -- I am still using good old make.

                  f.
                • Jonathan de Halleux
                  ... yes but bindings comes with jam files... ... Jonathan de Halleux, Research Assistant Center for Systems Engineering and Applied Mechanics (CESAME)
                  Message 8 of 10 , Jul 3, 2003
                    > ps: I have tried to compile (msvc, vc7) the examples but the jamfiles
                    > don't work: pointing to list directory ?

                    Unfortunately, here I can't help. Jam is on my `to learn' list
                    -- I am still using good old make.

                    yes but bindings comes with jam files...

                    Yahoo! Groups Sponsor
                    ADVERTISEMENT

                    To unsubscribe from this group, send an email to:
                    ublas-dev-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

                    -----------------------------------------------------------------------------------
                    Jonathan de Halleux, Research Assistant
                    Center for Systems Engineering and Applied Mechanics (CESAME)
                    Universite catholique de Louvain
                    Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
                    B-1348 Louvain-la-Neuve Belgium
                    E-mail : dehalleux@...
                    -----------------------------------------------------------------------------------

                  • Kresimir Fresl
                    ... True. Those in `amos , `blas and `traits directories were written by Toon, and those in `atlas and `lapack by Joerg (Joerg sent them to me when he
                    Message 9 of 10 , Jul 3, 2003
                      Jonathan de Halleux wrote:

                      >> > ps: I have tried to compile (msvc, vc7) the examples but the jamfiles
                      >> > don't work: pointing to list directory ?

                      >> Unfortunately, here I can't help. Jam is on my `to learn' list
                      >> -- I am still using good old make.

                      > yes but bindings comes with jam files...

                      True. Those in `amos', `blas' and `traits' directories were written
                      by Toon, and those in `atlas' and `lapack' by Joerg (Joerg sent
                      them to me when he tested the library and I simply included them
                      in the hope that they can be useful -- maybe as examples).

                      f.
                    • Toon Knapen
                      Cool, the bindings package is just what I was looking for. Too bad it is not documentated in the uBLAS doc. I think doc. should be updated about that. By the
                      Message 10 of 10 , Jul 7, 2003
                        Message
                        Cool, the bindings package is just what I was looking for. Too bad it is not documentated in the uBLAS doc. I think doc. should be updated about that. 
                        By the way, is bindings still progressing ? I can see that svd is not supported ? 
                         
                        Yes. We're adding new functions every week and are trying to generate some documentation. So let us know what you want to know and we'll try to complete the documentation with all answers to your questions. 

                        ps: I have tried to compile (msvc, vc7) the examples but the jamfiles don't work: pointing to list directory ? 
                         
                        try again, it should work now. 

                      Your message has been successfully submitted and would be delivered to recipients shortly.