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