]> https://gitweb.dealii.org/ - dealii.git/commitdiff
starting on it
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 22 Mar 2005 03:26:30 +0000 (03:26 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 22 Mar 2005 03:26:30 +0000 (03:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@10200 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/blastemplates/blas.h.in [new file with mode: 0644]
deal.II/contrib/blastemplates/templates.pl [new file with mode: 0644]

diff --git a/deal.II/contrib/blastemplates/blas.h.in b/deal.II/contrib/blastemplates/blas.h.in
new file mode 100644 (file)
index 0000000..a3b74be
--- /dev/null
@@ -0,0 +1,34 @@
+// General Matrix
+// Matrix vector product
+void dgemv_ (char* trans, int* m, int* n,
+            double* alpha, double* A, int* lda,
+            double* x, int* incx,
+            double* b, double* y, int* incy);
+// Compute eigenvalues and vectors
+void dgeev_ (char* jobvl, char* jobvr,
+            int* n, double* A, int* lda,
+            double* lambda_re, double* lambda_im,
+            double* vl, int* ldvl,
+            double* vr, int* ldva,
+            double* work, int* lwork,
+            int* info);
+// Compute eigenvalues and vectors (expert)
+void dgeevx_ (char* balanc, char* jobvl, char* jobvr, char* sense,
+             int* n, double* A, int* lda,
+             double* lambda_re, double* lambda_im,
+             double* vl, int* ldvl,
+             double* vr, int* ldvr,
+             int* ilo, int* ihi,
+             double* scale, double* abnrm,
+             double* rconde, double* rcondv,
+             double* work, int* lwork,
+             int* iwork, int* info);
+// Compute singular value decomposition
+void dgesvd_ (int* jobu, int* jobvt,
+             int* n, int* m, double* A, int* lda,
+             double* s,
+             double* u, int* ldu,
+             double* vt, int* ldvt,
+             double* work, int* lwork,
+             int* info);
+
diff --git a/deal.II/contrib/blastemplates/templates.pl b/deal.II/contrib/blastemplates/templates.pl
new file mode 100644 (file)
index 0000000..5e7bed3
--- /dev/null
@@ -0,0 +1,79 @@
+#---------------------------------------------------------------------------
+#    $Id$
+#    Version: $Name$
+#
+#    Copyright (C) 2005 by the deal authors
+#
+#    This file is subject to QPL and may not be  distributed
+#    without copyright and license information. Please refer
+#    to the file deal.II/doc/license.html for the  text  and
+#    further information on this license.
+#
+#---------------------------------------------------------------------------
+
+my $templates;
+my $double;
+
+
+print << 'EOT'
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    This file was automatically generated from blas.h.in
+//
+//    Copyright (C) 2005 by the deal authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+#ifndef __BLAS_TEMPLATES_H
+#define __BLAS_TEMPLATES_H
+
+extern "C"
+{
+EOT
+    ;
+
+while(<>)
+{
+    if (m'^\s*//')
+    {
+       print;
+       next;
+    }
+    if (m'\s*(\w+)\s+d(\w+)_\s*\(')
+    {
+       $double = $_;
+       my $type = $1;
+       my $name = $2;
+       while (<>)
+       {
+           $double .= $_;
+           last if (m';');
+       }
+       my $single = $double;
+       $single =~ s/d$name/s$name/;
+       $single =~ s/double/float/g;
+       print $double,$single;
+       
+       $double =~ m/\(([^\)]*)/;
+       my $args = $1;
+       $args =~ s/\s+/ /g;
+       $args2 = $args;
+       $args2 =~ s/\w+\*//g;
+       
+       $templates .= "\n\ninline $type\n$name ($args)\n{\n  d$name\_ ($args2);\n}\n";
+       $args =~ s/double/float/g;
+       $type =~ s/double/float/g;
+       $templates .= "\n\ninline $type\n$name ($args)\n{\n  s$name\_ ($args2);\n}\n";
+    }
+}
+
+print "\n}\n";
+
+print "\n$templates\n\n#endif\n";

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.