2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013, by the GROMACS development team, led by
5 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6 * others, as listed in the AUTHORS file in the top-level source
7 * directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 #include "gmx_lapack.h"
41 F77_FUNC(slabrd,SLABRD)(int *m,
55 int a_dim1, a_offset, x_dim1, x_offset, y_dim1, y_offset;
58 float minusone = -1.0;
64 a_offset = 1 + a_dim1;
71 x_offset = 1 + x_dim1;
74 y_offset = 1 + y_dim1;
77 if (*m <= 0 || *n <= 0) {
84 for (i__ = 1; i__ <= i__1; ++i__) {
88 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &a[i__ + a_dim1], lda,
89 &y[i__ + y_dim1], ldy, &one, &a[i__ + i__ * a_dim1], &c__1);
92 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &x[i__ + x_dim1], ldx,
93 &a[i__*a_dim1+1],&c__1,&one,&a[i__+i__*a_dim1],&c__1);
99 F77_FUNC(slarfg,SLARFG)(&i__2, &a[i__ + i__ * a_dim1], &a[i__3 + i__ * a_dim1],
101 d__[i__] = a[i__ + i__ * a_dim1];
103 a[i__ + i__ * a_dim1] = 1.;
107 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &a[i__ + (i__ + 1) *
108 a_dim1], lda, &a[i__ + i__ * a_dim1], &c__1, &zero, &
109 y[i__ + 1 + i__ * y_dim1], &c__1);
112 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &a[i__ + a_dim1],
113 lda, &a[i__ + i__ * a_dim1], &c__1, &zero, &y[i__ *
117 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &y[i__ + 1 +
118 y_dim1], ldy, &y[i__ * y_dim1 + 1], &c__1, &one, &y[
119 i__ + 1 + i__ * y_dim1], &c__1);
122 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &x[i__ + x_dim1],
123 ldx, &a[i__ + i__ * a_dim1], &c__1, &zero, &y[i__ *
127 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &minusone, &a[(i__ + 1) *
128 a_dim1 + 1], lda, &y[i__ * y_dim1 + 1], &c__1, &one,
129 &y[i__ + 1 + i__ * y_dim1], &c__1);
131 F77_FUNC(sscal,SSCAL)(&i__2, &tauq[i__], &y[i__ + 1 + i__ * y_dim1], &c__1);
134 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__, &minusone, &y[i__ + 1 +
135 y_dim1], ldy, &a[i__ + a_dim1], lda, &one, &a[i__ + (
136 i__ + 1) * a_dim1], lda);
139 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &minusone, &a[(i__ + 1) *
140 a_dim1 + 1], lda, &x[i__ + x_dim1], ldx, &one, &a[
141 i__ + (i__ + 1) * a_dim1], lda);
147 F77_FUNC(slarfg,SLARFG)(&i__2, &a[i__ + (i__ + 1) * a_dim1],
148 &a[i__ + i__3 * a_dim1], lda, &taup[i__]);
149 e[i__] = a[i__ + (i__ + 1) * a_dim1];
150 a[i__ + (i__ + 1) * a_dim1] = 1.;
154 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &one, &a[i__ + 1 + (i__
155 + 1) * a_dim1], lda, &a[i__ + (i__ + 1) * a_dim1],
156 lda, &zero, &x[i__ + 1 + i__ * x_dim1], &c__1);
158 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__, &one, &y[i__ + 1 + y_dim1],
159 ldy, &a[i__ + (i__ + 1) * a_dim1], lda, &zero, &x[
160 i__ * x_dim1 + 1], &c__1);
162 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__, &minusone, &a[i__ + 1 +
163 a_dim1], lda, &x[i__ * x_dim1 + 1], &c__1, &one, &x[
164 i__ + 1 + i__ * x_dim1], &c__1);
167 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &one, &a[(i__ + 1) *
168 a_dim1 + 1], lda, &a[i__ + (i__ + 1) * a_dim1], lda, &
169 zero, &x[i__ * x_dim1 + 1], &c__1);
172 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &x[i__ + 1 +
173 x_dim1], ldx, &x[i__ * x_dim1 + 1], &c__1, &one, &x[
174 i__ + 1 + i__ * x_dim1], &c__1);
176 F77_FUNC(sscal,SSCAL)(&i__2, &taup[i__], &x[i__ + 1 + i__ * x_dim1], &c__1);
182 for (i__ = 1; i__ <= i__1; ++i__) {
186 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &y[i__ + y_dim1], ldy,
187 &a[i__ + a_dim1], lda, &one, &a[i__ + i__ * a_dim1],lda);
190 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &minusone, &a[i__ * a_dim1 + 1],
191 lda, &x[i__ + x_dim1], ldx, &one,&a[i__+i__*a_dim1],lda);
197 F77_FUNC(slarfg,SLARFG)(&i__2, &a[i__ + i__ * a_dim1],
198 &a[i__ + i__3 * a_dim1], lda, &taup[i__]);
199 d__[i__] = a[i__ + i__ * a_dim1];
201 a[i__ + i__ * a_dim1] = 1.;
205 F77_FUNC(sgemv,SGEMV)("No transpose",&i__2,&i__3,&one,&a[i__+1+i__*a_dim1],
206 lda, &a[i__ + i__ * a_dim1], lda, &zero,
207 &x[i__ + 1 + i__ * x_dim1], &c__1);
210 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &y[i__ + y_dim1],
211 ldy, &a[i__ + i__ * a_dim1], lda, &zero, &x[i__ *
215 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &a[i__ + 1 +
216 a_dim1], lda, &x[i__ * x_dim1 + 1], &c__1, &one, &x[
217 i__ + 1 + i__ * x_dim1], &c__1);
220 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &one, &a[i__ * a_dim1 +
221 1], lda, &a[i__ + i__ * a_dim1], lda, &zero, &x[i__ *
225 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &x[i__ + 1 +
226 x_dim1], ldx, &x[i__ * x_dim1 + 1], &c__1, &one, &x[
227 i__ + 1 + i__ * x_dim1], &c__1);
229 F77_FUNC(sscal,SSCAL)(&i__2, &taup[i__], &x[i__ + 1 + i__ * x_dim1], &c__1);
233 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &a[i__ + 1 +
234 a_dim1], lda, &y[i__ + y_dim1], ldy, &one, &a[i__ +
235 1 + i__ * a_dim1], &c__1);
237 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__, &minusone, &x[i__ + 1 +
238 x_dim1], ldx, &a[i__ * a_dim1 + 1], &c__1, &one, &a[
239 i__ + 1 + i__ * a_dim1], &c__1);
245 F77_FUNC(slarfg,SLARFG)(&i__2, &a[i__ + 1 + i__ * a_dim1],
246 &a[i__3 + i__ * a_dim1], &c__1, &tauq[i__]);
247 e[i__] = a[i__ + 1 + i__ * a_dim1];
248 a[i__ + 1 + i__ * a_dim1] = 1.;
252 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &a[i__ + 1 + (i__ +
253 1) * a_dim1], lda, &a[i__ + 1 + i__ * a_dim1], &c__1,
254 &zero, &y[i__ + 1 + i__ * y_dim1], &c__1);
257 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__3, &one, &a[i__ + 1 + a_dim1],
258 lda, &a[i__ + 1 + i__ * a_dim1], &c__1, &zero, &y[
259 i__ * y_dim1 + 1], &c__1);
262 F77_FUNC(sgemv,SGEMV)("No transpose", &i__2, &i__3, &minusone, &y[i__ + 1 +
263 y_dim1], ldy, &y[i__ * y_dim1 + 1], &c__1, &one, &y[
264 i__ + 1 + i__ * y_dim1], &c__1);
266 F77_FUNC(sgemv,SGEMV)("Transpose", &i__2, &i__, &one, &x[i__ + 1 + x_dim1],
267 ldx, &a[i__ + 1 + i__ * a_dim1], &c__1, &zero, &y[
268 i__ * y_dim1 + 1], &c__1);
270 F77_FUNC(sgemv,SGEMV)("Transpose", &i__, &i__2, &minusone, &a[(i__ + 1) * a_dim1
271 + 1], lda, &y[i__ * y_dim1 + 1], &c__1, &one, &y[i__
272 + 1 + i__ * y_dim1], &c__1);
274 F77_FUNC(sscal,SSCAL)(&i__2, &tauq[i__], &y[i__ + 1 + i__ * y_dim1], &c__1);