From bf1be935e7aecaaed196f557f0d342cc5d10d2a0 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 22 Mar 2005 03:26:30 +0000 Subject: [PATCH] starting on it git-svn-id: https://svn.dealii.org/trunk@10200 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/contrib/blastemplates/blas.h.in | 34 ++++++++++ deal.II/contrib/blastemplates/templates.pl | 79 ++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 deal.II/contrib/blastemplates/blas.h.in create mode 100644 deal.II/contrib/blastemplates/templates.pl diff --git a/deal.II/contrib/blastemplates/blas.h.in b/deal.II/contrib/blastemplates/blas.h.in new file mode 100644 index 0000000000..a3b74be2b3 --- /dev/null +++ b/deal.II/contrib/blastemplates/blas.h.in @@ -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 index 0000000000..5e7bed3dca --- /dev/null +++ b/deal.II/contrib/blastemplates/templates.pl @@ -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"; -- 2.39.5