getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Getfem-users] A bug in the gmm and a possible fix for that


From: Renard Yves
Subject: Re: [Getfem-users] A bug in the gmm and a possible fix for that
Date: Wed, 08 Apr 2009 15:12:27 +0200
User-agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1)


Dear Kayhan,

You are perfectly right. This bug has been recently fixed in the svn repository of gmm (on gna.org/projects/getfem) and will included in the next version. Thank you for your bug report,

Yves.


Kayhan Batmanghelich <address@hidden> a écrit :

Dear gemm users,

I think that I found a bug in the gmm and a way to fix it. Here is an example which produces the bug. I only changed one line and "I think" that I fixed it. Please let me know if I should not have done it or there is a better solution:

#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <exception>
#include <math.h>
#include <sstream>
#include <cstdlib>

#define GMM_USES_LAPACK
#include <gmm/gmm.h>

int main(int argc, char *argv[])
{
    std::vector<double>     X(3);
    std::vector<double>     Y(3);


    gmm::dense_matrix<double> M(3,3);
    M(0,0) = M(1,1) = M(2,2) = 2.0 ;
    M(1,2) = 1.0 ;

    X[0] = 1.0 ; X[1] = 2.0 ; X[1] = 3.0 ;
    gmm::mult(M,X,Y) ;
    std::cout << M << " times " << X << "is equal to " << Y << std::endl ;


}


and here is what I got when i tried to compile it :

address@hidden g++ Ex1.cpp -o Ex1 -I/home/kayhan/Src/gmmSource/tmpInstall/include -llapack -lblas -lg2c In file included from /home/kayhan/Src/gmmSource/tmpInstall/include/gmm/gmm.h:47,
                 from Ex1.cpp:11:
/home/kayhan/Src/gmmSource/tmpInstall/include/gmm/gmm_lapack_interface.h: In function ?void gmm::svd(gmm::dense_matrix<std::complex<float> >&, gmm::dense_matrix<std::complex<float> >&, gmm::dense_matrix<std::complex<float> >&, std::vector<float, std::allocator<float> >&)?: /home/kayhan/Src/gmmSource/tmpInstall/include/gmm/gmm_lapack_interface.h:412: error: ?cgesvd_? was not declared in this scope /home/kayhan/Src/gmmSource/tmpInstall/include/gmm/gmm_lapack_interface.h: In function ?void gmm::svd(gmm::dense_matrix<std::complex<double> >&, gmm::dense_matrix<std::complex<double> >&, gmm::dense_matrix<std::complex<double> >&, std::vector<double, std::allocator<double> >&)?: /home/kayhan/Src/gmmSource/tmpInstall/include/gmm/gmm_lapack_interface.h:413: error: ?zgesvd_? was not declared in this scope


To fix it, I changed the line 366 on the gmm_lapack_interface.h and changed it to :

void sgesvd_(...); void dgesvd_(...); void cgesvd_(...); void zgesvd_(...) ;

and it fixes the problem.

I am using Ubuntu8.10, 64bit system, gcc4.3.2,gmm3.1 . Please let me know if more information is required.


Regards,
Kayhan









reply via email to

[Prev in Thread] Current Thread [Next in Thread]