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.

c_sblat2c.c 108 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895
  1. #include <math.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <complex.h>
  6. #ifdef complex
  7. #undef complex
  8. #endif
  9. #ifdef I
  10. #undef I
  11. #endif
  12. #include "common.h"
  13. typedef blasint integer;
  14. typedef unsigned int uinteger;
  15. typedef char *address;
  16. typedef short int shortint;
  17. typedef float real;
  18. typedef double doublereal;
  19. typedef struct { real r, i; } complex;
  20. typedef struct { doublereal r, i; } doublecomplex;
  21. #ifdef _MSC_VER
  22. static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
  23. static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
  24. static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
  25. static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
  26. #else
  27. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  28. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  29. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  30. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  31. #endif
  32. #define pCf(z) (*_pCf(z))
  33. #define pCd(z) (*_pCd(z))
  34. typedef int logical;
  35. typedef short int shortlogical;
  36. typedef char logical1;
  37. typedef char integer1;
  38. #define TRUE_ (1)
  39. #define FALSE_ (0)
  40. /* Extern is for use with -E */
  41. #ifndef Extern
  42. #define Extern extern
  43. #endif
  44. /* I/O stuff */
  45. typedef int flag;
  46. typedef int ftnlen;
  47. typedef int ftnint;
  48. /*external read, write*/
  49. typedef struct
  50. { flag cierr;
  51. ftnint ciunit;
  52. flag ciend;
  53. char *cifmt;
  54. ftnint cirec;
  55. } cilist;
  56. /*internal read, write*/
  57. typedef struct
  58. { flag icierr;
  59. char *iciunit;
  60. flag iciend;
  61. char *icifmt;
  62. ftnint icirlen;
  63. ftnint icirnum;
  64. } icilist;
  65. /*open*/
  66. typedef struct
  67. { flag oerr;
  68. ftnint ounit;
  69. char *ofnm;
  70. ftnlen ofnmlen;
  71. char *osta;
  72. char *oacc;
  73. char *ofm;
  74. ftnint orl;
  75. char *oblnk;
  76. } olist;
  77. /*close*/
  78. typedef struct
  79. { flag cerr;
  80. ftnint cunit;
  81. char *csta;
  82. } cllist;
  83. /*rewind, backspace, endfile*/
  84. typedef struct
  85. { flag aerr;
  86. ftnint aunit;
  87. } alist;
  88. /* inquire */
  89. typedef struct
  90. { flag inerr;
  91. ftnint inunit;
  92. char *infile;
  93. ftnlen infilen;
  94. ftnint *inex; /*parameters in standard's order*/
  95. ftnint *inopen;
  96. ftnint *innum;
  97. ftnint *innamed;
  98. char *inname;
  99. ftnlen innamlen;
  100. char *inacc;
  101. ftnlen inacclen;
  102. char *inseq;
  103. ftnlen inseqlen;
  104. char *indir;
  105. ftnlen indirlen;
  106. char *infmt;
  107. ftnlen infmtlen;
  108. char *inform;
  109. ftnint informlen;
  110. char *inunf;
  111. ftnlen inunflen;
  112. ftnint *inrecl;
  113. ftnint *innrec;
  114. char *inblank;
  115. ftnlen inblanklen;
  116. } inlist;
  117. #define VOID void
  118. union Multitype { /* for multiple entry points */
  119. integer1 g;
  120. shortint h;
  121. integer i;
  122. /* longint j; */
  123. real r;
  124. doublereal d;
  125. complex c;
  126. doublecomplex z;
  127. };
  128. typedef union Multitype Multitype;
  129. struct Vardesc { /* for Namelist */
  130. char *name;
  131. char *addr;
  132. ftnlen *dims;
  133. int type;
  134. };
  135. typedef struct Vardesc Vardesc;
  136. struct Namelist {
  137. char *name;
  138. Vardesc **vars;
  139. int nvars;
  140. };
  141. typedef struct Namelist Namelist;
  142. #define abs(x) ((x) >= 0 ? (x) : -(x))
  143. #define dabs(x) (fabs(x))
  144. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  145. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  146. #define dmin(a,b) (f2cmin(a,b))
  147. #define dmax(a,b) (f2cmax(a,b))
  148. #define bit_test(a,b) ((a) >> (b) & 1)
  149. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  150. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  151. #define abort_() { sig_die("Fortran abort routine called", 1); }
  152. #define c_abs(z) (cabsf(Cf(z)))
  153. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  154. #ifdef _MSC_VER
  155. #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
  156. #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/Cd(b)._Val[1]);}
  157. #else
  158. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  159. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  160. #endif
  161. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  162. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  163. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  164. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  165. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  166. #define d_abs(x) (fabs(*(x)))
  167. #define d_acos(x) (acos(*(x)))
  168. #define d_asin(x) (asin(*(x)))
  169. #define d_atan(x) (atan(*(x)))
  170. #define d_atn2(x, y) (atan2(*(x),*(y)))
  171. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  172. #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
  173. #define d_cos(x) (cos(*(x)))
  174. #define d_cosh(x) (cosh(*(x)))
  175. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  176. #define d_exp(x) (exp(*(x)))
  177. #define d_imag(z) (cimag(Cd(z)))
  178. #define r_imag(z) (cimagf(Cf(z)))
  179. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  180. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  181. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  182. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  183. #define d_log(x) (log(*(x)))
  184. #define d_mod(x, y) (fmod(*(x), *(y)))
  185. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  186. #define d_nint(x) u_nint(*(x))
  187. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  188. #define d_sign(a,b) u_sign(*(a),*(b))
  189. #define r_sign(a,b) u_sign(*(a),*(b))
  190. #define d_sin(x) (sin(*(x)))
  191. #define d_sinh(x) (sinh(*(x)))
  192. #define d_sqrt(x) (sqrt(*(x)))
  193. #define d_tan(x) (tan(*(x)))
  194. #define d_tanh(x) (tanh(*(x)))
  195. #define i_abs(x) abs(*(x))
  196. #define i_dnnt(x) ((integer)u_nint(*(x)))
  197. #define i_len(s, n) (n)
  198. #define i_nint(x) ((integer)u_nint(*(x)))
  199. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  200. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  201. #define pow_si(B,E) spow_ui(*(B),*(E))
  202. #define pow_ri(B,E) spow_ui(*(B),*(E))
  203. #define pow_di(B,E) dpow_ui(*(B),*(E))
  204. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  205. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  206. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  207. #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++ = ' '; }
  208. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  209. #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]; }
  210. #define sig_die(s, kill) { exit(1); }
  211. #define s_stop(s, n) {exit(0);}
  212. #define z_abs(z) (cabs(Cd(z)))
  213. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  214. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  215. #define myexit_() break;
  216. #define mycycle_() continue;
  217. #define myceiling_(w) {ceil(w)}
  218. #define myhuge_(w) {HUGE_VAL}
  219. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  220. #define mymaxloc_(w,s,e,n) dmaxloc_(w,*(s),*(e),n)
  221. /* procedure parameter types for -A and -C++ */
  222. #define F2C_proc_par_types 1
  223. /* Common Block Declarations */
  224. struct {
  225. integer infot, noutc;
  226. logical ok;
  227. } infoc_;
  228. #define infoc_1 infoc_
  229. struct {
  230. char srnamt[12];
  231. } srnamc_;
  232. #define srnamc_1 srnamc_
  233. /* Table of constant values */
  234. static integer c__1 = 1;
  235. static integer c__65 = 65;
  236. static integer c__2 = 2;
  237. static real c_b123 = (float)1.;
  238. static real c_b135 = (float)0.;
  239. static integer c__6 = 6;
  240. static logical c_true = TRUE_;
  241. static integer c_n1 = -1;
  242. static integer c__0 = 0;
  243. static logical c_false = FALSE_;
  244. /* Main program */ int main(void)
  245. {
  246. /* Initialized data */
  247. static char snames[16][13] = { "cblas_sgemv ", "cblas_sgbmv ", "cblas_ssymv ",
  248. "cblas_ssbmv ", "cblas_sspmv ", "cblas_strmv ", "cblas_stbmv ", "cblas_stpmv ",
  249. "cblas_strsv ", "cblas_stbsv ", "cblas_stpsv ", "cblas_sger ", "cblas_ssyr ",
  250. "cblas_sspr ", "cblas_ssyr2 ", "cblas_sspr2 "};
  251. /* System generated locals */
  252. integer i__1, i__2, i__3;
  253. real r__1;
  254. /* Local variables */
  255. static integer nalf, idim[9];
  256. static logical same;
  257. static integer ninc, nbet, ntra;
  258. static logical rewi;
  259. extern /* Subroutine */ int schk1_(char*, real*, real*, integer*, integer*, logical*, logical*, logical*, integer*, integer*, integer*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, integer*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, integer*, ftnlen);
  260. extern /* Subroutine */ int schk2_(char*, real*, real*, integer*, integer*, logical*, logical*, logical*, integer*, integer*, integer*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, integer*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, integer*, ftnlen);
  261. extern /* Subroutine */ int schk3_(char*, real*, real*, integer*, integer*, logical*, logical*, logical*, integer*, integer*, integer*, integer*, integer*, integer*, integer*, integer*, real*, real*, real*, real*, real*, real*, real*, real*, real*, integer*, ftnlen);
  262. extern /* Subroutine */ int schk4_(char*, real*, real*, integer*, integer*, logical*, logical*, logical*, integer*, integer*, integer*, real*, integer*, integer*, integer*, integer*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, integer*, ftnlen);
  263. extern /* Subroutine */ int schk5_(char*, real*, real*, integer*, integer*, logical*, logical*, logical*, integer*, integer*, integer*, real*, integer*, integer*, integer*, integer*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, real*, integer*, ftnlen);
  264. extern /* Subroutine */ int schk6_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nalf, real* alf, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, real* z__, integer* iorder, ftnlen sname_len);
  265. static real a[4225] /* was [65][65] */, g[65];
  266. static integer i__, j, n;
  267. static logical fatal;
  268. static real x[65], y[65], z__[130];
  269. extern doublereal sdiff_(real*, real*);
  270. static logical trace;
  271. static integer nidim;
  272. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  273. static char snaps[32], trans[1];
  274. static integer isnum;
  275. static logical ltest[16];
  276. static real aa[4225];
  277. static integer kb[7];
  278. static real as[4225];
  279. static logical sfatal;
  280. static real xs[130], ys[130];
  281. static logical corder;
  282. static real xx[130], yt[65], yy[130];
  283. static char snamet[12];
  284. static real thresh;
  285. static logical rorder;
  286. static integer layout;
  287. static logical ltestt;
  288. extern /* Subroutine */ int cs2chke_(char*, ftnlen);
  289. static logical tsterr;
  290. static real alf[7];
  291. static integer inc[7], nkb;
  292. static real bet[7];
  293. extern logical lse_(real*, real*, integer*);
  294. static real eps, err;
  295. char tmpchar;
  296. /* Test program for the REAL Level 2 Blas. */
  297. /* The program must be driven by a short data file. The first 17 records */
  298. /* of the file are read using list-directed input, the last 16 records */
  299. /* are read using the format ( A12, L2 ). An annotated example of a data */
  300. /* file can be obtained by deleting the first 3 characters from the */
  301. /* following 33 lines: */
  302. /* 'SBLAT2.SNAP' NAME OF SNAPSHOT OUTPUT FILE */
  303. /* -1 UNIT NUMBER OF SNAPSHOT FILE (NOT USED IF .LT. 0) */
  304. /* F LOGICAL FLAG, T TO REWIND SNAPSHOT FILE AFTER EACH RECORD. */
  305. /* F LOGICAL FLAG, T TO STOP ON FAILURES. */
  306. /* T LOGICAL FLAG, T TO TEST ERROR EXITS. */
  307. /* 2 0 TO TEST COLUMN-MAJOR, 1 TO TEST ROW-MAJOR, 2 TO TEST BOTH */
  308. /* 16.0 THRESHOLD VALUE OF TEST RATIO */
  309. /* 6 NUMBER OF VALUES OF N */
  310. /* 0 1 2 3 5 9 VALUES OF N */
  311. /* 4 NUMBER OF VALUES OF K */
  312. /* 0 1 2 4 VALUES OF K */
  313. /* 4 NUMBER OF VALUES OF INCX AND INCY */
  314. /* 1 2 -1 -2 VALUES OF INCX AND INCY */
  315. /* 3 NUMBER OF VALUES OF ALPHA */
  316. /* 0.0 1.0 0.7 VALUES OF ALPHA */
  317. /* 3 NUMBER OF VALUES OF BETA */
  318. /* 0.0 1.0 0.9 VALUES OF BETA */
  319. /* cblas_sgemv T PUT F FOR NO TEST. SAME COLUMNS. */
  320. /* cblas_sgbmv T PUT F FOR NO TEST. SAME COLUMNS. */
  321. /* cblas_ssymv T PUT F FOR NO TEST. SAME COLUMNS. */
  322. /* cblas_ssbmv T PUT F FOR NO TEST. SAME COLUMNS. */
  323. /* cblas_sspmv T PUT F FOR NO TEST. SAME COLUMNS. */
  324. /* cblas_strmv T PUT F FOR NO TEST. SAME COLUMNS. */
  325. /* cblas_stbmv T PUT F FOR NO TEST. SAME COLUMNS. */
  326. /* cblas_stpmv T PUT F FOR NO TEST. SAME COLUMNS. */
  327. /* cblas_strsv T PUT F FOR NO TEST. SAME COLUMNS. */
  328. /* cblas_stbsv T PUT F FOR NO TEST. SAME COLUMNS. */
  329. /* cblas_stpsv T PUT F FOR NO TEST. SAME COLUMNS. */
  330. /* cblas_sger T PUT F FOR NO TEST. SAME COLUMNS. */
  331. /* cblas_ssyr T PUT F FOR NO TEST. SAME COLUMNS. */
  332. /* cblas_sspr T PUT F FOR NO TEST. SAME COLUMNS. */
  333. /* cblas_ssyr2 T PUT F FOR NO TEST. SAME COLUMNS. */
  334. /* cblas_sspr2 T PUT F FOR NO TEST. SAME COLUMNS. */
  335. /* See: */
  336. /* Dongarra J. J., Du Croz J. J., Hammarling S. and Hanson R. J.. */
  337. /* An extended set of Fortran Basic Linear Algebra Subprograms. */
  338. /* Technical Memoranda Nos. 41 (revision 3) and 81, Mathematics */
  339. /* and Computer Science Division, Argonne National Laboratory, */
  340. /* 9700 South Cass Avenue, Argonne, Illinois 60439, US. */
  341. /* Or */
  342. /* NAG Technical Reports TR3/87 and TR4/87, Numerical Algorithms */
  343. /* Group Ltd., NAG Central Office, 256 Banbury Road, Oxford */
  344. /* OX2 7DE, UK, and Numerical Algorithms Group Inc., 1101 31st */
  345. /* Street, Suite 100, Downers Grove, Illinois 60515-1263, USA. */
  346. /* -- Written on 10-August-1987. */
  347. /* Richard Hanson, Sandia National Labs. */
  348. /* Jeremy Du Croz, NAG Central Office. */
  349. /* .. Parameters .. */
  350. /* .. Local Scalars .. */
  351. /* .. Local Arrays .. */
  352. /* .. External Functions .. */
  353. /* .. External Subroutines .. */
  354. /* .. Intrinsic Functions .. */
  355. /* .. Scalars in Common .. */
  356. /* .. Common blocks .. */
  357. /* .. Data statements .. */
  358. /* .. Executable Statements .. */
  359. infoc_1.noutc = 6;
  360. /* Read name and unit number for snapshot output file and open file. */
  361. char line[80];
  362. fgets(line,80,stdin);
  363. sscanf(line,"'%s'",snaps);
  364. fgets(line,80,stdin);
  365. #ifdef USE64BITINT
  366. sscanf(line,"%ld",&ntra);
  367. #else
  368. sscanf(line,"%d",&ntra);
  369. #endif
  370. trace = ntra >= 0;
  371. if (trace) {
  372. /* o__1.oerr = 0;
  373. o__1.ounit = ntra;
  374. o__1.ofnmlen = 32;
  375. o__1.ofnm = snaps;
  376. o__1.orl = 0;
  377. o__1.osta = 0;
  378. o__1.oacc = 0;
  379. o__1.ofm = 0;
  380. o__1.oblnk = 0;
  381. f_open(&o__1);*/
  382. }
  383. /* Read the flag that directs rewinding of the snapshot file. */
  384. fgets(line,80,stdin);
  385. sscanf(line,"%d",&rewi);
  386. rewi = rewi && trace;
  387. /* Read the flag that directs stopping on any failure. */
  388. fgets(line,80,stdin);
  389. sscanf(line,"%c",&tmpchar);
  390. /* Read the flag that indicates whether error exits are to be tested. */
  391. sfatal=FALSE_;
  392. if (tmpchar=='T')sfatal=TRUE_;
  393. fgets(line,80,stdin);
  394. sscanf(line,"%c",&tmpchar);
  395. /* Read the flag that indicates whether error exits are to be tested. */
  396. tsterr=FALSE_;
  397. if (tmpchar=='T')tsterr=TRUE_;
  398. /* Read the flag that indicates whether row-major data layout to be tested. */
  399. fgets(line,80,stdin);
  400. sscanf(line,"%d",&layout);
  401. /* Read the threshold value of the test ratio */
  402. fgets(line,80,stdin);
  403. sscanf(line,"%f",&thresh);
  404. /* Read and check the parameter values for the tests. */
  405. /* Values of N */
  406. fgets(line,80,stdin);
  407. #ifdef USE64BITINT
  408. sscanf(line,"%ld",&nidim);
  409. #else
  410. sscanf(line,"%d",&nidim);
  411. #endif
  412. if (nidim < 1 || nidim > 9) {
  413. fprintf(stderr,"NUMBER OF VALUES OF N IS LESS THAN 1 OR GREATER THAN 9");
  414. goto L220;
  415. }
  416. fgets(line,80,stdin);
  417. #ifdef USE64BITINT
  418. sscanf(line,"%ld %ld %ld %ld %ld %ld %ld %ld %ld",&idim[0],&idim[1],&idim[2],
  419. &idim[3],&idim[4],&idim[5],&idim[6],&idim[7],&idim[8]);
  420. #else
  421. sscanf(line,"%d %d %d %d %d %d %d %d %d",&idim[0],&idim[1],&idim[2],
  422. &idim[3],&idim[4],&idim[5],&idim[6],&idim[7],&idim[8]);
  423. #endif
  424. i__1 = nidim;
  425. for (i__ = 1; i__ <= i__1; ++i__) {
  426. if (idim[i__ - 1] < 0 || idim[i__ - 1] > 65) {
  427. fprintf(stderr,"VALUE OF N IS LESS THAN 0 OR GREATER THAN 65\n");
  428. goto L220;
  429. }
  430. /* L10: */
  431. }
  432. /* Values of K */
  433. fgets(line,80,stdin);
  434. #ifdef USE64BITINT
  435. sscanf(line,"%ld",&nkb);
  436. #else
  437. sscanf(line,"%d",&nkb);
  438. #endif
  439. if (nkb < 1 || nkb > 7) {
  440. fprintf(stderr,"NUMBER OF VALUES OF K IS LESS THAN 1 OR GREATER THAN 7");
  441. goto L220;
  442. }
  443. fgets(line,80,stdin);
  444. #ifdef USE64BITINT
  445. sscanf(line,"%ld %ld %ld %ld %ld %ld %ld",&kb[0],&kb[1],&kb[2],&kb[3],&kb[4],&kb[5],&kb[6]);
  446. #else
  447. sscanf(line,"%d %d %d %d %d %d %d",&kb[0],&kb[1],&kb[2],&kb[3],&kb[4],&kb[5],&kb[6]);
  448. #endif
  449. i__1 = nkb;
  450. for (i__ = 1; i__ <= i__1; ++i__) {
  451. if (kb[i__ - 1] < 0 ) {
  452. fprintf(stderr,"VALUE OF K IS LESS THAN 0\n");
  453. goto L230;
  454. }
  455. /* L20: */
  456. }
  457. /* Values of INCX and INCY */
  458. fgets(line,80,stdin);
  459. #ifdef USE64BITINT
  460. sscanf(line,"%ld",&ninc);
  461. #else
  462. sscanf(line,"%d",&ninc);
  463. #endif
  464. if (ninc < 1 || ninc > 7) {
  465. fprintf(stderr,"NUMBER OF VALUES OF INCX AND INCY IS LESS THAN 1 OR GREATER THAN 7");
  466. goto L230;
  467. }
  468. fgets(line,80,stdin);
  469. #ifdef USE64BITINT
  470. sscanf(line,"%ld %ld %ld %ld %ld %ld %ld",&inc[0],&inc[1],&inc[2],&inc[3],&inc[4],&inc[5],&inc[6]);
  471. #else
  472. sscanf(line,"%d %d %d %d %d %d %d",&inc[0],&inc[1],&inc[2],&inc[3],&inc[4],&inc[5],&inc[6]);
  473. #endif
  474. i__1 = ninc;
  475. for (i__ = 1; i__ <= i__1; ++i__) {
  476. if (inc[i__ - 1] == 0 || (i__2 = inc[i__ - 1], abs(i__2)) > 2) {
  477. fprintf (stderr,"ABSOLUTE VALUE OF INCX OR INCY IS 0 OR GREATER THAN 2\n");
  478. goto L230;
  479. }
  480. /* L30: */
  481. }
  482. /* Values of ALPHA */
  483. fgets(line,80,stdin);
  484. sscanf(line,"%d",&nalf);
  485. if (nalf < 1 || nalf > 7) {
  486. fprintf(stderr,"VALUE OF ALPHA IS LESS THAN 0 OR GREATER THAN 7\n");
  487. goto L230;
  488. }
  489. fgets(line,80,stdin);
  490. sscanf(line,"%f %f %f %f %f %f %f",&alf[0],&alf[1],&alf[2],&alf[3],&alf[4],&alf[5],&alf[6]);
  491. /* Values of BETA */
  492. fgets(line,80,stdin);
  493. sscanf(line,"%d",&nbet);
  494. if (nbet < 1 || nbet > 7) {
  495. fprintf(stderr,"VALUE OF BETA IS LESS THAN 0 OR GREATER THAN 7\n");
  496. goto L230;
  497. }
  498. fgets(line,80,stdin);
  499. sscanf(line,"%f %f %f %f %f %f %f",&bet[0],&bet[1],&bet[2],&bet[3],&bet[4],&bet[5],&bet[6]);
  500. /* Report values of parameters. */
  501. printf("TESTS OF THE REAL LEVEL 2 BLAS\nTHE FOLLOWING PARAMETER VALUES WILL BE USED:\n");
  502. printf(" FOR N");
  503. for (i__ =1; i__ <=nidim;++i__) printf(" %d",idim[i__-1]);
  504. printf("\n");
  505. printf(" FOR K");
  506. for (i__ =1; i__ <=nkb;++i__) printf(" %d",kb[i__-1]);
  507. printf("\n");
  508. printf(" FOR INCX AND INCY");
  509. for (i__ =1; i__ <=ninc;++i__) printf(" %d",inc[i__-1]);
  510. printf("\n");
  511. printf(" FOR ALPHA");
  512. for (i__ =1; i__ <=nalf;++i__) printf(" %f",alf[i__-1]);
  513. printf("\n");
  514. printf(" FOR BETA");
  515. for (i__ =1; i__ <=nbet;++i__) printf(" %f",bet[i__-1]);
  516. printf("\n");
  517. if (! tsterr) {
  518. printf(" ERROR-EXITS WILL NOT BE TESTED\n");
  519. }
  520. printf("ROUTINES PASS COMPUTATIONAL TESTS IF TEST RATIO IS LESS THAN %f\n",thresh);
  521. rorder = FALSE_;
  522. corder = FALSE_;
  523. if (layout == 2) {
  524. rorder = TRUE_;
  525. corder = TRUE_;
  526. printf("COLUMN-MAJOR AND ROW-MAJOR DATA LAYOUTS ARE TESTED\n");
  527. } else if (layout == 1) {
  528. rorder = TRUE_;
  529. printf("ROW-MAJOR DATA LAYOUT IS TESTED\n");
  530. } else if (layout == 0) {
  531. corder = TRUE_;
  532. printf("COLUMN-MAJOR DATA LAYOUT IS TESTED\n");
  533. }
  534. /* Read names of subroutines and flags which indicate */
  535. /* whether they are to be tested. */
  536. for (i__ = 1; i__ <= 16; ++i__) {
  537. ltest[i__ - 1] = FALSE_;
  538. /* L40: */
  539. }
  540. L50:
  541. if (! fgets(line,80,stdin)) {
  542. goto L80;
  543. }
  544. i__1 = sscanf(line,"%12c %c",snamet,&tmpchar);
  545. ltestt=FALSE_;
  546. if (tmpchar=='T')ltestt=TRUE_;
  547. if (i__1 < 2) {
  548. goto L80;
  549. }
  550. for (i__ = 1; i__ <= 16; ++i__) {
  551. if (s_cmp(snamet, snames[i__ - 1], (ftnlen)12, (ftnlen)12) ==
  552. 0) {
  553. goto L70;
  554. }
  555. /* L60: */
  556. }
  557. printf("SUBPROGRAM NAME %s NOT RECOGNIZED\n****** TESTS ABANDONED ******\n",snamet);
  558. exit(1);
  559. L70:
  560. ltest[i__ - 1] = ltestt;
  561. goto L50;
  562. L80:
  563. /* cl__1.cerr = 0;
  564. cl__1.cunit = 5;
  565. cl__1.csta = 0;
  566. f_clos(&cl__1);*/
  567. /* Compute EPS (the machine precision). */
  568. eps = (float)1.;
  569. L90:
  570. r__1 = eps + (float)1.;
  571. if (sdiff_(&r__1, &c_b123) == (float)0.) {
  572. goto L100;
  573. }
  574. eps *= (float).5;
  575. goto L90;
  576. L100:
  577. eps += eps;
  578. printf("RELATIVE MACHINE PRECISION IS TAKEN TO BE %9.1g\n",eps);
  579. /* Check the reliability of SMVCH using exact data. */
  580. n = 32;
  581. i__1 = n;
  582. for (j = 1; j <= i__1; ++j) {
  583. i__2 = n;
  584. for (i__ = 1; i__ <= i__2; ++i__) {
  585. /* Computing MAX */
  586. i__3 = i__ - j + 1;
  587. a[i__ + j * 65 - 66] = (real) f2cmax(i__3,0);
  588. /* L110: */
  589. }
  590. x[j - 1] = (real) j;
  591. y[j - 1] = (float)0.;
  592. /* L120: */
  593. }
  594. i__1 = n;
  595. for (j = 1; j <= i__1; ++j) {
  596. yy[j - 1] = (real) (j * ((j + 1) * j) / 2 - (j + 1) * j * (j - 1) / 3)
  597. ;
  598. /* L130: */
  599. }
  600. /* YY holds the exact result. On exit from SMVCH YT holds */
  601. /* the result computed by SMVCH. */
  602. *(unsigned char *)trans = 'N';
  603. smvch_(trans, &n, &n, &c_b123, a, &c__65, x, &c__1, &c_b135, y, &c__1, yt,
  604. g, yy, &eps, &err, &fatal, &c__6, &c_true, (ftnlen)1);
  605. same = lse_(yy, yt, &n);
  606. if (! same || err != (float)0.) {
  607. printf("ERROR IN SMVCH - IN-LINE DOT PRODUCTS ARE BEING EVALUATED WRONGLY\n");
  608. printf("SMVCH WAS CALLED WITH TRANS = %s ", trans);
  609. printf("AND RETURNED SAME = %c AND ERR = %12.3f.\n",(same==FALSE_? 'F':'T'),err);
  610. printf("THIS MAY BE DUE TO FAULTS IN THE ARITHMETIC OR THE COMPILER.\n");
  611. printf("****** TESTS ABANDONED ******\n");
  612. exit(1);
  613. }
  614. *(unsigned char *)trans = 'T';
  615. smvch_(trans, &n, &n, &c_b123, a, &c__65, x, &c_n1, &c_b135, y, &c_n1, yt,
  616. g, yy, &eps, &err, &fatal, &c__6, &c_true, (ftnlen)1);
  617. same = lse_(yy, yt, &n);
  618. if (! same || err != (float)0.) {
  619. printf("ERROR IN SMVCH - IN-LINE DOT PRODUCTS ARE BEING EVALUATED WRONGLY\n");
  620. printf("SMVCH WAS CALLED WITH TRANS = %s ", trans);
  621. printf("AND RETURNED SAME = %c AND ERR = %12.3f.\n",(same==FALSE_? 'F':'T'),err);
  622. printf("THIS MAY BE DUE TO FAULTS IN THE ARITHMETIC OR THE COMPILER.\n");
  623. printf("****** TESTS ABANDONED ******\n");
  624. exit(1);
  625. }
  626. /* Test each subroutine in turn. */
  627. for (isnum = 1; isnum <= 16; ++isnum) {
  628. if (! ltest[isnum - 1]) {
  629. /* Subprogram is not to be tested. */
  630. printf("%12s WAS NOT TESTED\n",snames[isnum-1]);
  631. } else {
  632. s_copy(srnamc_1.srnamt, snames[isnum - 1], (ftnlen)12, (
  633. ftnlen)12);
  634. /* Test error exits. */
  635. if (tsterr) {
  636. cs2chke_(snames[isnum - 1], (ftnlen)12);
  637. }
  638. /* Test computations. */
  639. infoc_1.infot = 0;
  640. infoc_1.ok = TRUE_;
  641. fatal = FALSE_;
  642. switch ((int)isnum) {
  643. case 1: goto L140;
  644. case 2: goto L140;
  645. case 3: goto L150;
  646. case 4: goto L150;
  647. case 5: goto L150;
  648. case 6: goto L160;
  649. case 7: goto L160;
  650. case 8: goto L160;
  651. case 9: goto L160;
  652. case 10: goto L160;
  653. case 11: goto L160;
  654. case 12: goto L170;
  655. case 13: goto L180;
  656. case 14: goto L180;
  657. case 15: goto L190;
  658. case 16: goto L190;
  659. }
  660. /* Test SGEMV, 01, and SGBMV, 02. */
  661. L140:
  662. if (corder) {
  663. schk1_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  664. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &nalf,
  665. alf, &nbet, bet, &ninc, inc, &c__65, &c__2, a, aa,
  666. as, x, xx, xs, y, yy, ys, yt, g, &c__0, (ftnlen)12);
  667. }
  668. if (rorder) {
  669. schk1_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  670. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &nalf,
  671. alf, &nbet, bet, &ninc, inc, &c__65, &c__2, a, aa,
  672. as, x, xx, xs, y, yy, ys, yt, g, &c__1, (ftnlen)12);
  673. }
  674. goto L200;
  675. /* Test SSYMV, 03, SSBMV, 04, and SSPMV, 05. */
  676. L150:
  677. if (corder) {
  678. schk2_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  679. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &nalf,
  680. alf, &nbet, bet, &ninc, inc, &c__65, &c__2, a, aa,
  681. as, x, xx, xs, y, yy, ys, yt, g, &c__0, (ftnlen)12);
  682. }
  683. if (rorder) {
  684. schk2_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  685. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &nalf,
  686. alf, &nbet, bet, &ninc, inc, &c__65, &c__2, a, aa,
  687. as, x, xx, xs, y, yy, ys, yt, g, &c__1, (ftnlen)12);
  688. }
  689. goto L200;
  690. /* Test STRMV, 06, STBMV, 07, STPMV, 08, */
  691. /* STRSV, 09, STBSV, 10, and STPSV, 11. */
  692. L160:
  693. if (corder) {
  694. schk3_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  695. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &ninc,
  696. inc, &c__65, &c__2, a, aa, as, y, yy, ys, yt, g, z__,
  697. &c__0, (ftnlen)12);
  698. }
  699. if (rorder) {
  700. schk3_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  701. &trace, &rewi, &fatal, &nidim, idim, &nkb, kb, &ninc,
  702. inc, &c__65, &c__2, a, aa, as, y, yy, ys, yt, g, z__,
  703. &c__1, (ftnlen)12);
  704. }
  705. goto L200;
  706. /* Test SGER, 12. */
  707. L170:
  708. if (corder) {
  709. schk4_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  710. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  711. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  712. ys, yt, g, z__, &c__0, (ftnlen)12);
  713. }
  714. if (rorder) {
  715. schk4_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  716. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  717. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  718. ys, yt, g, z__, &c__1, (ftnlen)12);
  719. }
  720. goto L200;
  721. /* Test SSYR, 13, and SSPR, 14. */
  722. L180:
  723. if (corder) {
  724. schk5_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  725. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  726. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  727. ys, yt, g, z__, &c__0, (ftnlen)12);
  728. }
  729. if (rorder) {
  730. schk5_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  731. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  732. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  733. ys, yt, g, z__, &c__1, (ftnlen)12);
  734. }
  735. goto L200;
  736. /* Test SSYR2, 15, and SSPR2, 16. */
  737. L190:
  738. if (corder) {
  739. schk6_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  740. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  741. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  742. ys, yt, g, z__, &c__0, (ftnlen)12);
  743. }
  744. if (rorder) {
  745. schk6_(snames[isnum - 1], &eps, &thresh, &c__6, &ntra,
  746. &trace, &rewi, &fatal, &nidim, idim, &nalf, alf, &
  747. ninc, inc, &c__65, &c__2, a, aa, as, x, xx, xs, y, yy,
  748. ys, yt, g, z__, &c__1, (ftnlen)12);
  749. }
  750. L200:
  751. if (fatal && sfatal) {
  752. goto L220;
  753. }
  754. }
  755. /* L210: */
  756. }
  757. printf("\nEND OF TESTS\n");
  758. goto L240;
  759. L220:
  760. printf("\n****** FATAL ERROR - TESTS ABANDONED ******\n");
  761. goto L240;
  762. L230:
  763. printf("AMEND DATA FILE OR INCREASE ARRAY SIZES IN PROGRAM\n");
  764. printf("****** TESTS ABANDONED ******\n");
  765. L240:
  766. if (trace) {
  767. /* cl__1.cerr = 0;
  768. cl__1.cunit = ntra;
  769. cl__1.csta = 0;
  770. f_clos(&cl__1);*/
  771. }
  772. /* cl__1.cerr = 0;
  773. cl__1.cunit = 6;
  774. cl__1.csta = 0;
  775. f_clos(&cl__1);
  776. s_stop("", (ftnlen)0);*/
  777. exit(0);
  778. /* End of SBLAT2. */
  779. } /* MAIN__ */
  780. /* Subroutine */ int schk1_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nkb, integer* kb, integer* nalf, real* alf, integer* nbet, real* bet, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, integer* iorder, ftnlen sname_len)
  781. {
  782. /* Initialized data */
  783. static char ich[3+1] = "NTC";
  784. /* System generated locals */
  785. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8;
  786. /* Local variables */
  787. static real beta;
  788. static integer ldas;
  789. static logical same;
  790. static integer incx, incy;
  791. static logical full, tran, null;
  792. static integer i__, m, n;
  793. static real alpha;
  794. static logical isame[13];
  795. extern /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  796. static integer nargs;
  797. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  798. static logical reset;
  799. static integer incxs, incys;
  800. static char trans[1];
  801. static integer ia, ib, ic;
  802. static logical banded;
  803. static integer nc, nd, im, in, kl, ml, nk, nl, ku, ix, iy, ms, lx, ly, ns;
  804. extern /* Subroutine */ void csgbmv_(integer*, char*, integer*, integer*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, ftnlen);
  805. extern /* Subroutine */ void csgemv_(integer*, char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, ftnlen);
  806. static char ctrans[14];
  807. static real errmax;
  808. extern logical lseres_(char* type__, char* uplo, integer* m, integer* n, real* aa, real* as, integer* lda, ftnlen ltype_len, ftnlen uplo_len);
  809. static real transl;
  810. static char transs[1];
  811. static integer laa, lda;
  812. static real als, bls;
  813. extern logical lse_(real*, real*, integer*);
  814. static real err;
  815. static integer iku, kls, kus;
  816. /* Tests SGEMV and SGBMV. */
  817. /* Auxiliary routine for test program for Level 2 Blas. */
  818. /* -- Written on 10-August-1987. */
  819. /* Richard Hanson, Sandia National Labs. */
  820. /* Jeremy Du Croz, NAG Central Office. */
  821. /* .. Parameters .. */
  822. /* .. Scalar Arguments .. */
  823. /* .. Array Arguments .. */
  824. /* .. Local Scalars .. */
  825. /* .. Local Arrays .. */
  826. /* .. External Functions .. */
  827. /* .. External Subroutines .. */
  828. /* .. Intrinsic Functions .. */
  829. /* .. Scalars in Common .. */
  830. /* .. Common blocks .. */
  831. /* .. Data statements .. */
  832. /* Parameter adjustments */
  833. --idim;
  834. --kb;
  835. --alf;
  836. --bet;
  837. --inc;
  838. --g;
  839. --yt;
  840. --y;
  841. --x;
  842. --as;
  843. --aa;
  844. a_dim1 = *nmax;
  845. a_offset = 1 + a_dim1 * 1;
  846. a -= a_offset;
  847. --ys;
  848. --yy;
  849. --xs;
  850. --xx;
  851. /* Function Body */
  852. /* .. Executable Statements .. */
  853. full = *(unsigned char *)&sname[8] == 'e';
  854. banded = *(unsigned char *)&sname[8] == 'b';
  855. /* Define the number of arguments. */
  856. if (full) {
  857. nargs = 11;
  858. } else if (banded) {
  859. nargs = 13;
  860. }
  861. nc = 0;
  862. reset = TRUE_;
  863. errmax = (float)0.;
  864. i__1 = *nidim;
  865. for (in = 1; in <= i__1; ++in) {
  866. n = idim[in];
  867. nd = n / 2 + 1;
  868. for (im = 1; im <= 2; ++im) {
  869. if (im == 1) {
  870. /* Computing MAX */
  871. i__2 = n - nd;
  872. m = f2cmax(i__2,0);
  873. }
  874. if (im == 2) {
  875. /* Computing MIN */
  876. i__2 = n + nd;
  877. m = f2cmin(i__2,*nmax);
  878. }
  879. if (banded) {
  880. nk = *nkb;
  881. } else {
  882. nk = 1;
  883. }
  884. i__2 = nk;
  885. for (iku = 1; iku <= i__2; ++iku) {
  886. if (banded) {
  887. ku = kb[iku];
  888. /* Computing MAX */
  889. i__3 = ku - 1;
  890. kl = f2cmax(i__3,0);
  891. } else {
  892. ku = n - 1;
  893. kl = m - 1;
  894. }
  895. /* Set LDA to 1 more than minimum value if room. */
  896. if (banded) {
  897. lda = kl + ku + 1;
  898. } else {
  899. lda = m;
  900. }
  901. if (lda < *nmax) {
  902. ++lda;
  903. }
  904. /* Skip tests if not enough room. */
  905. if (lda > *nmax) {
  906. goto L100;
  907. }
  908. laa = lda * n;
  909. null = n <= 0 || m <= 0;
  910. /* Generate the matrix A. */
  911. transl = (float)0.;
  912. smake_(sname + 7, " ", " ", &m, &n, &a[a_offset], nmax, &aa[1]
  913. , &lda, &kl, &ku, &reset, &transl, (ftnlen)2, (ftnlen)
  914. 1, (ftnlen)1);
  915. for (ic = 1; ic <= 3; ++ic) {
  916. *(unsigned char *)trans = *(unsigned char *)&ich[ic - 1];
  917. if (*(unsigned char *)trans == 'N') {
  918. s_copy(ctrans, " CblasNoTrans", (ftnlen)14, (ftnlen)
  919. 14);
  920. } else if (*(unsigned char *)trans == 'T') {
  921. s_copy(ctrans, " CblasTrans", (ftnlen)14, (ftnlen)
  922. 14);
  923. } else {
  924. s_copy(ctrans, "CblasConjTrans", (ftnlen)14, (ftnlen)
  925. 14);
  926. }
  927. tran = *(unsigned char *)trans == 'T' || *(unsigned char *
  928. )trans == 'C';
  929. if (tran) {
  930. ml = n;
  931. nl = m;
  932. } else {
  933. ml = m;
  934. nl = n;
  935. }
  936. i__3 = *ninc;
  937. for (ix = 1; ix <= i__3; ++ix) {
  938. incx = inc[ix];
  939. lx = abs(incx) * nl;
  940. /* Generate the vector X. */
  941. transl = (float).5;
  942. i__4 = abs(incx);
  943. i__5 = nl - 1;
  944. smake_("ge", " ", " ", &c__1, &nl, &x[1], &c__1, &xx[
  945. 1], &i__4, &c__0, &i__5, &reset, &transl, (
  946. ftnlen)2, (ftnlen)1, (ftnlen)1);
  947. if (nl > 1) {
  948. x[nl / 2] = (float)0.;
  949. xx[abs(incx) * (nl / 2 - 1) + 1] = (float)0.;
  950. }
  951. i__4 = *ninc;
  952. for (iy = 1; iy <= i__4; ++iy) {
  953. incy = inc[iy];
  954. ly = abs(incy) * ml;
  955. i__5 = *nalf;
  956. for (ia = 1; ia <= i__5; ++ia) {
  957. alpha = alf[ia];
  958. i__6 = *nbet;
  959. for (ib = 1; ib <= i__6; ++ib) {
  960. beta = bet[ib];
  961. /* Generate the vector Y. */
  962. transl = (float)0.;
  963. i__7 = abs(incy);
  964. i__8 = ml - 1;
  965. smake_("ge", " ", " ", &c__1, &ml, &y[1],
  966. &c__1, &yy[1], &i__7, &c__0, &
  967. i__8, &reset, &transl, (ftnlen)2,
  968. (ftnlen)1, (ftnlen)1);
  969. ++nc;
  970. /* Save every datum before calling the */
  971. /* subroutine. */
  972. *(unsigned char *)transs = *(unsigned
  973. char *)trans;
  974. ms = m;
  975. ns = n;
  976. kls = kl;
  977. kus = ku;
  978. als = alpha;
  979. i__7 = laa;
  980. for (i__ = 1; i__ <= i__7; ++i__) {
  981. as[i__] = aa[i__];
  982. /* L10: */
  983. }
  984. ldas = lda;
  985. i__7 = lx;
  986. for (i__ = 1; i__ <= i__7; ++i__) {
  987. xs[i__] = xx[i__];
  988. /* L20: */
  989. }
  990. incxs = incx;
  991. bls = beta;
  992. i__7 = ly;
  993. for (i__ = 1; i__ <= i__7; ++i__) {
  994. ys[i__] = yy[i__];
  995. /* L30: */
  996. }
  997. incys = incy;
  998. /* Call the subroutine. */
  999. if (full) {
  1000. if (*trace) {
  1001. /*
  1002. sprintf(ntra,"%6d: %12s %14s %3d %3d %4.1f A %3d X %2d %4.1f Y %2d .\n",
  1003. nc,sname,ctrans,m,n,alpha,lda,incx,beta,incy);
  1004. */
  1005. }
  1006. if (*rewi) {
  1007. /* al__1.aerr = 0;
  1008. al__1.aunit = *ntra;
  1009. f_rew(&al__1);*/
  1010. }
  1011. csgemv_(iorder, trans, &m, &n, &alpha,
  1012. &aa[1], &lda, &xx[1], &incx,
  1013. &beta, &yy[1], &incy, (ftnlen)
  1014. 1);
  1015. } else if (banded) {
  1016. if (*trace) {
  1017. /*
  1018. sprintf(ntra,"%6d: %12s %14s %3d %3d %3d %3d %4.1f A %3d %2d %4.1f Y %2d\n",
  1019. nc,sname,ctrans,m,n,kl,ku,alpha,lda,incx,beta,incy);
  1020. */
  1021. }
  1022. if (*rewi) {
  1023. /* al__1.aerr = 0;
  1024. al__1.aunit = *ntra;
  1025. f_rew(&al__1);*/
  1026. }
  1027. csgbmv_(iorder, trans, &m, &n, &kl, &
  1028. ku, &alpha, &aa[1], &lda, &xx[
  1029. 1], &incx, &beta, &yy[1], &
  1030. incy, (ftnlen)1);
  1031. }
  1032. /* Check if error-exit was taken incorrectly. */
  1033. if (! infoc_1.ok) {
  1034. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  1035. *fatal = TRUE_;
  1036. goto L130;
  1037. }
  1038. /* See what data changed inside subroutines. */
  1039. isame[0] = *(unsigned char *)trans == *(
  1040. unsigned char *)transs;
  1041. isame[1] = ms == m;
  1042. isame[2] = ns == n;
  1043. if (full) {
  1044. isame[3] = als == alpha;
  1045. isame[4] = lse_(&as[1], &aa[1], &laa);
  1046. isame[5] = ldas == lda;
  1047. isame[6] = lse_(&xs[1], &xx[1], &lx);
  1048. isame[7] = incxs == incx;
  1049. isame[8] = bls == beta;
  1050. if (null) {
  1051. isame[9] = lse_(&ys[1], &yy[1], &
  1052. ly);
  1053. } else {
  1054. i__7 = abs(incy);
  1055. isame[9] = lseres_("ge", " ", &
  1056. c__1, &ml, &ys[1], &yy[1],
  1057. &i__7, (ftnlen)2, (
  1058. ftnlen)1);
  1059. }
  1060. isame[10] = incys == incy;
  1061. } else if (banded) {
  1062. isame[3] = kls == kl;
  1063. isame[4] = kus == ku;
  1064. isame[5] = als == alpha;
  1065. isame[6] = lse_(&as[1], &aa[1], &laa);
  1066. isame[7] = ldas == lda;
  1067. isame[8] = lse_(&xs[1], &xx[1], &lx);
  1068. isame[9] = incxs == incx;
  1069. isame[10] = bls == beta;
  1070. if (null) {
  1071. isame[11] = lse_(&ys[1], &yy[1], &
  1072. ly);
  1073. } else {
  1074. i__7 = abs(incy);
  1075. isame[11] = lseres_("ge", " ", &
  1076. c__1, &ml, &ys[1], &yy[1],
  1077. &i__7, (ftnlen)2, (
  1078. ftnlen)1);
  1079. }
  1080. isame[12] = incys == incy;
  1081. }
  1082. /* If data was incorrectly changed, report */
  1083. /* and return. */
  1084. same = TRUE_;
  1085. i__7 = nargs;
  1086. for (i__ = 1; i__ <= i__7; ++i__) {
  1087. same = same && isame[i__ - 1];
  1088. if (! isame[i__ - 1]) {
  1089. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  1090. }
  1091. /* L40: */
  1092. }
  1093. if (! same) {
  1094. *fatal = TRUE_;
  1095. goto L130;
  1096. }
  1097. if (! null) {
  1098. /* Check the result. */
  1099. smvch_(trans, &m, &n, &alpha, &a[
  1100. a_offset], nmax, &x[1], &incx,
  1101. &beta, &y[1], &incy, &yt[1],
  1102. &g[1], &yy[1], eps, &err,
  1103. fatal, nout, &c_true, (ftnlen)
  1104. 1);
  1105. errmax = dmax(errmax,err);
  1106. /* If got really bad answer, report and */
  1107. /* return. */
  1108. if (*fatal) {
  1109. goto L130;
  1110. }
  1111. } else {
  1112. /* Avoid repeating tests with M.le.0 or */
  1113. /* N.le.0. */
  1114. goto L110;
  1115. }
  1116. /* L50: */
  1117. }
  1118. /* L60: */
  1119. }
  1120. /* L70: */
  1121. }
  1122. /* L80: */
  1123. }
  1124. /* L90: */
  1125. }
  1126. L100:
  1127. ;
  1128. }
  1129. L110:
  1130. ;
  1131. }
  1132. /* L120: */
  1133. }
  1134. /* Report result. */
  1135. if (errmax < *thresh) {
  1136. if (*iorder == 0) {
  1137. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1138. }
  1139. if (*iorder == 1) {
  1140. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1141. }
  1142. } else {
  1143. if (*iorder == 0) {
  1144. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1145. }
  1146. if (*iorder == 1) {
  1147. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1148. }
  1149. }
  1150. goto L140;
  1151. L130:
  1152. printf("******* %12s FAILED ON CALL NUMBER:",sname);
  1153. if (full) {
  1154. printf("%6d: %12s %14s %3d %3d %4.1f A %3d X %2d %4.1f Y %2d .\n",
  1155. nc,sname,ctrans,m,n,alpha,lda,incx,beta,incy);
  1156. } else if (banded) {
  1157. printf("%6d: %12s %14s %3d %3d %3d %3d %4.1f A %3d %2d %4.1f Y %2d\n",
  1158. nc,sname,ctrans,m,n,kl,ku,alpha,lda,incx,beta,incy);
  1159. }
  1160. L140:
  1161. return 0;
  1162. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  1163. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  1164. /* $ ' - SUSPECT *******' ) */
  1165. /* End of SCHK1. */
  1166. } /* schk1_ */
  1167. /* Subroutine */ int schk2_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nkb, integer* kb, integer* nalf, real* alf, integer* nbet, real* bet, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, integer* iorder, ftnlen sname_len)
  1168. {
  1169. /* Initialized data */
  1170. static char ich[2+1] = "UL";
  1171. /* System generated locals */
  1172. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8;
  1173. /* Local variables */
  1174. static real beta;
  1175. static integer ldas;
  1176. static logical same;
  1177. static integer incx, incy;
  1178. static logical full, null;
  1179. static char uplo[1];
  1180. static integer i__, k, n;
  1181. static real alpha;
  1182. static logical isame[13];
  1183. extern /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  1184. static integer nargs;
  1185. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  1186. static logical reset;
  1187. static char cuplo[14];
  1188. static integer incxs, incys;
  1189. static char uplos[1];
  1190. static integer ia, ib, ic;
  1191. static logical banded;
  1192. static integer nc, ik, in;
  1193. static logical packed;
  1194. static integer nk, ks, ix, iy, ns, lx, ly;
  1195. static real errmax;
  1196. extern logical lseres_(char* , char*, integer*, integer*, real*, real*, integer*, ftnlen, ftnlen);
  1197. extern /* Subroutine */ void cssbmv_(integer*, char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, ftnlen);
  1198. static real transl;
  1199. extern /* Subroutine */ void csspmv_(integer*, char*, integer*, real*, real*, real*, integer*, real*, real*, integer*, ftnlen);
  1200. extern /* Subroutine */ void cssymv_(integer*, char*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, ftnlen);
  1201. static integer laa, lda;
  1202. static real als, bls;
  1203. extern logical lse_(real*, real*, integer*);
  1204. static real err;
  1205. /* Tests SSYMV, SSBMV and SSPMV. */
  1206. /* Auxiliary routine for test program for Level 2 Blas. */
  1207. /* -- Written on 10-August-1987. */
  1208. /* Richard Hanson, Sandia National Labs. */
  1209. /* Jeremy Du Croz, NAG Central Office. */
  1210. /* .. Parameters .. */
  1211. /* .. Scalar Arguments .. */
  1212. /* .. Array Arguments .. */
  1213. /* .. Local Scalars .. */
  1214. /* .. Local Arrays .. */
  1215. /* .. External Functions .. */
  1216. /* .. External Subroutines .. */
  1217. /* .. Intrinsic Functions .. */
  1218. /* .. Scalars in Common .. */
  1219. /* .. Common blocks .. */
  1220. /* .. Data statements .. */
  1221. /* Parameter adjustments */
  1222. --idim;
  1223. --kb;
  1224. --alf;
  1225. --bet;
  1226. --inc;
  1227. --g;
  1228. --yt;
  1229. --y;
  1230. --x;
  1231. --as;
  1232. --aa;
  1233. a_dim1 = *nmax;
  1234. a_offset = 1 + a_dim1 * 1;
  1235. a -= a_offset;
  1236. --ys;
  1237. --yy;
  1238. --xs;
  1239. --xx;
  1240. /* Function Body */
  1241. /* .. Executable Statements .. */
  1242. full = *(unsigned char *)&sname[8] == 'y';
  1243. banded = *(unsigned char *)&sname[8] == 'b';
  1244. packed = *(unsigned char *)&sname[8] == 'p';
  1245. /* Define the number of arguments. */
  1246. if (full) {
  1247. nargs = 10;
  1248. } else if (banded) {
  1249. nargs = 11;
  1250. } else if (packed) {
  1251. nargs = 9;
  1252. }
  1253. nc = 0;
  1254. reset = TRUE_;
  1255. errmax = (float)0.;
  1256. i__1 = *nidim;
  1257. for (in = 1; in <= i__1; ++in) {
  1258. n = idim[in];
  1259. if (banded) {
  1260. nk = *nkb;
  1261. } else {
  1262. nk = 1;
  1263. }
  1264. i__2 = nk;
  1265. for (ik = 1; ik <= i__2; ++ik) {
  1266. if (banded) {
  1267. k = kb[ik];
  1268. } else {
  1269. k = n - 1;
  1270. }
  1271. /* Set LDA to 1 more than minimum value if room. */
  1272. if (banded) {
  1273. lda = k + 1;
  1274. } else {
  1275. lda = n;
  1276. }
  1277. if (lda < *nmax) {
  1278. ++lda;
  1279. }
  1280. /* Skip tests if not enough room. */
  1281. if (lda > *nmax) {
  1282. goto L100;
  1283. }
  1284. if (packed) {
  1285. laa = n * (n + 1) / 2;
  1286. } else {
  1287. laa = lda * n;
  1288. }
  1289. null = n <= 0;
  1290. for (ic = 1; ic <= 2; ++ic) {
  1291. *(unsigned char *)uplo = *(unsigned char *)&ich[ic - 1];
  1292. if (*(unsigned char *)uplo == 'U') {
  1293. s_copy(cuplo, " CblasUpper", (ftnlen)14, (ftnlen)14);
  1294. } else {
  1295. s_copy(cuplo, " CblasLower", (ftnlen)14, (ftnlen)14);
  1296. }
  1297. /* Generate the matrix A. */
  1298. transl = (float)0.;
  1299. smake_(sname + 7, uplo, " ", &n, &n, &a[a_offset], nmax, &aa[
  1300. 1], &lda, &k, &k, &reset, &transl, (ftnlen)2, (ftnlen)
  1301. 1, (ftnlen)1);
  1302. i__3 = *ninc;
  1303. for (ix = 1; ix <= i__3; ++ix) {
  1304. incx = inc[ix];
  1305. lx = abs(incx) * n;
  1306. /* Generate the vector X. */
  1307. transl = (float).5;
  1308. i__4 = abs(incx);
  1309. i__5 = n - 1;
  1310. smake_("ge", " ", " ", &c__1, &n, &x[1], &c__1, &xx[1], &
  1311. i__4, &c__0, &i__5, &reset, &transl, (ftnlen)2, (
  1312. ftnlen)1, (ftnlen)1);
  1313. if (n > 1) {
  1314. x[n / 2] = (float)0.;
  1315. xx[abs(incx) * (n / 2 - 1) + 1] = (float)0.;
  1316. }
  1317. i__4 = *ninc;
  1318. for (iy = 1; iy <= i__4; ++iy) {
  1319. incy = inc[iy];
  1320. ly = abs(incy) * n;
  1321. i__5 = *nalf;
  1322. for (ia = 1; ia <= i__5; ++ia) {
  1323. alpha = alf[ia];
  1324. i__6 = *nbet;
  1325. for (ib = 1; ib <= i__6; ++ib) {
  1326. beta = bet[ib];
  1327. /* Generate the vector Y. */
  1328. transl = (float)0.;
  1329. i__7 = abs(incy);
  1330. i__8 = n - 1;
  1331. smake_("ge", " ", " ", &c__1, &n, &y[1], &
  1332. c__1, &yy[1], &i__7, &c__0, &i__8, &
  1333. reset, &transl, (ftnlen)2, (ftnlen)1,
  1334. (ftnlen)1);
  1335. ++nc;
  1336. /* Save every datum before calling the */
  1337. /* subroutine. */
  1338. *(unsigned char *)uplos = *(unsigned char *)
  1339. uplo;
  1340. ns = n;
  1341. ks = k;
  1342. als = alpha;
  1343. i__7 = laa;
  1344. for (i__ = 1; i__ <= i__7; ++i__) {
  1345. as[i__] = aa[i__];
  1346. /* L10: */
  1347. }
  1348. ldas = lda;
  1349. i__7 = lx;
  1350. for (i__ = 1; i__ <= i__7; ++i__) {
  1351. xs[i__] = xx[i__];
  1352. /* L20: */
  1353. }
  1354. incxs = incx;
  1355. bls = beta;
  1356. i__7 = ly;
  1357. for (i__ = 1; i__ <= i__7; ++i__) {
  1358. ys[i__] = yy[i__];
  1359. /* L30: */
  1360. }
  1361. incys = incy;
  1362. /* Call the subroutine. */
  1363. if (full) {
  1364. if (*trace) {
  1365. /*
  1366. sprintf(ntra,"%6d: %12s (%14s, %3d, %4.1f, A %3d, X %2d, %4.1f Y %2d )..\n",
  1367. nc,sname,cuplo,n,alpha,lda,incx,beta,incy);
  1368. */
  1369. }
  1370. if (*rewi) {
  1371. /* al__1.aerr = 0;
  1372. al__1.aunit = *ntra;
  1373. f_rew(&al__1);*/
  1374. }
  1375. cssymv_(iorder, uplo, &n, &alpha, &aa[1],
  1376. &lda, &xx[1], &incx, &beta, &yy[1]
  1377. , &incy, (ftnlen)1);
  1378. } else if (banded) {
  1379. if (*trace) {
  1380. /*
  1381. sprintf(ntra,"%6d: %12s (%14s %3d, %3d, %4.1f, A %3d, X %2d, %4.1f, Y, %2d ).\n",
  1382. nc,sname,cuplo,n,k,alpha,lda,incx,beta,incy);
  1383. */
  1384. }
  1385. if (*rewi) {
  1386. /* al__1.aerr = 0;
  1387. al__1.aunit = *ntra;
  1388. f_rew(&al__1);*/
  1389. }
  1390. cssbmv_(iorder, uplo, &n, &k, &alpha, &aa[
  1391. 1], &lda, &xx[1], &incx, &beta, &
  1392. yy[1], &incy, (ftnlen)1);
  1393. } else if (packed) {
  1394. if (*trace) {
  1395. /*
  1396. sprintf(ntra,"%6d: %12s ( %14s %3d, %4.1f, AP X %2d, %4.1f, Y, %2d ).\n",
  1397. nc,sname,cuplo,n,alpha,incx,beta,incy);
  1398. */
  1399. }
  1400. if (*rewi) {
  1401. /* al__1.aerr = 0;
  1402. al__1.aunit = *ntra;
  1403. f_rew(&al__1);*/
  1404. }
  1405. csspmv_(iorder, uplo, &n, &alpha, &aa[1],
  1406. &xx[1], &incx, &beta, &yy[1], &
  1407. incy, (ftnlen)1);
  1408. }
  1409. /* Check if error-exit was taken incorrectly. */
  1410. if (! infoc_1.ok) {
  1411. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  1412. *fatal = TRUE_;
  1413. goto L120;
  1414. }
  1415. /* See what data changed inside subroutines. */
  1416. isame[0] = *(unsigned char *)uplo == *(
  1417. unsigned char *)uplos;
  1418. isame[1] = ns == n;
  1419. if (full) {
  1420. isame[2] = als == alpha;
  1421. isame[3] = lse_(&as[1], &aa[1], &laa);
  1422. isame[4] = ldas == lda;
  1423. isame[5] = lse_(&xs[1], &xx[1], &lx);
  1424. isame[6] = incxs == incx;
  1425. isame[7] = bls == beta;
  1426. if (null) {
  1427. isame[8] = lse_(&ys[1], &yy[1], &ly);
  1428. } else {
  1429. i__7 = abs(incy);
  1430. isame[8] = lseres_("ge", " ", &c__1, &
  1431. n, &ys[1], &yy[1], &i__7, (
  1432. ftnlen)2, (ftnlen)1);
  1433. }
  1434. isame[9] = incys == incy;
  1435. } else if (banded) {
  1436. isame[2] = ks == k;
  1437. isame[3] = als == alpha;
  1438. isame[4] = lse_(&as[1], &aa[1], &laa);
  1439. isame[5] = ldas == lda;
  1440. isame[6] = lse_(&xs[1], &xx[1], &lx);
  1441. isame[7] = incxs == incx;
  1442. isame[8] = bls == beta;
  1443. if (null) {
  1444. isame[9] = lse_(&ys[1], &yy[1], &ly);
  1445. } else {
  1446. i__7 = abs(incy);
  1447. isame[9] = lseres_("ge", " ", &c__1, &
  1448. n, &ys[1], &yy[1], &i__7, (
  1449. ftnlen)2, (ftnlen)1);
  1450. }
  1451. isame[10] = incys == incy;
  1452. } else if (packed) {
  1453. isame[2] = als == alpha;
  1454. isame[3] = lse_(&as[1], &aa[1], &laa);
  1455. isame[4] = lse_(&xs[1], &xx[1], &lx);
  1456. isame[5] = incxs == incx;
  1457. isame[6] = bls == beta;
  1458. if (null) {
  1459. isame[7] = lse_(&ys[1], &yy[1], &ly);
  1460. } else {
  1461. i__7 = abs(incy);
  1462. isame[7] = lseres_("ge", " ", &c__1, &
  1463. n, &ys[1], &yy[1], &i__7, (
  1464. ftnlen)2, (ftnlen)1);
  1465. }
  1466. isame[8] = incys == incy;
  1467. }
  1468. /* If data was incorrectly changed, report and */
  1469. /* return. */
  1470. same = TRUE_;
  1471. i__7 = nargs;
  1472. for (i__ = 1; i__ <= i__7; ++i__) {
  1473. same = same && isame[i__ - 1];
  1474. if (! isame[i__ - 1]) {
  1475. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  1476. }
  1477. /* L40: */
  1478. }
  1479. if (! same) {
  1480. *fatal = TRUE_;
  1481. goto L120;
  1482. }
  1483. if (! null) {
  1484. /* Check the result. */
  1485. smvch_("N", &n, &n, &alpha, &a[a_offset],
  1486. nmax, &x[1], &incx, &beta, &y[1],
  1487. &incy, &yt[1], &g[1], &yy[1], eps,
  1488. &err, fatal, nout, &c_true, (
  1489. ftnlen)1);
  1490. errmax = dmax(errmax,err);
  1491. /* If got really bad answer, report and */
  1492. /* return. */
  1493. if (*fatal) {
  1494. goto L120;
  1495. }
  1496. } else {
  1497. /* Avoid repeating tests with N.le.0 */
  1498. goto L110;
  1499. }
  1500. /* L50: */
  1501. }
  1502. /* L60: */
  1503. }
  1504. /* L70: */
  1505. }
  1506. /* L80: */
  1507. }
  1508. /* L90: */
  1509. }
  1510. L100:
  1511. ;
  1512. }
  1513. L110:
  1514. ;
  1515. }
  1516. /* Report result. */
  1517. if (errmax < *thresh) {
  1518. if (*iorder == 0) {
  1519. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1520. }
  1521. if (*iorder == 1) {
  1522. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1523. }
  1524. } else {
  1525. if (*iorder == 0) {
  1526. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1527. }
  1528. if (*iorder == 1) {
  1529. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1530. }
  1531. }
  1532. goto L130;
  1533. L120:
  1534. printf("******* %12s FAILED ON CALL NUMBER:",sname);
  1535. if (full) {
  1536. printf("%6d: %12s (%14s, %3d, %4.1f, A %3d, X %2d, %4.1f Y %2d )..\n",
  1537. nc,sname,cuplo,n,alpha,lda,incx,beta,incy);
  1538. } else if (banded) {
  1539. printf("%6d: %12s (%14s %3d, %3d, %4.1f, A %3d, X %2d, %4.1f, Y, %2d ).\n",
  1540. nc,sname,cuplo,n,k,alpha,lda,incx,beta,incy);
  1541. } else if (packed) {
  1542. printf("%6d: %12s ( %14s %3d, %4.1f, AP X %2d, %4.1f, Y, %2d ).\n",
  1543. nc,sname,cuplo,n,alpha,incx,beta,incy);
  1544. }
  1545. L130:
  1546. return 0;
  1547. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  1548. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  1549. /* $ ' - SUSPECT *******' ) */
  1550. /* End of SCHK2. */
  1551. } /* schk2_ */
  1552. /* Subroutine */ int schk3_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nkb, integer* kb, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* xt, real* g, real* z__, integer* iorder, ftnlen sname_len)
  1553. {
  1554. /* Initialized data */
  1555. static char ichu[2+1] = "UL";
  1556. static char icht[3+1] = "NTC";
  1557. static char ichd[2+1] = "UN";
  1558. /* System generated locals */
  1559. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
  1560. /* Local variables */
  1561. static char diag[1];
  1562. static integer ldas;
  1563. static logical same;
  1564. static integer incx;
  1565. static logical full, null;
  1566. static char uplo[1], cdiag[14];
  1567. static integer i__, k, n;
  1568. static char diags[1];
  1569. static logical isame[13];
  1570. extern /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  1571. static integer nargs;
  1572. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  1573. static logical reset;
  1574. static char cuplo[14];
  1575. static integer incxs;
  1576. static char trans[1], uplos[1];
  1577. static logical banded;
  1578. static integer nc, ik, in;
  1579. static logical packed;
  1580. static integer nk, ks, ix, ns, lx;
  1581. static char ctrans[14];
  1582. static real errmax;
  1583. extern logical lseres_(char*, char*, integer*, integer*, real*, real*, integer*, ftnlen, ftnlen);
  1584. extern /* Subroutine */ void cstbmv_(integer*, char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1585. static real transl;
  1586. extern /* Subroutine */ void cstbsv_(integer*, char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1587. static char transs[1];
  1588. extern /* Subroutine */ void cstpmv_(integer*, char*, char*, char*, integer*, real*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1589. extern /* Subroutine */ void cstrmv_(integer*, char*, char*, char*, integer*, real*, integer*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1590. extern /* Subroutine */ void cstpsv_(integer*, char*, char*, char*, integer*, real*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1591. extern /* Subroutine */ void cstrsv_(integer*, char*, char*, char*, integer*, real*, integer*, real*, integer*, ftnlen, ftnlen, ftnlen);
  1592. static integer laa, icd, lda, ict, icu;
  1593. extern logical lse_(real*, real*, integer*);
  1594. static real err;
  1595. /* Tests STRMV, STBMV, STPMV, STRSV, STBSV and STPSV. */
  1596. /* Auxiliary routine for test program for Level 2 Blas. */
  1597. /* -- Written on 10-August-1987. */
  1598. /* Richard Hanson, Sandia National Labs. */
  1599. /* Jeremy Du Croz, NAG Central Office. */
  1600. /* .. Parameters .. */
  1601. /* .. Scalar Arguments .. */
  1602. /* .. Array Arguments .. */
  1603. /* .. Local Scalars .. */
  1604. /* .. Local Arrays .. */
  1605. /* .. External Functions .. */
  1606. /* .. External Subroutines .. */
  1607. /* .. Intrinsic Functions .. */
  1608. /* .. Scalars in Common .. */
  1609. /* .. Common blocks .. */
  1610. /* .. Data statements .. */
  1611. /* Parameter adjustments */
  1612. --idim;
  1613. --kb;
  1614. --inc;
  1615. --z__;
  1616. --g;
  1617. --xt;
  1618. --x;
  1619. --as;
  1620. --aa;
  1621. a_dim1 = *nmax;
  1622. a_offset = 1 + a_dim1 * 1;
  1623. a -= a_offset;
  1624. --xs;
  1625. --xx;
  1626. /* Function Body */
  1627. /* .. Executable Statements .. */
  1628. full = *(unsigned char *)&sname[8] == 'r';
  1629. banded = *(unsigned char *)&sname[8] == 'b';
  1630. packed = *(unsigned char *)&sname[8] == 'p';
  1631. /* Define the number of arguments. */
  1632. if (full) {
  1633. nargs = 8;
  1634. } else if (banded) {
  1635. nargs = 9;
  1636. } else if (packed) {
  1637. nargs = 7;
  1638. }
  1639. nc = 0;
  1640. reset = TRUE_;
  1641. errmax = (float)0.;
  1642. /* Set up zero vector for SMVCH. */
  1643. i__1 = *nmax;
  1644. for (i__ = 1; i__ <= i__1; ++i__) {
  1645. z__[i__] = (float)0.;
  1646. /* L10: */
  1647. }
  1648. i__1 = *nidim;
  1649. for (in = 1; in <= i__1; ++in) {
  1650. n = idim[in];
  1651. if (banded) {
  1652. nk = *nkb;
  1653. } else {
  1654. nk = 1;
  1655. }
  1656. i__2 = nk;
  1657. for (ik = 1; ik <= i__2; ++ik) {
  1658. if (banded) {
  1659. k = kb[ik];
  1660. } else {
  1661. k = n - 1;
  1662. }
  1663. /* Set LDA to 1 more than minimum value if room. */
  1664. if (banded) {
  1665. lda = k + 1;
  1666. } else {
  1667. lda = n;
  1668. }
  1669. if (lda < *nmax) {
  1670. ++lda;
  1671. }
  1672. /* Skip tests if not enough room. */
  1673. if (lda > *nmax) {
  1674. goto L100;
  1675. }
  1676. if (packed) {
  1677. laa = n * (n + 1) / 2;
  1678. } else {
  1679. laa = lda * n;
  1680. }
  1681. null = n <= 0;
  1682. for (icu = 1; icu <= 2; ++icu) {
  1683. *(unsigned char *)uplo = *(unsigned char *)&ichu[icu - 1];
  1684. if (*(unsigned char *)uplo == 'U') {
  1685. s_copy(cuplo, " CblasUpper", (ftnlen)14, (ftnlen)14);
  1686. } else {
  1687. s_copy(cuplo, " CblasLower", (ftnlen)14, (ftnlen)14);
  1688. }
  1689. for (ict = 1; ict <= 3; ++ict) {
  1690. *(unsigned char *)trans = *(unsigned char *)&icht[ict - 1]
  1691. ;
  1692. if (*(unsigned char *)trans == 'N') {
  1693. s_copy(ctrans, " CblasNoTrans", (ftnlen)14, (ftnlen)
  1694. 14);
  1695. } else if (*(unsigned char *)trans == 'T') {
  1696. s_copy(ctrans, " CblasTrans", (ftnlen)14, (ftnlen)
  1697. 14);
  1698. } else {
  1699. s_copy(ctrans, "CblasConjTrans", (ftnlen)14, (ftnlen)
  1700. 14);
  1701. }
  1702. for (icd = 1; icd <= 2; ++icd) {
  1703. *(unsigned char *)diag = *(unsigned char *)&ichd[icd
  1704. - 1];
  1705. if (*(unsigned char *)diag == 'N') {
  1706. s_copy(cdiag, " CblasNonUnit", (ftnlen)14, (
  1707. ftnlen)14);
  1708. } else {
  1709. s_copy(cdiag, " CblasUnit", (ftnlen)14, (
  1710. ftnlen)14);
  1711. }
  1712. /* Generate the matrix A. */
  1713. transl = (float)0.;
  1714. smake_(sname + 7, uplo, diag, &n, &n, &a[a_offset],
  1715. nmax, &aa[1], &lda, &k, &k, &reset, &transl, (
  1716. ftnlen)2, (ftnlen)1, (ftnlen)1);
  1717. i__3 = *ninc;
  1718. for (ix = 1; ix <= i__3; ++ix) {
  1719. incx = inc[ix];
  1720. lx = abs(incx) * n;
  1721. /* Generate the vector X. */
  1722. transl = (float).5;
  1723. i__4 = abs(incx);
  1724. i__5 = n - 1;
  1725. smake_("ge", " ", " ", &c__1, &n, &x[1], &c__1, &
  1726. xx[1], &i__4, &c__0, &i__5, &reset, &
  1727. transl, (ftnlen)2, (ftnlen)1, (ftnlen)1);
  1728. if (n > 1) {
  1729. x[n / 2] = (float)0.;
  1730. xx[abs(incx) * (n / 2 - 1) + 1] = (float)0.;
  1731. }
  1732. ++nc;
  1733. /* Save every datum before calling the subroutine. */
  1734. *(unsigned char *)uplos = *(unsigned char *)uplo;
  1735. *(unsigned char *)transs = *(unsigned char *)
  1736. trans;
  1737. *(unsigned char *)diags = *(unsigned char *)diag;
  1738. ns = n;
  1739. ks = k;
  1740. i__4 = laa;
  1741. for (i__ = 1; i__ <= i__4; ++i__) {
  1742. as[i__] = aa[i__];
  1743. /* L20: */
  1744. }
  1745. ldas = lda;
  1746. i__4 = lx;
  1747. for (i__ = 1; i__ <= i__4; ++i__) {
  1748. xs[i__] = xx[i__];
  1749. /* L30: */
  1750. }
  1751. incxs = incx;
  1752. /* Call the subroutine. */
  1753. if (s_cmp(sname + 9, "mv", (ftnlen)2, (ftnlen)2)
  1754. == 0) {
  1755. if (full) {
  1756. if (*trace) {
  1757. /*
  1758. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d ,A, %3d, X, %2d ).\n",
  1759. nc,sname,cuplo,ctrans,cdiag,n,lda,incx);
  1760. */
  1761. }
  1762. if (*rewi) {
  1763. /* al__1.aerr = 0;
  1764. al__1.aunit = *ntra;
  1765. f_rew(&al__1);*/
  1766. }
  1767. cstrmv_(iorder, uplo, trans, diag, &n, &
  1768. aa[1], &lda, &xx[1], &incx, (
  1769. ftnlen)1, (ftnlen)1, (ftnlen)1);
  1770. } else if (banded) {
  1771. if (*trace) {
  1772. /*
  1773. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d, %3d ,A, %3d, X, %2d ).\n",
  1774. nc,sname,cuplo,ctrans,cdiag,n,k,lda,incx);
  1775. */
  1776. }
  1777. if (*rewi) {
  1778. /* al__1.aerr = 0;
  1779. al__1.aunit = *ntra;
  1780. f_rew(&al__1);*/
  1781. }
  1782. cstbmv_(iorder, uplo, trans, diag, &n, &k,
  1783. &aa[1], &lda, &xx[1], &incx, (
  1784. ftnlen)1, (ftnlen)1, (ftnlen)1);
  1785. } else if (packed) {
  1786. if (*trace) {
  1787. /*
  1788. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d ,AP, X, %2d ).\n",
  1789. nc,sname,cuplo,ctrans,cdiag,n,incx);
  1790. */
  1791. }
  1792. if (*rewi) {
  1793. /* al__1.aerr = 0;
  1794. al__1.aunit = *ntra;
  1795. f_rew(&al__1);*/
  1796. }
  1797. cstpmv_(iorder, uplo, trans, diag, &n, &
  1798. aa[1], &xx[1], &incx, (ftnlen)1, (
  1799. ftnlen)1, (ftnlen)1);
  1800. }
  1801. } else if (s_cmp(sname + 9, "sv", (ftnlen)2, (
  1802. ftnlen)2) == 0) {
  1803. if (full) {
  1804. if (*trace) {
  1805. /*
  1806. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d ,A, %3d, X, %2d ).\n",
  1807. nc,sname,cuplo,ctrans,cdiag,n,lda,incx);
  1808. */
  1809. }
  1810. if (*rewi) {
  1811. /* al__1.aerr = 0;
  1812. al__1.aunit = *ntra;
  1813. f_rew(&al__1);*/
  1814. }
  1815. cstrsv_(iorder, uplo, trans, diag, &n, &
  1816. aa[1], &lda, &xx[1], &incx, (
  1817. ftnlen)1, (ftnlen)1, (ftnlen)1);
  1818. } else if (banded) {
  1819. if (*trace) {
  1820. /*
  1821. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d, %3d ,A, %3d, X, %2d ).\n",
  1822. nc,sname,cuplo,ctrans,cdiag,n,k,lda,incx);
  1823. */
  1824. }
  1825. if (*rewi) {
  1826. /* al__1.aerr = 0;
  1827. al__1.aunit = *ntra;
  1828. f_rew(&al__1);*/
  1829. }
  1830. cstbsv_(iorder, uplo, trans, diag, &n, &k,
  1831. &aa[1], &lda, &xx[1], &incx, (
  1832. ftnlen)1, (ftnlen)1, (ftnlen)1);
  1833. } else if (packed) {
  1834. if (*trace) {
  1835. /*
  1836. sprintf(ntra,"%6d: %12s (%14s,%14s,%14s %3d ,AP, X, %2d ).\n",
  1837. nc,sname,cuplo,ctrans,cdiag,n,incx);
  1838. */
  1839. }
  1840. if (*rewi) {
  1841. /* al__1.aerr = 0;
  1842. al__1.aunit = *ntra;
  1843. f_rew(&al__1);*/
  1844. }
  1845. cstpsv_(iorder, uplo, trans, diag, &n, &
  1846. aa[1], &xx[1], &incx, (ftnlen)1, (
  1847. ftnlen)1, (ftnlen)1);
  1848. }
  1849. }
  1850. /* Check if error-exit was taken incorrectly. */
  1851. if (! infoc_1.ok) {
  1852. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  1853. *fatal = TRUE_;
  1854. goto L120;
  1855. }
  1856. /* See what data changed inside subroutines. */
  1857. isame[0] = *(unsigned char *)uplo == *(unsigned
  1858. char *)uplos;
  1859. isame[1] = *(unsigned char *)trans == *(unsigned
  1860. char *)transs;
  1861. isame[2] = *(unsigned char *)diag == *(unsigned
  1862. char *)diags;
  1863. isame[3] = ns == n;
  1864. if (full) {
  1865. isame[4] = lse_(&as[1], &aa[1], &laa);
  1866. isame[5] = ldas == lda;
  1867. if (null) {
  1868. isame[6] = lse_(&xs[1], &xx[1], &lx);
  1869. } else {
  1870. i__4 = abs(incx);
  1871. isame[6] = lseres_("ge", " ", &c__1, &n, &
  1872. xs[1], &xx[1], &i__4, (ftnlen)2, (
  1873. ftnlen)1);
  1874. }
  1875. isame[7] = incxs == incx;
  1876. } else if (banded) {
  1877. isame[4] = ks == k;
  1878. isame[5] = lse_(&as[1], &aa[1], &laa);
  1879. isame[6] = ldas == lda;
  1880. if (null) {
  1881. isame[7] = lse_(&xs[1], &xx[1], &lx);
  1882. } else {
  1883. i__4 = abs(incx);
  1884. isame[7] = lseres_("ge", " ", &c__1, &n, &
  1885. xs[1], &xx[1], &i__4, (ftnlen)2, (
  1886. ftnlen)1);
  1887. }
  1888. isame[8] = incxs == incx;
  1889. } else if (packed) {
  1890. isame[4] = lse_(&as[1], &aa[1], &laa);
  1891. if (null) {
  1892. isame[5] = lse_(&xs[1], &xx[1], &lx);
  1893. } else {
  1894. i__4 = abs(incx);
  1895. isame[5] = lseres_("ge", " ", &c__1, &n, &
  1896. xs[1], &xx[1], &i__4, (ftnlen)2, (
  1897. ftnlen)1);
  1898. }
  1899. isame[6] = incxs == incx;
  1900. }
  1901. /* If data was incorrectly changed, report and */
  1902. /* return. */
  1903. same = TRUE_;
  1904. i__4 = nargs;
  1905. for (i__ = 1; i__ <= i__4; ++i__) {
  1906. same = same && isame[i__ - 1];
  1907. if (! isame[i__ - 1]) {
  1908. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  1909. }
  1910. /* L40: */
  1911. }
  1912. if (! same) {
  1913. *fatal = TRUE_;
  1914. goto L120;
  1915. }
  1916. if (! null) {
  1917. if (s_cmp(sname + 9, "mv", (ftnlen)2, (ftnlen)
  1918. 2) == 0) {
  1919. /* Check the result. */
  1920. smvch_(trans, &n, &n, &c_b123, &a[
  1921. a_offset], nmax, &x[1], &incx, &
  1922. c_b135, &z__[1], &incx, &xt[1], &
  1923. g[1], &xx[1], eps, &err, fatal,
  1924. nout, &c_true, (ftnlen)1);
  1925. } else if (s_cmp(sname + 9, "sv", (ftnlen)2, (
  1926. ftnlen)2) == 0) {
  1927. /* Compute approximation to original vector. */
  1928. i__4 = n;
  1929. for (i__ = 1; i__ <= i__4; ++i__) {
  1930. z__[i__] = xx[(i__ - 1) * abs(incx) +
  1931. 1];
  1932. xx[(i__ - 1) * abs(incx) + 1] = x[i__]
  1933. ;
  1934. /* L50: */
  1935. }
  1936. smvch_(trans, &n, &n, &c_b123, &a[
  1937. a_offset], nmax, &z__[1], &incx, &
  1938. c_b135, &x[1], &incx, &xt[1], &g[
  1939. 1], &xx[1], eps, &err, fatal,
  1940. nout, &c_false, (ftnlen)1);
  1941. }
  1942. errmax = dmax(errmax,err);
  1943. /* If got really bad answer, report and return. */
  1944. if (*fatal) {
  1945. goto L120;
  1946. }
  1947. } else {
  1948. /* Avoid repeating tests with N.le.0. */
  1949. goto L110;
  1950. }
  1951. /* L60: */
  1952. }
  1953. /* L70: */
  1954. }
  1955. /* L80: */
  1956. }
  1957. /* L90: */
  1958. }
  1959. L100:
  1960. ;
  1961. }
  1962. L110:
  1963. ;
  1964. }
  1965. /* Report result. */
  1966. if (errmax < *thresh) {
  1967. if (*iorder == 0) {
  1968. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1969. }
  1970. if (*iorder == 1) {
  1971. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  1972. }
  1973. } else {
  1974. if (*iorder == 0) {
  1975. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1976. }
  1977. if (*iorder == 1) {
  1978. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  1979. }
  1980. }
  1981. goto L130;
  1982. L120:
  1983. printf("******* %12s FAILED ON CALL NUMBER:",sname);
  1984. if (full) {
  1985. printf("%6d: %12s (%14s,%14s,%14s %3d ,A, %3d, X, %2d ).\n",
  1986. nc,sname,cuplo,ctrans,cdiag,n,lda,incx);
  1987. } else if (banded) {
  1988. printf("%6d: %12s (%14s,%14s,%14s %3d, %3d ,A, %3d, X, %2d ).\n",
  1989. nc,sname,cuplo,ctrans,cdiag,n,k,lda,incx);
  1990. } else if (packed) {
  1991. printf("%6d: %12s (%14s,%14s,%14s %3d ,AP, X, %2d ).\n",
  1992. nc,sname,cuplo,ctrans,cdiag,n,incx);
  1993. }
  1994. L130:
  1995. return 0;
  1996. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  1997. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  1998. /* $ ' - SUSPECT *******' ) */
  1999. /* End of SCHK3. */
  2000. } /* schk3_ */
  2001. /* Subroutine */ int schk4_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nalf, real* alf, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, real* z__, integer* iorder, ftnlen sname_len)
  2002. {
  2003. /* System generated locals */
  2004. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6;
  2005. /* Local variables */
  2006. static integer ldas;
  2007. static logical same;
  2008. static integer incx, incy;
  2009. static logical null;
  2010. static integer i__, j, m, n;
  2011. static real alpha, w[1];
  2012. static logical isame[13];
  2013. /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  2014. extern /* Subroutine */ void csger_(integer*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, integer*);
  2015. static integer nargs;
  2016. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  2017. static logical reset;
  2018. static integer incxs, incys, ia, nc, nd, im, in, ms, ix, iy, ns, lx, ly;
  2019. static real errmax;
  2020. extern logical lseres_(char* , char*, integer*, integer*, real*, real*, integer*, ftnlen, ftnlen);
  2021. static real transl;
  2022. static integer laa, lda;
  2023. static real als;
  2024. extern logical lse_(real*, real*, integer*);
  2025. static real err;
  2026. /* Tests SGER. */
  2027. /* Auxiliary routine for test program for Level 2 Blas. */
  2028. /* -- Written on 10-August-1987. */
  2029. /* Richard Hanson, Sandia National Labs. */
  2030. /* Jeremy Du Croz, NAG Central Office. */
  2031. /* .. Parameters .. */
  2032. /* .. Scalar Arguments .. */
  2033. /* .. Array Arguments .. */
  2034. /* .. Local Scalars .. */
  2035. /* .. Local Arrays .. */
  2036. /* .. External Functions .. */
  2037. /* .. External Subroutines .. */
  2038. /* .. Intrinsic Functions .. */
  2039. /* .. Scalars in Common .. */
  2040. /* .. Common blocks .. */
  2041. /* .. Executable Statements .. */
  2042. /* Define the number of arguments. */
  2043. /* Parameter adjustments */
  2044. --idim;
  2045. --alf;
  2046. --inc;
  2047. --z__;
  2048. --g;
  2049. --yt;
  2050. --y;
  2051. --x;
  2052. --as;
  2053. --aa;
  2054. a_dim1 = *nmax;
  2055. a_offset = 1 + a_dim1 * 1;
  2056. a -= a_offset;
  2057. --ys;
  2058. --yy;
  2059. --xs;
  2060. --xx;
  2061. /* Function Body */
  2062. nargs = 9;
  2063. nc = 0;
  2064. reset = TRUE_;
  2065. errmax = (float)0.;
  2066. i__1 = *nidim;
  2067. for (in = 1; in <= i__1; ++in) {
  2068. n = idim[in];
  2069. nd = n / 2 + 1;
  2070. for (im = 1; im <= 2; ++im) {
  2071. if (im == 1) {
  2072. /* Computing MAX */
  2073. i__2 = n - nd;
  2074. m = f2cmax(i__2,0);
  2075. }
  2076. if (im == 2) {
  2077. /* Computing MIN */
  2078. i__2 = n + nd;
  2079. m = f2cmin(i__2,*nmax);
  2080. }
  2081. /* Set LDA to 1 more than minimum value if room. */
  2082. lda = m;
  2083. if (lda < *nmax) {
  2084. ++lda;
  2085. }
  2086. /* Skip tests if not enough room. */
  2087. if (lda > *nmax) {
  2088. goto L110;
  2089. }
  2090. laa = lda * n;
  2091. null = n <= 0 || m <= 0;
  2092. i__2 = *ninc;
  2093. for (ix = 1; ix <= i__2; ++ix) {
  2094. incx = inc[ix];
  2095. lx = abs(incx) * m;
  2096. /* Generate the vector X. */
  2097. transl = (float).5;
  2098. i__3 = abs(incx);
  2099. i__4 = m - 1;
  2100. smake_("ge", " ", " ", &c__1, &m, &x[1], &c__1, &xx[1], &i__3,
  2101. &c__0, &i__4, &reset, &transl, (ftnlen)2, (ftnlen)1,
  2102. (ftnlen)1);
  2103. if (m > 1) {
  2104. x[m / 2] = (float)0.;
  2105. xx[abs(incx) * (m / 2 - 1) + 1] = (float)0.;
  2106. }
  2107. i__3 = *ninc;
  2108. for (iy = 1; iy <= i__3; ++iy) {
  2109. incy = inc[iy];
  2110. ly = abs(incy) * n;
  2111. /* Generate the vector Y. */
  2112. transl = (float)0.;
  2113. i__4 = abs(incy);
  2114. i__5 = n - 1;
  2115. smake_("ge", " ", " ", &c__1, &n, &y[1], &c__1, &yy[1], &
  2116. i__4, &c__0, &i__5, &reset, &transl, (ftnlen)2, (
  2117. ftnlen)1, (ftnlen)1);
  2118. if (n > 1) {
  2119. y[n / 2] = (float)0.;
  2120. yy[abs(incy) * (n / 2 - 1) + 1] = (float)0.;
  2121. }
  2122. i__4 = *nalf;
  2123. for (ia = 1; ia <= i__4; ++ia) {
  2124. alpha = alf[ia];
  2125. /* Generate the matrix A. */
  2126. transl = (float)0.;
  2127. i__5 = m - 1;
  2128. i__6 = n - 1;
  2129. smake_(sname + 7, " ", " ", &m, &n, &a[a_offset],
  2130. nmax, &aa[1], &lda, &i__5, &i__6, &reset, &
  2131. transl, (ftnlen)2, (ftnlen)1, (ftnlen)1);
  2132. ++nc;
  2133. /* Save every datum before calling the subroutine. */
  2134. ms = m;
  2135. ns = n;
  2136. als = alpha;
  2137. i__5 = laa;
  2138. for (i__ = 1; i__ <= i__5; ++i__) {
  2139. as[i__] = aa[i__];
  2140. /* L10: */
  2141. }
  2142. ldas = lda;
  2143. i__5 = lx;
  2144. for (i__ = 1; i__ <= i__5; ++i__) {
  2145. xs[i__] = xx[i__];
  2146. /* L20: */
  2147. }
  2148. incxs = incx;
  2149. i__5 = ly;
  2150. for (i__ = 1; i__ <= i__5; ++i__) {
  2151. ys[i__] = yy[i__];
  2152. /* L30: */
  2153. }
  2154. incys = incy;
  2155. /* Call the subroutine. */
  2156. if (*trace) {
  2157. /*
  2158. sprintf(ntra,"%6d: %12s (%3d, %3d) %4.1f, X, %2d, Y, %2d, A, %3d).\n",
  2159. nc,sname,m,n,alpha,incx,incy,lda);
  2160. */
  2161. }
  2162. if (*rewi) {
  2163. /* al__1.aerr = 0;
  2164. al__1.aunit = *ntra;
  2165. f_rew(&al__1);*/
  2166. }
  2167. csger_(iorder, &m, &n, &alpha, &xx[1], &incx, &yy[1],
  2168. &incy, &aa[1], &lda);
  2169. /* Check if error-exit was taken incorrectly. */
  2170. if (! infoc_1.ok) {
  2171. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  2172. *fatal = TRUE_;
  2173. goto L140;
  2174. }
  2175. /* See what data changed inside subroutine. */
  2176. isame[0] = ms == m;
  2177. isame[1] = ns == n;
  2178. isame[2] = als == alpha;
  2179. isame[3] = lse_(&xs[1], &xx[1], &lx);
  2180. isame[4] = incxs == incx;
  2181. isame[5] = lse_(&ys[1], &yy[1], &ly);
  2182. isame[6] = incys == incy;
  2183. if (null) {
  2184. isame[7] = lse_(&as[1], &aa[1], &laa);
  2185. } else {
  2186. isame[7] = lseres_("ge", " ", &m, &n, &as[1], &aa[
  2187. 1], &lda, (ftnlen)2, (ftnlen)1);
  2188. }
  2189. isame[8] = ldas == lda;
  2190. /* If data was incorrectly changed, report and return. */
  2191. same = TRUE_;
  2192. i__5 = nargs;
  2193. for (i__ = 1; i__ <= i__5; ++i__) {
  2194. same = same && isame[i__ - 1];
  2195. if (! isame[i__ - 1]) {
  2196. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  2197. }
  2198. /* L40: */
  2199. }
  2200. if (! same) {
  2201. *fatal = TRUE_;
  2202. goto L140;
  2203. }
  2204. if (! null) {
  2205. /* Check the result column by column. */
  2206. if (incx > 0) {
  2207. i__5 = m;
  2208. for (i__ = 1; i__ <= i__5; ++i__) {
  2209. z__[i__] = x[i__];
  2210. /* L50: */
  2211. }
  2212. } else {
  2213. i__5 = m;
  2214. for (i__ = 1; i__ <= i__5; ++i__) {
  2215. z__[i__] = x[m - i__ + 1];
  2216. /* L60: */
  2217. }
  2218. }
  2219. i__5 = n;
  2220. for (j = 1; j <= i__5; ++j) {
  2221. if (incy > 0) {
  2222. w[0] = y[j];
  2223. } else {
  2224. w[0] = y[n - j + 1];
  2225. }
  2226. smvch_("N", &m, &c__1, &alpha, &z__[1], nmax,
  2227. w, &c__1, &c_b123, &a[j * a_dim1 + 1],
  2228. &c__1, &yt[1], &g[1], &aa[(j - 1) *
  2229. lda + 1], eps, &err, fatal, nout, &
  2230. c_true, (ftnlen)1);
  2231. errmax = dmax(errmax,err);
  2232. /* If got really bad answer, report and return. */
  2233. if (*fatal) {
  2234. goto L130;
  2235. }
  2236. /* L70: */
  2237. }
  2238. } else {
  2239. /* Avoid repeating tests with M.le.0 or N.le.0. */
  2240. goto L110;
  2241. }
  2242. /* L80: */
  2243. }
  2244. /* L90: */
  2245. }
  2246. /* L100: */
  2247. }
  2248. L110:
  2249. ;
  2250. }
  2251. /* L120: */
  2252. }
  2253. /* Report result. */
  2254. if (errmax < *thresh) {
  2255. if (*iorder == 0) {
  2256. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2257. }
  2258. if (*iorder == 1) {
  2259. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2260. }
  2261. } else {
  2262. if (*iorder == 0) {
  2263. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2264. }
  2265. if (*iorder == 1) {
  2266. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2267. }
  2268. }
  2269. goto L150;
  2270. L130:
  2271. printf(" THESE ARE THE RESULTS FOR COLUMN %3d:\n",j);
  2272. L140:
  2273. printf("******* %12s FAILED ON CALL NUMBER:\n",sname);
  2274. printf("%6d: %12s (%3d, %3d) %4.1f, X, %2d, Y, %2d, A, %3d).\n",
  2275. nc,sname,m,n,alpha,incx,incy,lda);
  2276. L150:
  2277. return 0;
  2278. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  2279. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  2280. /* $ ' - SUSPECT *******' ) */
  2281. /* End of SCHK4. */
  2282. } /* schk4_ */
  2283. /* Subroutine */ int schk5_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nalf, real* alf, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, real* z__, integer* iorder, ftnlen sname_len)
  2284. {
  2285. /* Initialized data */
  2286. static char ich[2+1] = "UL";
  2287. /* System generated locals */
  2288. integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
  2289. /* Builtin functions */
  2290. /* Local variables */
  2291. static integer ldas;
  2292. static logical same;
  2293. static integer incx;
  2294. static logical full, null;
  2295. static char uplo[1];
  2296. static integer i__, j, n;
  2297. static real alpha, w[1];
  2298. static logical isame[13];
  2299. extern /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  2300. static integer nargs;
  2301. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  2302. static logical reset;
  2303. static char cuplo[14];
  2304. static integer incxs;
  2305. extern /* Subroutine */ void csspr_(integer*, char*, integer*, real*, real*, integer*, real*, ftnlen);
  2306. static logical upper;
  2307. static char uplos[1];
  2308. extern /* Subroutine */ void cssyr_(integer*, char*, integer*, real*, real*, integer*, real*, integer*, ftnlen);
  2309. static integer ia, ja, ic, nc, jj, lj, in;
  2310. static logical packed;
  2311. static integer ix, ns, lx;
  2312. static real errmax;
  2313. extern logical lseres_(char*, char*, integer*, integer*, real*, real*, integer*, ftnlen, ftnlen);
  2314. static real transl;
  2315. static integer laa, lda;
  2316. static real als;
  2317. extern logical lse_(real*, real*, integer*);
  2318. static real err;
  2319. /* Tests SSYR and SSPR. */
  2320. /* Auxiliary routine for test program for Level 2 Blas. */
  2321. /* -- Written on 10-August-1987. */
  2322. /* Richard Hanson, Sandia National Labs. */
  2323. /* Jeremy Du Croz, NAG Central Office. */
  2324. /* .. Parameters .. */
  2325. /* .. Scalar Arguments .. */
  2326. /* .. Array Arguments .. */
  2327. /* .. Local Scalars .. */
  2328. /* .. Local Arrays .. */
  2329. /* .. External Functions .. */
  2330. /* .. External Subroutines .. */
  2331. /* .. Intrinsic Functions .. */
  2332. /* .. Scalars in Common .. */
  2333. /* .. Common blocks .. */
  2334. /* .. Data statements .. */
  2335. /* Parameter adjustments */
  2336. --idim;
  2337. --alf;
  2338. --inc;
  2339. --z__;
  2340. --g;
  2341. --yt;
  2342. --y;
  2343. --x;
  2344. --as;
  2345. --aa;
  2346. a_dim1 = *nmax;
  2347. a_offset = 1 + a_dim1 * 1;
  2348. a -= a_offset;
  2349. --ys;
  2350. --yy;
  2351. --xs;
  2352. --xx;
  2353. /* Function Body */
  2354. /* .. Executable Statements .. */
  2355. full = *(unsigned char *)&sname[8] == 'y';
  2356. packed = *(unsigned char *)&sname[8] == 'p';
  2357. /* Define the number of arguments. */
  2358. if (full) {
  2359. nargs = 7;
  2360. } else if (packed) {
  2361. nargs = 6;
  2362. }
  2363. nc = 0;
  2364. reset = TRUE_;
  2365. errmax = (float)0.;
  2366. i__1 = *nidim;
  2367. for (in = 1; in <= i__1; ++in) {
  2368. n = idim[in];
  2369. /* Set LDA to 1 more than minimum value if room. */
  2370. lda = n;
  2371. if (lda < *nmax) {
  2372. ++lda;
  2373. }
  2374. /* Skip tests if not enough room. */
  2375. if (lda > *nmax) {
  2376. goto L100;
  2377. }
  2378. if (packed) {
  2379. laa = n * (n + 1) / 2;
  2380. } else {
  2381. laa = lda * n;
  2382. }
  2383. for (ic = 1; ic <= 2; ++ic) {
  2384. *(unsigned char *)uplo = *(unsigned char *)&ich[ic - 1];
  2385. if (*(unsigned char *)uplo == 'U') {
  2386. s_copy(cuplo, " CblasUpper", (ftnlen)14, (ftnlen)14);
  2387. } else {
  2388. s_copy(cuplo, " CblasLower", (ftnlen)14, (ftnlen)14);
  2389. }
  2390. upper = *(unsigned char *)uplo == 'U';
  2391. i__2 = *ninc;
  2392. for (ix = 1; ix <= i__2; ++ix) {
  2393. incx = inc[ix];
  2394. lx = abs(incx) * n;
  2395. /* Generate the vector X. */
  2396. transl = (float).5;
  2397. i__3 = abs(incx);
  2398. i__4 = n - 1;
  2399. smake_("ge", " ", " ", &c__1, &n, &x[1], &c__1, &xx[1], &i__3,
  2400. &c__0, &i__4, &reset, &transl, (ftnlen)2, (ftnlen)1,
  2401. (ftnlen)1);
  2402. if (n > 1) {
  2403. x[n / 2] = (float)0.;
  2404. xx[abs(incx) * (n / 2 - 1) + 1] = (float)0.;
  2405. }
  2406. i__3 = *nalf;
  2407. for (ia = 1; ia <= i__3; ++ia) {
  2408. alpha = alf[ia];
  2409. null = n <= 0 || alpha == (float)0.;
  2410. /* Generate the matrix A. */
  2411. transl = (float)0.;
  2412. i__4 = n - 1;
  2413. i__5 = n - 1;
  2414. smake_(sname + 7, uplo, " ", &n, &n, &a[a_offset], nmax, &
  2415. aa[1], &lda, &i__4, &i__5, &reset, &transl, (
  2416. ftnlen)2, (ftnlen)1, (ftnlen)1);
  2417. ++nc;
  2418. /* Save every datum before calling the subroutine. */
  2419. *(unsigned char *)uplos = *(unsigned char *)uplo;
  2420. ns = n;
  2421. als = alpha;
  2422. i__4 = laa;
  2423. for (i__ = 1; i__ <= i__4; ++i__) {
  2424. as[i__] = aa[i__];
  2425. /* L10: */
  2426. }
  2427. ldas = lda;
  2428. i__4 = lx;
  2429. for (i__ = 1; i__ <= i__4; ++i__) {
  2430. xs[i__] = xx[i__];
  2431. /* L20: */
  2432. }
  2433. incxs = incx;
  2434. /* Call the subroutine. */
  2435. if (full) {
  2436. if (*trace) {
  2437. /*
  2438. sprintf(ntra,"%6d: %12s (%14s, %3d, %4.1f, X, %2d, A, %3d).\n",
  2439. nc,sname,cuplo,alpha,incx,lda);
  2440. */
  2441. }
  2442. if (*rewi) {
  2443. /* al__1.aerr = 0;
  2444. al__1.aunit = *ntra;
  2445. f_rew(&al__1);*/
  2446. }
  2447. cssyr_(iorder, uplo, &n, &alpha, &xx[1], &incx, &aa[1]
  2448. , &lda, (ftnlen)1);
  2449. } else if (packed) {
  2450. if (*trace) {
  2451. /*
  2452. sprintf(ntra,"%6d: %12s (%14s, %3d, %4.1f, X, %2d, AP).\n",
  2453. nc,sname,cuplo,n,alpha,incx);
  2454. */
  2455. }
  2456. if (*rewi) {
  2457. /* al__1.aerr = 0;
  2458. al__1.aunit = *ntra;
  2459. f_rew(&al__1);*/
  2460. }
  2461. csspr_(iorder, uplo, &n, &alpha, &xx[1], &incx, &aa[1]
  2462. , (ftnlen)1);
  2463. }
  2464. /* Check if error-exit was taken incorrectly. */
  2465. if (! infoc_1.ok) {
  2466. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  2467. *fatal = TRUE_;
  2468. goto L120;
  2469. }
  2470. /* See what data changed inside subroutines. */
  2471. isame[0] = *(unsigned char *)uplo == *(unsigned char *)
  2472. uplos;
  2473. isame[1] = ns == n;
  2474. isame[2] = als == alpha;
  2475. isame[3] = lse_(&xs[1], &xx[1], &lx);
  2476. isame[4] = incxs == incx;
  2477. if (null) {
  2478. isame[5] = lse_(&as[1], &aa[1], &laa);
  2479. } else {
  2480. isame[5] = lseres_(sname + 7, uplo, &n, &n, &as[1], &
  2481. aa[1], &lda, (ftnlen)2, (ftnlen)1);
  2482. }
  2483. if (! packed) {
  2484. isame[6] = ldas == lda;
  2485. }
  2486. /* If data was incorrectly changed, report and return. */
  2487. same = TRUE_;
  2488. i__4 = nargs;
  2489. for (i__ = 1; i__ <= i__4; ++i__) {
  2490. same = same && isame[i__ - 1];
  2491. if (! isame[i__ - 1]) {
  2492. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  2493. }
  2494. /* L30: */
  2495. }
  2496. if (! same) {
  2497. *fatal = TRUE_;
  2498. goto L120;
  2499. }
  2500. if (! null) {
  2501. /* Check the result column by column. */
  2502. if (incx > 0) {
  2503. i__4 = n;
  2504. for (i__ = 1; i__ <= i__4; ++i__) {
  2505. z__[i__] = x[i__];
  2506. /* L40: */
  2507. }
  2508. } else {
  2509. i__4 = n;
  2510. for (i__ = 1; i__ <= i__4; ++i__) {
  2511. z__[i__] = x[n - i__ + 1];
  2512. /* L50: */
  2513. }
  2514. }
  2515. ja = 1;
  2516. i__4 = n;
  2517. for (j = 1; j <= i__4; ++j) {
  2518. w[0] = z__[j];
  2519. if (upper) {
  2520. jj = 1;
  2521. lj = j;
  2522. } else {
  2523. jj = j;
  2524. lj = n - j + 1;
  2525. }
  2526. smvch_("N", &lj, &c__1, &alpha, &z__[jj], &lj, w,
  2527. &c__1, &c_b123, &a[jj + j * a_dim1], &
  2528. c__1, &yt[1], &g[1], &aa[ja], eps, &err,
  2529. fatal, nout, &c_true, (ftnlen)1);
  2530. if (full) {
  2531. if (upper) {
  2532. ja += lda;
  2533. } else {
  2534. ja = ja + lda + 1;
  2535. }
  2536. } else {
  2537. ja += lj;
  2538. }
  2539. errmax = dmax(errmax,err);
  2540. /* If got really bad answer, report and return. */
  2541. if (*fatal) {
  2542. goto L110;
  2543. }
  2544. /* L60: */
  2545. }
  2546. } else {
  2547. /* Avoid repeating tests if N.le.0. */
  2548. if (n <= 0) {
  2549. goto L100;
  2550. }
  2551. }
  2552. /* L70: */
  2553. }
  2554. /* L80: */
  2555. }
  2556. /* L90: */
  2557. }
  2558. L100:
  2559. ;
  2560. }
  2561. /* Report result. */
  2562. if (errmax < *thresh) {
  2563. if (*iorder == 0) {
  2564. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2565. }
  2566. if (*iorder == 1) {
  2567. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2568. }
  2569. } else {
  2570. if (*iorder == 0) {
  2571. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2572. }
  2573. if (*iorder == 1) {
  2574. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2575. }
  2576. }
  2577. goto L130;
  2578. L110:
  2579. printf(" THESE ARE THE RESULTS FOR COLUMN %3d:\n",j);
  2580. L120:
  2581. printf("******* %12s FAILED ON CALL NUMBER:\n",sname);
  2582. if (full) {
  2583. printf("%6d: %12s (%14s, %3d, %4.1f, X, %2d, A, %3d).\n",
  2584. nc,sname,cuplo,n,alpha,incx,lda);
  2585. } else if (packed) {
  2586. printf("%6d: %12s (%14s, %3d, %4.1f, X, %2d, AP).\n",
  2587. nc,sname,cuplo,n,alpha,incx);
  2588. }
  2589. L130:
  2590. return 0;
  2591. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  2592. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  2593. /* $ ' - SUSPECT *******' ) */
  2594. /* End of SCHK5. */
  2595. } /* schk5_ */
  2596. /* Subroutine */ int schk6_(char* sname, real* eps, real* thresh, integer* nout, integer* ntra, logical* trace, logical* rewi, logical* fatal, integer* nidim, integer* idim, integer* nalf, real* alf, integer* ninc, integer* inc, integer* nmax, integer* incmax, real* a, real* aa, real* as, real* x, real* xx, real* xs, real* y, real* yy, real* ys, real* yt, real* g, real* z__, integer* iorder, ftnlen sname_len)
  2597. {
  2598. /* Initialized data */
  2599. static char ich[2+1] = "UL";
  2600. /* System generated locals */
  2601. integer a_dim1, a_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5,
  2602. i__6;
  2603. /* Local variables */
  2604. static integer ldas;
  2605. static logical same;
  2606. static integer incx, incy;
  2607. static logical full, null;
  2608. static char uplo[1];
  2609. static integer i__, j, n;
  2610. static real alpha, w[2];
  2611. static logical isame[13];
  2612. extern /* Subroutine */ int smake_(char*, char*, char*, integer*, integer*, real*, integer*, real*, integer*, integer*, integer*, logical*, real*, ftnlen, ftnlen, ftnlen);
  2613. static integer nargs;
  2614. extern /* Subroutine */ int smvch_(char*, integer*, integer*, real*, real*, integer*, real*, integer*, real*, real*, integer*, real*, real*, real*, real*, real*, logical*, integer*, logical*, ftnlen);
  2615. static logical reset;
  2616. static char cuplo[14];
  2617. static integer incxs, incys;
  2618. static logical upper;
  2619. static char uplos[1];
  2620. static integer ia, ja, ic;
  2621. extern /* Subroutine */ void csspr2_(integer*, char*, integer*, real*, real*, integer*, real*, integer*, real*, ftnlen);
  2622. static integer nc, jj, lj, in;
  2623. static logical packed;
  2624. extern /* Subroutine */ void cssyr2_(integer*, char*, integer*, real*, real*, integer*, real*, integer*, real*, integer*, ftnlen);
  2625. static integer ix, iy, ns, lx, ly;
  2626. static real errmax;
  2627. extern logical lseres_(char* type__, char* uplo, integer* m, integer* n, real* aa, real* as, integer* lda, ftnlen ltype_len, ftnlen uplo_len);
  2628. static real transl;
  2629. static integer laa, lda;
  2630. static real als;
  2631. extern logical lse_(real*, real*, integer*);
  2632. static real err;
  2633. /* Tests SSYR2 and SSPR2. */
  2634. /* Auxiliary routine for test program for Level 2 Blas. */
  2635. /* -- Written on 10-August-1987. */
  2636. /* Richard Hanson, Sandia National Labs. */
  2637. /* Jeremy Du Croz, NAG Central Office. */
  2638. /* .. Parameters .. */
  2639. /* .. Scalar Arguments .. */
  2640. /* .. Array Arguments .. */
  2641. /* .. Local Scalars .. */
  2642. /* .. Local Arrays .. */
  2643. /* .. External Functions .. */
  2644. /* .. External Subroutines .. */
  2645. /* .. Intrinsic Functions .. */
  2646. /* .. Scalars in Common .. */
  2647. /* .. Common blocks .. */
  2648. /* .. Data statements .. */
  2649. /* Parameter adjustments */
  2650. --idim;
  2651. --alf;
  2652. --inc;
  2653. z_dim1 = *nmax;
  2654. z_offset = 1 + z_dim1 * 1;
  2655. z__ -= z_offset;
  2656. --g;
  2657. --yt;
  2658. --y;
  2659. --x;
  2660. --as;
  2661. --aa;
  2662. a_dim1 = *nmax;
  2663. a_offset = 1 + a_dim1 * 1;
  2664. a -= a_offset;
  2665. --ys;
  2666. --yy;
  2667. --xs;
  2668. --xx;
  2669. /* Function Body */
  2670. /* .. Executable Statements .. */
  2671. full = *(unsigned char *)&sname[8] == 'y';
  2672. packed = *(unsigned char *)&sname[8] == 'p';
  2673. /* Define the number of arguments. */
  2674. if (full) {
  2675. nargs = 9;
  2676. } else if (packed) {
  2677. nargs = 8;
  2678. }
  2679. nc = 0;
  2680. reset = TRUE_;
  2681. errmax = (float)0.;
  2682. i__1 = *nidim;
  2683. for (in = 1; in <= i__1; ++in) {
  2684. n = idim[in];
  2685. /* Set LDA to 1 more than minimum value if room. */
  2686. lda = n;
  2687. if (lda < *nmax) {
  2688. ++lda;
  2689. }
  2690. /* Skip tests if not enough room. */
  2691. if (lda > *nmax) {
  2692. goto L140;
  2693. }
  2694. if (packed) {
  2695. laa = n * (n + 1) / 2;
  2696. } else {
  2697. laa = lda * n;
  2698. }
  2699. for (ic = 1; ic <= 2; ++ic) {
  2700. *(unsigned char *)uplo = *(unsigned char *)&ich[ic - 1];
  2701. if (*(unsigned char *)uplo == 'U') {
  2702. s_copy(cuplo, " CblasUpper", (ftnlen)14, (ftnlen)14);
  2703. } else {
  2704. s_copy(cuplo, " CblasLower", (ftnlen)14, (ftnlen)14);
  2705. }
  2706. upper = *(unsigned char *)uplo == 'U';
  2707. i__2 = *ninc;
  2708. for (ix = 1; ix <= i__2; ++ix) {
  2709. incx = inc[ix];
  2710. lx = abs(incx) * n;
  2711. /* Generate the vector X. */
  2712. transl = (float).5;
  2713. i__3 = abs(incx);
  2714. i__4 = n - 1;
  2715. smake_("ge", " ", " ", &c__1, &n, &x[1], &c__1, &xx[1], &i__3,
  2716. &c__0, &i__4, &reset, &transl, (ftnlen)2, (ftnlen)1,
  2717. (ftnlen)1);
  2718. if (n > 1) {
  2719. x[n / 2] = (float)0.;
  2720. xx[abs(incx) * (n / 2 - 1) + 1] = (float)0.;
  2721. }
  2722. i__3 = *ninc;
  2723. for (iy = 1; iy <= i__3; ++iy) {
  2724. incy = inc[iy];
  2725. ly = abs(incy) * n;
  2726. /* Generate the vector Y. */
  2727. transl = (float)0.;
  2728. i__4 = abs(incy);
  2729. i__5 = n - 1;
  2730. smake_("ge", " ", " ", &c__1, &n, &y[1], &c__1, &yy[1], &
  2731. i__4, &c__0, &i__5, &reset, &transl, (ftnlen)2, (
  2732. ftnlen)1, (ftnlen)1);
  2733. if (n > 1) {
  2734. y[n / 2] = (float)0.;
  2735. yy[abs(incy) * (n / 2 - 1) + 1] = (float)0.;
  2736. }
  2737. i__4 = *nalf;
  2738. for (ia = 1; ia <= i__4; ++ia) {
  2739. alpha = alf[ia];
  2740. null = n <= 0 || alpha == (float)0.;
  2741. /* Generate the matrix A. */
  2742. transl = (float)0.;
  2743. i__5 = n - 1;
  2744. i__6 = n - 1;
  2745. smake_(sname + 7, uplo, " ", &n, &n, &a[a_offset],
  2746. nmax, &aa[1], &lda, &i__5, &i__6, &reset, &
  2747. transl, (ftnlen)2, (ftnlen)1, (ftnlen)1);
  2748. ++nc;
  2749. /* Save every datum before calling the subroutine. */
  2750. *(unsigned char *)uplos = *(unsigned char *)uplo;
  2751. ns = n;
  2752. als = alpha;
  2753. i__5 = laa;
  2754. for (i__ = 1; i__ <= i__5; ++i__) {
  2755. as[i__] = aa[i__];
  2756. /* L10: */
  2757. }
  2758. ldas = lda;
  2759. i__5 = lx;
  2760. for (i__ = 1; i__ <= i__5; ++i__) {
  2761. xs[i__] = xx[i__];
  2762. /* L20: */
  2763. }
  2764. incxs = incx;
  2765. i__5 = ly;
  2766. for (i__ = 1; i__ <= i__5; ++i__) {
  2767. ys[i__] = yy[i__];
  2768. /* L30: */
  2769. }
  2770. incys = incy;
  2771. /* Call the subroutine. */
  2772. if (full) {
  2773. if (*trace) {
  2774. /*
  2775. sprintf(ntra,"%6d: %12s (%14s, %3d, %4.1f, X, %2d, Y, %2d, A, %3d).\n",
  2776. nc,sname,cuplo,n,alpha,incx,incy,lda);
  2777. */
  2778. }
  2779. if (*rewi) {
  2780. /* al__1.aerr = 0;
  2781. al__1.aunit = *ntra;
  2782. f_rew(&al__1);*/
  2783. }
  2784. cssyr2_(iorder, uplo, &n, &alpha, &xx[1], &incx, &
  2785. yy[1], &incy, &aa[1], &lda, (ftnlen)1);
  2786. } else if (packed) {
  2787. if (*trace) {
  2788. /*
  2789. sprintf(ntra,"%6d: %12s (%14s, %3d, %4.1f, X, %2d, Y, %2d, AP).\n",
  2790. nc,sname,cuplo,n,alpha,incx,incy);
  2791. */
  2792. }
  2793. if (*rewi) {
  2794. /* al__1.aerr = 0;
  2795. al__1.aunit = *ntra;
  2796. f_rew(&al__1);*/
  2797. }
  2798. csspr2_(iorder, uplo, &n, &alpha, &xx[1], &incx, &
  2799. yy[1], &incy, &aa[1], (ftnlen)1);
  2800. }
  2801. /* Check if error-exit was taken incorrectly. */
  2802. if (! infoc_1.ok) {
  2803. printf(" ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *******n");
  2804. *fatal = TRUE_;
  2805. goto L160;
  2806. }
  2807. /* See what data changed inside subroutines. */
  2808. isame[0] = *(unsigned char *)uplo == *(unsigned char *
  2809. )uplos;
  2810. isame[1] = ns == n;
  2811. isame[2] = als == alpha;
  2812. isame[3] = lse_(&xs[1], &xx[1], &lx);
  2813. isame[4] = incxs == incx;
  2814. isame[5] = lse_(&ys[1], &yy[1], &ly);
  2815. isame[6] = incys == incy;
  2816. if (null) {
  2817. isame[7] = lse_(&as[1], &aa[1], &laa);
  2818. } else {
  2819. isame[7] = lseres_(sname + 7, uplo, &n, &n, &as[1]
  2820. , &aa[1], &lda, (ftnlen)2, (ftnlen)1);
  2821. }
  2822. if (! packed) {
  2823. isame[8] = ldas == lda;
  2824. }
  2825. /* If data was incorrectly changed, report and return. */
  2826. same = TRUE_;
  2827. i__5 = nargs;
  2828. for (i__ = 1; i__ <= i__5; ++i__) {
  2829. same = same && isame[i__ - 1];
  2830. if (! isame[i__ - 1]) {
  2831. printf(" ******* FATAL ERROR - PARAMETER NUMBER %2d WAS CHANGED INCORRECTLY *******\n",i__);
  2832. }
  2833. /* L40: */
  2834. }
  2835. if (! same) {
  2836. *fatal = TRUE_;
  2837. goto L160;
  2838. }
  2839. if (! null) {
  2840. /* Check the result column by column. */
  2841. if (incx > 0) {
  2842. i__5 = n;
  2843. for (i__ = 1; i__ <= i__5; ++i__) {
  2844. z__[i__ + z_dim1] = x[i__];
  2845. /* L50: */
  2846. }
  2847. } else {
  2848. i__5 = n;
  2849. for (i__ = 1; i__ <= i__5; ++i__) {
  2850. z__[i__ + z_dim1] = x[n - i__ + 1];
  2851. /* L60: */
  2852. }
  2853. }
  2854. if (incy > 0) {
  2855. i__5 = n;
  2856. for (i__ = 1; i__ <= i__5; ++i__) {
  2857. z__[i__ + (z_dim1 << 1)] = y[i__];
  2858. /* L70: */
  2859. }
  2860. } else {
  2861. i__5 = n;
  2862. for (i__ = 1; i__ <= i__5; ++i__) {
  2863. z__[i__ + (z_dim1 << 1)] = y[n - i__ + 1];
  2864. /* L80: */
  2865. }
  2866. }
  2867. ja = 1;
  2868. i__5 = n;
  2869. for (j = 1; j <= i__5; ++j) {
  2870. w[0] = z__[j + (z_dim1 << 1)];
  2871. w[1] = z__[j + z_dim1];
  2872. if (upper) {
  2873. jj = 1;
  2874. lj = j;
  2875. } else {
  2876. jj = j;
  2877. lj = n - j + 1;
  2878. }
  2879. smvch_("N", &lj, &c__2, &alpha, &z__[jj +
  2880. z_dim1], nmax, w, &c__1, &c_b123, &a[
  2881. jj + j * a_dim1], &c__1, &yt[1], &g[1]
  2882. , &aa[ja], eps, &err, fatal, nout, &
  2883. c_true, (ftnlen)1);
  2884. if (full) {
  2885. if (upper) {
  2886. ja += lda;
  2887. } else {
  2888. ja = ja + lda + 1;
  2889. }
  2890. } else {
  2891. ja += lj;
  2892. }
  2893. errmax = dmax(errmax,err);
  2894. /* If got really bad answer, report and return. */
  2895. if (*fatal) {
  2896. goto L150;
  2897. }
  2898. /* L90: */
  2899. }
  2900. } else {
  2901. /* Avoid repeating tests with N.le.0. */
  2902. if (n <= 0) {
  2903. goto L140;
  2904. }
  2905. }
  2906. /* L100: */
  2907. }
  2908. /* L110: */
  2909. }
  2910. /* L120: */
  2911. }
  2912. /* L130: */
  2913. }
  2914. L140:
  2915. ;
  2916. }
  2917. /* Report result. */
  2918. if (errmax < *thresh) {
  2919. if (*iorder == 0) {
  2920. printf("%12s PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2921. }
  2922. if (*iorder == 1) {
  2923. printf("%12s PASSED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS)\n",sname,nc);
  2924. }
  2925. } else {
  2926. if (*iorder == 0) {
  2927. printf("%12s COMPLETED THE COLUMN-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2928. }
  2929. if (*iorder == 1) {
  2930. printf("%12s COMPLETED THE ROW-MAJOR COMPUTATIONAL TESTS (%6d CALLS) ******* BUT WITH MAXIMUM TEST RATIO %8.2f - SUSPECT *******\n",sname,nc,errmax);;
  2931. }
  2932. }
  2933. goto L170;
  2934. L150:
  2935. printf(" THESE ARE THE RESULTS FOR COLUMN %3d:\n",j);
  2936. L160:
  2937. printf("******* %12s FAILED ON CALL NUMBER:\n",sname);
  2938. if (full) {
  2939. printf("%6d: %12s (%14s, %3d, %4.1f, X, %2d, Y, %2d, A, %3d).\n",
  2940. nc,sname,cuplo,n,alpha,incx,incy,lda);
  2941. } else if (packed) {
  2942. printf("%6d: %12s (%14s, %3d, %4.1f, X, %2d, Y, %2d, AP).\n",
  2943. nc,sname,cuplo,n,alpha,incx,incy);
  2944. }
  2945. L170:
  2946. return 0;
  2947. /* 9997 FORMAT( ' ',A12, ' COMPLETED THE COMPUTATIONAL TESTS (', I6, ' C', */
  2948. /* $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', F8.2, */
  2949. /* $ ' - SUSPECT *******' ) */
  2950. /* End of SCHK6. */
  2951. } /* schk6_ */
  2952. /* Subroutine */ int smake_(char* type__, char* uplo, char* diag, integer* m, integer* n, real* a, integer* nmax, real* aa, integer* lda, integer* kl, integer* ku, logical* reset, real* transl, ftnlen type_len, ftnlen uplo_len, ftnlen diag_len)
  2953. {
  2954. /* System generated locals */
  2955. integer a_dim1, a_offset, i__1, i__2, i__3, i__4;
  2956. /* Local variables */
  2957. static integer ibeg, iend;
  2958. extern doublereal sbeg_(logical*);
  2959. static integer ioff;
  2960. static logical unit;
  2961. static integer i__, j;
  2962. static logical lower;
  2963. static integer i1, i2, i3;
  2964. static logical upper;
  2965. static integer kk;
  2966. static logical gen, tri, sym;
  2967. /* Generates values for an M by N matrix A within the bandwidth */
  2968. /* defined by KL and KU. */
  2969. /* Stores the values in the array AA in the data structure required */
  2970. /* by the routine, with unwanted elements set to rogue value. */
  2971. /* TYPE is 'ge', 'gb', 'sy', 'sb', 'sp', 'tr', 'tb' OR 'tp'. */
  2972. /* Auxiliary routine for test program for Level 2 Blas. */
  2973. /* -- Written on 10-August-1987. */
  2974. /* Richard Hanson, Sandia National Labs. */
  2975. /* Jeremy Du Croz, NAG Central Office. */
  2976. /* .. Parameters .. */
  2977. /* .. Scalar Arguments .. */
  2978. /* .. Array Arguments .. */
  2979. /* .. Local Scalars .. */
  2980. /* .. External Functions .. */
  2981. /* .. Intrinsic Functions .. */
  2982. /* .. Executable Statements .. */
  2983. /* Parameter adjustments */
  2984. a_dim1 = *nmax;
  2985. a_offset = 1 + a_dim1 * 1;
  2986. a -= a_offset;
  2987. --aa;
  2988. /* Function Body */
  2989. gen = *(unsigned char *)type__ == 'g';
  2990. sym = *(unsigned char *)type__ == 's';
  2991. tri = *(unsigned char *)type__ == 't';
  2992. upper = (sym || tri) && *(unsigned char *)uplo == 'U';
  2993. lower = (sym || tri) && *(unsigned char *)uplo == 'L';
  2994. unit = tri && *(unsigned char *)diag == 'U';
  2995. /* Generate data in array A. */
  2996. i__1 = *n;
  2997. for (j = 1; j <= i__1; ++j) {
  2998. i__2 = *m;
  2999. for (i__ = 1; i__ <= i__2; ++i__) {
  3000. if (gen || (upper && i__ <= j) || (lower && i__ >= j)) {
  3001. if (i__ <= j && (j - i__ <= *ku || i__ >= j && i__ - j <= *kl))
  3002. {
  3003. a[i__ + j * a_dim1] = sbeg_(reset) + *transl;
  3004. } else {
  3005. a[i__ + j * a_dim1] = (float)0.;
  3006. }
  3007. if (i__ != j) {
  3008. if (sym) {
  3009. a[j + i__ * a_dim1] = a[i__ + j * a_dim1];
  3010. } else if (tri) {
  3011. a[j + i__ * a_dim1] = (float)0.;
  3012. }
  3013. }
  3014. }
  3015. /* L10: */
  3016. }
  3017. if (tri) {
  3018. a[j + j * a_dim1] += (float)1.;
  3019. }
  3020. if (unit) {
  3021. a[j + j * a_dim1] = (float)1.;
  3022. }
  3023. /* L20: */
  3024. }
  3025. /* Store elements in array AS in data structure required by routine. */
  3026. if (s_cmp(type__, "ge", (ftnlen)2, (ftnlen)2) == 0) {
  3027. i__1 = *n;
  3028. for (j = 1; j <= i__1; ++j) {
  3029. i__2 = *m;
  3030. for (i__ = 1; i__ <= i__2; ++i__) {
  3031. aa[i__ + (j - 1) * *lda] = a[i__ + j * a_dim1];
  3032. /* L30: */
  3033. }
  3034. i__2 = *lda;
  3035. for (i__ = *m + 1; i__ <= i__2; ++i__) {
  3036. aa[i__ + (j - 1) * *lda] = (float)-1e10;
  3037. /* L40: */
  3038. }
  3039. /* L50: */
  3040. }
  3041. } else if (s_cmp(type__, "gb", (ftnlen)2, (ftnlen)2) == 0) {
  3042. i__1 = *n;
  3043. for (j = 1; j <= i__1; ++j) {
  3044. i__2 = *ku + 1 - j;
  3045. for (i1 = 1; i1 <= i__2; ++i1) {
  3046. aa[i1 + (j - 1) * *lda] = (float)-1e10;
  3047. /* L60: */
  3048. }
  3049. /* Computing MIN */
  3050. i__3 = *kl + *ku + 1, i__4 = *ku + 1 + *m - j;
  3051. i__2 = f2cmin(i__3,i__4);
  3052. for (i2 = i1; i2 <= i__2; ++i2) {
  3053. aa[i2 + (j - 1) * *lda] = a[i2 + j - *ku - 1 + j * a_dim1];
  3054. /* L70: */
  3055. }
  3056. i__2 = *lda;
  3057. for (i3 = i2; i3 <= i__2; ++i3) {
  3058. aa[i3 + (j - 1) * *lda] = (float)-1e10;
  3059. /* L80: */
  3060. }
  3061. /* L90: */
  3062. }
  3063. } else if (s_cmp(type__, "sy", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(type__,
  3064. "tr", (ftnlen)2, (ftnlen)2) == 0) {
  3065. i__1 = *n;
  3066. for (j = 1; j <= i__1; ++j) {
  3067. if (upper) {
  3068. ibeg = 1;
  3069. if (unit) {
  3070. iend = j - 1;
  3071. } else {
  3072. iend = j;
  3073. }
  3074. } else {
  3075. if (unit) {
  3076. ibeg = j + 1;
  3077. } else {
  3078. ibeg = j;
  3079. }
  3080. iend = *n;
  3081. }
  3082. i__2 = ibeg - 1;
  3083. for (i__ = 1; i__ <= i__2; ++i__) {
  3084. aa[i__ + (j - 1) * *lda] = (float)-1e10;
  3085. /* L100: */
  3086. }
  3087. i__2 = iend;
  3088. for (i__ = ibeg; i__ <= i__2; ++i__) {
  3089. aa[i__ + (j - 1) * *lda] = a[i__ + j * a_dim1];
  3090. /* L110: */
  3091. }
  3092. i__2 = *lda;
  3093. for (i__ = iend + 1; i__ <= i__2; ++i__) {
  3094. aa[i__ + (j - 1) * *lda] = (float)-1e10;
  3095. /* L120: */
  3096. }
  3097. /* L130: */
  3098. }
  3099. } else if (s_cmp(type__, "sb", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(type__,
  3100. "tb", (ftnlen)2, (ftnlen)2) == 0) {
  3101. i__1 = *n;
  3102. for (j = 1; j <= i__1; ++j) {
  3103. if (upper) {
  3104. kk = *kl + 1;
  3105. /* Computing MAX */
  3106. i__2 = 1, i__3 = *kl + 2 - j;
  3107. ibeg = f2cmax(i__2,i__3);
  3108. if (unit) {
  3109. iend = *kl;
  3110. } else {
  3111. iend = *kl + 1;
  3112. }
  3113. } else {
  3114. kk = 1;
  3115. if (unit) {
  3116. ibeg = 2;
  3117. } else {
  3118. ibeg = 1;
  3119. }
  3120. /* Computing MIN */
  3121. i__2 = *kl + 1, i__3 = *m + 1 - j;
  3122. iend = f2cmin(i__2,i__3);
  3123. }
  3124. i__2 = ibeg - 1;
  3125. for (i__ = 1; i__ <= i__2; ++i__) {
  3126. aa[i__ + (j - 1) * *lda] = (float)-1e10;
  3127. /* L140: */
  3128. }
  3129. i__2 = iend;
  3130. for (i__ = ibeg; i__ <= i__2; ++i__) {
  3131. aa[i__ + (j - 1) * *lda] = a[i__ + j - kk + j * a_dim1];
  3132. /* L150: */
  3133. }
  3134. i__2 = *lda;
  3135. for (i__ = iend + 1; i__ <= i__2; ++i__) {
  3136. aa[i__ + (j - 1) * *lda] = (float)-1e10;
  3137. /* L160: */
  3138. }
  3139. /* L170: */
  3140. }
  3141. } else if (s_cmp(type__, "sp", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(type__,
  3142. "tp", (ftnlen)2, (ftnlen)2) == 0) {
  3143. ioff = 0;
  3144. i__1 = *n;
  3145. for (j = 1; j <= i__1; ++j) {
  3146. if (upper) {
  3147. ibeg = 1;
  3148. iend = j;
  3149. } else {
  3150. ibeg = j;
  3151. iend = *n;
  3152. }
  3153. i__2 = iend;
  3154. for (i__ = ibeg; i__ <= i__2; ++i__) {
  3155. ++ioff;
  3156. aa[ioff] = a[i__ + j * a_dim1];
  3157. if (i__ == j) {
  3158. if (unit) {
  3159. aa[ioff] = (float)-1e10;
  3160. }
  3161. }
  3162. /* L180: */
  3163. }
  3164. /* L190: */
  3165. }
  3166. }
  3167. return 0;
  3168. /* End of SMAKE. */
  3169. } /* smake_ */
  3170. /* Subroutine */ int smvch_(char* trans, integer* m, integer* n, real* alpha, real* a, integer* nmax, real* x, integer* incx, real* beta, real* y, integer* incy, real* yt, real* g, real* yy, real* eps, real* err, logical* fatal, integer* nout, logical* mv, ftnlen trans_len)
  3171. {
  3172. /* System generated locals */
  3173. integer a_dim1, a_offset, i__1, i__2;
  3174. real r__1;
  3175. /* Builtin functions */
  3176. double sqrt(double);
  3177. /* Local variables */
  3178. static real erri;
  3179. static logical tran;
  3180. static integer i__, j, incxl, incyl, ml, nl, iy, jx, kx, ky;
  3181. /* Checks the results of the computational tests. */
  3182. /* Auxiliary routine for test program for Level 2 Blas. */
  3183. /* -- Written on 10-August-1987. */
  3184. /* Richard Hanson, Sandia National Labs. */
  3185. /* Jeremy Du Croz, NAG Central Office. */
  3186. /* .. Parameters .. */
  3187. /* .. Scalar Arguments .. */
  3188. /* .. Array Arguments .. */
  3189. /* .. Local Scalars .. */
  3190. /* .. Intrinsic Functions .. */
  3191. /* .. Executable Statements .. */
  3192. /* Parameter adjustments */
  3193. a_dim1 = *nmax;
  3194. a_offset = 1 + a_dim1 * 1;
  3195. a -= a_offset;
  3196. --x;
  3197. --y;
  3198. --yt;
  3199. --g;
  3200. --yy;
  3201. /* Function Body */
  3202. tran = *(unsigned char *)trans == 'T' || *(unsigned char *)trans == 'C';
  3203. if (tran) {
  3204. ml = *n;
  3205. nl = *m;
  3206. } else {
  3207. ml = *m;
  3208. nl = *n;
  3209. }
  3210. if (*incx < 0) {
  3211. kx = nl;
  3212. incxl = -1;
  3213. } else {
  3214. kx = 1;
  3215. incxl = 1;
  3216. }
  3217. if (*incy < 0) {
  3218. ky = ml;
  3219. incyl = -1;
  3220. } else {
  3221. ky = 1;
  3222. incyl = 1;
  3223. }
  3224. /* Compute expected result in YT using data in A, X and Y. */
  3225. /* Compute gauges in G. */
  3226. iy = ky;
  3227. i__1 = ml;
  3228. for (i__ = 1; i__ <= i__1; ++i__) {
  3229. yt[iy] = (float)0.;
  3230. g[iy] = (float)0.;
  3231. jx = kx;
  3232. if (tran) {
  3233. i__2 = nl;
  3234. for (j = 1; j <= i__2; ++j) {
  3235. yt[iy] += a[j + i__ * a_dim1] * x[jx];
  3236. g[iy] += (r__1 = a[j + i__ * a_dim1] * x[jx], dabs(r__1));
  3237. jx += incxl;
  3238. /* L10: */
  3239. }
  3240. } else {
  3241. i__2 = nl;
  3242. for (j = 1; j <= i__2; ++j) {
  3243. yt[iy] += a[i__ + j * a_dim1] * x[jx];
  3244. g[iy] += (r__1 = a[i__ + j * a_dim1] * x[jx], dabs(r__1));
  3245. jx += incxl;
  3246. /* L20: */
  3247. }
  3248. }
  3249. yt[iy] = *alpha * yt[iy] + *beta * y[iy];
  3250. g[iy] = dabs(*alpha) * g[iy] + (r__1 = *beta * y[iy], dabs(r__1));
  3251. iy += incyl;
  3252. /* L30: */
  3253. }
  3254. /* Compute the error ratio for this result. */
  3255. *err = (float)0.;
  3256. i__1 = ml;
  3257. for (i__ = 1; i__ <= i__1; ++i__) {
  3258. erri = (r__1 = yt[i__] - yy[(i__ - 1) * abs(*incy) + 1], dabs(r__1)) /
  3259. *eps;
  3260. if (g[i__] != (float)0.) {
  3261. erri /= g[i__];
  3262. }
  3263. *err = dmax(*err,erri);
  3264. if (*err * sqrt(*eps) >= (float)1.) {
  3265. goto L50;
  3266. }
  3267. /* L40: */
  3268. }
  3269. /* If the loop completes, all results are at least half accurate. */
  3270. goto L70;
  3271. /* Report fatal error. */
  3272. L50:
  3273. *fatal = TRUE_;
  3274. printf(" ******* FATAL ERROR - COMPUTED RESULT IS LESS THAN HALF ACCURATE *******\n EXPECTED RESULT COMPUTED RESULT\n");
  3275. i__1 = ml;
  3276. for (i__ = 1; i__ <= i__1; ++i__) {
  3277. if (*mv) {
  3278. printf("%7d %18.6g %18.6g\n",i__,yt[i__],yy[(i__ - 1) * abs(*incy) + 1]);
  3279. } else {
  3280. printf("%7d %18.6g %18.6g\n",i__,yy[(i__ - 1) * abs(*incy) + 1], yt[i__]);
  3281. }
  3282. /* L60: */
  3283. }
  3284. L70:
  3285. return 0;
  3286. /* End of SMVCH. */
  3287. } /* smvch_ */
  3288. logical lse_(real* ri, real* rj, integer* lr)
  3289. {
  3290. /* System generated locals */
  3291. integer i__1;
  3292. logical ret_val;
  3293. /* Local variables */
  3294. static integer i__;
  3295. /* Tests if two arrays are identical. */
  3296. /* Auxiliary routine for test program for Level 2 Blas. */
  3297. /* -- Written on 10-August-1987. */
  3298. /* Richard Hanson, Sandia National Labs. */
  3299. /* Jeremy Du Croz, NAG Central Office. */
  3300. /* .. Scalar Arguments .. */
  3301. /* .. Array Arguments .. */
  3302. /* .. Local Scalars .. */
  3303. /* .. Executable Statements .. */
  3304. /* Parameter adjustments */
  3305. --rj;
  3306. --ri;
  3307. /* Function Body */
  3308. i__1 = *lr;
  3309. for (i__ = 1; i__ <= i__1; ++i__) {
  3310. if (ri[i__] != rj[i__]) {
  3311. goto L20;
  3312. }
  3313. /* L10: */
  3314. }
  3315. ret_val = TRUE_;
  3316. goto L30;
  3317. L20:
  3318. ret_val = FALSE_;
  3319. L30:
  3320. return ret_val;
  3321. /* End of LSE. */
  3322. } /* lse_ */
  3323. logical lseres_(char* type__, char* uplo, integer* m, integer* n, real* aa, real* as, integer* lda, ftnlen ltype_len, ftnlen uplo_len)
  3324. {
  3325. /* System generated locals */
  3326. integer aa_dim1, aa_offset, as_dim1, as_offset, i__1, i__2;
  3327. logical ret_val;
  3328. /* Local variables */
  3329. static integer ibeg, iend, i__, j;
  3330. static logical upper;
  3331. /* Tests if selected elements in two arrays are equal. */
  3332. /* TYPE is 'ge', 'sy' or 'sp'. */
  3333. /* Auxiliary routine for test program for Level 2 Blas. */
  3334. /* -- Written on 10-August-1987. */
  3335. /* Richard Hanson, Sandia National Labs. */
  3336. /* Jeremy Du Croz, NAG Central Office. */
  3337. /* .. Scalar Arguments .. */
  3338. /* .. Array Arguments .. */
  3339. /* .. Local Scalars .. */
  3340. /* .. Executable Statements .. */
  3341. /* Parameter adjustments */
  3342. as_dim1 = *lda;
  3343. as_offset = 1 + as_dim1 * 1;
  3344. as -= as_offset;
  3345. aa_dim1 = *lda;
  3346. aa_offset = 1 + aa_dim1 * 1;
  3347. aa -= aa_offset;
  3348. /* Function Body */
  3349. upper = *(unsigned char *)uplo == 'U';
  3350. if (s_cmp(type__, "ge", (ftnlen)2, (ftnlen)2) == 0) {
  3351. i__1 = *n;
  3352. for (j = 1; j <= i__1; ++j) {
  3353. i__2 = *lda;
  3354. for (i__ = *m + 1; i__ <= i__2; ++i__) {
  3355. if (aa[i__ + j * aa_dim1] != as[i__ + j * as_dim1]) {
  3356. goto L70;
  3357. }
  3358. /* L10: */
  3359. }
  3360. /* L20: */
  3361. }
  3362. } else if (s_cmp(type__, "sy", (ftnlen)2, (ftnlen)2) == 0) {
  3363. i__1 = *n;
  3364. for (j = 1; j <= i__1; ++j) {
  3365. if (upper) {
  3366. ibeg = 1;
  3367. iend = j;
  3368. } else {
  3369. ibeg = j;
  3370. iend = *n;
  3371. }
  3372. i__2 = ibeg - 1;
  3373. for (i__ = 1; i__ <= i__2; ++i__) {
  3374. if (aa[i__ + j * aa_dim1] != as[i__ + j * as_dim1]) {
  3375. goto L70;
  3376. }
  3377. /* L30: */
  3378. }
  3379. i__2 = *lda;
  3380. for (i__ = iend + 1; i__ <= i__2; ++i__) {
  3381. if (aa[i__ + j * aa_dim1] != as[i__ + j * as_dim1]) {
  3382. goto L70;
  3383. }
  3384. /* L40: */
  3385. }
  3386. /* L50: */
  3387. }
  3388. }
  3389. /* 60 CONTINUE */
  3390. ret_val = TRUE_;
  3391. goto L80;
  3392. L70:
  3393. ret_val = FALSE_;
  3394. L80:
  3395. return ret_val;
  3396. /* End of LSERES. */
  3397. } /* lseres_ */
  3398. doublereal sbeg_(logical* reset)
  3399. {
  3400. /* System generated locals */
  3401. real ret_val;
  3402. /* Local variables */
  3403. static integer i__, ic, mi;
  3404. /* Generates random numbers uniformly distributed between -0.5 and 0.5. */
  3405. /* Auxiliary routine for test program for Level 2 Blas. */
  3406. /* -- Written on 10-August-1987. */
  3407. /* Richard Hanson, Sandia National Labs. */
  3408. /* Jeremy Du Croz, NAG Central Office. */
  3409. /* .. Scalar Arguments .. */
  3410. /* .. Local Scalars .. */
  3411. /* .. Save statement .. */
  3412. /* .. Intrinsic Functions .. */
  3413. /* .. Executable Statements .. */
  3414. if (*reset) {
  3415. /* Initialize local variables. */
  3416. mi = 891;
  3417. i__ = 7;
  3418. ic = 0;
  3419. *reset = FALSE_;
  3420. }
  3421. /* The sequence of values of I is bounded between 1 and 999. */
  3422. /* If initial I = 1,2,3,6,7 or 9, the period will be 50. */
  3423. /* If initial I = 4 or 8, the period will be 25. */
  3424. /* If initial I = 5, the period will be 10. */
  3425. /* IC is used to break up the period by skipping 1 value of I in 6. */
  3426. ++ic;
  3427. L10:
  3428. i__ *= mi;
  3429. i__ -= i__ / 1000 * 1000;
  3430. if (ic >= 5) {
  3431. ic = 0;
  3432. goto L10;
  3433. }
  3434. ret_val = (real) (i__ - 500) / (float)1001.;
  3435. return ret_val;
  3436. /* End of SBEG. */
  3437. } /* sbeg_ */
  3438. doublereal sdiff_(real* x, real* y)
  3439. {
  3440. /* System generated locals */
  3441. real ret_val;
  3442. /* Auxiliary routine for test program for Level 2 Blas. */
  3443. /* -- Written on 10-August-1987. */
  3444. /* Richard Hanson, Sandia National Labs. */
  3445. /* .. Scalar Arguments .. */
  3446. /* .. Executable Statements .. */
  3447. ret_val = *x - *y;
  3448. return ret_val;
  3449. /* End of SDIFF. */
  3450. } /* sdiff_ */