You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

slarfb.c 33 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. /* f2c.h -- Standard Fortran to C header file */
  2. /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
  3. - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  4. #ifndef F2C_INCLUDE
  5. #define F2C_INCLUDE
  6. #include <math.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <complex.h>
  11. #ifdef complex
  12. #undef complex
  13. #endif
  14. #ifdef I
  15. #undef I
  16. #endif
  17. typedef int integer;
  18. typedef unsigned int uinteger;
  19. typedef char *address;
  20. typedef short int shortint;
  21. typedef float real;
  22. typedef double doublereal;
  23. typedef struct { real r, i; } complex;
  24. typedef struct { doublereal r, i; } doublecomplex;
  25. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  26. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  27. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  28. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  29. #define pCf(z) (*_pCf(z))
  30. #define pCd(z) (*_pCd(z))
  31. typedef int logical;
  32. typedef short int shortlogical;
  33. typedef char logical1;
  34. typedef char integer1;
  35. #define TRUE_ (1)
  36. #define FALSE_ (0)
  37. /* Extern is for use with -E */
  38. #ifndef Extern
  39. #define Extern extern
  40. #endif
  41. /* I/O stuff */
  42. typedef int flag;
  43. typedef int ftnlen;
  44. typedef int ftnint;
  45. /*external read, write*/
  46. typedef struct
  47. { flag cierr;
  48. ftnint ciunit;
  49. flag ciend;
  50. char *cifmt;
  51. ftnint cirec;
  52. } cilist;
  53. /*internal read, write*/
  54. typedef struct
  55. { flag icierr;
  56. char *iciunit;
  57. flag iciend;
  58. char *icifmt;
  59. ftnint icirlen;
  60. ftnint icirnum;
  61. } icilist;
  62. /*open*/
  63. typedef struct
  64. { flag oerr;
  65. ftnint ounit;
  66. char *ofnm;
  67. ftnlen ofnmlen;
  68. char *osta;
  69. char *oacc;
  70. char *ofm;
  71. ftnint orl;
  72. char *oblnk;
  73. } olist;
  74. /*close*/
  75. typedef struct
  76. { flag cerr;
  77. ftnint cunit;
  78. char *csta;
  79. } cllist;
  80. /*rewind, backspace, endfile*/
  81. typedef struct
  82. { flag aerr;
  83. ftnint aunit;
  84. } alist;
  85. /* inquire */
  86. typedef struct
  87. { flag inerr;
  88. ftnint inunit;
  89. char *infile;
  90. ftnlen infilen;
  91. ftnint *inex; /*parameters in standard's order*/
  92. ftnint *inopen;
  93. ftnint *innum;
  94. ftnint *innamed;
  95. char *inname;
  96. ftnlen innamlen;
  97. char *inacc;
  98. ftnlen inacclen;
  99. char *inseq;
  100. ftnlen inseqlen;
  101. char *indir;
  102. ftnlen indirlen;
  103. char *infmt;
  104. ftnlen infmtlen;
  105. char *inform;
  106. ftnint informlen;
  107. char *inunf;
  108. ftnlen inunflen;
  109. ftnint *inrecl;
  110. ftnint *innrec;
  111. char *inblank;
  112. ftnlen inblanklen;
  113. } inlist;
  114. #define VOID void
  115. union Multitype { /* for multiple entry points */
  116. integer1 g;
  117. shortint h;
  118. integer i;
  119. /* longint j; */
  120. real r;
  121. doublereal d;
  122. complex c;
  123. doublecomplex z;
  124. };
  125. typedef union Multitype Multitype;
  126. struct Vardesc { /* for Namelist */
  127. char *name;
  128. char *addr;
  129. ftnlen *dims;
  130. int type;
  131. };
  132. typedef struct Vardesc Vardesc;
  133. struct Namelist {
  134. char *name;
  135. Vardesc **vars;
  136. int nvars;
  137. };
  138. typedef struct Namelist Namelist;
  139. #define abs(x) ((x) >= 0 ? (x) : -(x))
  140. #define dabs(x) (fabs(x))
  141. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  142. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  143. #define dmin(a,b) (f2cmin(a,b))
  144. #define dmax(a,b) (f2cmax(a,b))
  145. #define bit_test(a,b) ((a) >> (b) & 1)
  146. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  147. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  148. #define abort_() { sig_die("Fortran abort routine called", 1); }
  149. #define c_abs(z) (cabsf(Cf(z)))
  150. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  151. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  152. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  153. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  154. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  155. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  156. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  157. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  158. #define d_abs(x) (fabs(*(x)))
  159. #define d_acos(x) (acos(*(x)))
  160. #define d_asin(x) (asin(*(x)))
  161. #define d_atan(x) (atan(*(x)))
  162. #define d_atn2(x, y) (atan2(*(x),*(y)))
  163. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  164. #define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); }
  165. #define d_cos(x) (cos(*(x)))
  166. #define d_cosh(x) (cosh(*(x)))
  167. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  168. #define d_exp(x) (exp(*(x)))
  169. #define d_imag(z) (cimag(Cd(z)))
  170. #define r_imag(z) (cimag(Cf(z)))
  171. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  172. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  173. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  174. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  175. #define d_log(x) (log(*(x)))
  176. #define d_mod(x, y) (fmod(*(x), *(y)))
  177. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  178. #define d_nint(x) u_nint(*(x))
  179. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  180. #define d_sign(a,b) u_sign(*(a),*(b))
  181. #define r_sign(a,b) u_sign(*(a),*(b))
  182. #define d_sin(x) (sin(*(x)))
  183. #define d_sinh(x) (sinh(*(x)))
  184. #define d_sqrt(x) (sqrt(*(x)))
  185. #define d_tan(x) (tan(*(x)))
  186. #define d_tanh(x) (tanh(*(x)))
  187. #define i_abs(x) abs(*(x))
  188. #define i_dnnt(x) ((integer)u_nint(*(x)))
  189. #define i_len(s, n) (n)
  190. #define i_nint(x) ((integer)u_nint(*(x)))
  191. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  192. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  193. #define pow_si(B,E) spow_ui(*(B),*(E))
  194. #define pow_ri(B,E) spow_ui(*(B),*(E))
  195. #define pow_di(B,E) dpow_ui(*(B),*(E))
  196. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  197. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  198. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  199. #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
  200. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  201. #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
  202. #define sig_die(s, kill) { exit(1); }
  203. #define s_stop(s, n) {exit(0);}
  204. static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
  205. #define z_abs(z) (cabs(Cd(z)))
  206. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  207. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  208. #define myexit_() break;
  209. #define mycycle() continue;
  210. #define myceiling(w) {ceil(w)}
  211. #define myhuge(w) {HUGE_VAL}
  212. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  213. #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
  214. /* procedure parameter types for -A and -C++ */
  215. #define F2C_proc_par_types 1
  216. #ifdef __cplusplus
  217. typedef logical (*L_fp)(...);
  218. #else
  219. typedef logical (*L_fp)();
  220. #endif
  221. static float spow_ui(float x, integer n) {
  222. float pow=1.0; unsigned long int u;
  223. if(n != 0) {
  224. if(n < 0) n = -n, x = 1/x;
  225. for(u = n; ; ) {
  226. if(u & 01) pow *= x;
  227. if(u >>= 1) x *= x;
  228. else break;
  229. }
  230. }
  231. return pow;
  232. }
  233. static double dpow_ui(double x, integer n) {
  234. double pow=1.0; unsigned long int u;
  235. if(n != 0) {
  236. if(n < 0) n = -n, x = 1/x;
  237. for(u = n; ; ) {
  238. if(u & 01) pow *= x;
  239. if(u >>= 1) x *= x;
  240. else break;
  241. }
  242. }
  243. return pow;
  244. }
  245. static _Complex float cpow_ui(_Complex float x, integer n) {
  246. _Complex float pow=1.0; unsigned long int u;
  247. if(n != 0) {
  248. if(n < 0) n = -n, x = 1/x;
  249. for(u = n; ; ) {
  250. if(u & 01) pow *= x;
  251. if(u >>= 1) x *= x;
  252. else break;
  253. }
  254. }
  255. return pow;
  256. }
  257. static _Complex double zpow_ui(_Complex double x, integer n) {
  258. _Complex double pow=1.0; unsigned long int u;
  259. if(n != 0) {
  260. if(n < 0) n = -n, x = 1/x;
  261. for(u = n; ; ) {
  262. if(u & 01) pow *= x;
  263. if(u >>= 1) x *= x;
  264. else break;
  265. }
  266. }
  267. return pow;
  268. }
  269. static integer pow_ii(integer x, integer n) {
  270. integer pow; unsigned long int u;
  271. if (n <= 0) {
  272. if (n == 0 || x == 1) pow = 1;
  273. else if (x != -1) pow = x == 0 ? 1/x : 0;
  274. else n = -n;
  275. }
  276. if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
  277. u = n;
  278. for(pow = 1; ; ) {
  279. if(u & 01) pow *= x;
  280. if(u >>= 1) x *= x;
  281. else break;
  282. }
  283. }
  284. return pow;
  285. }
  286. static integer dmaxloc_(double *w, integer s, integer e, integer *n)
  287. {
  288. double m; integer i, mi;
  289. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  290. if (w[i-1]>m) mi=i ,m=w[i-1];
  291. return mi-s+1;
  292. }
  293. static integer smaxloc_(float *w, integer s, integer e, integer *n)
  294. {
  295. float m; integer i, mi;
  296. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  297. if (w[i-1]>m) mi=i ,m=w[i-1];
  298. return mi-s+1;
  299. }
  300. static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  301. integer n = *n_, incx = *incx_, incy = *incy_, i;
  302. _Complex float zdotc = 0.0;
  303. if (incx == 1 && incy == 1) {
  304. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  305. zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
  306. }
  307. } else {
  308. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  309. zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
  310. }
  311. }
  312. pCf(z) = zdotc;
  313. }
  314. static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  315. integer n = *n_, incx = *incx_, incy = *incy_, i;
  316. _Complex double zdotc = 0.0;
  317. if (incx == 1 && incy == 1) {
  318. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  319. zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
  320. }
  321. } else {
  322. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  323. zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
  324. }
  325. }
  326. pCd(z) = zdotc;
  327. }
  328. static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  329. integer n = *n_, incx = *incx_, incy = *incy_, i;
  330. _Complex float zdotc = 0.0;
  331. if (incx == 1 && incy == 1) {
  332. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  333. zdotc += Cf(&x[i]) * Cf(&y[i]);
  334. }
  335. } else {
  336. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  337. zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
  338. }
  339. }
  340. pCf(z) = zdotc;
  341. }
  342. static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  343. integer n = *n_, incx = *incx_, incy = *incy_, i;
  344. _Complex double zdotc = 0.0;
  345. if (incx == 1 && incy == 1) {
  346. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  347. zdotc += Cd(&x[i]) * Cd(&y[i]);
  348. }
  349. } else {
  350. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  351. zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
  352. }
  353. }
  354. pCd(z) = zdotc;
  355. }
  356. #endif
  357. /* -- translated by f2c (version 20000121).
  358. You must link the resulting object file with the libraries:
  359. -lf2c -lm (in that order)
  360. */
  361. /* Table of constant values */
  362. static integer c__1 = 1;
  363. static real c_b14 = 1.f;
  364. static real c_b25 = -1.f;
  365. /* > \brief \b SLARFB applies a block reflector or its transpose to a general rectangular matrix. */
  366. /* =========== DOCUMENTATION =========== */
  367. /* Online html documentation available at */
  368. /* http://www.netlib.org/lapack/explore-html/ */
  369. /* > \htmlonly */
  370. /* > Download SLARFB + dependencies */
  371. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slarfb.
  372. f"> */
  373. /* > [TGZ]</a> */
  374. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slarfb.
  375. f"> */
  376. /* > [ZIP]</a> */
  377. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarfb.
  378. f"> */
  379. /* > [TXT]</a> */
  380. /* > \endhtmlonly */
  381. /* Definition: */
  382. /* =========== */
  383. /* SUBROUTINE SLARFB( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, */
  384. /* T, LDT, C, LDC, WORK, LDWORK ) */
  385. /* CHARACTER DIRECT, SIDE, STOREV, TRANS */
  386. /* INTEGER K, LDC, LDT, LDV, LDWORK, M, N */
  387. /* REAL C( LDC, * ), T( LDT, * ), V( LDV, * ), */
  388. /* $ WORK( LDWORK, * ) */
  389. /* > \par Purpose: */
  390. /* ============= */
  391. /* > */
  392. /* > \verbatim */
  393. /* > */
  394. /* > SLARFB applies a real block reflector H or its transpose H**T to a */
  395. /* > real m by n matrix C, from either the left or the right. */
  396. /* > \endverbatim */
  397. /* Arguments: */
  398. /* ========== */
  399. /* > \param[in] SIDE */
  400. /* > \verbatim */
  401. /* > SIDE is CHARACTER*1 */
  402. /* > = 'L': apply H or H**T from the Left */
  403. /* > = 'R': apply H or H**T from the Right */
  404. /* > \endverbatim */
  405. /* > */
  406. /* > \param[in] TRANS */
  407. /* > \verbatim */
  408. /* > TRANS is CHARACTER*1 */
  409. /* > = 'N': apply H (No transpose) */
  410. /* > = 'T': apply H**T (Transpose) */
  411. /* > \endverbatim */
  412. /* > */
  413. /* > \param[in] DIRECT */
  414. /* > \verbatim */
  415. /* > DIRECT is CHARACTER*1 */
  416. /* > Indicates how H is formed from a product of elementary */
  417. /* > reflectors */
  418. /* > = 'F': H = H(1) H(2) . . . H(k) (Forward) */
  419. /* > = 'B': H = H(k) . . . H(2) H(1) (Backward) */
  420. /* > \endverbatim */
  421. /* > */
  422. /* > \param[in] STOREV */
  423. /* > \verbatim */
  424. /* > STOREV is CHARACTER*1 */
  425. /* > Indicates how the vectors which define the elementary */
  426. /* > reflectors are stored: */
  427. /* > = 'C': Columnwise */
  428. /* > = 'R': Rowwise */
  429. /* > \endverbatim */
  430. /* > */
  431. /* > \param[in] M */
  432. /* > \verbatim */
  433. /* > M is INTEGER */
  434. /* > The number of rows of the matrix C. */
  435. /* > \endverbatim */
  436. /* > */
  437. /* > \param[in] N */
  438. /* > \verbatim */
  439. /* > N is INTEGER */
  440. /* > The number of columns of the matrix C. */
  441. /* > \endverbatim */
  442. /* > */
  443. /* > \param[in] K */
  444. /* > \verbatim */
  445. /* > K is INTEGER */
  446. /* > The order of the matrix T (= the number of elementary */
  447. /* > reflectors whose product defines the block reflector). */
  448. /* > If SIDE = 'L', M >= K >= 0; */
  449. /* > if SIDE = 'R', N >= K >= 0. */
  450. /* > \endverbatim */
  451. /* > */
  452. /* > \param[in] V */
  453. /* > \verbatim */
  454. /* > V is REAL array, dimension */
  455. /* > (LDV,K) if STOREV = 'C' */
  456. /* > (LDV,M) if STOREV = 'R' and SIDE = 'L' */
  457. /* > (LDV,N) if STOREV = 'R' and SIDE = 'R' */
  458. /* > The matrix V. See Further Details. */
  459. /* > \endverbatim */
  460. /* > */
  461. /* > \param[in] LDV */
  462. /* > \verbatim */
  463. /* > LDV is INTEGER */
  464. /* > The leading dimension of the array V. */
  465. /* > If STOREV = 'C' and SIDE = 'L', LDV >= f2cmax(1,M); */
  466. /* > if STOREV = 'C' and SIDE = 'R', LDV >= f2cmax(1,N); */
  467. /* > if STOREV = 'R', LDV >= K. */
  468. /* > \endverbatim */
  469. /* > */
  470. /* > \param[in] T */
  471. /* > \verbatim */
  472. /* > T is REAL array, dimension (LDT,K) */
  473. /* > The triangular k by k matrix T in the representation of the */
  474. /* > block reflector. */
  475. /* > \endverbatim */
  476. /* > */
  477. /* > \param[in] LDT */
  478. /* > \verbatim */
  479. /* > LDT is INTEGER */
  480. /* > The leading dimension of the array T. LDT >= K. */
  481. /* > \endverbatim */
  482. /* > */
  483. /* > \param[in,out] C */
  484. /* > \verbatim */
  485. /* > C is REAL array, dimension (LDC,N) */
  486. /* > On entry, the m by n matrix C. */
  487. /* > On exit, C is overwritten by H*C or H**T*C or C*H or C*H**T. */
  488. /* > \endverbatim */
  489. /* > */
  490. /* > \param[in] LDC */
  491. /* > \verbatim */
  492. /* > LDC is INTEGER */
  493. /* > The leading dimension of the array C. LDC >= f2cmax(1,M). */
  494. /* > \endverbatim */
  495. /* > */
  496. /* > \param[out] WORK */
  497. /* > \verbatim */
  498. /* > WORK is REAL array, dimension (LDWORK,K) */
  499. /* > \endverbatim */
  500. /* > */
  501. /* > \param[in] LDWORK */
  502. /* > \verbatim */
  503. /* > LDWORK is INTEGER */
  504. /* > The leading dimension of the array WORK. */
  505. /* > If SIDE = 'L', LDWORK >= f2cmax(1,N); */
  506. /* > if SIDE = 'R', LDWORK >= f2cmax(1,M). */
  507. /* > \endverbatim */
  508. /* Authors: */
  509. /* ======== */
  510. /* > \author Univ. of Tennessee */
  511. /* > \author Univ. of California Berkeley */
  512. /* > \author Univ. of Colorado Denver */
  513. /* > \author NAG Ltd. */
  514. /* > \date June 2013 */
  515. /* > \ingroup realOTHERauxiliary */
  516. /* > \par Further Details: */
  517. /* ===================== */
  518. /* > */
  519. /* > \verbatim */
  520. /* > */
  521. /* > The shape of the matrix V and the storage of the vectors which define */
  522. /* > the H(i) is best illustrated by the following example with n = 5 and */
  523. /* > k = 3. The elements equal to 1 are not stored; the corresponding */
  524. /* > array elements are modified but restored on exit. The rest of the */
  525. /* > array is not used. */
  526. /* > */
  527. /* > DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R': */
  528. /* > */
  529. /* > V = ( 1 ) V = ( 1 v1 v1 v1 v1 ) */
  530. /* > ( v1 1 ) ( 1 v2 v2 v2 ) */
  531. /* > ( v1 v2 1 ) ( 1 v3 v3 ) */
  532. /* > ( v1 v2 v3 ) */
  533. /* > ( v1 v2 v3 ) */
  534. /* > */
  535. /* > DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R': */
  536. /* > */
  537. /* > V = ( v1 v2 v3 ) V = ( v1 v1 1 ) */
  538. /* > ( v1 v2 v3 ) ( v2 v2 v2 1 ) */
  539. /* > ( 1 v2 v3 ) ( v3 v3 v3 v3 1 ) */
  540. /* > ( 1 v3 ) */
  541. /* > ( 1 ) */
  542. /* > \endverbatim */
  543. /* > */
  544. /* ===================================================================== */
  545. /* Subroutine */ int slarfb_(char *side, char *trans, char *direct, char *
  546. storev, integer *m, integer *n, integer *k, real *v, integer *ldv,
  547. real *t, integer *ldt, real *c__, integer *ldc, real *work, integer *
  548. ldwork)
  549. {
  550. /* System generated locals */
  551. integer c_dim1, c_offset, t_dim1, t_offset, v_dim1, v_offset, work_dim1,
  552. work_offset, i__1, i__2;
  553. /* Local variables */
  554. integer i__, j;
  555. extern logical lsame_(char *, char *);
  556. extern /* Subroutine */ int sgemm_(char *, char *, integer *, integer *,
  557. integer *, real *, real *, integer *, real *, integer *, real *,
  558. real *, integer *), scopy_(integer *, real *,
  559. integer *, real *, integer *), strmm_(char *, char *, char *,
  560. char *, integer *, integer *, real *, real *, integer *, real *,
  561. integer *);
  562. char transt[1];
  563. /* -- LAPACK auxiliary routine (version 3.7.0) -- */
  564. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  565. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  566. /* June 2013 */
  567. /* ===================================================================== */
  568. /* Quick return if possible */
  569. /* Parameter adjustments */
  570. v_dim1 = *ldv;
  571. v_offset = 1 + v_dim1 * 1;
  572. v -= v_offset;
  573. t_dim1 = *ldt;
  574. t_offset = 1 + t_dim1 * 1;
  575. t -= t_offset;
  576. c_dim1 = *ldc;
  577. c_offset = 1 + c_dim1 * 1;
  578. c__ -= c_offset;
  579. work_dim1 = *ldwork;
  580. work_offset = 1 + work_dim1 * 1;
  581. work -= work_offset;
  582. /* Function Body */
  583. if (*m <= 0 || *n <= 0) {
  584. return 0;
  585. }
  586. if (lsame_(trans, "N")) {
  587. *(unsigned char *)transt = 'T';
  588. } else {
  589. *(unsigned char *)transt = 'N';
  590. }
  591. if (lsame_(storev, "C")) {
  592. if (lsame_(direct, "F")) {
  593. /* Let V = ( V1 ) (first K rows) */
  594. /* ( V2 ) */
  595. /* where V1 is unit lower triangular. */
  596. if (lsame_(side, "L")) {
  597. /* Form H * C or H**T * C where C = ( C1 ) */
  598. /* ( C2 ) */
  599. /* W := C**T * V = (C1**T * V1 + C2**T * V2) (stored in WORK) */
  600. /* W := C1**T */
  601. i__1 = *k;
  602. for (j = 1; j <= i__1; ++j) {
  603. scopy_(n, &c__[j + c_dim1], ldc, &work[j * work_dim1 + 1],
  604. &c__1);
  605. /* L10: */
  606. }
  607. /* W := W * V1 */
  608. strmm_("Right", "Lower", "No transpose", "Unit", n, k, &c_b14,
  609. &v[v_offset], ldv, &work[work_offset], ldwork);
  610. if (*m > *k) {
  611. /* W := W + C2**T * V2 */
  612. i__1 = *m - *k;
  613. sgemm_("Transpose", "No transpose", n, k, &i__1, &c_b14, &
  614. c__[*k + 1 + c_dim1], ldc, &v[*k + 1 + v_dim1],
  615. ldv, &c_b14, &work[work_offset], ldwork);
  616. }
  617. /* W := W * T**T or W * T */
  618. strmm_("Right", "Upper", transt, "Non-unit", n, k, &c_b14, &t[
  619. t_offset], ldt, &work[work_offset], ldwork);
  620. /* C := C - V * W**T */
  621. if (*m > *k) {
  622. /* C2 := C2 - V2 * W**T */
  623. i__1 = *m - *k;
  624. sgemm_("No transpose", "Transpose", &i__1, n, k, &c_b25, &
  625. v[*k + 1 + v_dim1], ldv, &work[work_offset],
  626. ldwork, &c_b14, &c__[*k + 1 + c_dim1], ldc);
  627. }
  628. /* W := W * V1**T */
  629. strmm_("Right", "Lower", "Transpose", "Unit", n, k, &c_b14, &
  630. v[v_offset], ldv, &work[work_offset], ldwork);
  631. /* C1 := C1 - W**T */
  632. i__1 = *k;
  633. for (j = 1; j <= i__1; ++j) {
  634. i__2 = *n;
  635. for (i__ = 1; i__ <= i__2; ++i__) {
  636. c__[j + i__ * c_dim1] -= work[i__ + j * work_dim1];
  637. /* L20: */
  638. }
  639. /* L30: */
  640. }
  641. } else if (lsame_(side, "R")) {
  642. /* Form C * H or C * H**T where C = ( C1 C2 ) */
  643. /* W := C * V = (C1*V1 + C2*V2) (stored in WORK) */
  644. /* W := C1 */
  645. i__1 = *k;
  646. for (j = 1; j <= i__1; ++j) {
  647. scopy_(m, &c__[j * c_dim1 + 1], &c__1, &work[j *
  648. work_dim1 + 1], &c__1);
  649. /* L40: */
  650. }
  651. /* W := W * V1 */
  652. strmm_("Right", "Lower", "No transpose", "Unit", m, k, &c_b14,
  653. &v[v_offset], ldv, &work[work_offset], ldwork);
  654. if (*n > *k) {
  655. /* W := W + C2 * V2 */
  656. i__1 = *n - *k;
  657. sgemm_("No transpose", "No transpose", m, k, &i__1, &
  658. c_b14, &c__[(*k + 1) * c_dim1 + 1], ldc, &v[*k +
  659. 1 + v_dim1], ldv, &c_b14, &work[work_offset],
  660. ldwork);
  661. }
  662. /* W := W * T or W * T**T */
  663. strmm_("Right", "Upper", trans, "Non-unit", m, k, &c_b14, &t[
  664. t_offset], ldt, &work[work_offset], ldwork);
  665. /* C := C - W * V**T */
  666. if (*n > *k) {
  667. /* C2 := C2 - W * V2**T */
  668. i__1 = *n - *k;
  669. sgemm_("No transpose", "Transpose", m, &i__1, k, &c_b25, &
  670. work[work_offset], ldwork, &v[*k + 1 + v_dim1],
  671. ldv, &c_b14, &c__[(*k + 1) * c_dim1 + 1], ldc);
  672. }
  673. /* W := W * V1**T */
  674. strmm_("Right", "Lower", "Transpose", "Unit", m, k, &c_b14, &
  675. v[v_offset], ldv, &work[work_offset], ldwork);
  676. /* C1 := C1 - W */
  677. i__1 = *k;
  678. for (j = 1; j <= i__1; ++j) {
  679. i__2 = *m;
  680. for (i__ = 1; i__ <= i__2; ++i__) {
  681. c__[i__ + j * c_dim1] -= work[i__ + j * work_dim1];
  682. /* L50: */
  683. }
  684. /* L60: */
  685. }
  686. }
  687. } else {
  688. /* Let V = ( V1 ) */
  689. /* ( V2 ) (last K rows) */
  690. /* where V2 is unit upper triangular. */
  691. if (lsame_(side, "L")) {
  692. /* Form H * C or H**T * C where C = ( C1 ) */
  693. /* ( C2 ) */
  694. /* W := C**T * V = (C1**T * V1 + C2**T * V2) (stored in WORK) */
  695. /* W := C2**T */
  696. i__1 = *k;
  697. for (j = 1; j <= i__1; ++j) {
  698. scopy_(n, &c__[*m - *k + j + c_dim1], ldc, &work[j *
  699. work_dim1 + 1], &c__1);
  700. /* L70: */
  701. }
  702. /* W := W * V2 */
  703. strmm_("Right", "Upper", "No transpose", "Unit", n, k, &c_b14,
  704. &v[*m - *k + 1 + v_dim1], ldv, &work[work_offset],
  705. ldwork);
  706. if (*m > *k) {
  707. /* W := W + C1**T * V1 */
  708. i__1 = *m - *k;
  709. sgemm_("Transpose", "No transpose", n, k, &i__1, &c_b14, &
  710. c__[c_offset], ldc, &v[v_offset], ldv, &c_b14, &
  711. work[work_offset], ldwork);
  712. }
  713. /* W := W * T**T or W * T */
  714. strmm_("Right", "Lower", transt, "Non-unit", n, k, &c_b14, &t[
  715. t_offset], ldt, &work[work_offset], ldwork);
  716. /* C := C - V * W**T */
  717. if (*m > *k) {
  718. /* C1 := C1 - V1 * W**T */
  719. i__1 = *m - *k;
  720. sgemm_("No transpose", "Transpose", &i__1, n, k, &c_b25, &
  721. v[v_offset], ldv, &work[work_offset], ldwork, &
  722. c_b14, &c__[c_offset], ldc)
  723. ;
  724. }
  725. /* W := W * V2**T */
  726. strmm_("Right", "Upper", "Transpose", "Unit", n, k, &c_b14, &
  727. v[*m - *k + 1 + v_dim1], ldv, &work[work_offset],
  728. ldwork);
  729. /* C2 := C2 - W**T */
  730. i__1 = *k;
  731. for (j = 1; j <= i__1; ++j) {
  732. i__2 = *n;
  733. for (i__ = 1; i__ <= i__2; ++i__) {
  734. c__[*m - *k + j + i__ * c_dim1] -= work[i__ + j *
  735. work_dim1];
  736. /* L80: */
  737. }
  738. /* L90: */
  739. }
  740. } else if (lsame_(side, "R")) {
  741. /* Form C * H or C * H' where C = ( C1 C2 ) */
  742. /* W := C * V = (C1*V1 + C2*V2) (stored in WORK) */
  743. /* W := C2 */
  744. i__1 = *k;
  745. for (j = 1; j <= i__1; ++j) {
  746. scopy_(m, &c__[(*n - *k + j) * c_dim1 + 1], &c__1, &work[
  747. j * work_dim1 + 1], &c__1);
  748. /* L100: */
  749. }
  750. /* W := W * V2 */
  751. strmm_("Right", "Upper", "No transpose", "Unit", m, k, &c_b14,
  752. &v[*n - *k + 1 + v_dim1], ldv, &work[work_offset],
  753. ldwork);
  754. if (*n > *k) {
  755. /* W := W + C1 * V1 */
  756. i__1 = *n - *k;
  757. sgemm_("No transpose", "No transpose", m, k, &i__1, &
  758. c_b14, &c__[c_offset], ldc, &v[v_offset], ldv, &
  759. c_b14, &work[work_offset], ldwork);
  760. }
  761. /* W := W * T or W * T**T */
  762. strmm_("Right", "Lower", trans, "Non-unit", m, k, &c_b14, &t[
  763. t_offset], ldt, &work[work_offset], ldwork);
  764. /* C := C - W * V**T */
  765. if (*n > *k) {
  766. /* C1 := C1 - W * V1**T */
  767. i__1 = *n - *k;
  768. sgemm_("No transpose", "Transpose", m, &i__1, k, &c_b25, &
  769. work[work_offset], ldwork, &v[v_offset], ldv, &
  770. c_b14, &c__[c_offset], ldc)
  771. ;
  772. }
  773. /* W := W * V2**T */
  774. strmm_("Right", "Upper", "Transpose", "Unit", m, k, &c_b14, &
  775. v[*n - *k + 1 + v_dim1], ldv, &work[work_offset],
  776. ldwork);
  777. /* C2 := C2 - W */
  778. i__1 = *k;
  779. for (j = 1; j <= i__1; ++j) {
  780. i__2 = *m;
  781. for (i__ = 1; i__ <= i__2; ++i__) {
  782. c__[i__ + (*n - *k + j) * c_dim1] -= work[i__ + j *
  783. work_dim1];
  784. /* L110: */
  785. }
  786. /* L120: */
  787. }
  788. }
  789. }
  790. } else if (lsame_(storev, "R")) {
  791. if (lsame_(direct, "F")) {
  792. /* Let V = ( V1 V2 ) (V1: first K columns) */
  793. /* where V1 is unit upper triangular. */
  794. if (lsame_(side, "L")) {
  795. /* Form H * C or H**T * C where C = ( C1 ) */
  796. /* ( C2 ) */
  797. /* W := C**T * V**T = (C1**T * V1**T + C2**T * V2**T) (stored in WORK) */
  798. /* W := C1**T */
  799. i__1 = *k;
  800. for (j = 1; j <= i__1; ++j) {
  801. scopy_(n, &c__[j + c_dim1], ldc, &work[j * work_dim1 + 1],
  802. &c__1);
  803. /* L130: */
  804. }
  805. /* W := W * V1**T */
  806. strmm_("Right", "Upper", "Transpose", "Unit", n, k, &c_b14, &
  807. v[v_offset], ldv, &work[work_offset], ldwork);
  808. if (*m > *k) {
  809. /* W := W + C2**T * V2**T */
  810. i__1 = *m - *k;
  811. sgemm_("Transpose", "Transpose", n, k, &i__1, &c_b14, &
  812. c__[*k + 1 + c_dim1], ldc, &v[(*k + 1) * v_dim1 +
  813. 1], ldv, &c_b14, &work[work_offset], ldwork);
  814. }
  815. /* W := W * T**T or W * T */
  816. strmm_("Right", "Upper", transt, "Non-unit", n, k, &c_b14, &t[
  817. t_offset], ldt, &work[work_offset], ldwork);
  818. /* C := C - V**T * W**T */
  819. if (*m > *k) {
  820. /* C2 := C2 - V2**T * W**T */
  821. i__1 = *m - *k;
  822. sgemm_("Transpose", "Transpose", &i__1, n, k, &c_b25, &v[(
  823. *k + 1) * v_dim1 + 1], ldv, &work[work_offset],
  824. ldwork, &c_b14, &c__[*k + 1 + c_dim1], ldc);
  825. }
  826. /* W := W * V1 */
  827. strmm_("Right", "Upper", "No transpose", "Unit", n, k, &c_b14,
  828. &v[v_offset], ldv, &work[work_offset], ldwork);
  829. /* C1 := C1 - W**T */
  830. i__1 = *k;
  831. for (j = 1; j <= i__1; ++j) {
  832. i__2 = *n;
  833. for (i__ = 1; i__ <= i__2; ++i__) {
  834. c__[j + i__ * c_dim1] -= work[i__ + j * work_dim1];
  835. /* L140: */
  836. }
  837. /* L150: */
  838. }
  839. } else if (lsame_(side, "R")) {
  840. /* Form C * H or C * H**T where C = ( C1 C2 ) */
  841. /* W := C * V**T = (C1*V1**T + C2*V2**T) (stored in WORK) */
  842. /* W := C1 */
  843. i__1 = *k;
  844. for (j = 1; j <= i__1; ++j) {
  845. scopy_(m, &c__[j * c_dim1 + 1], &c__1, &work[j *
  846. work_dim1 + 1], &c__1);
  847. /* L160: */
  848. }
  849. /* W := W * V1**T */
  850. strmm_("Right", "Upper", "Transpose", "Unit", m, k, &c_b14, &
  851. v[v_offset], ldv, &work[work_offset], ldwork);
  852. if (*n > *k) {
  853. /* W := W + C2 * V2**T */
  854. i__1 = *n - *k;
  855. sgemm_("No transpose", "Transpose", m, k, &i__1, &c_b14, &
  856. c__[(*k + 1) * c_dim1 + 1], ldc, &v[(*k + 1) *
  857. v_dim1 + 1], ldv, &c_b14, &work[work_offset],
  858. ldwork);
  859. }
  860. /* W := W * T or W * T**T */
  861. strmm_("Right", "Upper", trans, "Non-unit", m, k, &c_b14, &t[
  862. t_offset], ldt, &work[work_offset], ldwork);
  863. /* C := C - W * V */
  864. if (*n > *k) {
  865. /* C2 := C2 - W * V2 */
  866. i__1 = *n - *k;
  867. sgemm_("No transpose", "No transpose", m, &i__1, k, &
  868. c_b25, &work[work_offset], ldwork, &v[(*k + 1) *
  869. v_dim1 + 1], ldv, &c_b14, &c__[(*k + 1) * c_dim1
  870. + 1], ldc);
  871. }
  872. /* W := W * V1 */
  873. strmm_("Right", "Upper", "No transpose", "Unit", m, k, &c_b14,
  874. &v[v_offset], ldv, &work[work_offset], ldwork);
  875. /* C1 := C1 - W */
  876. i__1 = *k;
  877. for (j = 1; j <= i__1; ++j) {
  878. i__2 = *m;
  879. for (i__ = 1; i__ <= i__2; ++i__) {
  880. c__[i__ + j * c_dim1] -= work[i__ + j * work_dim1];
  881. /* L170: */
  882. }
  883. /* L180: */
  884. }
  885. }
  886. } else {
  887. /* Let V = ( V1 V2 ) (V2: last K columns) */
  888. /* where V2 is unit lower triangular. */
  889. if (lsame_(side, "L")) {
  890. /* Form H * C or H**T * C where C = ( C1 ) */
  891. /* ( C2 ) */
  892. /* W := C**T * V**T = (C1**T * V1**T + C2**T * V2**T) (stored in WORK) */
  893. /* W := C2**T */
  894. i__1 = *k;
  895. for (j = 1; j <= i__1; ++j) {
  896. scopy_(n, &c__[*m - *k + j + c_dim1], ldc, &work[j *
  897. work_dim1 + 1], &c__1);
  898. /* L190: */
  899. }
  900. /* W := W * V2**T */
  901. strmm_("Right", "Lower", "Transpose", "Unit", n, k, &c_b14, &
  902. v[(*m - *k + 1) * v_dim1 + 1], ldv, &work[work_offset]
  903. , ldwork);
  904. if (*m > *k) {
  905. /* W := W + C1**T * V1**T */
  906. i__1 = *m - *k;
  907. sgemm_("Transpose", "Transpose", n, k, &i__1, &c_b14, &
  908. c__[c_offset], ldc, &v[v_offset], ldv, &c_b14, &
  909. work[work_offset], ldwork);
  910. }
  911. /* W := W * T**T or W * T */
  912. strmm_("Right", "Lower", transt, "Non-unit", n, k, &c_b14, &t[
  913. t_offset], ldt, &work[work_offset], ldwork);
  914. /* C := C - V**T * W**T */
  915. if (*m > *k) {
  916. /* C1 := C1 - V1**T * W**T */
  917. i__1 = *m - *k;
  918. sgemm_("Transpose", "Transpose", &i__1, n, k, &c_b25, &v[
  919. v_offset], ldv, &work[work_offset], ldwork, &
  920. c_b14, &c__[c_offset], ldc);
  921. }
  922. /* W := W * V2 */
  923. strmm_("Right", "Lower", "No transpose", "Unit", n, k, &c_b14,
  924. &v[(*m - *k + 1) * v_dim1 + 1], ldv, &work[
  925. work_offset], ldwork);
  926. /* C2 := C2 - W**T */
  927. i__1 = *k;
  928. for (j = 1; j <= i__1; ++j) {
  929. i__2 = *n;
  930. for (i__ = 1; i__ <= i__2; ++i__) {
  931. c__[*m - *k + j + i__ * c_dim1] -= work[i__ + j *
  932. work_dim1];
  933. /* L200: */
  934. }
  935. /* L210: */
  936. }
  937. } else if (lsame_(side, "R")) {
  938. /* Form C * H or C * H**T where C = ( C1 C2 ) */
  939. /* W := C * V**T = (C1*V1**T + C2*V2**T) (stored in WORK) */
  940. /* W := C2 */
  941. i__1 = *k;
  942. for (j = 1; j <= i__1; ++j) {
  943. scopy_(m, &c__[(*n - *k + j) * c_dim1 + 1], &c__1, &work[
  944. j * work_dim1 + 1], &c__1);
  945. /* L220: */
  946. }
  947. /* W := W * V2**T */
  948. strmm_("Right", "Lower", "Transpose", "Unit", m, k, &c_b14, &
  949. v[(*n - *k + 1) * v_dim1 + 1], ldv, &work[work_offset]
  950. , ldwork);
  951. if (*n > *k) {
  952. /* W := W + C1 * V1**T */
  953. i__1 = *n - *k;
  954. sgemm_("No transpose", "Transpose", m, k, &i__1, &c_b14, &
  955. c__[c_offset], ldc, &v[v_offset], ldv, &c_b14, &
  956. work[work_offset], ldwork);
  957. }
  958. /* W := W * T or W * T**T */
  959. strmm_("Right", "Lower", trans, "Non-unit", m, k, &c_b14, &t[
  960. t_offset], ldt, &work[work_offset], ldwork);
  961. /* C := C - W * V */
  962. if (*n > *k) {
  963. /* C1 := C1 - W * V1 */
  964. i__1 = *n - *k;
  965. sgemm_("No transpose", "No transpose", m, &i__1, k, &
  966. c_b25, &work[work_offset], ldwork, &v[v_offset],
  967. ldv, &c_b14, &c__[c_offset], ldc);
  968. }
  969. /* W := W * V2 */
  970. strmm_("Right", "Lower", "No transpose", "Unit", m, k, &c_b14,
  971. &v[(*n - *k + 1) * v_dim1 + 1], ldv, &work[
  972. work_offset], ldwork);
  973. /* C1 := C1 - W */
  974. i__1 = *k;
  975. for (j = 1; j <= i__1; ++j) {
  976. i__2 = *m;
  977. for (i__ = 1; i__ <= i__2; ++i__) {
  978. c__[i__ + (*n - *k + j) * c_dim1] -= work[i__ + j *
  979. work_dim1];
  980. /* L230: */
  981. }
  982. /* L240: */
  983. }
  984. }
  985. }
  986. }
  987. return 0;
  988. /* End of SLARFB */
  989. } /* slarfb_ */