Index: /trunk/SophyaExt/LinAlg/intflapack.cc
===================================================================
--- /trunk/SophyaExt/LinAlg/intflapack.cc	(revision 2874)
+++ /trunk/SophyaExt/LinAlg/intflapack.cc	(revision 2875)
@@ -80,107 +80,197 @@
 */
 
+/*
+  Decembre 2005 : Suite portage AIX xlC 
+  On declare des noms en majuscule pour les routines fortran - 
+  avec ou sans underscore _ , suivant les systemes 
+*/
+#ifdef AIX
+
+#define sgesv    sgesv
+#define dgesv    dgesv
+#define cgesv    cgesv 
+#define zgesv    zgesv
+
+#define ssysv    ssysv
+#define dsysv    dsysv
+#define csysv    csysv
+#define zsysv    zsysv
+
+#define sgels    sgels
+#define dgels    dgels
+#define cgels    cgels
+#define zgels    zgels
+
+#define sgelsd    sgelsd
+#define dgelsd    dgelsd
+#define cgelsd    cgelsd
+#define zgelsd    zgelsd
+
+#define sgesvd    sgesvd
+#define dgesvd    dgesvd
+#define cgesvd    cgesvd
+#define zgesvd    zgesvd
+
+#define sgesdd    sgesdd
+#define dgesdd    dgesdd
+#define cgesdd    cgesdd
+#define zgesdd    zgesdd
+
+#define ssyev     ssyev
+#define dsyev     dsyev
+#define cheev     cheev
+#define zheev     zheev
+
+#define sgeev     sgeev
+#define dgeev     dgeev
+#define cgeev     cgeev
+#define zgeev     zgeev
+
+#else 
+
+#define sgesv    sgesv_
+#define dgesv    dgesv_
+#define cgesv    cgesv_ 
+#define zgesv    zgesv_
+
+#define ssysv    ssysv_
+#define dsysv    dsysv_
+#define csysv    csysv_
+#define zsysv    zsysv_
+
+#define sgels    sgels_
+#define dgels    dgels_
+#define cgels    cgels_
+#define zgels    zgels_
+
+#define sgelsd    sgelsd_
+#define dgelsd    dgelsd_
+#define cgelsd    cgelsd_
+#define zgelsd    zgelsd_
+
+#define sgesvd    sgesvd_
+#define dgesvd    dgesvd_
+#define cgesvd    cgesvd_
+#define zgesvd    zgesvd_
+
+#define sgesdd    sgesdd_
+#define dgesdd    dgesdd_
+#define cgesdd    cgesdd_
+#define zgesdd    zgesdd_
+
+#define ssyev     ssyev_
+#define dsyev     dsyev_
+#define cheev     cheev_
+#define zheev     zheev_
+
+#define sgeev     sgeev_
+#define dgeev     dgeev_
+#define cgeev     cgeev_
+#define zgeev     zgeev_
+
+#endif
 ////////////////////////////////////////////////////////////////////////////////////
 extern "C" {
 // Le calculateur de workingspace
-  int_4 ilaenv_(int_4 *ispec,char *name,char *opts,int_4 *n1,int_4 *n2,int_4 *n3,int_4 *n4,
+  int_4 ilaenv(int_4 *ispec,char *name,char *opts,int_4 *n1,int_4 *n2,int_4 *n3,int_4 *n4,
                 int_4 nc1,int_4 nc2);
 
 // Drivers pour resolution de systemes lineaires
-  void sgesv_(int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
+  void sgesv(int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
 	      int_4* ipiv, r_4* b, int_4* ldb, int_4* info);
-  void dgesv_(int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
+  void dgesv(int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
 	      int_4* ipiv, r_8* b, int_4* ldb, int_4* info);
-  void cgesv_(int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
+  void cgesv(int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
 	      int_4* ipiv, complex<r_4>* b, int_4* ldb, int_4* info);
-  void zgesv_(int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
+  void zgesv(int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
 	      int_4* ipiv, complex<r_8>* b, int_4* ldb, int_4* info);
 
 // Drivers pour resolution de systemes lineaires symetriques
-  void ssysv_(char* uplo, int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
+  void ssysv(char* uplo, int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
 	      int_4* ipiv, r_4* b, int_4* ldb,
               r_4* work, int_4* lwork, int_4* info);
-  void dsysv_(char* uplo, int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
+  void dsysv(char* uplo, int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
 	      int_4* ipiv, r_8* b, int_4* ldb,
               r_8* work, int_4* lwork, int_4* info);
-  void csysv_(char* uplo, int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
+  void csysv(char* uplo, int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
 	      int_4* ipiv, complex<r_4>* b, int_4* ldb,
               complex<r_4>* work, int_4* lwork, int_4* info);
-  void zsysv_(char* uplo, int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
+  void zsysv(char* uplo, int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
 	      int_4* ipiv, complex<r_8>* b, int_4* ldb,
               complex<r_8>* work, int_4* lwork, int_4* info);
 
 // Driver pour resolution de systemes au sens de Xi2
-  void sgels_(char * trans, int_4* m, int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
+  void sgels(char * trans, int_4* m, int_4* n, int_4* nrhs, r_4* a, int_4* lda, 
 	      r_4* b, int_4* ldb, r_4* work, int_4* lwork, int_4* info);
-  void dgels_(char * trans, int_4* m, int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
+  void dgels(char * trans, int_4* m, int_4* n, int_4* nrhs, r_8* a, int_4* lda, 
 	      r_8* b, int_4* ldb, r_8* work, int_4* lwork, int_4* info);
-  void cgels_(char * trans, int_4* m, int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
+  void cgels(char * trans, int_4* m, int_4* n, int_4* nrhs, complex<r_4>* a, int_4* lda, 
 	      complex<r_4>* b, int_4* ldb, complex<r_4>* work, int_4* lwork, int_4* info);
-  void zgels_(char * trans, int_4* m, int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
+  void zgels(char * trans, int_4* m, int_4* n, int_4* nrhs, complex<r_8>* a, int_4* lda, 
 	      complex<r_8>* b, int_4* ldb, complex<r_8>* work, int_4* lwork, int_4* info);
 
 // Driver pour resolution de systemes au sens de Xi2 par SVD Divide & Conquer
-  void sgelsd_(int_4* m,int_4* n,int_4* nrhs,r_4* a,int_4* lda, 
+  void sgelsd(int_4* m,int_4* n,int_4* nrhs,r_4* a,int_4* lda, 
 	      r_4* b,int_4* ldb,r_4* s,r_4* rcond,int_4* rank,
               r_4* work,int_4* lwork,int_4* iwork,int_4* info);
-  void dgelsd_(int_4* m,int_4* n,int_4* nrhs,r_8* a,int_4* lda, 
+  void dgelsd(int_4* m,int_4* n,int_4* nrhs,r_8* a,int_4* lda, 
 	      r_8* b,int_4* ldb,r_8* s,r_8* rcond,int_4* rank,
               r_8* work,int_4* lwork,int_4* iwork,int_4* info);
-  void cgelsd_(int_4* m,int_4* n,int_4* nrhs,complex<r_4>* a,int_4* lda, 
+  void cgelsd(int_4* m,int_4* n,int_4* nrhs,complex<r_4>* a,int_4* lda, 
 	      complex<r_4>* b,int_4* ldb,r_4* s,r_4* rcond,int_4* rank,
               complex<r_4>* work,int_4* lwork,r_4* rwork,int_4* iwork,int_4* info);
-  void zgelsd_(int_4* m,int_4* n,int_4* nrhs,complex<r_8>* a,int_4* lda, 
+  void zgelsd(int_4* m,int_4* n,int_4* nrhs,complex<r_8>* a,int_4* lda, 
 	      complex<r_8>* b,int_4* ldb,r_8* s,r_8* rcond,int_4* rank,
               complex<r_8>* work,int_4* lwork,r_8* rwork,int_4* iwork,int_4* info);
 
 // Driver pour decomposition SVD 
-  void sgesvd_(char* jobu, char* jobvt, int_4* m, int_4* n, r_4* a, int_4* lda,
+  void sgesvd(char* jobu, char* jobvt, int_4* m, int_4* n, r_4* a, int_4* lda,
 	       r_4* s, r_4* u, int_4* ldu, r_4* vt, int_4* ldvt, 
 	       r_4* work, int_4* lwork, int_4* info);
-  void dgesvd_(char* jobu, char* jobvt, int_4* m, int_4* n, r_8* a, int_4* lda,
+  void dgesvd(char* jobu, char* jobvt, int_4* m, int_4* n, r_8* a, int_4* lda,
 	       r_8* s, r_8* u, int_4* ldu, r_8* vt, int_4* ldvt, 
 	       r_8* work, int_4* lwork, int_4* info);
-  void cgesvd_(char* jobu, char* jobvt, int_4* m, int_4* n, complex<r_4>* a, int_4* lda,
+  void cgesvd(char* jobu, char* jobvt, int_4* m, int_4* n, complex<r_4>* a, int_4* lda,
 	       r_4* s, complex<r_4>* u, int_4* ldu, complex<r_4>* vt, int_4* ldvt, 
 	       complex<r_4>* work, int_4* lwork, r_4* rwork, int_4* info);
-  void zgesvd_(char* jobu, char* jobvt, int_4* m, int_4* n, complex<r_8>* a, int_4* lda,
+  void zgesvd(char* jobu, char* jobvt, int_4* m, int_4* n, complex<r_8>* a, int_4* lda,
 	       r_8* s, complex<r_8>* u, int_4* ldu, complex<r_8>* vt, int_4* ldvt, 
 	       complex<r_8>* work, int_4* lwork, r_8* rwork, int_4* info);
 
 // Driver pour decomposition SVD Divide and Conquer
-  void sgesdd_(char* jobz, int_4* m, int_4* n, r_4* a, int_4* lda,
+  void sgesdd(char* jobz, int_4* m, int_4* n, r_4* a, int_4* lda,
 	       r_4* s, r_4* u, int_4* ldu, r_4* vt, int_4* ldvt, 
 	       r_4* work, int_4* lwork, int_4* iwork, int_4* info);
-  void dgesdd_(char* jobz, int_4* m, int_4* n, r_8* a, int_4* lda,
+  void dgesdd(char* jobz, int_4* m, int_4* n, r_8* a, int_4* lda,
 	       r_8* s, r_8* u, int_4* ldu, r_8* vt, int_4* ldvt, 
 	       r_8* work, int_4* lwork, int_4* iwork, int_4* info);
-  void cgesdd_(char* jobz, int_4* m, int_4* n, complex<r_4>* a, int_4* lda,
+  void cgesdd(char* jobz, int_4* m, int_4* n, complex<r_4>* a, int_4* lda,
 	       r_4* s, complex<r_4>* u, int_4* ldu, complex<r_4>* vt, int_4* ldvt, 
 	       complex<r_4>* work, int_4* lwork, r_4* rwork, int_4* iwork, int_4* info);
-  void zgesdd_(char* jobz, int_4* m, int_4* n, complex<r_8>* a, int_4* lda,
+  void zgesdd(char* jobz, int_4* m, int_4* n, complex<r_8>* a, int_4* lda,
 	       r_8* s, complex<r_8>* u, int_4* ldu, complex<r_8>* vt, int_4* ldvt, 
 	       complex<r_8>* work, int_4* lwork, r_8* rwork, int_4* iwork, int_4* info);
 
 // Driver pour eigen decomposition for symetric/hermitian matrices
-  void ssyev_(char* jobz, char* uplo, int_4* n, r_4* a, int_4* lda, r_4* w,
+  void ssyev(char* jobz, char* uplo, int_4* n, r_4* a, int_4* lda, r_4* w,
               r_4* work, int_4 *lwork, int_4* info);
-  void dsyev_(char* jobz, char* uplo, int_4* n, r_8* a, int_4* lda, r_8* w,
+  void dsyev(char* jobz, char* uplo, int_4* n, r_8* a, int_4* lda, r_8* w,
               r_8* work, int_4 *lwork, int_4* info);
-  void cheev_(char* jobz, char* uplo, int_4* n, complex<r_4>* a, int_4* lda, r_4* w,
+  void cheev(char* jobz, char* uplo, int_4* n, complex<r_4>* a, int_4* lda, r_4* w,
               complex<r_4>* work, int_4 *lwork, r_4* rwork, int_4* info);
-  void zheev_(char* jobz, char* uplo, int_4* n, complex<r_8>* a, int_4* lda, r_8* w,
+  void zheev(char* jobz, char* uplo, int_4* n, complex<r_8>* a, int_4* lda, r_8* w,
               complex<r_8>* work, int_4 *lwork, r_8* rwork, int_4* info);
 
 // Driver pour eigen decomposition for general squared matrices
-  void sgeev_(char* jobl, char* jobvr, int_4* n, r_4* a, int_4* lda, r_4* wr, r_4* wi,
+  void sgeev(char* jobl, char* jobvr, int_4* n, r_4* a, int_4* lda, r_4* wr, r_4* wi,
               r_4* vl, int_4* ldvl, r_4* vr, int_4* ldvr, 
               r_4* work, int_4 *lwork, int_4* info);
-  void dgeev_(char* jobl, char* jobvr, int_4* n, r_8* a, int_4* lda, r_8* wr, r_8* wi,
+  void dgeev(char* jobl, char* jobvr, int_4* n, r_8* a, int_4* lda, r_8* wr, r_8* wi,
               r_8* vl, int_4* ldvl, r_8* vr, int_4* ldvr, 
               r_8* work, int_4 *lwork, int_4* info);
-  void cgeev_(char* jobl, char* jobvr, int_4* n,  complex<r_4>* a, int_4* lda, complex<r_4>* w,
+  void cgeev(char* jobl, char* jobvr, int_4* n,  complex<r_4>* a, int_4* lda, complex<r_4>* w,
               complex<r_4>* vl, int_4* ldvl, complex<r_4>* vr, int_4* ldvr, 
               complex<r_4>* work, int_4 *lwork, r_4* rwork, int_4* info);
-  void zgeev_(char* jobl, char* jobvr, int_4* n,  complex<r_8>* a, int_4* lda, complex<r_8>* w,
+  void zgeev(char* jobl, char* jobvr, int_4* n,  complex<r_8>* a, int_4* lda, complex<r_8>* w,
               complex<r_8>* vl, int_4* ldvl, complex<r_8>* vr, int_4* ldvr, 
               complex<r_8>* work, int_4 *lwork, r_8* rwork, int_4* info);
@@ -207,5 +297,5 @@
 {
  int_4 nc1 = strlen(name), nc2 = strlen(opts), rc=0;
- rc = ilaenv_(&ispec,name,opts,&n1,&n2,&n3,&n4,nc1,nc2);
+ rc = ilaenv(&ispec,name,opts,&n1,&n2,&n3,&n4,nc1,nc2);
  //cout<<"ilaenv_en_C("<<ispec<<","<<name<<"("<<nc1<<"),"<<opts<<"("<<nc2<<"),"
  //    <<n1<<","<<n2<<","<<n3<<","<<n4<<") = "<<rc<<endl;
@@ -262,12 +352,12 @@
 
   if (typeid(T) == typeid(r_4) )
-    sgesv_(&n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb, &info);
+    sgesv(&n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb, &info);
   else if (typeid(T) == typeid(r_8) ) 
-    dgesv_(&n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb, &info);
+    dgesv(&n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb, &info);
   else if (typeid(T) == typeid(complex<r_4>) ) 
-    cgesv_(&n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv, 
+    cgesv(&n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv, 
 	   (complex<r_4> *)b.Data(), &ldb, &info);
   else if (typeid(T) == typeid(complex<r_8>) ) 
-    zgesv_(&n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv, 
+    zgesv(&n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv, 
 	   (complex<r_8> *)b.Data(), &ldb, &info);
   else {
@@ -326,29 +416,29 @@
 
   if (typeid(T) == typeid(r_4) ) {
-    ssysv_(&uplo, &n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb,
+    ssysv(&uplo, &n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb,
           (r_4 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork  +GARDMEM];
-    ssysv_(&uplo, &n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb,
+    ssysv(&uplo, &n, &nrhs, (r_4 *)a.Data(), &lda, ipiv, (r_4 *)b.Data(), &ldb,
           (r_4 *)work, &lwork, &info);
   } else if (typeid(T) == typeid(r_8) )  {
-    dsysv_(&uplo, &n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb,
+    dsysv(&uplo, &n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb,
           (r_8 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork  +GARDMEM];
-    dsysv_(&uplo, &n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb,
+    dsysv(&uplo, &n, &nrhs, (r_8 *)a.Data(), &lda, ipiv, (r_8 *)b.Data(), &ldb,
           (r_8 *)work, &lwork, &info);
   } else if (typeid(T) == typeid(complex<r_4>) )  {
-    csysv_(&uplo, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv,
+    csysv(&uplo, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv,
 	  (complex<r_4> *)b.Data(), &ldb,
           (complex<r_4> *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork  +GARDMEM];
-    csysv_(&uplo, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv,
+    csysv(&uplo, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, ipiv,
 	  (complex<r_4> *)b.Data(), &ldb,
           (complex<r_4> *)work, &lwork, &info);
   } else if (typeid(T) == typeid(complex<r_8>) )  {
-    zsysv_(&uplo, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv,
+    zsysv(&uplo, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv,
 	  (complex<r_8> *)b.Data(), &ldb,
           (complex<r_8> *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork  +GARDMEM];
-    zsysv_(&uplo, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv,
+    zsysv(&uplo, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, ipiv,
 	  (complex<r_8> *)b.Data(), &ldb,
           (complex<r_8> *)work, &lwork, &info);
@@ -427,26 +517,26 @@
   
   if (typeid(T) == typeid(r_4) ) {
-    sgels_(&trans, &m, &n, &nrhs, (r_4 *)a.Data(), &lda, 
+    sgels(&trans, &m, &n, &nrhs, (r_4 *)a.Data(), &lda, 
 	   (r_4 *)b.Data(), &ldb, (r_4 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork  +GARDMEM];
-    sgels_(&trans, &m, &n, &nrhs, (r_4 *)a.Data(), &lda, 
+    sgels(&trans, &m, &n, &nrhs, (r_4 *)a.Data(), &lda, 
 	   (r_4 *)b.Data(), &ldb, (r_4 *)work, &lwork, &info);
   } else if (typeid(T) == typeid(r_8) )  {
-    dgels_(&trans, &m, &n, &nrhs, (r_8 *)a.Data(), &lda, 
+    dgels(&trans, &m, &n, &nrhs, (r_8 *)a.Data(), &lda, 
 	   (r_8 *)b.Data(), &ldb, (r_8 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork  +GARDMEM];
-    dgels_(&trans, &m, &n, &nrhs, (r_8 *)a.Data(), &lda, 
+    dgels(&trans, &m, &n, &nrhs, (r_8 *)a.Data(), &lda, 
 	   (r_8 *)b.Data(), &ldb, (r_8 *)work, &lwork, &info);
   } else if (typeid(T) == typeid(complex<r_4>) )  {
-    cgels_(&trans, &m, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, 
+    cgels(&trans, &m, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, 
 	   (complex<r_4> *)b.Data(), &ldb, (complex<r_4> *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork  +GARDMEM];
-    cgels_(&trans, &m, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, 
+    cgels(&trans, &m, &n, &nrhs, (complex<r_4> *)a.Data(), &lda, 
 	   (complex<r_4> *)b.Data(), &ldb, (complex<r_4> *)work, &lwork, &info);
   } else if (typeid(T) == typeid(complex<r_8>) )  {
-    zgels_(&trans, &m, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, 
+    zgels(&trans, &m, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, 
 	   (complex<r_8> *)b.Data(), &ldb, (complex<r_8> *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork  +GARDMEM];
-    zgels_(&trans, &m, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, 
+    zgels(&trans, &m, &n, &nrhs, (complex<r_8> *)a.Data(), &lda, 
 	   (complex<r_8> *)b.Data(), &ldb, (complex<r_8> *)work, &lwork, &info);
   } else {
@@ -554,9 +644,9 @@
     r_4 srcond = rcond;
     iwork = new int_4[3*minmn*nlvl+11*minmn  +GARDMEM];
-    sgelsd_(&m,&n,&nrhs,(r_4*)a.Data(),&lda, 
+    sgelsd(&m,&n,&nrhs,(r_4*)a.Data(),&lda, 
 	   (r_4*)b.Data(),&ldb,(r_4*)sloc,&srcond,&rank,
            (r_4*)wkget,&lwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    sgelsd_(&m,&n,&nrhs,(r_4*)a.Data(),&lda, 
+    sgelsd(&m,&n,&nrhs,(r_4*)a.Data(),&lda, 
 	   (r_4*)b.Data(),&ldb,(r_4*)sloc,&srcond,&rank,
            (r_4*)work,&lwork,(int_4*)iwork,&info);
@@ -565,9 +655,9 @@
   } else if(typeid(T) == typeid(r_8) )  {
     iwork = new int_4[3*minmn*nlvl+11*minmn  +GARDMEM];
-    dgelsd_(&m,&n,&nrhs,(r_8*)a.Data(),&lda, 
+    dgelsd(&m,&n,&nrhs,(r_8*)a.Data(),&lda, 
 	   (r_8*)b.Data(),&ldb,(r_8*)s.Data(),&rcond,&rank,
            (r_8*)wkget,&lwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    dgelsd_(&m,&n,&nrhs,(r_8*)a.Data(),&lda, 
+    dgelsd(&m,&n,&nrhs,(r_8*)a.Data(),&lda, 
 	   (r_8*)b.Data(),&ldb,(r_8*)s.Data(),&rcond,&rank,
            (r_8*)work,&lwork,(int_4*)iwork,&info);
@@ -581,9 +671,9 @@
     r_4* sloc = new r_4[minmn];
     r_4 srcond = rcond;
-    cgelsd_(&m,&n,&nrhs,(complex<r_4>*)a.Data(),&lda, 
+    cgelsd(&m,&n,&nrhs,(complex<r_4>*)a.Data(),&lda, 
 	   (complex<r_4>*)b.Data(),&ldb,(r_4*)sloc,&srcond,&rank,
            (complex<r_4>*)wkget,&lwork,(r_4*)rwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    cgelsd_(&m,&n,&nrhs,(complex<r_4>*)a.Data(),&lda, 
+    cgelsd(&m,&n,&nrhs,(complex<r_4>*)a.Data(),&lda, 
 	   (complex<r_4>*)b.Data(),&ldb,(r_4*)sloc,&srcond,&rank,
            (complex<r_4>*)work,&lwork,(r_4*)rwork,(int_4*)iwork,&info);
@@ -598,9 +688,9 @@
     r_8* rwork = new r_8[lrwork +GARDMEM];
     iwork = new int_4[3*minmn*nlvl+11*minmn  +GARDMEM];
-    zgelsd_(&m,&n,&nrhs,(complex<r_8>*)a.Data(),&lda, 
+    zgelsd(&m,&n,&nrhs,(complex<r_8>*)a.Data(),&lda, 
 	   (complex<r_8>*)b.Data(),&ldb,(r_8*)s.Data(),&rcond,&rank,
            (complex<r_8>*)wkget,&lwork,(r_8*)rwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    zgelsd_(&m,&n,&nrhs,(complex<r_8>*)a.Data(),&lda, 
+    zgelsd(&m,&n,&nrhs,(complex<r_8>*)a.Data(),&lda, 
 	   (complex<r_8>*)b.Data(),&ldb,(r_8*)s.Data(),&rcond,&rank,
            (complex<r_8>*)work,&lwork,(r_8*)rwork,(int_4*)iwork,&info);
@@ -726,17 +816,17 @@
 
   if (typeid(T) == typeid(r_4) ) {
-    sgesvd_(&jobu, &jobvt, &m, &n, (r_4 *)a.Data(), &lda,
+    sgesvd(&jobu, &jobvt, &m, &n, (r_4 *)a.Data(), &lda,
 	    (r_4 *)s.Data(), (r_4 *) up->Data(), &ldu, (r_4 *)vtp->Data(), &ldvt, 
 	    (r_4 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    sgesvd_(&jobu, &jobvt, &m, &n, (r_4 *)a.Data(), &lda,
+    sgesvd(&jobu, &jobvt, &m, &n, (r_4 *)a.Data(), &lda,
 	    (r_4 *)s.Data(), (r_4 *) up->Data(), &ldu, (r_4 *)vtp->Data(), &ldvt, 
 	    (r_4 *)work, &lwork, &info);
   } else if (typeid(T) == typeid(r_8) ) {
-    dgesvd_(&jobu, &jobvt, &m, &n, (r_8 *)a.Data(), &lda,
+    dgesvd(&jobu, &jobvt, &m, &n, (r_8 *)a.Data(), &lda,
 	    (r_8 *)s.Data(), (r_8 *) up->Data(), &ldu, (r_8 *)vtp->Data(), &ldvt, 
 	    (r_8 *)wkget, &lwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    dgesvd_(&jobu, &jobvt, &m, &n, (r_8 *)a.Data(), &lda,
+    dgesvd(&jobu, &jobvt, &m, &n, (r_8 *)a.Data(), &lda,
 	    (r_8 *)s.Data(), (r_8 *) up->Data(), &ldu, (r_8 *)vtp->Data(), &ldvt, 
 	    (r_8 *)work, &lwork, &info);
@@ -744,10 +834,10 @@
     r_4 * rwork = new r_4[5*minmn +GARDMEM];
     r_4 * sloc  = new r_4[minmn];
-    cgesvd_(&jobu, &jobvt, &m, &n, (complex<r_4> *)a.Data(), &lda,
+    cgesvd(&jobu, &jobvt, &m, &n, (complex<r_4> *)a.Data(), &lda,
 	    (r_4 *)sloc, (complex<r_4> *) up->Data(), &ldu, 
 	    (complex<r_4> *)vtp->Data(), &ldvt, 
 	    (complex<r_4> *)wkget, &lwork, (r_4 *)rwork, &info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    cgesvd_(&jobu, &jobvt, &m, &n, (complex<r_4> *)a.Data(), &lda,
+    cgesvd(&jobu, &jobvt, &m, &n, (complex<r_4> *)a.Data(), &lda,
 	    (r_4 *)sloc, (complex<r_4> *) up->Data(), &ldu, 
 	    (complex<r_4> *)vtp->Data(), &ldvt, 
@@ -758,10 +848,10 @@
     r_8 * rwork = new r_8[5*minmn +GARDMEM];
     r_8 * sloc  = new r_8[minmn];
-    zgesvd_(&jobu, &jobvt, &m, &n, (complex<r_8> *)a.Data(), &lda,
+    zgesvd(&jobu, &jobvt, &m, &n, (complex<r_8> *)a.Data(), &lda,
 	    (r_8 *)sloc, (complex<r_8> *) up->Data(), &ldu, 
 	    (complex<r_8> *)vtp->Data(), &ldvt, 
 	    (complex<r_8> *)wkget, &lwork, (r_8 *)rwork, &info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    zgesvd_(&jobu, &jobvt, &m, &n, (complex<r_8> *)a.Data(), &lda,
+    zgesvd(&jobu, &jobvt, &m, &n, (complex<r_8> *)a.Data(), &lda,
 	    (r_8 *)sloc, (complex<r_8> *) up->Data(), &ldu, 
 	    (complex<r_8> *)vtp->Data(), &ldvt, 
@@ -818,9 +908,9 @@
     r_4* sloc = new r_4[minmn];
     iwork = new int_4[8*minmn +GARDMEM];
-    sgesdd_(&jobz,&m,&n,(r_4*)a.Data(),&lda,
+    sgesdd(&jobz,&m,&n,(r_4*)a.Data(),&lda,
 	   (r_4*)sloc,(r_4*)u.Data(),&ldu,(r_4*)vt.Data(),&ldvt, 
 	   (r_4*)wkget,&lwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    sgesdd_(&jobz,&m,&n,(r_4*)a.Data(),&lda,
+    sgesdd(&jobz,&m,&n,(r_4*)a.Data(),&lda,
 	   (r_4*)sloc,(r_4*)u.Data(),&ldu,(r_4*)vt.Data(),&ldvt, 
 	   (r_4*)work,&lwork,(int_4*)iwork,&info);
@@ -829,9 +919,9 @@
   } else if(typeid(T) == typeid(r_8) ) {
     iwork = new int_4[8*minmn +GARDMEM];
-    dgesdd_(&jobz,&m,&n,(r_8*)a.Data(),&lda,
+    dgesdd(&jobz,&m,&n,(r_8*)a.Data(),&lda,
 	   (r_8*)s.Data(),(r_8*)u.Data(),&ldu,(r_8*)vt.Data(),&ldvt, 
 	   (r_8*)wkget,&lwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    dgesdd_(&jobz,&m,&n,(r_8*)a.Data(),&lda,
+    dgesdd(&jobz,&m,&n,(r_8*)a.Data(),&lda,
 	   (r_8*)s.Data(),(r_8*)u.Data(),&ldu,(r_8*)vt.Data(),&ldvt, 
 	   (r_8*)work,&lwork,(int_4*)iwork,&info);
@@ -840,9 +930,9 @@
     r_4* rwork = new r_4[5*minmn*minmn+5*minmn +GARDMEM];
     iwork = new int_4[8*minmn +GARDMEM];
-    cgesdd_(&jobz,&m,&n,(complex<r_4>*)a.Data(),&lda,
+    cgesdd(&jobz,&m,&n,(complex<r_4>*)a.Data(),&lda,
 	   (r_4*)sloc,(complex<r_4>*)u.Data(),&ldu,(complex<r_4>*)vt.Data(),&ldvt, 
 	   (complex<r_4>*)wkget,&lwork,(r_4*)rwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],4); work = new T[lwork +GARDMEM];
-    cgesdd_(&jobz,&m,&n,(complex<r_4>*)a.Data(),&lda,
+    cgesdd(&jobz,&m,&n,(complex<r_4>*)a.Data(),&lda,
 	   (r_4*)sloc,(complex<r_4>*)u.Data(),&ldu,(complex<r_4>*)vt.Data(),&ldvt, 
 	   (complex<r_4>*)work,&lwork,(r_4*)rwork,(int_4*)iwork,&info);
@@ -852,9 +942,9 @@
     r_8* rwork = new r_8[5*minmn*minmn+5*minmn +GARDMEM];
     iwork = new int_4[8*minmn +GARDMEM];
-    zgesdd_(&jobz,&m,&n,(complex<r_8>*)a.Data(),&lda,
+    zgesdd(&jobz,&m,&n,(complex<r_8>*)a.Data(),&lda,
 	   (r_8*)s.Data(),(complex<r_8>*)u.Data(),&ldu,(complex<r_8>*)vt.Data(),&ldvt, 
 	   (complex<r_8>*)wkget,&lwork,(r_8*)rwork,(int_4*)iwork,&info);
     lwork = type2i4(&wkget[0],8); work = new T[lwork +GARDMEM];
-    zgesdd_(&jobz,&m,&n,(complex<r_8>*)a.Data(),&lda,
+    zgesdd(&jobz,&m,&n,(complex<r_8>*)a.Data(),&lda,
 	   (r_8*)s.Data(),(complex<r_8>*)u.Data(),&ldu,(complex<r_8>*)vt.Data(),&ldvt, 
 	   (complex<r_8>*)work,&lwork,(r_8*)rwork,(int_4*)iwork,&info);
@@ -909,22 +999,22 @@
   if (typeid(T) == typeid(r_4) ) {
     r_4* w = new r_4[n];
-    ssyev_(&jobz,&uplo,&n,(r_4 *)a.Data(),&lda,(r_4 *)w,(r_4 *)wkget,&lwork,&info);
+    ssyev(&jobz,&uplo,&n,(r_4 *)a.Data(),&lda,(r_4 *)w,(r_4 *)wkget,&lwork,&info);
     lwork = type2i4(&wkget[0],4); /* 3*n-1;*/ work = new T[lwork  +GARDMEM];
-    ssyev_(&jobz,&uplo,&n,(r_4 *)a.Data(),&lda,(r_4 *)w,(r_4 *)work,&lwork,&info);
+    ssyev(&jobz,&uplo,&n,(r_4 *)a.Data(),&lda,(r_4 *)w,(r_4 *)work,&lwork,&info);
     if(info==0) for(int i=0;i<n;i++) b(i) = w[i];
     delete [] w;
   } else if (typeid(T) == typeid(r_8) )  {
     r_8* w = new r_8[n];
-    dsyev_(&jobz,&uplo,&n,(r_8 *)a.Data(),&lda,(r_8 *)w,(r_8 *)wkget,&lwork,&info);
+    dsyev(&jobz,&uplo,&n,(r_8 *)a.Data(),&lda,(r_8 *)w,(r_8 *)wkget,&lwork,&info);
     lwork = type2i4(&wkget[0],8); /* 3*n-1;*/ work = new T[lwork  +GARDMEM];
-    dsyev_(&jobz,&uplo,&n,(r_8 *)a.Data(),&lda,(r_8 *)w,(r_8 *)work,&lwork,&info);
+    dsyev(&jobz,&uplo,&n,(r_8 *)a.Data(),&lda,(r_8 *)w,(r_8 *)work,&lwork,&info);
     if(info==0) for(int i=0;i<n;i++) b(i) = w[i];
     delete [] w;
   } else if (typeid(T) == typeid(complex<r_4>) )  {
     r_4* rwork = new r_4[3*n-2  +GARDMEM]; r_4* w = new r_4[n];
-    cheev_(&jobz,&uplo,&n,(complex<r_4> *)a.Data(),&lda,(r_4 *)w
+    cheev(&jobz,&uplo,&n,(complex<r_4> *)a.Data(),&lda,(r_4 *)w
           ,(complex<r_4> *)wkget,&lwork,(r_4 *)rwork,&info);
     lwork = type2i4(&wkget[0],4); /* 2*n-1;*/ work = new T[lwork  +GARDMEM];
-    cheev_(&jobz,&uplo,&n,(complex<r_4> *)a.Data(),&lda,(r_4 *)w
+    cheev(&jobz,&uplo,&n,(complex<r_4> *)a.Data(),&lda,(r_4 *)w
           ,(complex<r_4> *)work,&lwork,(r_4 *)rwork,&info);
     if(info==0) for(int i=0;i<n;i++) b(i) = w[i];
@@ -932,8 +1022,8 @@
   } else if (typeid(T) == typeid(complex<r_8>) )  {
     r_8* rwork = new r_8[3*n-2  +GARDMEM]; r_8* w = new r_8[n];
-    zheev_(&jobz,&uplo,&n,(complex<r_8> *)a.Data(),&lda,(r_8 *)w
+    zheev(&jobz,&uplo,&n,(complex<r_8> *)a.Data(),&lda,(r_8 *)w
           ,(complex<r_8> *)wkget,&lwork,(r_8 *)rwork,&info);
     lwork = type2i4(&wkget[0],8); /* 2*n-1;*/ work = new T[lwork  +GARDMEM];
-    zheev_(&jobz,&uplo,&n,(complex<r_8> *)a.Data(),&lda,(r_8 *)w
+    zheev(&jobz,&uplo,&n,(complex<r_8> *)a.Data(),&lda,(r_8 *)w
           ,(complex<r_8> *)work,&lwork,(r_8 *)rwork,&info);
     if(info==0) for(int i=0;i<n;i++) b(i) = w[i];
@@ -1004,9 +1094,9 @@
   if (typeid(T) == typeid(r_4) ) {
     r_4* wr = new r_4[n]; r_4* wi = new r_4[n]; r_4* vl = NULL;
-    sgeev_(&jobvl,&jobvr,&n,(r_4 *)a.Data(),&lda,(r_4 *)wr,(r_4 *)wi,
+    sgeev(&jobvl,&jobvr,&n,(r_4 *)a.Data(),&lda,(r_4 *)wr,(r_4 *)wi,
 	   (r_4 *)vl,&ldvl,(r_4 *)evec.Data(),&ldvr,
            (r_4 *)wkget,&lwork,&info);
     lwork = type2i4(&wkget[0],4); /* 4*n;*/ work = new T[lwork  +GARDMEM];
-    sgeev_(&jobvl,&jobvr,&n,(r_4 *)a.Data(),&lda,(r_4 *)wr,(r_4 *)wi,
+    sgeev(&jobvl,&jobvr,&n,(r_4 *)a.Data(),&lda,(r_4 *)wr,(r_4 *)wi,
 	   (r_4 *)vl,&ldvl,(r_4 *)evec.Data(),&ldvr,
            (r_4 *)work,&lwork,&info);
@@ -1015,9 +1105,9 @@
   } else if (typeid(T) == typeid(r_8) )  {
     r_8* wr = new r_8[n]; r_8* wi = new r_8[n]; r_8* vl = NULL;
-    dgeev_(&jobvl,&jobvr,&n,(r_8 *)a.Data(),&lda,(r_8 *)wr,(r_8 *)wi,
+    dgeev(&jobvl,&jobvr,&n,(r_8 *)a.Data(),&lda,(r_8 *)wr,(r_8 *)wi,
 	   (r_8 *)vl,&ldvl,(r_8 *)evec.Data(),&ldvr,
            (r_8 *)wkget,&lwork,&info);
     lwork = type2i4(&wkget[0],8); /* 4*n;*/ work = new T[lwork  +GARDMEM];
-    dgeev_(&jobvl,&jobvr,&n,(r_8 *)a.Data(),&lda,(r_8 *)wr,(r_8 *)wi,
+    dgeev(&jobvl,&jobvr,&n,(r_8 *)a.Data(),&lda,(r_8 *)wr,(r_8 *)wi,
 	   (r_8 *)vl,&ldvl,(r_8 *)evec.Data(),&ldvr,
            (r_8 *)work,&lwork,&info);
@@ -1026,9 +1116,9 @@
   } else if (typeid(T) == typeid(complex<r_4>) )  {
     r_4* rwork = new r_4[2*n  +GARDMEM]; r_4* vl = NULL; TVector< complex<r_4> > w(n);
-    cgeev_(&jobvl,&jobvr,&n,(complex<r_4> *)a.Data(),&lda,(complex<r_4> *)w.Data(),
+    cgeev(&jobvl,&jobvr,&n,(complex<r_4> *)a.Data(),&lda,(complex<r_4> *)w.Data(),
 	   (complex<r_4> *)vl,&ldvl,(complex<r_4> *)evec.Data(),&ldvr,
            (complex<r_4> *)wkget,&lwork,(r_4 *)rwork,&info);
     lwork = type2i4(&wkget[0],4); /* 2*n;*/ work = new T[lwork  +GARDMEM];
-    cgeev_(&jobvl,&jobvr,&n,(complex<r_4> *)a.Data(),&lda,(complex<r_4> *)w.Data(),
+    cgeev(&jobvl,&jobvr,&n,(complex<r_4> *)a.Data(),&lda,(complex<r_4> *)w.Data(),
 	   (complex<r_4> *)vl,&ldvl,(complex<r_4> *)evec.Data(),&ldvr,
            (complex<r_4> *)work,&lwork,(r_4 *)rwork,&info);
@@ -1037,9 +1127,9 @@
   } else if (typeid(T) == typeid(complex<r_8>) )  {
     r_8* rwork = new r_8[2*n  +GARDMEM]; r_8* vl = NULL;
-    zgeev_(&jobvl,&jobvr,&n,(complex<r_8> *)a.Data(),&lda,(complex<r_8> *)eval.Data(),
+    zgeev(&jobvl,&jobvr,&n,(complex<r_8> *)a.Data(),&lda,(complex<r_8> *)eval.Data(),
 	   (complex<r_8> *)vl,&ldvl,(complex<r_8> *)evec.Data(),&ldvr,
            (complex<r_8> *)wkget,&lwork,(r_8 *)rwork,&info);
     lwork = type2i4(&wkget[0],8); /* 2*n;*/ work = new T[lwork  +GARDMEM];
-    zgeev_(&jobvl,&jobvr,&n,(complex<r_8> *)a.Data(),&lda,(complex<r_8> *)eval.Data(),
+    zgeev(&jobvl,&jobvr,&n,(complex<r_8> *)a.Data(),&lda,(complex<r_8> *)eval.Data(),
 	   (complex<r_8> *)vl,&ldvl,(complex<r_8> *)evec.Data(),&ldvr,
            (complex<r_8> *)work,&lwork,(r_8 *)rwork,&info);
@@ -1068,8 +1158,10 @@
 
 #if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+namespace SOPHYA {
 template class LapackServer<r_4>;
 template class LapackServer<r_8>;
 template class LapackServer< complex<r_4> >;
 template class LapackServer< complex<r_8> >;
+}
 #endif
 
