scattnlay.cc 401 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477
  1. /* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1ubuntu2) on Wed Nov 19 14:02:21 2014 */
  2. #define PY_SSIZE_T_CLEAN
  3. #ifndef CYTHON_USE_PYLONG_INTERNALS
  4. #ifdef PYLONG_BITS_IN_DIGIT
  5. #define CYTHON_USE_PYLONG_INTERNALS 0
  6. #else
  7. #include "pyconfig.h"
  8. #ifdef PYLONG_BITS_IN_DIGIT
  9. #define CYTHON_USE_PYLONG_INTERNALS 1
  10. #else
  11. #define CYTHON_USE_PYLONG_INTERNALS 0
  12. #endif
  13. #endif
  14. #endif
  15. #include "Python.h"
  16. #ifndef Py_PYTHON_H
  17. #error Python headers needed to compile C extensions, please install development version of Python.
  18. #elif PY_VERSION_HEX < 0x02040000
  19. #error Cython requires Python 2.4+.
  20. #else
  21. #define CYTHON_ABI "0_20_1post0"
  22. #include <stddef.h> /* For offsetof */
  23. #ifndef offsetof
  24. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  25. #endif
  26. #if !defined(WIN32) && !defined(MS_WINDOWS)
  27. #ifndef __stdcall
  28. #define __stdcall
  29. #endif
  30. #ifndef __cdecl
  31. #define __cdecl
  32. #endif
  33. #ifndef __fastcall
  34. #define __fastcall
  35. #endif
  36. #endif
  37. #ifndef DL_IMPORT
  38. #define DL_IMPORT(t) t
  39. #endif
  40. #ifndef DL_EXPORT
  41. #define DL_EXPORT(t) t
  42. #endif
  43. #ifndef PY_LONG_LONG
  44. #define PY_LONG_LONG LONG_LONG
  45. #endif
  46. #ifndef Py_HUGE_VAL
  47. #define Py_HUGE_VAL HUGE_VAL
  48. #endif
  49. #ifdef PYPY_VERSION
  50. #define CYTHON_COMPILING_IN_PYPY 1
  51. #define CYTHON_COMPILING_IN_CPYTHON 0
  52. #else
  53. #define CYTHON_COMPILING_IN_PYPY 0
  54. #define CYTHON_COMPILING_IN_CPYTHON 1
  55. #endif
  56. #if CYTHON_COMPILING_IN_PYPY
  57. #define Py_OptimizeFlag 0
  58. #endif
  59. #if PY_VERSION_HEX < 0x02050000
  60. typedef int Py_ssize_t;
  61. #define PY_SSIZE_T_MAX INT_MAX
  62. #define PY_SSIZE_T_MIN INT_MIN
  63. #define PY_FORMAT_SIZE_T ""
  64. #define CYTHON_FORMAT_SSIZE_T ""
  65. #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  66. #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
  67. #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
  68. (PyErr_Format(PyExc_TypeError, \
  69. "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
  70. (PyObject*)0))
  71. #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
  72. !PyComplex_Check(o))
  73. #define PyIndex_Check __Pyx_PyIndex_Check
  74. #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  75. #define __PYX_BUILD_PY_SSIZE_T "i"
  76. #else
  77. #define __PYX_BUILD_PY_SSIZE_T "n"
  78. #define CYTHON_FORMAT_SSIZE_T "z"
  79. #define __Pyx_PyIndex_Check PyIndex_Check
  80. #endif
  81. #if PY_VERSION_HEX < 0x02060000
  82. #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  83. #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
  84. #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
  85. #define PyVarObject_HEAD_INIT(type, size) \
  86. PyObject_HEAD_INIT(type) size,
  87. #define PyType_Modified(t)
  88. typedef struct {
  89. void *buf;
  90. PyObject *obj;
  91. Py_ssize_t len;
  92. Py_ssize_t itemsize;
  93. int readonly;
  94. int ndim;
  95. char *format;
  96. Py_ssize_t *shape;
  97. Py_ssize_t *strides;
  98. Py_ssize_t *suboffsets;
  99. void *internal;
  100. } Py_buffer;
  101. #define PyBUF_SIMPLE 0
  102. #define PyBUF_WRITABLE 0x0001
  103. #define PyBUF_FORMAT 0x0004
  104. #define PyBUF_ND 0x0008
  105. #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  106. #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  107. #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  108. #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  109. #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  110. #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  111. #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  112. typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  113. typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
  114. #endif
  115. #if PY_MAJOR_VERSION < 3
  116. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  117. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  118. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  119. #define __Pyx_DefaultClassType PyClass_Type
  120. #else
  121. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  122. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  123. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  124. #define __Pyx_DefaultClassType PyType_Type
  125. #endif
  126. #if PY_VERSION_HEX < 0x02060000
  127. #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
  128. #endif
  129. #if PY_MAJOR_VERSION >= 3
  130. #define Py_TPFLAGS_CHECKTYPES 0
  131. #define Py_TPFLAGS_HAVE_INDEX 0
  132. #endif
  133. #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  134. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  135. #endif
  136. #if PY_VERSION_HEX < 0x02060000
  137. #define Py_TPFLAGS_HAVE_VERSION_TAG 0
  138. #endif
  139. #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  140. #define Py_TPFLAGS_IS_ABSTRACT 0
  141. #endif
  142. #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  143. #define Py_TPFLAGS_HAVE_FINALIZE 0
  144. #endif
  145. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  146. #define CYTHON_PEP393_ENABLED 1
  147. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
  148. 0 : _PyUnicode_Ready((PyObject *)(op)))
  149. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  150. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  151. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  152. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  153. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  154. #else
  155. #define CYTHON_PEP393_ENABLED 0
  156. #define __Pyx_PyUnicode_READY(op) (0)
  157. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  158. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  159. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  160. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  161. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  162. #endif
  163. #if CYTHON_COMPILING_IN_PYPY
  164. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  165. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  166. #else
  167. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  168. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
  169. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  170. #endif
  171. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  172. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  173. #if PY_MAJOR_VERSION >= 3
  174. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  175. #else
  176. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  177. #endif
  178. #if PY_MAJOR_VERSION >= 3
  179. #define PyBaseString_Type PyUnicode_Type
  180. #define PyStringObject PyUnicodeObject
  181. #define PyString_Type PyUnicode_Type
  182. #define PyString_Check PyUnicode_Check
  183. #define PyString_CheckExact PyUnicode_CheckExact
  184. #endif
  185. #if PY_VERSION_HEX < 0x02060000
  186. #define PyBytesObject PyStringObject
  187. #define PyBytes_Type PyString_Type
  188. #define PyBytes_Check PyString_Check
  189. #define PyBytes_CheckExact PyString_CheckExact
  190. #define PyBytes_FromString PyString_FromString
  191. #define PyBytes_FromStringAndSize PyString_FromStringAndSize
  192. #define PyBytes_FromFormat PyString_FromFormat
  193. #define PyBytes_DecodeEscape PyString_DecodeEscape
  194. #define PyBytes_AsString PyString_AsString
  195. #define PyBytes_AsStringAndSize PyString_AsStringAndSize
  196. #define PyBytes_Size PyString_Size
  197. #define PyBytes_AS_STRING PyString_AS_STRING
  198. #define PyBytes_GET_SIZE PyString_GET_SIZE
  199. #define PyBytes_Repr PyString_Repr
  200. #define PyBytes_Concat PyString_Concat
  201. #define PyBytes_ConcatAndDel PyString_ConcatAndDel
  202. #endif
  203. #if PY_MAJOR_VERSION >= 3
  204. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  205. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  206. #else
  207. #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
  208. PyString_Check(obj) || PyUnicode_Check(obj))
  209. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  210. #endif
  211. #if PY_VERSION_HEX < 0x02060000
  212. #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
  213. #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
  214. #endif
  215. #ifndef PySet_CheckExact
  216. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  217. #endif
  218. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  219. #if PY_MAJOR_VERSION >= 3
  220. #define PyIntObject PyLongObject
  221. #define PyInt_Type PyLong_Type
  222. #define PyInt_Check(op) PyLong_Check(op)
  223. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  224. #define PyInt_FromString PyLong_FromString
  225. #define PyInt_FromUnicode PyLong_FromUnicode
  226. #define PyInt_FromLong PyLong_FromLong
  227. #define PyInt_FromSize_t PyLong_FromSize_t
  228. #define PyInt_FromSsize_t PyLong_FromSsize_t
  229. #define PyInt_AsLong PyLong_AsLong
  230. #define PyInt_AS_LONG PyLong_AS_LONG
  231. #define PyInt_AsSsize_t PyLong_AsSsize_t
  232. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  233. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  234. #define PyNumber_Int PyNumber_Long
  235. #endif
  236. #if PY_MAJOR_VERSION >= 3
  237. #define PyBoolObject PyLongObject
  238. #endif
  239. #if PY_VERSION_HEX < 0x030200A4
  240. typedef long Py_hash_t;
  241. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  242. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  243. #else
  244. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  245. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  246. #endif
  247. #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  248. #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  249. #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  250. #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
  251. #else
  252. #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
  253. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
  254. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
  255. (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  256. #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
  257. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  258. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
  259. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  260. #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
  261. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  262. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
  263. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
  264. #endif
  265. #if PY_MAJOR_VERSION >= 3
  266. #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  267. #endif
  268. #if PY_VERSION_HEX < 0x02050000
  269. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
  270. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  271. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
  272. #else
  273. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
  274. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  275. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
  276. #endif
  277. #if PY_VERSION_HEX < 0x02050000
  278. #define __Pyx_NAMESTR(n) ((char *)(n))
  279. #define __Pyx_DOCSTR(n) ((char *)(n))
  280. #else
  281. #define __Pyx_NAMESTR(n) (n)
  282. #define __Pyx_DOCSTR(n) (n)
  283. #endif
  284. #ifndef CYTHON_INLINE
  285. #if defined(__GNUC__)
  286. #define CYTHON_INLINE __inline__
  287. #elif defined(_MSC_VER)
  288. #define CYTHON_INLINE __inline
  289. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  290. #define CYTHON_INLINE inline
  291. #else
  292. #define CYTHON_INLINE
  293. #endif
  294. #endif
  295. #ifndef CYTHON_RESTRICT
  296. #if defined(__GNUC__)
  297. #define CYTHON_RESTRICT __restrict__
  298. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  299. #define CYTHON_RESTRICT __restrict
  300. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  301. #define CYTHON_RESTRICT restrict
  302. #else
  303. #define CYTHON_RESTRICT
  304. #endif
  305. #endif
  306. #ifdef NAN
  307. #define __PYX_NAN() ((float) NAN)
  308. #else
  309. static CYTHON_INLINE float __PYX_NAN() {
  310. /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
  311. a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
  312. a quiet NaN. */
  313. float value;
  314. memset(&value, 0xFF, sizeof(value));
  315. return value;
  316. }
  317. #endif
  318. #ifdef __cplusplus
  319. template<typename T>
  320. void __Pyx_call_destructor(T* x) {
  321. x->~T();
  322. }
  323. #endif
  324. #if PY_MAJOR_VERSION >= 3
  325. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  326. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  327. #else
  328. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  329. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  330. #endif
  331. #ifndef __PYX_EXTERN_C
  332. #ifdef __cplusplus
  333. #define __PYX_EXTERN_C extern "C"
  334. #else
  335. #define __PYX_EXTERN_C extern
  336. #endif
  337. #endif
  338. #if defined(WIN32) || defined(MS_WINDOWS)
  339. #define _USE_MATH_DEFINES
  340. #endif
  341. #include <math.h>
  342. #define __PYX_HAVE__scattnlay
  343. #define __PYX_HAVE_API__scattnlay
  344. #include "string.h"
  345. #include "stdio.h"
  346. #include "stdlib.h"
  347. #include "numpy/arrayobject.h"
  348. #include "numpy/ufuncobject.h"
  349. #include "py_nmie.h"
  350. #ifdef _OPENMP
  351. #include <omp.h>
  352. #endif /* _OPENMP */
  353. #ifdef PYREX_WITHOUT_ASSERTIONS
  354. #define CYTHON_WITHOUT_ASSERTIONS
  355. #endif
  356. #ifndef CYTHON_UNUSED
  357. # if defined(__GNUC__)
  358. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  359. # define CYTHON_UNUSED __attribute__ ((__unused__))
  360. # else
  361. # define CYTHON_UNUSED
  362. # endif
  363. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  364. # define CYTHON_UNUSED __attribute__ ((__unused__))
  365. # else
  366. # define CYTHON_UNUSED
  367. # endif
  368. #endif
  369. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  370. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  371. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  372. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  373. #define __PYX_DEFAULT_STRING_ENCODING ""
  374. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  375. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  376. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  377. (sizeof(type) < sizeof(Py_ssize_t)) || \
  378. (sizeof(type) > sizeof(Py_ssize_t) && \
  379. likely(v < (type)PY_SSIZE_T_MAX || \
  380. v == (type)PY_SSIZE_T_MAX) && \
  381. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  382. v == (type)PY_SSIZE_T_MIN))) || \
  383. (sizeof(type) == sizeof(Py_ssize_t) && \
  384. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  385. v == (type)PY_SSIZE_T_MAX))) )
  386. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  387. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  388. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  389. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  390. #define __Pyx_PyBytes_FromString PyBytes_FromString
  391. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  392. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  393. #if PY_MAJOR_VERSION < 3
  394. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  395. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  396. #else
  397. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  398. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  399. #endif
  400. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  401. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  402. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
  403. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
  404. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
  405. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
  406. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
  407. #if PY_MAJOR_VERSION < 3
  408. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  409. {
  410. const Py_UNICODE *u_end = u;
  411. while (*u_end++) ;
  412. return u_end - u - 1;
  413. }
  414. #else
  415. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  416. #endif
  417. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  418. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  419. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  420. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  421. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  422. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  423. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  424. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  425. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  426. #if CYTHON_COMPILING_IN_CPYTHON
  427. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  428. #else
  429. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  430. #endif
  431. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  432. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  433. static int __Pyx_sys_getdefaultencoding_not_ascii;
  434. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  435. PyObject* sys = NULL;
  436. PyObject* default_encoding = NULL;
  437. PyObject* ascii_chars_u = NULL;
  438. PyObject* ascii_chars_b = NULL;
  439. sys = PyImport_ImportModule("sys");
  440. if (sys == NULL) goto bad;
  441. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  442. if (default_encoding == NULL) goto bad;
  443. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  444. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  445. } else {
  446. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  447. char ascii_chars[128];
  448. int c;
  449. for (c = 0; c < 128; c++) {
  450. ascii_chars[c] = c;
  451. }
  452. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  453. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  454. if (ascii_chars_u == NULL) goto bad;
  455. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  456. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  457. PyErr_Format(
  458. PyExc_ValueError,
  459. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  460. default_encoding_c);
  461. goto bad;
  462. }
  463. }
  464. Py_XDECREF(sys);
  465. Py_XDECREF(default_encoding);
  466. Py_XDECREF(ascii_chars_u);
  467. Py_XDECREF(ascii_chars_b);
  468. return 0;
  469. bad:
  470. Py_XDECREF(sys);
  471. Py_XDECREF(default_encoding);
  472. Py_XDECREF(ascii_chars_u);
  473. Py_XDECREF(ascii_chars_b);
  474. return -1;
  475. }
  476. #endif
  477. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  478. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  479. #else
  480. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  481. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  482. static char* __PYX_DEFAULT_STRING_ENCODING;
  483. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  484. PyObject* sys = NULL;
  485. PyObject* default_encoding = NULL;
  486. char* default_encoding_c;
  487. sys = PyImport_ImportModule("sys");
  488. if (sys == NULL) goto bad;
  489. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  490. if (default_encoding == NULL) goto bad;
  491. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  492. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  493. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  494. Py_DECREF(sys);
  495. Py_DECREF(default_encoding);
  496. return 0;
  497. bad:
  498. Py_XDECREF(sys);
  499. Py_XDECREF(default_encoding);
  500. return -1;
  501. }
  502. #endif
  503. #endif
  504. /* Test for GCC > 2.95 */
  505. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  506. #define likely(x) __builtin_expect(!!(x), 1)
  507. #define unlikely(x) __builtin_expect(!!(x), 0)
  508. #else /* !__GNUC__ or GCC < 2.95 */
  509. #define likely(x) (x)
  510. #define unlikely(x) (x)
  511. #endif /* __GNUC__ */
  512. static PyObject *__pyx_m;
  513. static PyObject *__pyx_d;
  514. static PyObject *__pyx_b;
  515. static PyObject *__pyx_empty_tuple;
  516. static PyObject *__pyx_empty_bytes;
  517. static int __pyx_lineno;
  518. static int __pyx_clineno = 0;
  519. static const char * __pyx_cfilenm= __FILE__;
  520. static const char *__pyx_filename;
  521. #if !defined(CYTHON_CCOMPLEX)
  522. #if defined(__cplusplus)
  523. #define CYTHON_CCOMPLEX 1
  524. #elif defined(_Complex_I)
  525. #define CYTHON_CCOMPLEX 1
  526. #else
  527. #define CYTHON_CCOMPLEX 0
  528. #endif
  529. #endif
  530. #if CYTHON_CCOMPLEX
  531. #ifdef __cplusplus
  532. #include <complex>
  533. #else
  534. #include <complex.h>
  535. #endif
  536. #endif
  537. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  538. #undef _Complex_I
  539. #define _Complex_I 1.0fj
  540. #endif
  541. static const char *__pyx_f[] = {
  542. "scattnlay.pyx",
  543. "__init__.pxd",
  544. "type.pxd",
  545. };
  546. #define IS_UNSIGNED(type) (((type) -1) > 0)
  547. struct __Pyx_StructField_;
  548. #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
  549. typedef struct {
  550. const char* name; /* for error messages only */
  551. struct __Pyx_StructField_* fields;
  552. size_t size; /* sizeof(type) */
  553. size_t arraysize[8]; /* length of array in each dimension */
  554. int ndim;
  555. char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  556. char is_unsigned;
  557. int flags;
  558. } __Pyx_TypeInfo;
  559. typedef struct __Pyx_StructField_ {
  560. __Pyx_TypeInfo* type;
  561. const char* name;
  562. size_t offset;
  563. } __Pyx_StructField;
  564. typedef struct {
  565. __Pyx_StructField* field;
  566. size_t parent_offset;
  567. } __Pyx_BufFmt_StackElem;
  568. typedef struct {
  569. __Pyx_StructField root;
  570. __Pyx_BufFmt_StackElem* head;
  571. size_t fmt_offset;
  572. size_t new_count, enc_count;
  573. size_t struct_alignment;
  574. int is_complex;
  575. char enc_type;
  576. char new_packmode;
  577. char enc_packmode;
  578. char is_valid_array;
  579. } __Pyx_BufFmt_Context;
  580. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
  581. * # in Cython to enable them only on the right systems.
  582. *
  583. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  584. * ctypedef npy_int16 int16_t
  585. * ctypedef npy_int32 int32_t
  586. */
  587. typedef npy_int8 __pyx_t_5numpy_int8_t;
  588. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
  589. *
  590. * ctypedef npy_int8 int8_t
  591. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  592. * ctypedef npy_int32 int32_t
  593. * ctypedef npy_int64 int64_t
  594. */
  595. typedef npy_int16 __pyx_t_5numpy_int16_t;
  596. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
  597. * ctypedef npy_int8 int8_t
  598. * ctypedef npy_int16 int16_t
  599. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  600. * ctypedef npy_int64 int64_t
  601. * #ctypedef npy_int96 int96_t
  602. */
  603. typedef npy_int32 __pyx_t_5numpy_int32_t;
  604. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
  605. * ctypedef npy_int16 int16_t
  606. * ctypedef npy_int32 int32_t
  607. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  608. * #ctypedef npy_int96 int96_t
  609. * #ctypedef npy_int128 int128_t
  610. */
  611. typedef npy_int64 __pyx_t_5numpy_int64_t;
  612. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
  613. * #ctypedef npy_int128 int128_t
  614. *
  615. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  616. * ctypedef npy_uint16 uint16_t
  617. * ctypedef npy_uint32 uint32_t
  618. */
  619. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  620. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
  621. *
  622. * ctypedef npy_uint8 uint8_t
  623. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  624. * ctypedef npy_uint32 uint32_t
  625. * ctypedef npy_uint64 uint64_t
  626. */
  627. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  628. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
  629. * ctypedef npy_uint8 uint8_t
  630. * ctypedef npy_uint16 uint16_t
  631. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  632. * ctypedef npy_uint64 uint64_t
  633. * #ctypedef npy_uint96 uint96_t
  634. */
  635. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  636. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
  637. * ctypedef npy_uint16 uint16_t
  638. * ctypedef npy_uint32 uint32_t
  639. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  640. * #ctypedef npy_uint96 uint96_t
  641. * #ctypedef npy_uint128 uint128_t
  642. */
  643. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  644. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
  645. * #ctypedef npy_uint128 uint128_t
  646. *
  647. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  648. * ctypedef npy_float64 float64_t
  649. * #ctypedef npy_float80 float80_t
  650. */
  651. typedef npy_float32 __pyx_t_5numpy_float32_t;
  652. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
  653. *
  654. * ctypedef npy_float32 float32_t
  655. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  656. * #ctypedef npy_float80 float80_t
  657. * #ctypedef npy_float128 float128_t
  658. */
  659. typedef npy_float64 __pyx_t_5numpy_float64_t;
  660. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
  661. * # The int types are mapped a bit surprising --
  662. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  663. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  664. * ctypedef npy_longlong long_t
  665. * ctypedef npy_longlong longlong_t
  666. */
  667. typedef npy_long __pyx_t_5numpy_int_t;
  668. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
  669. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  670. * ctypedef npy_long int_t
  671. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  672. * ctypedef npy_longlong longlong_t
  673. *
  674. */
  675. typedef npy_longlong __pyx_t_5numpy_long_t;
  676. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
  677. * ctypedef npy_long int_t
  678. * ctypedef npy_longlong long_t
  679. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  680. *
  681. * ctypedef npy_ulong uint_t
  682. */
  683. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  684. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
  685. * ctypedef npy_longlong longlong_t
  686. *
  687. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  688. * ctypedef npy_ulonglong ulong_t
  689. * ctypedef npy_ulonglong ulonglong_t
  690. */
  691. typedef npy_ulong __pyx_t_5numpy_uint_t;
  692. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
  693. *
  694. * ctypedef npy_ulong uint_t
  695. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  696. * ctypedef npy_ulonglong ulonglong_t
  697. *
  698. */
  699. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  700. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
  701. * ctypedef npy_ulong uint_t
  702. * ctypedef npy_ulonglong ulong_t
  703. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  704. *
  705. * ctypedef npy_intp intp_t
  706. */
  707. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  708. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
  709. * ctypedef npy_ulonglong ulonglong_t
  710. *
  711. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  712. * ctypedef npy_uintp uintp_t
  713. *
  714. */
  715. typedef npy_intp __pyx_t_5numpy_intp_t;
  716. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
  717. *
  718. * ctypedef npy_intp intp_t
  719. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  720. *
  721. * ctypedef npy_double float_t
  722. */
  723. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  724. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
  725. * ctypedef npy_uintp uintp_t
  726. *
  727. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  728. * ctypedef npy_double double_t
  729. * ctypedef npy_longdouble longdouble_t
  730. */
  731. typedef npy_double __pyx_t_5numpy_float_t;
  732. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
  733. *
  734. * ctypedef npy_double float_t
  735. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  736. * ctypedef npy_longdouble longdouble_t
  737. *
  738. */
  739. typedef npy_double __pyx_t_5numpy_double_t;
  740. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
  741. * ctypedef npy_double float_t
  742. * ctypedef npy_double double_t
  743. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  744. *
  745. * ctypedef npy_cfloat cfloat_t
  746. */
  747. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  748. #if CYTHON_CCOMPLEX
  749. #ifdef __cplusplus
  750. typedef ::std::complex< double > __pyx_t_double_complex;
  751. #else
  752. typedef double _Complex __pyx_t_double_complex;
  753. #endif
  754. #else
  755. typedef struct { double real, imag; } __pyx_t_double_complex;
  756. #endif
  757. #if CYTHON_CCOMPLEX
  758. #ifdef __cplusplus
  759. typedef ::std::complex< float > __pyx_t_float_complex;
  760. #else
  761. typedef float _Complex __pyx_t_float_complex;
  762. #endif
  763. #else
  764. typedef struct { float real, imag; } __pyx_t_float_complex;
  765. #endif
  766. /*--- Type declarations ---*/
  767. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
  768. * ctypedef npy_longdouble longdouble_t
  769. *
  770. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  771. * ctypedef npy_cdouble cdouble_t
  772. * ctypedef npy_clongdouble clongdouble_t
  773. */
  774. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  775. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
  776. *
  777. * ctypedef npy_cfloat cfloat_t
  778. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  779. * ctypedef npy_clongdouble clongdouble_t
  780. *
  781. */
  782. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  783. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
  784. * ctypedef npy_cfloat cfloat_t
  785. * ctypedef npy_cdouble cdouble_t
  786. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  787. *
  788. * ctypedef npy_cdouble complex_t
  789. */
  790. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  791. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
  792. * ctypedef npy_clongdouble clongdouble_t
  793. *
  794. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  795. *
  796. * cdef inline object PyArray_MultiIterNew1(a):
  797. */
  798. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  799. #ifndef CYTHON_REFNANNY
  800. #define CYTHON_REFNANNY 0
  801. #endif
  802. #if CYTHON_REFNANNY
  803. typedef struct {
  804. void (*INCREF)(void*, PyObject*, int);
  805. void (*DECREF)(void*, PyObject*, int);
  806. void (*GOTREF)(void*, PyObject*, int);
  807. void (*GIVEREF)(void*, PyObject*, int);
  808. void* (*SetupContext)(const char*, int, const char*);
  809. void (*FinishContext)(void**);
  810. } __Pyx_RefNannyAPIStruct;
  811. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  812. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  813. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  814. #ifdef WITH_THREAD
  815. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  816. if (acquire_gil) { \
  817. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  818. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  819. PyGILState_Release(__pyx_gilstate_save); \
  820. } else { \
  821. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  822. }
  823. #else
  824. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  825. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  826. #endif
  827. #define __Pyx_RefNannyFinishContext() \
  828. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  829. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  830. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  831. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  832. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  833. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  834. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  835. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  836. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  837. #else
  838. #define __Pyx_RefNannyDeclarations
  839. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  840. #define __Pyx_RefNannyFinishContext()
  841. #define __Pyx_INCREF(r) Py_INCREF(r)
  842. #define __Pyx_DECREF(r) Py_DECREF(r)
  843. #define __Pyx_GOTREF(r)
  844. #define __Pyx_GIVEREF(r)
  845. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  846. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  847. #define __Pyx_XGOTREF(r)
  848. #define __Pyx_XGIVEREF(r)
  849. #endif /* CYTHON_REFNANNY */
  850. #define __Pyx_XDECREF_SET(r, v) do { \
  851. PyObject *tmp = (PyObject *) r; \
  852. r = v; __Pyx_XDECREF(tmp); \
  853. } while (0)
  854. #define __Pyx_DECREF_SET(r, v) do { \
  855. PyObject *tmp = (PyObject *) r; \
  856. r = v; __Pyx_DECREF(tmp); \
  857. } while (0)
  858. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  859. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  860. #if CYTHON_COMPILING_IN_CPYTHON
  861. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  862. PyTypeObject* tp = Py_TYPE(obj);
  863. if (likely(tp->tp_getattro))
  864. return tp->tp_getattro(obj, attr_name);
  865. #if PY_MAJOR_VERSION < 3
  866. if (likely(tp->tp_getattr))
  867. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  868. #endif
  869. return PyObject_GetAttr(obj, attr_name);
  870. }
  871. #else
  872. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  873. #endif
  874. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  875. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  876. #if CYTHON_COMPILING_IN_CPYTHON
  877. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  878. #else
  879. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  880. #endif
  881. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
  882. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  883. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  884. static void __Pyx_WriteUnraisable(const char *name, int clineno,
  885. int lineno, const char *filename,
  886. int full_traceback); /*proto*/
  887. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  888. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  889. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  890. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  891. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  892. const char* function_name); /*proto*/
  893. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  894. const char *name, int exact); /*proto*/
  895. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  896. __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
  897. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
  898. static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
  899. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  900. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  901. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
  902. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
  903. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  904. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  905. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  906. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  907. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  908. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  909. int wraparound, int boundscheck);
  910. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  911. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  912. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  913. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  914. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  915. int wraparound, int boundscheck);
  916. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  917. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  918. int is_list, int wraparound, int boundscheck);
  919. static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
  920. #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
  921. #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  922. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  923. __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
  924. (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
  925. __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
  926. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
  927. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  928. int is_list, int wraparound, int boundscheck);
  929. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  930. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  931. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  932. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  933. typedef struct {
  934. Py_ssize_t shape, strides, suboffsets;
  935. } __Pyx_Buf_DimInfo;
  936. typedef struct {
  937. size_t refcount;
  938. Py_buffer pybuffer;
  939. } __Pyx_Buffer;
  940. typedef struct {
  941. __Pyx_Buffer *rcbuffer;
  942. char *data;
  943. __Pyx_Buf_DimInfo diminfo[8];
  944. } __Pyx_LocalBuf_ND;
  945. #if PY_MAJOR_VERSION < 3
  946. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
  947. static void __Pyx_ReleaseBuffer(Py_buffer *view);
  948. #else
  949. #define __Pyx_GetBuffer PyObject_GetBuffer
  950. #define __Pyx_ReleaseBuffer PyBuffer_Release
  951. #endif
  952. static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
  953. static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
  954. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  955. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
  956. #if CYTHON_CCOMPLEX
  957. #ifdef __cplusplus
  958. #define __Pyx_CREAL(z) ((z).real())
  959. #define __Pyx_CIMAG(z) ((z).imag())
  960. #else
  961. #define __Pyx_CREAL(z) (__real__(z))
  962. #define __Pyx_CIMAG(z) (__imag__(z))
  963. #endif
  964. #else
  965. #define __Pyx_CREAL(z) ((z).real)
  966. #define __Pyx_CIMAG(z) ((z).imag)
  967. #endif
  968. #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
  969. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  970. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  971. #else
  972. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  973. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  974. #endif
  975. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  976. #if CYTHON_CCOMPLEX
  977. #define __Pyx_c_eq(a, b) ((a)==(b))
  978. #define __Pyx_c_sum(a, b) ((a)+(b))
  979. #define __Pyx_c_diff(a, b) ((a)-(b))
  980. #define __Pyx_c_prod(a, b) ((a)*(b))
  981. #define __Pyx_c_quot(a, b) ((a)/(b))
  982. #define __Pyx_c_neg(a) (-(a))
  983. #ifdef __cplusplus
  984. #define __Pyx_c_is_zero(z) ((z)==(double)0)
  985. #define __Pyx_c_conj(z) (::std::conj(z))
  986. #if 1
  987. #define __Pyx_c_abs(z) (::std::abs(z))
  988. #define __Pyx_c_pow(a, b) (::std::pow(a, b))
  989. #endif
  990. #else
  991. #define __Pyx_c_is_zero(z) ((z)==0)
  992. #define __Pyx_c_conj(z) (conj(z))
  993. #if 1
  994. #define __Pyx_c_abs(z) (cabs(z))
  995. #define __Pyx_c_pow(a, b) (cpow(a, b))
  996. #endif
  997. #endif
  998. #else
  999. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
  1000. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
  1001. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
  1002. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
  1003. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
  1004. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
  1005. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
  1006. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
  1007. #if 1
  1008. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
  1009. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
  1010. #endif
  1011. #endif
  1012. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1013. #if CYTHON_CCOMPLEX
  1014. #define __Pyx_c_eqf(a, b) ((a)==(b))
  1015. #define __Pyx_c_sumf(a, b) ((a)+(b))
  1016. #define __Pyx_c_difff(a, b) ((a)-(b))
  1017. #define __Pyx_c_prodf(a, b) ((a)*(b))
  1018. #define __Pyx_c_quotf(a, b) ((a)/(b))
  1019. #define __Pyx_c_negf(a) (-(a))
  1020. #ifdef __cplusplus
  1021. #define __Pyx_c_is_zerof(z) ((z)==(float)0)
  1022. #define __Pyx_c_conjf(z) (::std::conj(z))
  1023. #if 1
  1024. #define __Pyx_c_absf(z) (::std::abs(z))
  1025. #define __Pyx_c_powf(a, b) (::std::pow(a, b))
  1026. #endif
  1027. #else
  1028. #define __Pyx_c_is_zerof(z) ((z)==0)
  1029. #define __Pyx_c_conjf(z) (conjf(z))
  1030. #if 1
  1031. #define __Pyx_c_absf(z) (cabsf(z))
  1032. #define __Pyx_c_powf(a, b) (cpowf(a, b))
  1033. #endif
  1034. #endif
  1035. #else
  1036. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
  1037. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
  1038. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
  1039. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
  1040. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
  1041. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
  1042. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
  1043. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
  1044. #if 1
  1045. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
  1046. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
  1047. #endif
  1048. #endif
  1049. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1050. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1051. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1052. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1053. static int __Pyx_check_binary_version(void);
  1054. #if !defined(__Pyx_PyIdentifier_FromString)
  1055. #if PY_MAJOR_VERSION < 3
  1056. #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
  1057. #else
  1058. #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
  1059. #endif
  1060. #endif
  1061. static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
  1062. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
  1063. typedef struct {
  1064. int code_line;
  1065. PyCodeObject* code_object;
  1066. } __Pyx_CodeObjectCacheEntry;
  1067. struct __Pyx_CodeObjectCache {
  1068. int count;
  1069. int max_count;
  1070. __Pyx_CodeObjectCacheEntry* entries;
  1071. };
  1072. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1073. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1074. static PyCodeObject *__pyx_find_code_object(int code_line);
  1075. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1076. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1077. int py_line, const char *filename); /*proto*/
  1078. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  1079. /* Module declarations from 'cpython.buffer' */
  1080. /* Module declarations from 'cpython.ref' */
  1081. /* Module declarations from 'libc.string' */
  1082. /* Module declarations from 'libc.stdio' */
  1083. /* Module declarations from 'cpython.object' */
  1084. /* Module declarations from '__builtin__' */
  1085. /* Module declarations from 'cpython.type' */
  1086. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1087. /* Module declarations from 'libc.stdlib' */
  1088. /* Module declarations from 'numpy' */
  1089. /* Module declarations from 'numpy' */
  1090. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1091. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1092. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1093. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1094. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1095. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1096. /* Module declarations from 'scattnlay' */
  1097. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *); /*proto*/
  1098. static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
  1099. static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
  1100. static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
  1101. #define __Pyx_MODULE_NAME "scattnlay"
  1102. int __pyx_module_is_main_scattnlay = 0;
  1103. /* Implementation of 'scattnlay' */
  1104. static PyObject *__pyx_builtin_range;
  1105. static PyObject *__pyx_builtin_ValueError;
  1106. static PyObject *__pyx_builtin_RuntimeError;
  1107. static PyObject *__pyx_pf_9scattnlay_scattnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_theta, Py_ssize_t __pyx_v_pl, Py_ssize_t __pyx_v_n_max); /* proto */
  1108. static PyObject *__pyx_pf_9scattnlay_2fieldnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_coords, Py_ssize_t __pyx_v_pl, Py_ssize_t __pyx_v_n_max); /* proto */
  1109. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  1110. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  1111. static char __pyx_k_B[] = "B";
  1112. static char __pyx_k_C[] = "C";
  1113. static char __pyx_k_E[] = "E";
  1114. static char __pyx_k_H[] = "H";
  1115. static char __pyx_k_I[] = "I";
  1116. static char __pyx_k_L[] = "L";
  1117. static char __pyx_k_O[] = "O";
  1118. static char __pyx_k_Q[] = "Q";
  1119. static char __pyx_k_b[] = "b";
  1120. static char __pyx_k_d[] = "d";
  1121. static char __pyx_k_f[] = "f";
  1122. static char __pyx_k_g[] = "g";
  1123. static char __pyx_k_h[] = "h";
  1124. static char __pyx_k_i[] = "i";
  1125. static char __pyx_k_l[] = "l";
  1126. static char __pyx_k_m[] = "m";
  1127. static char __pyx_k_q[] = "q";
  1128. static char __pyx_k_x[] = "x";
  1129. static char __pyx_k_Ei[] = "Ei";
  1130. static char __pyx_k_Er[] = "Er";
  1131. static char __pyx_k_Hi[] = "Hi";
  1132. static char __pyx_k_Hr[] = "Hr";
  1133. static char __pyx_k_S1[] = "S1";
  1134. static char __pyx_k_S2[] = "S2";
  1135. static char __pyx_k_Zd[] = "Zd";
  1136. static char __pyx_k_Zf[] = "Zf";
  1137. static char __pyx_k_Zg[] = "Zg";
  1138. static char __pyx_k_np[] = "np";
  1139. static char __pyx_k_pl[] = "pl";
  1140. static char __pyx_k_Qbk[] = "Qbk";
  1141. static char __pyx_k_Qpr[] = "Qpr";
  1142. static char __pyx_k_S1i[] = "S1i";
  1143. static char __pyx_k_S1r[] = "S1r";
  1144. static char __pyx_k_S2i[] = "S2i";
  1145. static char __pyx_k_S2r[] = "S2r";
  1146. static char __pyx_k_int[] = "int";
  1147. static char __pyx_k_Qabs[] = "Qabs";
  1148. static char __pyx_k_Qext[] = "Qext";
  1149. static char __pyx_k_Qsca[] = "Qsca";
  1150. static char __pyx_k_copy[] = "copy";
  1151. static char __pyx_k_imag[] = "imag";
  1152. static char __pyx_k_main[] = "__main__";
  1153. static char __pyx_k_real[] = "real";
  1154. static char __pyx_k_test[] = "__test__";
  1155. static char __pyx_k_dtype[] = "dtype";
  1156. static char __pyx_k_flags[] = "flags";
  1157. static char __pyx_k_n_max[] = "n_max";
  1158. static char __pyx_k_numpy[] = "numpy";
  1159. static char __pyx_k_range[] = "range";
  1160. static char __pyx_k_terms[] = "terms";
  1161. static char __pyx_k_theta[] = "theta";
  1162. static char __pyx_k_zeros[] = "zeros";
  1163. static char __pyx_k_Albedo[] = "Albedo";
  1164. static char __pyx_k_coords[] = "coords";
  1165. static char __pyx_k_import[] = "__import__";
  1166. static char __pyx_k_float64[] = "float64";
  1167. static char __pyx_k_fieldnlay[] = "fieldnlay";
  1168. static char __pyx_k_scattnlay[] = "scattnlay";
  1169. static char __pyx_k_ValueError[] = "ValueError";
  1170. static char __pyx_k_complex128[] = "complex128";
  1171. static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
  1172. static char __pyx_k_RuntimeError[] = "RuntimeError";
  1173. static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
  1174. static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer";
  1175. static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  1176. static char __pyx_k_home_ovidio_scattering_scattnla[] = "/home/ovidio/scattering/scattnlay/python-scattnlay-0.3.0/scattnlay.pyx";
  1177. static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  1178. static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  1179. static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  1180. static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  1181. static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  1182. static PyObject *__pyx_n_s_Albedo;
  1183. static PyObject *__pyx_n_s_C;
  1184. static PyObject *__pyx_n_s_C_CONTIGUOUS;
  1185. static PyObject *__pyx_n_s_E;
  1186. static PyObject *__pyx_n_s_Ei;
  1187. static PyObject *__pyx_n_s_Er;
  1188. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  1189. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  1190. static PyObject *__pyx_n_s_H;
  1191. static PyObject *__pyx_n_s_Hi;
  1192. static PyObject *__pyx_n_s_Hr;
  1193. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  1194. static PyObject *__pyx_n_s_Qabs;
  1195. static PyObject *__pyx_n_s_Qbk;
  1196. static PyObject *__pyx_n_s_Qext;
  1197. static PyObject *__pyx_n_s_Qpr;
  1198. static PyObject *__pyx_n_s_Qsca;
  1199. static PyObject *__pyx_n_s_RuntimeError;
  1200. static PyObject *__pyx_n_s_S1;
  1201. static PyObject *__pyx_n_s_S1i;
  1202. static PyObject *__pyx_n_s_S1r;
  1203. static PyObject *__pyx_n_s_S2;
  1204. static PyObject *__pyx_n_s_S2i;
  1205. static PyObject *__pyx_n_s_S2r;
  1206. static PyObject *__pyx_n_s_ValueError;
  1207. static PyObject *__pyx_n_s_complex128;
  1208. static PyObject *__pyx_n_s_coords;
  1209. static PyObject *__pyx_n_s_copy;
  1210. static PyObject *__pyx_n_s_dtype;
  1211. static PyObject *__pyx_n_s_fieldnlay;
  1212. static PyObject *__pyx_n_s_flags;
  1213. static PyObject *__pyx_n_s_float64;
  1214. static PyObject *__pyx_n_s_g;
  1215. static PyObject *__pyx_kp_s_home_ovidio_scattering_scattnla;
  1216. static PyObject *__pyx_n_s_i;
  1217. static PyObject *__pyx_n_s_imag;
  1218. static PyObject *__pyx_n_s_import;
  1219. static PyObject *__pyx_n_s_int;
  1220. static PyObject *__pyx_n_s_m;
  1221. static PyObject *__pyx_n_s_main;
  1222. static PyObject *__pyx_n_s_n_max;
  1223. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  1224. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  1225. static PyObject *__pyx_n_s_np;
  1226. static PyObject *__pyx_n_s_numpy;
  1227. static PyObject *__pyx_n_s_pl;
  1228. static PyObject *__pyx_n_s_pyx_getbuffer;
  1229. static PyObject *__pyx_n_s_pyx_releasebuffer;
  1230. static PyObject *__pyx_n_s_range;
  1231. static PyObject *__pyx_n_s_real;
  1232. static PyObject *__pyx_n_s_scattnlay;
  1233. static PyObject *__pyx_n_s_terms;
  1234. static PyObject *__pyx_n_s_test;
  1235. static PyObject *__pyx_n_s_theta;
  1236. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  1237. static PyObject *__pyx_n_s_x;
  1238. static PyObject *__pyx_n_s_zeros;
  1239. static PyObject *__pyx_int_0;
  1240. static PyObject *__pyx_int_1;
  1241. static PyObject *__pyx_int_2;
  1242. static PyObject *__pyx_int_3;
  1243. static PyArrayObject *__pyx_k__2;
  1244. static PyArrayObject *__pyx_k__10;
  1245. static PyObject *__pyx_tuple_;
  1246. static PyObject *__pyx_tuple__3;
  1247. static PyObject *__pyx_tuple__4;
  1248. static PyObject *__pyx_tuple__5;
  1249. static PyObject *__pyx_tuple__6;
  1250. static PyObject *__pyx_tuple__7;
  1251. static PyObject *__pyx_tuple__8;
  1252. static PyObject *__pyx_tuple__9;
  1253. static PyObject *__pyx_slice__14;
  1254. static PyObject *__pyx_slice__16;
  1255. static PyObject *__pyx_slice__18;
  1256. static PyObject *__pyx_tuple__11;
  1257. static PyObject *__pyx_tuple__12;
  1258. static PyObject *__pyx_tuple__13;
  1259. static PyObject *__pyx_tuple__15;
  1260. static PyObject *__pyx_tuple__17;
  1261. static PyObject *__pyx_tuple__19;
  1262. static PyObject *__pyx_tuple__20;
  1263. static PyObject *__pyx_tuple__21;
  1264. static PyObject *__pyx_tuple__22;
  1265. static PyObject *__pyx_tuple__23;
  1266. static PyObject *__pyx_tuple__24;
  1267. static PyObject *__pyx_tuple__25;
  1268. static PyObject *__pyx_tuple__26;
  1269. static PyObject *__pyx_tuple__27;
  1270. static PyObject *__pyx_tuple__28;
  1271. static PyObject *__pyx_tuple__29;
  1272. static PyObject *__pyx_tuple__30;
  1273. static PyObject *__pyx_tuple__31;
  1274. static PyObject *__pyx_tuple__33;
  1275. static PyObject *__pyx_tuple__34;
  1276. static PyObject *__pyx_tuple__35;
  1277. static PyObject *__pyx_codeobj__32;
  1278. static PyObject *__pyx_codeobj__36;
  1279. /* "scattnlay.pyx":29
  1280. * cimport numpy as np
  1281. *
  1282. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1283. * assert a.dtype == np.float64
  1284. *
  1285. */
  1286. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *__pyx_v_a) {
  1287. double *__pyx_r;
  1288. __Pyx_RefNannyDeclarations
  1289. PyObject *__pyx_t_1 = NULL;
  1290. PyObject *__pyx_t_2 = NULL;
  1291. PyObject *__pyx_t_3 = NULL;
  1292. int __pyx_t_4;
  1293. int __pyx_t_5;
  1294. int __pyx_lineno = 0;
  1295. const char *__pyx_filename = NULL;
  1296. int __pyx_clineno = 0;
  1297. __Pyx_RefNannySetupContext("npy2c", 0);
  1298. __Pyx_INCREF((PyObject *)__pyx_v_a);
  1299. /* "scattnlay.pyx":30
  1300. *
  1301. * cdef inline double *npy2c(np.ndarray a):
  1302. * assert a.dtype == np.float64 # <<<<<<<<<<<<<<
  1303. *
  1304. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1305. */
  1306. #ifndef CYTHON_WITHOUT_ASSERTIONS
  1307. if (unlikely(!Py_OptimizeFlag)) {
  1308. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1309. __Pyx_GOTREF(__pyx_t_1);
  1310. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1311. __Pyx_GOTREF(__pyx_t_2);
  1312. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1313. __Pyx_GOTREF(__pyx_t_3);
  1314. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1315. __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1316. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1317. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1318. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1319. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1320. if (unlikely(!__pyx_t_4)) {
  1321. PyErr_SetNone(PyExc_AssertionError);
  1322. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1323. }
  1324. }
  1325. #endif
  1326. /* "scattnlay.pyx":32
  1327. * assert a.dtype == np.float64
  1328. *
  1329. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy # <<<<<<<<<<<<<<
  1330. * a = a.copy('C')
  1331. *
  1332. */
  1333. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1334. __Pyx_GOTREF(__pyx_t_2);
  1335. __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  1336. __Pyx_GOTREF(__pyx_t_3);
  1337. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1338. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1339. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1340. __pyx_t_5 = ((!__pyx_t_4) != 0);
  1341. if (__pyx_t_5) {
  1342. /* "scattnlay.pyx":33
  1343. *
  1344. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1345. * a = a.copy('C') # <<<<<<<<<<<<<<
  1346. *
  1347. * # Return data pointer
  1348. */
  1349. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1350. __Pyx_GOTREF(__pyx_t_3);
  1351. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1352. __Pyx_GOTREF(__pyx_t_2);
  1353. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1354. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1355. __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
  1356. __pyx_t_2 = 0;
  1357. goto __pyx_L3;
  1358. }
  1359. __pyx_L3:;
  1360. /* "scattnlay.pyx":36
  1361. *
  1362. * # Return data pointer
  1363. * return <double *>(a.data) # <<<<<<<<<<<<<<
  1364. *
  1365. * cdef extern from "py_nmie.h":
  1366. */
  1367. __pyx_r = ((double *)__pyx_v_a->data);
  1368. goto __pyx_L0;
  1369. /* "scattnlay.pyx":29
  1370. * cimport numpy as np
  1371. *
  1372. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1373. * assert a.dtype == np.float64
  1374. *
  1375. */
  1376. /* function exit code */
  1377. __pyx_L1_error:;
  1378. __Pyx_XDECREF(__pyx_t_1);
  1379. __Pyx_XDECREF(__pyx_t_2);
  1380. __Pyx_XDECREF(__pyx_t_3);
  1381. __Pyx_WriteUnraisable("scattnlay.npy2c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  1382. __pyx_r = 0;
  1383. __pyx_L0:;
  1384. __Pyx_XDECREF((PyObject *)__pyx_v_a);
  1385. __Pyx_RefNannyFinishContext();
  1386. return __pyx_r;
  1387. }
  1388. /* "scattnlay.pyx":42
  1389. * int nfMieField(int L, int pl, double x[], double mr[], double mi[], int n_max, int nCoords, double Xp[], double Yp[], double Zp[], double Er[], double Ei[], double Hr[], double Hi[])
  1390. *
  1391. * def scattnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 1] theta = np.zeros(0, dtype = np.float64), Py_ssize_t pl = -1, Py_ssize_t n_max = -1): # <<<<<<<<<<<<<<
  1392. * cdef Py_ssize_t i
  1393. *
  1394. */
  1395. /* Python wrapper */
  1396. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1397. static PyMethodDef __pyx_mdef_9scattnlay_1scattnlay = {__Pyx_NAMESTR("scattnlay"), (PyCFunction)__pyx_pw_9scattnlay_1scattnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1398. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1399. PyArrayObject *__pyx_v_x = 0;
  1400. PyArrayObject *__pyx_v_m = 0;
  1401. PyArrayObject *__pyx_v_theta = 0;
  1402. Py_ssize_t __pyx_v_pl;
  1403. Py_ssize_t __pyx_v_n_max;
  1404. int __pyx_lineno = 0;
  1405. const char *__pyx_filename = NULL;
  1406. int __pyx_clineno = 0;
  1407. PyObject *__pyx_r = 0;
  1408. __Pyx_RefNannyDeclarations
  1409. __Pyx_RefNannySetupContext("scattnlay (wrapper)", 0);
  1410. {
  1411. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_theta,&__pyx_n_s_pl,&__pyx_n_s_n_max,0};
  1412. PyObject* values[5] = {0,0,0,0,0};
  1413. values[2] = (PyObject *)__pyx_k__2;
  1414. if (unlikely(__pyx_kwds)) {
  1415. Py_ssize_t kw_args;
  1416. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1417. switch (pos_args) {
  1418. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1419. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1420. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1421. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1422. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1423. case 0: break;
  1424. default: goto __pyx_L5_argtuple_error;
  1425. }
  1426. kw_args = PyDict_Size(__pyx_kwds);
  1427. switch (pos_args) {
  1428. case 0:
  1429. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  1430. else goto __pyx_L5_argtuple_error;
  1431. case 1:
  1432. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  1433. else {
  1434. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1435. }
  1436. case 2:
  1437. if (kw_args > 0) {
  1438. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta);
  1439. if (value) { values[2] = value; kw_args--; }
  1440. }
  1441. case 3:
  1442. if (kw_args > 0) {
  1443. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  1444. if (value) { values[3] = value; kw_args--; }
  1445. }
  1446. case 4:
  1447. if (kw_args > 0) {
  1448. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_max);
  1449. if (value) { values[4] = value; kw_args--; }
  1450. }
  1451. }
  1452. if (unlikely(kw_args > 0)) {
  1453. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scattnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1454. }
  1455. } else {
  1456. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1457. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1458. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1459. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1460. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1461. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1462. break;
  1463. default: goto __pyx_L5_argtuple_error;
  1464. }
  1465. }
  1466. __pyx_v_x = ((PyArrayObject *)values[0]);
  1467. __pyx_v_m = ((PyArrayObject *)values[1]);
  1468. __pyx_v_theta = ((PyArrayObject *)values[2]);
  1469. if (values[3]) {
  1470. __pyx_v_pl = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_pl == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1471. } else {
  1472. __pyx_v_pl = ((Py_ssize_t)-1);
  1473. }
  1474. if (values[4]) {
  1475. __pyx_v_n_max = __Pyx_PyIndex_AsSsize_t(values[4]); if (unlikely((__pyx_v_n_max == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1476. } else {
  1477. __pyx_v_n_max = ((Py_ssize_t)-1);
  1478. }
  1479. }
  1480. goto __pyx_L4_argument_unpacking_done;
  1481. __pyx_L5_argtuple_error:;
  1482. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1483. __pyx_L3_error:;
  1484. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1485. __Pyx_RefNannyFinishContext();
  1486. return NULL;
  1487. __pyx_L4_argument_unpacking_done:;
  1488. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1489. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1490. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1491. __pyx_r = __pyx_pf_9scattnlay_scattnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_theta, __pyx_v_pl, __pyx_v_n_max);
  1492. /* function exit code */
  1493. goto __pyx_L0;
  1494. __pyx_L1_error:;
  1495. __pyx_r = NULL;
  1496. __pyx_L0:;
  1497. __Pyx_RefNannyFinishContext();
  1498. return __pyx_r;
  1499. }
  1500. static PyObject *__pyx_pf_9scattnlay_scattnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_theta, Py_ssize_t __pyx_v_pl, Py_ssize_t __pyx_v_n_max) {
  1501. Py_ssize_t __pyx_v_i;
  1502. PyArrayObject *__pyx_v_terms = 0;
  1503. PyArrayObject *__pyx_v_Qext = 0;
  1504. PyArrayObject *__pyx_v_Qabs = 0;
  1505. PyArrayObject *__pyx_v_Qsca = 0;
  1506. PyArrayObject *__pyx_v_Qbk = 0;
  1507. PyArrayObject *__pyx_v_Qpr = 0;
  1508. PyArrayObject *__pyx_v_g = 0;
  1509. PyArrayObject *__pyx_v_Albedo = 0;
  1510. PyArrayObject *__pyx_v_S1 = 0;
  1511. PyArrayObject *__pyx_v_S2 = 0;
  1512. PyArrayObject *__pyx_v_S1r = 0;
  1513. PyArrayObject *__pyx_v_S1i = 0;
  1514. PyArrayObject *__pyx_v_S2r = 0;
  1515. PyArrayObject *__pyx_v_S2i = 0;
  1516. __Pyx_LocalBuf_ND __pyx_pybuffernd_Albedo;
  1517. __Pyx_Buffer __pyx_pybuffer_Albedo;
  1518. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qabs;
  1519. __Pyx_Buffer __pyx_pybuffer_Qabs;
  1520. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qbk;
  1521. __Pyx_Buffer __pyx_pybuffer_Qbk;
  1522. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qext;
  1523. __Pyx_Buffer __pyx_pybuffer_Qext;
  1524. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qpr;
  1525. __Pyx_Buffer __pyx_pybuffer_Qpr;
  1526. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qsca;
  1527. __Pyx_Buffer __pyx_pybuffer_Qsca;
  1528. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1;
  1529. __Pyx_Buffer __pyx_pybuffer_S1;
  1530. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1i;
  1531. __Pyx_Buffer __pyx_pybuffer_S1i;
  1532. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1r;
  1533. __Pyx_Buffer __pyx_pybuffer_S1r;
  1534. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2;
  1535. __Pyx_Buffer __pyx_pybuffer_S2;
  1536. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2i;
  1537. __Pyx_Buffer __pyx_pybuffer_S2i;
  1538. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2r;
  1539. __Pyx_Buffer __pyx_pybuffer_S2r;
  1540. __Pyx_LocalBuf_ND __pyx_pybuffernd_g;
  1541. __Pyx_Buffer __pyx_pybuffer_g;
  1542. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  1543. __Pyx_Buffer __pyx_pybuffer_m;
  1544. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  1545. __Pyx_Buffer __pyx_pybuffer_terms;
  1546. __Pyx_LocalBuf_ND __pyx_pybuffernd_theta;
  1547. __Pyx_Buffer __pyx_pybuffer_theta;
  1548. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  1549. __Pyx_Buffer __pyx_pybuffer_x;
  1550. PyObject *__pyx_r = NULL;
  1551. __Pyx_RefNannyDeclarations
  1552. PyObject *__pyx_t_1 = NULL;
  1553. PyObject *__pyx_t_2 = NULL;
  1554. PyObject *__pyx_t_3 = NULL;
  1555. PyObject *__pyx_t_4 = NULL;
  1556. PyObject *__pyx_t_5 = NULL;
  1557. PyArrayObject *__pyx_t_6 = NULL;
  1558. PyArrayObject *__pyx_t_7 = NULL;
  1559. PyArrayObject *__pyx_t_8 = NULL;
  1560. PyArrayObject *__pyx_t_9 = NULL;
  1561. PyArrayObject *__pyx_t_10 = NULL;
  1562. PyArrayObject *__pyx_t_11 = NULL;
  1563. PyArrayObject *__pyx_t_12 = NULL;
  1564. PyArrayObject *__pyx_t_13 = NULL;
  1565. PyArrayObject *__pyx_t_14 = NULL;
  1566. PyArrayObject *__pyx_t_15 = NULL;
  1567. npy_intp __pyx_t_16;
  1568. Py_ssize_t __pyx_t_17;
  1569. PyArrayObject *__pyx_t_18 = NULL;
  1570. int __pyx_t_19;
  1571. PyObject *__pyx_t_20 = NULL;
  1572. PyObject *__pyx_t_21 = NULL;
  1573. PyObject *__pyx_t_22 = NULL;
  1574. PyArrayObject *__pyx_t_23 = NULL;
  1575. PyArrayObject *__pyx_t_24 = NULL;
  1576. PyArrayObject *__pyx_t_25 = NULL;
  1577. Py_ssize_t __pyx_t_26;
  1578. Py_ssize_t __pyx_t_27;
  1579. Py_ssize_t __pyx_t_28;
  1580. Py_ssize_t __pyx_t_29;
  1581. Py_ssize_t __pyx_t_30;
  1582. Py_ssize_t __pyx_t_31;
  1583. Py_ssize_t __pyx_t_32;
  1584. Py_ssize_t __pyx_t_33;
  1585. int __pyx_lineno = 0;
  1586. const char *__pyx_filename = NULL;
  1587. int __pyx_clineno = 0;
  1588. __Pyx_RefNannySetupContext("scattnlay", 0);
  1589. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  1590. __pyx_pybuffer_terms.refcount = 0;
  1591. __pyx_pybuffernd_terms.data = NULL;
  1592. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  1593. __pyx_pybuffer_Qext.pybuffer.buf = NULL;
  1594. __pyx_pybuffer_Qext.refcount = 0;
  1595. __pyx_pybuffernd_Qext.data = NULL;
  1596. __pyx_pybuffernd_Qext.rcbuffer = &__pyx_pybuffer_Qext;
  1597. __pyx_pybuffer_Qabs.pybuffer.buf = NULL;
  1598. __pyx_pybuffer_Qabs.refcount = 0;
  1599. __pyx_pybuffernd_Qabs.data = NULL;
  1600. __pyx_pybuffernd_Qabs.rcbuffer = &__pyx_pybuffer_Qabs;
  1601. __pyx_pybuffer_Qsca.pybuffer.buf = NULL;
  1602. __pyx_pybuffer_Qsca.refcount = 0;
  1603. __pyx_pybuffernd_Qsca.data = NULL;
  1604. __pyx_pybuffernd_Qsca.rcbuffer = &__pyx_pybuffer_Qsca;
  1605. __pyx_pybuffer_Qbk.pybuffer.buf = NULL;
  1606. __pyx_pybuffer_Qbk.refcount = 0;
  1607. __pyx_pybuffernd_Qbk.data = NULL;
  1608. __pyx_pybuffernd_Qbk.rcbuffer = &__pyx_pybuffer_Qbk;
  1609. __pyx_pybuffer_Qpr.pybuffer.buf = NULL;
  1610. __pyx_pybuffer_Qpr.refcount = 0;
  1611. __pyx_pybuffernd_Qpr.data = NULL;
  1612. __pyx_pybuffernd_Qpr.rcbuffer = &__pyx_pybuffer_Qpr;
  1613. __pyx_pybuffer_g.pybuffer.buf = NULL;
  1614. __pyx_pybuffer_g.refcount = 0;
  1615. __pyx_pybuffernd_g.data = NULL;
  1616. __pyx_pybuffernd_g.rcbuffer = &__pyx_pybuffer_g;
  1617. __pyx_pybuffer_Albedo.pybuffer.buf = NULL;
  1618. __pyx_pybuffer_Albedo.refcount = 0;
  1619. __pyx_pybuffernd_Albedo.data = NULL;
  1620. __pyx_pybuffernd_Albedo.rcbuffer = &__pyx_pybuffer_Albedo;
  1621. __pyx_pybuffer_S1.pybuffer.buf = NULL;
  1622. __pyx_pybuffer_S1.refcount = 0;
  1623. __pyx_pybuffernd_S1.data = NULL;
  1624. __pyx_pybuffernd_S1.rcbuffer = &__pyx_pybuffer_S1;
  1625. __pyx_pybuffer_S2.pybuffer.buf = NULL;
  1626. __pyx_pybuffer_S2.refcount = 0;
  1627. __pyx_pybuffernd_S2.data = NULL;
  1628. __pyx_pybuffernd_S2.rcbuffer = &__pyx_pybuffer_S2;
  1629. __pyx_pybuffer_S1r.pybuffer.buf = NULL;
  1630. __pyx_pybuffer_S1r.refcount = 0;
  1631. __pyx_pybuffernd_S1r.data = NULL;
  1632. __pyx_pybuffernd_S1r.rcbuffer = &__pyx_pybuffer_S1r;
  1633. __pyx_pybuffer_S1i.pybuffer.buf = NULL;
  1634. __pyx_pybuffer_S1i.refcount = 0;
  1635. __pyx_pybuffernd_S1i.data = NULL;
  1636. __pyx_pybuffernd_S1i.rcbuffer = &__pyx_pybuffer_S1i;
  1637. __pyx_pybuffer_S2r.pybuffer.buf = NULL;
  1638. __pyx_pybuffer_S2r.refcount = 0;
  1639. __pyx_pybuffernd_S2r.data = NULL;
  1640. __pyx_pybuffernd_S2r.rcbuffer = &__pyx_pybuffer_S2r;
  1641. __pyx_pybuffer_S2i.pybuffer.buf = NULL;
  1642. __pyx_pybuffer_S2i.refcount = 0;
  1643. __pyx_pybuffernd_S2i.data = NULL;
  1644. __pyx_pybuffernd_S2i.rcbuffer = &__pyx_pybuffer_S2i;
  1645. __pyx_pybuffer_x.pybuffer.buf = NULL;
  1646. __pyx_pybuffer_x.refcount = 0;
  1647. __pyx_pybuffernd_x.data = NULL;
  1648. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  1649. __pyx_pybuffer_m.pybuffer.buf = NULL;
  1650. __pyx_pybuffer_m.refcount = 0;
  1651. __pyx_pybuffernd_m.data = NULL;
  1652. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  1653. __pyx_pybuffer_theta.pybuffer.buf = NULL;
  1654. __pyx_pybuffer_theta.refcount = 0;
  1655. __pyx_pybuffernd_theta.data = NULL;
  1656. __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta;
  1657. {
  1658. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1659. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1660. }
  1661. __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1];
  1662. {
  1663. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1664. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1665. }
  1666. __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
  1667. {
  1668. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1669. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_theta.rcbuffer->pybuffer, (PyObject*)__pyx_v_theta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1670. }
  1671. __pyx_pybuffernd_theta.diminfo[0].strides = __pyx_pybuffernd_theta.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_theta.diminfo[0].shape = __pyx_pybuffernd_theta.rcbuffer->pybuffer.shape[0];
  1672. /* "scattnlay.pyx":45
  1673. * cdef Py_ssize_t i
  1674. *
  1675. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  1676. *
  1677. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1678. */
  1679. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1680. __Pyx_GOTREF(__pyx_t_1);
  1681. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1682. __Pyx_GOTREF(__pyx_t_2);
  1683. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1684. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1685. __Pyx_GOTREF(__pyx_t_1);
  1686. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1687. __Pyx_GOTREF(__pyx_t_3);
  1688. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1689. __Pyx_GIVEREF(__pyx_t_1);
  1690. __pyx_t_1 = 0;
  1691. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1692. __Pyx_GOTREF(__pyx_t_1);
  1693. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1694. __Pyx_GOTREF(__pyx_t_4);
  1695. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1696. __Pyx_GOTREF(__pyx_t_5);
  1697. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1698. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1699. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1700. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1701. __Pyx_GOTREF(__pyx_t_5);
  1702. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1703. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1704. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1705. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1706. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  1707. {
  1708. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1709. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_terms.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
  1710. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  1711. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1712. } else {__pyx_pybuffernd_terms.diminfo[0].strides = __pyx_pybuffernd_terms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_terms.diminfo[0].shape = __pyx_pybuffernd_terms.rcbuffer->pybuffer.shape[0];
  1713. }
  1714. }
  1715. __pyx_t_6 = 0;
  1716. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  1717. __pyx_t_5 = 0;
  1718. /* "scattnlay.pyx":47
  1719. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  1720. *
  1721. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1722. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1723. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1724. */
  1725. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1726. __Pyx_GOTREF(__pyx_t_5);
  1727. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1728. __Pyx_GOTREF(__pyx_t_1);
  1729. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1730. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1731. __Pyx_GOTREF(__pyx_t_5);
  1732. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1733. __Pyx_GOTREF(__pyx_t_3);
  1734. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1735. __Pyx_GIVEREF(__pyx_t_5);
  1736. __pyx_t_5 = 0;
  1737. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1738. __Pyx_GOTREF(__pyx_t_5);
  1739. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1740. __Pyx_GOTREF(__pyx_t_2);
  1741. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1742. __Pyx_GOTREF(__pyx_t_4);
  1743. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1744. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1745. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1746. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1747. __Pyx_GOTREF(__pyx_t_4);
  1748. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1749. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1750. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1751. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1752. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  1753. {
  1754. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1755. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1756. __pyx_v_Qext = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf = NULL;
  1757. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1758. } else {__pyx_pybuffernd_Qext.diminfo[0].strides = __pyx_pybuffernd_Qext.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qext.diminfo[0].shape = __pyx_pybuffernd_Qext.rcbuffer->pybuffer.shape[0];
  1759. }
  1760. }
  1761. __pyx_t_7 = 0;
  1762. __pyx_v_Qext = ((PyArrayObject *)__pyx_t_4);
  1763. __pyx_t_4 = 0;
  1764. /* "scattnlay.pyx":48
  1765. *
  1766. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1767. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1768. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1769. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1770. */
  1771. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1772. __Pyx_GOTREF(__pyx_t_4);
  1773. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1774. __Pyx_GOTREF(__pyx_t_5);
  1775. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1776. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1777. __Pyx_GOTREF(__pyx_t_4);
  1778. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1779. __Pyx_GOTREF(__pyx_t_3);
  1780. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1781. __Pyx_GIVEREF(__pyx_t_4);
  1782. __pyx_t_4 = 0;
  1783. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1784. __Pyx_GOTREF(__pyx_t_4);
  1785. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1786. __Pyx_GOTREF(__pyx_t_1);
  1787. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1788. __Pyx_GOTREF(__pyx_t_2);
  1789. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1790. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1791. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1792. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1793. __Pyx_GOTREF(__pyx_t_2);
  1794. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1795. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1796. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1797. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1798. __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  1799. {
  1800. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1801. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1802. __pyx_v_Qabs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf = NULL;
  1803. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1804. } else {__pyx_pybuffernd_Qabs.diminfo[0].strides = __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qabs.diminfo[0].shape = __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.shape[0];
  1805. }
  1806. }
  1807. __pyx_t_8 = 0;
  1808. __pyx_v_Qabs = ((PyArrayObject *)__pyx_t_2);
  1809. __pyx_t_2 = 0;
  1810. /* "scattnlay.pyx":49
  1811. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1812. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1813. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1814. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1815. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1816. */
  1817. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1818. __Pyx_GOTREF(__pyx_t_2);
  1819. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1820. __Pyx_GOTREF(__pyx_t_4);
  1821. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1822. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1823. __Pyx_GOTREF(__pyx_t_2);
  1824. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1825. __Pyx_GOTREF(__pyx_t_3);
  1826. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  1827. __Pyx_GIVEREF(__pyx_t_2);
  1828. __pyx_t_2 = 0;
  1829. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1830. __Pyx_GOTREF(__pyx_t_2);
  1831. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1832. __Pyx_GOTREF(__pyx_t_5);
  1833. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1834. __Pyx_GOTREF(__pyx_t_1);
  1835. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1836. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1837. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1838. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1839. __Pyx_GOTREF(__pyx_t_1);
  1840. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1841. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1842. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1843. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1844. __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
  1845. {
  1846. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1847. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1848. __pyx_v_Qsca = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf = NULL;
  1849. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1850. } else {__pyx_pybuffernd_Qsca.diminfo[0].strides = __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qsca.diminfo[0].shape = __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.shape[0];
  1851. }
  1852. }
  1853. __pyx_t_9 = 0;
  1854. __pyx_v_Qsca = ((PyArrayObject *)__pyx_t_1);
  1855. __pyx_t_1 = 0;
  1856. /* "scattnlay.pyx":50
  1857. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1858. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1859. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1860. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1861. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1862. */
  1863. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1864. __Pyx_GOTREF(__pyx_t_1);
  1865. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1866. __Pyx_GOTREF(__pyx_t_2);
  1867. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1868. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1869. __Pyx_GOTREF(__pyx_t_1);
  1870. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1871. __Pyx_GOTREF(__pyx_t_3);
  1872. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1873. __Pyx_GIVEREF(__pyx_t_1);
  1874. __pyx_t_1 = 0;
  1875. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1876. __Pyx_GOTREF(__pyx_t_1);
  1877. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1878. __Pyx_GOTREF(__pyx_t_4);
  1879. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1880. __Pyx_GOTREF(__pyx_t_5);
  1881. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1882. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1883. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1884. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1885. __Pyx_GOTREF(__pyx_t_5);
  1886. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1887. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1888. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1889. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1890. __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
  1891. {
  1892. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1893. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1894. __pyx_v_Qbk = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf = NULL;
  1895. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1896. } else {__pyx_pybuffernd_Qbk.diminfo[0].strides = __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qbk.diminfo[0].shape = __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.shape[0];
  1897. }
  1898. }
  1899. __pyx_t_10 = 0;
  1900. __pyx_v_Qbk = ((PyArrayObject *)__pyx_t_5);
  1901. __pyx_t_5 = 0;
  1902. /* "scattnlay.pyx":51
  1903. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1904. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1905. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1906. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1907. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1908. */
  1909. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1910. __Pyx_GOTREF(__pyx_t_5);
  1911. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1912. __Pyx_GOTREF(__pyx_t_1);
  1913. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1914. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1915. __Pyx_GOTREF(__pyx_t_5);
  1916. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1917. __Pyx_GOTREF(__pyx_t_3);
  1918. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1919. __Pyx_GIVEREF(__pyx_t_5);
  1920. __pyx_t_5 = 0;
  1921. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1922. __Pyx_GOTREF(__pyx_t_5);
  1923. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1924. __Pyx_GOTREF(__pyx_t_2);
  1925. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1926. __Pyx_GOTREF(__pyx_t_4);
  1927. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1928. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1929. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1930. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1931. __Pyx_GOTREF(__pyx_t_4);
  1932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1934. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1935. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1936. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  1937. {
  1938. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1939. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1940. __pyx_v_Qpr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf = NULL;
  1941. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1942. } else {__pyx_pybuffernd_Qpr.diminfo[0].strides = __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qpr.diminfo[0].shape = __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.shape[0];
  1943. }
  1944. }
  1945. __pyx_t_11 = 0;
  1946. __pyx_v_Qpr = ((PyArrayObject *)__pyx_t_4);
  1947. __pyx_t_4 = 0;
  1948. /* "scattnlay.pyx":52
  1949. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1950. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1951. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1952. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1953. *
  1954. */
  1955. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1956. __Pyx_GOTREF(__pyx_t_4);
  1957. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1958. __Pyx_GOTREF(__pyx_t_5);
  1959. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1960. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1961. __Pyx_GOTREF(__pyx_t_4);
  1962. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1963. __Pyx_GOTREF(__pyx_t_3);
  1964. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1965. __Pyx_GIVEREF(__pyx_t_4);
  1966. __pyx_t_4 = 0;
  1967. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1968. __Pyx_GOTREF(__pyx_t_4);
  1969. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1970. __Pyx_GOTREF(__pyx_t_1);
  1971. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1972. __Pyx_GOTREF(__pyx_t_2);
  1973. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1974. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1975. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1976. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1977. __Pyx_GOTREF(__pyx_t_2);
  1978. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1979. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1980. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1981. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1982. __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  1983. {
  1984. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1985. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_g.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  1986. __pyx_v_g = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_g.rcbuffer->pybuffer.buf = NULL;
  1987. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1988. } else {__pyx_pybuffernd_g.diminfo[0].strides = __pyx_pybuffernd_g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_g.diminfo[0].shape = __pyx_pybuffernd_g.rcbuffer->pybuffer.shape[0];
  1989. }
  1990. }
  1991. __pyx_t_12 = 0;
  1992. __pyx_v_g = ((PyArrayObject *)__pyx_t_2);
  1993. __pyx_t_2 = 0;
  1994. /* "scattnlay.pyx":53
  1995. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1996. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1997. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1998. *
  1999. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2000. */
  2001. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2002. __Pyx_GOTREF(__pyx_t_2);
  2003. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2004. __Pyx_GOTREF(__pyx_t_4);
  2005. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2006. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2007. __Pyx_GOTREF(__pyx_t_2);
  2008. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2009. __Pyx_GOTREF(__pyx_t_3);
  2010. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2011. __Pyx_GIVEREF(__pyx_t_2);
  2012. __pyx_t_2 = 0;
  2013. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2014. __Pyx_GOTREF(__pyx_t_2);
  2015. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2016. __Pyx_GOTREF(__pyx_t_5);
  2017. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2018. __Pyx_GOTREF(__pyx_t_1);
  2019. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2020. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2021. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2022. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2023. __Pyx_GOTREF(__pyx_t_1);
  2024. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2025. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2026. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2027. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2028. __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
  2029. {
  2030. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2031. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  2032. __pyx_v_Albedo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf = NULL;
  2033. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2034. } else {__pyx_pybuffernd_Albedo.diminfo[0].strides = __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Albedo.diminfo[0].shape = __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.shape[0];
  2035. }
  2036. }
  2037. __pyx_t_13 = 0;
  2038. __pyx_v_Albedo = ((PyArrayObject *)__pyx_t_1);
  2039. __pyx_t_1 = 0;
  2040. /* "scattnlay.pyx":55
  2041. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  2042. *
  2043. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2044. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2045. *
  2046. */
  2047. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2048. __Pyx_GOTREF(__pyx_t_1);
  2049. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2050. __Pyx_GOTREF(__pyx_t_2);
  2051. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2052. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2053. __Pyx_GOTREF(__pyx_t_1);
  2054. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2055. __Pyx_GOTREF(__pyx_t_3);
  2056. __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2057. __Pyx_GOTREF(__pyx_t_4);
  2058. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2059. __Pyx_GIVEREF(__pyx_t_1);
  2060. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  2061. __Pyx_GIVEREF(__pyx_t_3);
  2062. __pyx_t_1 = 0;
  2063. __pyx_t_3 = 0;
  2064. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2065. __Pyx_GOTREF(__pyx_t_3);
  2066. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2067. __Pyx_GIVEREF(__pyx_t_4);
  2068. __pyx_t_4 = 0;
  2069. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2070. __Pyx_GOTREF(__pyx_t_4);
  2071. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2072. __Pyx_GOTREF(__pyx_t_1);
  2073. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2074. __Pyx_GOTREF(__pyx_t_5);
  2075. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2076. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2077. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2078. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2079. __Pyx_GOTREF(__pyx_t_5);
  2080. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2081. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2082. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2083. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2084. __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
  2085. {
  2086. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2087. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S1.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  2088. __pyx_v_S1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S1.rcbuffer->pybuffer.buf = NULL;
  2089. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2090. } else {__pyx_pybuffernd_S1.diminfo[0].strides = __pyx_pybuffernd_S1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S1.diminfo[0].shape = __pyx_pybuffernd_S1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_S1.diminfo[1].strides = __pyx_pybuffernd_S1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_S1.diminfo[1].shape = __pyx_pybuffernd_S1.rcbuffer->pybuffer.shape[1];
  2091. }
  2092. }
  2093. __pyx_t_14 = 0;
  2094. __pyx_v_S1 = ((PyArrayObject *)__pyx_t_5);
  2095. __pyx_t_5 = 0;
  2096. /* "scattnlay.pyx":56
  2097. *
  2098. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2099. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2100. *
  2101. * cdef np.ndarray[np.float64_t, ndim = 1] S1r
  2102. */
  2103. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2104. __Pyx_GOTREF(__pyx_t_5);
  2105. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2106. __Pyx_GOTREF(__pyx_t_4);
  2107. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2108. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2109. __Pyx_GOTREF(__pyx_t_5);
  2110. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2111. __Pyx_GOTREF(__pyx_t_3);
  2112. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2113. __Pyx_GOTREF(__pyx_t_2);
  2114. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2115. __Pyx_GIVEREF(__pyx_t_5);
  2116. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2117. __Pyx_GIVEREF(__pyx_t_3);
  2118. __pyx_t_5 = 0;
  2119. __pyx_t_3 = 0;
  2120. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2121. __Pyx_GOTREF(__pyx_t_3);
  2122. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2123. __Pyx_GIVEREF(__pyx_t_2);
  2124. __pyx_t_2 = 0;
  2125. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2126. __Pyx_GOTREF(__pyx_t_2);
  2127. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2128. __Pyx_GOTREF(__pyx_t_5);
  2129. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2130. __Pyx_GOTREF(__pyx_t_1);
  2131. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2132. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2133. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2134. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2135. __Pyx_GOTREF(__pyx_t_1);
  2136. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2137. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2138. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2139. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2140. __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
  2141. {
  2142. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2143. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S2.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  2144. __pyx_v_S2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S2.rcbuffer->pybuffer.buf = NULL;
  2145. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2146. } else {__pyx_pybuffernd_S2.diminfo[0].strides = __pyx_pybuffernd_S2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S2.diminfo[0].shape = __pyx_pybuffernd_S2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_S2.diminfo[1].strides = __pyx_pybuffernd_S2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_S2.diminfo[1].shape = __pyx_pybuffernd_S2.rcbuffer->pybuffer.shape[1];
  2147. }
  2148. }
  2149. __pyx_t_15 = 0;
  2150. __pyx_v_S2 = ((PyArrayObject *)__pyx_t_1);
  2151. __pyx_t_1 = 0;
  2152. /* "scattnlay.pyx":63
  2153. * cdef np.ndarray[np.float64_t, ndim = 1] S2i
  2154. *
  2155. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  2156. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2157. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2158. */
  2159. __pyx_t_16 = (__pyx_v_x->dimensions[0]);
  2160. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  2161. __pyx_v_i = __pyx_t_17;
  2162. /* "scattnlay.pyx":64
  2163. *
  2164. * for i in range(x.shape[0]):
  2165. * S1r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2166. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2167. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2168. */
  2169. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2170. __Pyx_GOTREF(__pyx_t_1);
  2171. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2172. __Pyx_GOTREF(__pyx_t_2);
  2173. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2174. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2175. __Pyx_GOTREF(__pyx_t_1);
  2176. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2177. __Pyx_GOTREF(__pyx_t_3);
  2178. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2179. __Pyx_GIVEREF(__pyx_t_1);
  2180. __pyx_t_1 = 0;
  2181. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2182. __Pyx_GOTREF(__pyx_t_1);
  2183. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2184. __Pyx_GOTREF(__pyx_t_4);
  2185. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2186. __Pyx_GOTREF(__pyx_t_5);
  2187. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2188. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2189. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2190. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2191. __Pyx_GOTREF(__pyx_t_5);
  2192. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2193. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2194. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2195. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2196. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  2197. {
  2198. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2199. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2200. __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  2201. if (unlikely(__pyx_t_19 < 0)) {
  2202. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2203. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer, (PyObject*)__pyx_v_S1r, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  2204. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2205. __Pyx_RaiseBufferFallbackError();
  2206. } else {
  2207. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2208. }
  2209. }
  2210. __pyx_pybuffernd_S1r.diminfo[0].strides = __pyx_pybuffernd_S1r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S1r.diminfo[0].shape = __pyx_pybuffernd_S1r.rcbuffer->pybuffer.shape[0];
  2211. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2212. }
  2213. __pyx_t_18 = 0;
  2214. __Pyx_XDECREF_SET(__pyx_v_S1r, ((PyArrayObject *)__pyx_t_5));
  2215. __pyx_t_5 = 0;
  2216. /* "scattnlay.pyx":65
  2217. * for i in range(x.shape[0]):
  2218. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2219. * S1i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2220. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2221. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2222. */
  2223. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2224. __Pyx_GOTREF(__pyx_t_5);
  2225. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2226. __Pyx_GOTREF(__pyx_t_1);
  2227. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2228. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2229. __Pyx_GOTREF(__pyx_t_5);
  2230. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2231. __Pyx_GOTREF(__pyx_t_3);
  2232. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  2233. __Pyx_GIVEREF(__pyx_t_5);
  2234. __pyx_t_5 = 0;
  2235. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2236. __Pyx_GOTREF(__pyx_t_5);
  2237. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2238. __Pyx_GOTREF(__pyx_t_2);
  2239. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2240. __Pyx_GOTREF(__pyx_t_4);
  2241. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2242. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2243. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2244. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2245. __Pyx_GOTREF(__pyx_t_4);
  2246. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2247. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2248. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2249. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2250. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  2251. {
  2252. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2253. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2254. __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  2255. if (unlikely(__pyx_t_19 < 0)) {
  2256. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2257. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer, (PyObject*)__pyx_v_S1i, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  2258. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2259. __Pyx_RaiseBufferFallbackError();
  2260. } else {
  2261. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2262. }
  2263. }
  2264. __pyx_pybuffernd_S1i.diminfo[0].strides = __pyx_pybuffernd_S1i.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S1i.diminfo[0].shape = __pyx_pybuffernd_S1i.rcbuffer->pybuffer.shape[0];
  2265. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2266. }
  2267. __pyx_t_23 = 0;
  2268. __Pyx_XDECREF_SET(__pyx_v_S1i, ((PyArrayObject *)__pyx_t_4));
  2269. __pyx_t_4 = 0;
  2270. /* "scattnlay.pyx":66
  2271. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2272. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2273. * S2r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2274. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2275. *
  2276. */
  2277. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2278. __Pyx_GOTREF(__pyx_t_4);
  2279. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2280. __Pyx_GOTREF(__pyx_t_5);
  2281. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2282. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2283. __Pyx_GOTREF(__pyx_t_4);
  2284. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2285. __Pyx_GOTREF(__pyx_t_3);
  2286. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2287. __Pyx_GIVEREF(__pyx_t_4);
  2288. __pyx_t_4 = 0;
  2289. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2290. __Pyx_GOTREF(__pyx_t_4);
  2291. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2292. __Pyx_GOTREF(__pyx_t_1);
  2293. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2294. __Pyx_GOTREF(__pyx_t_2);
  2295. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2296. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2297. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2298. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2299. __Pyx_GOTREF(__pyx_t_2);
  2300. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2301. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2302. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2303. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2304. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  2305. {
  2306. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2307. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2308. __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  2309. if (unlikely(__pyx_t_19 < 0)) {
  2310. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2311. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer, (PyObject*)__pyx_v_S2r, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  2312. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2313. __Pyx_RaiseBufferFallbackError();
  2314. } else {
  2315. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2316. }
  2317. }
  2318. __pyx_pybuffernd_S2r.diminfo[0].strides = __pyx_pybuffernd_S2r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S2r.diminfo[0].shape = __pyx_pybuffernd_S2r.rcbuffer->pybuffer.shape[0];
  2319. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2320. }
  2321. __pyx_t_24 = 0;
  2322. __Pyx_XDECREF_SET(__pyx_v_S2r, ((PyArrayObject *)__pyx_t_2));
  2323. __pyx_t_2 = 0;
  2324. /* "scattnlay.pyx":67
  2325. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2326. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2327. * S2i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2328. *
  2329. * terms[i] = nfMieScatt(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), theta.shape[0], npy2c(theta), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2330. */
  2331. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2332. __Pyx_GOTREF(__pyx_t_2);
  2333. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2334. __Pyx_GOTREF(__pyx_t_4);
  2335. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2336. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2337. __Pyx_GOTREF(__pyx_t_2);
  2338. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2339. __Pyx_GOTREF(__pyx_t_3);
  2340. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2341. __Pyx_GIVEREF(__pyx_t_2);
  2342. __pyx_t_2 = 0;
  2343. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2344. __Pyx_GOTREF(__pyx_t_2);
  2345. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2346. __Pyx_GOTREF(__pyx_t_5);
  2347. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2348. __Pyx_GOTREF(__pyx_t_1);
  2349. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2350. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2351. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2352. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2353. __Pyx_GOTREF(__pyx_t_1);
  2354. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2355. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2356. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2357. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2358. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  2359. {
  2360. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2361. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2362. __pyx_t_19 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  2363. if (unlikely(__pyx_t_19 < 0)) {
  2364. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2365. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer, (PyObject*)__pyx_v_S2i, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  2366. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2367. __Pyx_RaiseBufferFallbackError();
  2368. } else {
  2369. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2370. }
  2371. }
  2372. __pyx_pybuffernd_S2i.diminfo[0].strides = __pyx_pybuffernd_S2i.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S2i.diminfo[0].shape = __pyx_pybuffernd_S2i.rcbuffer->pybuffer.shape[0];
  2373. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2374. }
  2375. __pyx_t_25 = 0;
  2376. __Pyx_XDECREF_SET(__pyx_v_S2i, ((PyArrayObject *)__pyx_t_1));
  2377. __pyx_t_1 = 0;
  2378. /* "scattnlay.pyx":69
  2379. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2380. *
  2381. * terms[i] = nfMieScatt(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), theta.shape[0], npy2c(theta), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  2382. *
  2383. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2384. */
  2385. __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_x), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2386. __Pyx_GOTREF(__pyx_t_1);
  2387. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2388. __Pyx_GOTREF(__pyx_t_2);
  2389. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2390. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2391. __Pyx_GOTREF(__pyx_t_1);
  2392. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2393. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2394. __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2395. __Pyx_GOTREF(__pyx_t_2);
  2396. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2397. __Pyx_GOTREF(__pyx_t_3);
  2398. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2399. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2400. __Pyx_GOTREF(__pyx_t_2);
  2401. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2402. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2403. __Pyx_GOTREF(__pyx_t_3);
  2404. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2405. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2406. __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2407. __Pyx_GOTREF(__pyx_t_2);
  2408. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_imag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2409. __Pyx_GOTREF(__pyx_t_4);
  2410. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2411. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2412. __Pyx_GOTREF(__pyx_t_2);
  2413. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2414. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2415. __Pyx_GOTREF(__pyx_t_4);
  2416. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2417. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2418. __pyx_t_26 = __pyx_v_i;
  2419. __pyx_t_19 = -1;
  2420. if (__pyx_t_26 < 0) {
  2421. __pyx_t_26 += __pyx_pybuffernd_Qext.diminfo[0].shape;
  2422. if (unlikely(__pyx_t_26 < 0)) __pyx_t_19 = 0;
  2423. } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_Qext.diminfo[0].shape)) __pyx_t_19 = 0;
  2424. if (unlikely(__pyx_t_19 != -1)) {
  2425. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2426. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2427. }
  2428. __pyx_t_27 = __pyx_v_i;
  2429. __pyx_t_19 = -1;
  2430. if (__pyx_t_27 < 0) {
  2431. __pyx_t_27 += __pyx_pybuffernd_Qsca.diminfo[0].shape;
  2432. if (unlikely(__pyx_t_27 < 0)) __pyx_t_19 = 0;
  2433. } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_Qsca.diminfo[0].shape)) __pyx_t_19 = 0;
  2434. if (unlikely(__pyx_t_19 != -1)) {
  2435. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2436. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2437. }
  2438. __pyx_t_28 = __pyx_v_i;
  2439. __pyx_t_19 = -1;
  2440. if (__pyx_t_28 < 0) {
  2441. __pyx_t_28 += __pyx_pybuffernd_Qabs.diminfo[0].shape;
  2442. if (unlikely(__pyx_t_28 < 0)) __pyx_t_19 = 0;
  2443. } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_Qabs.diminfo[0].shape)) __pyx_t_19 = 0;
  2444. if (unlikely(__pyx_t_19 != -1)) {
  2445. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2446. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2447. }
  2448. __pyx_t_29 = __pyx_v_i;
  2449. __pyx_t_19 = -1;
  2450. if (__pyx_t_29 < 0) {
  2451. __pyx_t_29 += __pyx_pybuffernd_Qbk.diminfo[0].shape;
  2452. if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
  2453. } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_Qbk.diminfo[0].shape)) __pyx_t_19 = 0;
  2454. if (unlikely(__pyx_t_19 != -1)) {
  2455. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2456. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2457. }
  2458. __pyx_t_30 = __pyx_v_i;
  2459. __pyx_t_19 = -1;
  2460. if (__pyx_t_30 < 0) {
  2461. __pyx_t_30 += __pyx_pybuffernd_Qpr.diminfo[0].shape;
  2462. if (unlikely(__pyx_t_30 < 0)) __pyx_t_19 = 0;
  2463. } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_Qpr.diminfo[0].shape)) __pyx_t_19 = 0;
  2464. if (unlikely(__pyx_t_19 != -1)) {
  2465. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2466. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2467. }
  2468. __pyx_t_31 = __pyx_v_i;
  2469. __pyx_t_19 = -1;
  2470. if (__pyx_t_31 < 0) {
  2471. __pyx_t_31 += __pyx_pybuffernd_g.diminfo[0].shape;
  2472. if (unlikely(__pyx_t_31 < 0)) __pyx_t_19 = 0;
  2473. } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_g.diminfo[0].shape)) __pyx_t_19 = 0;
  2474. if (unlikely(__pyx_t_19 != -1)) {
  2475. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2476. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2477. }
  2478. __pyx_t_32 = __pyx_v_i;
  2479. __pyx_t_19 = -1;
  2480. if (__pyx_t_32 < 0) {
  2481. __pyx_t_32 += __pyx_pybuffernd_Albedo.diminfo[0].shape;
  2482. if (unlikely(__pyx_t_32 < 0)) __pyx_t_19 = 0;
  2483. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_Albedo.diminfo[0].shape)) __pyx_t_19 = 0;
  2484. if (unlikely(__pyx_t_19 != -1)) {
  2485. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2486. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2487. }
  2488. __pyx_t_33 = __pyx_v_i;
  2489. __pyx_t_19 = -1;
  2490. if (__pyx_t_33 < 0) {
  2491. __pyx_t_33 += __pyx_pybuffernd_terms.diminfo[0].shape;
  2492. if (unlikely(__pyx_t_33 < 0)) __pyx_t_19 = 0;
  2493. } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_19 = 0;
  2494. if (unlikely(__pyx_t_19 != -1)) {
  2495. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2496. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2497. }
  2498. *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_terms.diminfo[0].strides) = nfMieScatt((__pyx_v_x->dimensions[1]), __pyx_v_pl, __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_1)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_3)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_4)), (__pyx_v_theta->dimensions[0]), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_theta)), __pyx_v_n_max, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_Qext.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_Qsca.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_Qabs.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_Qbk.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_Qpr.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_g.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_Albedo.diminfo[0].strides))), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_S1r)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_S1i)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_S2r)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_S2i)));
  2499. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2500. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2501. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2502. /* "scattnlay.pyx":71
  2503. * terms[i] = nfMieScatt(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), theta.shape[0], npy2c(theta), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2504. *
  2505. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  2506. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2507. *
  2508. */
  2509. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1r), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2510. __Pyx_GOTREF(__pyx_t_4);
  2511. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2512. __Pyx_GOTREF(__pyx_t_3);
  2513. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2514. __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2515. __Pyx_GOTREF(__pyx_t_4);
  2516. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1i), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2517. __Pyx_GOTREF(__pyx_t_1);
  2518. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2519. __Pyx_GOTREF(__pyx_t_2);
  2520. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2521. __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2522. __Pyx_GOTREF(__pyx_t_1);
  2523. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2524. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2525. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2526. __Pyx_GOTREF(__pyx_t_2);
  2527. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2528. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2529. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S1), __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2530. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2531. /* "scattnlay.pyx":72
  2532. *
  2533. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2534. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  2535. *
  2536. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2537. */
  2538. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2r), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2539. __Pyx_GOTREF(__pyx_t_2);
  2540. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2541. __Pyx_GOTREF(__pyx_t_1);
  2542. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2543. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2544. __Pyx_GOTREF(__pyx_t_2);
  2545. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2i), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2546. __Pyx_GOTREF(__pyx_t_3);
  2547. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2548. __Pyx_GOTREF(__pyx_t_4);
  2549. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2550. __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2551. __Pyx_GOTREF(__pyx_t_3);
  2552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2553. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2554. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2555. __Pyx_GOTREF(__pyx_t_4);
  2556. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2557. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2558. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S2), __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2559. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2560. }
  2561. /* "scattnlay.pyx":74
  2562. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2563. *
  2564. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 # <<<<<<<<<<<<<<
  2565. *
  2566. * def fieldnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 2] coords = np.zeros((0, 3), dtype = np.float64), Py_ssize_t pl = 0, Py_ssize_t n_max = 0):
  2567. */
  2568. __Pyx_XDECREF(__pyx_r);
  2569. __pyx_t_4 = PyTuple_New(10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2570. __Pyx_GOTREF(__pyx_t_4);
  2571. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  2572. PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_terms));
  2573. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  2574. __Pyx_INCREF(((PyObject *)__pyx_v_Qext));
  2575. PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_Qext));
  2576. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qext));
  2577. __Pyx_INCREF(((PyObject *)__pyx_v_Qsca));
  2578. PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Qsca));
  2579. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qsca));
  2580. __Pyx_INCREF(((PyObject *)__pyx_v_Qabs));
  2581. PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_Qabs));
  2582. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qabs));
  2583. __Pyx_INCREF(((PyObject *)__pyx_v_Qbk));
  2584. PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_Qbk));
  2585. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qbk));
  2586. __Pyx_INCREF(((PyObject *)__pyx_v_Qpr));
  2587. PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_Qpr));
  2588. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qpr));
  2589. __Pyx_INCREF(((PyObject *)__pyx_v_g));
  2590. PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_g));
  2591. __Pyx_GIVEREF(((PyObject *)__pyx_v_g));
  2592. __Pyx_INCREF(((PyObject *)__pyx_v_Albedo));
  2593. PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_Albedo));
  2594. __Pyx_GIVEREF(((PyObject *)__pyx_v_Albedo));
  2595. __Pyx_INCREF(((PyObject *)__pyx_v_S1));
  2596. PyTuple_SET_ITEM(__pyx_t_4, 8, ((PyObject *)__pyx_v_S1));
  2597. __Pyx_GIVEREF(((PyObject *)__pyx_v_S1));
  2598. __Pyx_INCREF(((PyObject *)__pyx_v_S2));
  2599. PyTuple_SET_ITEM(__pyx_t_4, 9, ((PyObject *)__pyx_v_S2));
  2600. __Pyx_GIVEREF(((PyObject *)__pyx_v_S2));
  2601. __pyx_r = __pyx_t_4;
  2602. __pyx_t_4 = 0;
  2603. goto __pyx_L0;
  2604. /* "scattnlay.pyx":42
  2605. * int nfMieField(int L, int pl, double x[], double mr[], double mi[], int n_max, int nCoords, double Xp[], double Yp[], double Zp[], double Er[], double Ei[], double Hr[], double Hi[])
  2606. *
  2607. * def scattnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 1] theta = np.zeros(0, dtype = np.float64), Py_ssize_t pl = -1, Py_ssize_t n_max = -1): # <<<<<<<<<<<<<<
  2608. * cdef Py_ssize_t i
  2609. *
  2610. */
  2611. /* function exit code */
  2612. __pyx_L1_error:;
  2613. __Pyx_XDECREF(__pyx_t_1);
  2614. __Pyx_XDECREF(__pyx_t_2);
  2615. __Pyx_XDECREF(__pyx_t_3);
  2616. __Pyx_XDECREF(__pyx_t_4);
  2617. __Pyx_XDECREF(__pyx_t_5);
  2618. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  2619. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  2620. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2621. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2622. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2623. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2624. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2625. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2626. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2627. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2628. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2629. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2630. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2631. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2632. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2633. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2634. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2635. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2636. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2637. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  2638. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2639. __pyx_r = NULL;
  2640. goto __pyx_L2;
  2641. __pyx_L0:;
  2642. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2643. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2644. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2645. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2646. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2647. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2648. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2649. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2650. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2651. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2652. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2653. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2654. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2655. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2656. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2657. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2658. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2659. __pyx_L2:;
  2660. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  2661. __Pyx_XDECREF((PyObject *)__pyx_v_Qext);
  2662. __Pyx_XDECREF((PyObject *)__pyx_v_Qabs);
  2663. __Pyx_XDECREF((PyObject *)__pyx_v_Qsca);
  2664. __Pyx_XDECREF((PyObject *)__pyx_v_Qbk);
  2665. __Pyx_XDECREF((PyObject *)__pyx_v_Qpr);
  2666. __Pyx_XDECREF((PyObject *)__pyx_v_g);
  2667. __Pyx_XDECREF((PyObject *)__pyx_v_Albedo);
  2668. __Pyx_XDECREF((PyObject *)__pyx_v_S1);
  2669. __Pyx_XDECREF((PyObject *)__pyx_v_S2);
  2670. __Pyx_XDECREF((PyObject *)__pyx_v_S1r);
  2671. __Pyx_XDECREF((PyObject *)__pyx_v_S1i);
  2672. __Pyx_XDECREF((PyObject *)__pyx_v_S2r);
  2673. __Pyx_XDECREF((PyObject *)__pyx_v_S2i);
  2674. __Pyx_XGIVEREF(__pyx_r);
  2675. __Pyx_RefNannyFinishContext();
  2676. return __pyx_r;
  2677. }
  2678. /* "scattnlay.pyx":76
  2679. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2680. *
  2681. * def fieldnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 2] coords = np.zeros((0, 3), dtype = np.float64), Py_ssize_t pl = 0, Py_ssize_t n_max = 0): # <<<<<<<<<<<<<<
  2682. * cdef Py_ssize_t i
  2683. *
  2684. */
  2685. /* Python wrapper */
  2686. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2687. static PyMethodDef __pyx_mdef_9scattnlay_3fieldnlay = {__Pyx_NAMESTR("fieldnlay"), (PyCFunction)__pyx_pw_9scattnlay_3fieldnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2688. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2689. PyArrayObject *__pyx_v_x = 0;
  2690. PyArrayObject *__pyx_v_m = 0;
  2691. PyArrayObject *__pyx_v_coords = 0;
  2692. Py_ssize_t __pyx_v_pl;
  2693. Py_ssize_t __pyx_v_n_max;
  2694. int __pyx_lineno = 0;
  2695. const char *__pyx_filename = NULL;
  2696. int __pyx_clineno = 0;
  2697. PyObject *__pyx_r = 0;
  2698. __Pyx_RefNannyDeclarations
  2699. __Pyx_RefNannySetupContext("fieldnlay (wrapper)", 0);
  2700. {
  2701. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_coords,&__pyx_n_s_pl,&__pyx_n_s_n_max,0};
  2702. PyObject* values[5] = {0,0,0,0,0};
  2703. values[2] = (PyObject *)__pyx_k__10;
  2704. if (unlikely(__pyx_kwds)) {
  2705. Py_ssize_t kw_args;
  2706. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2707. switch (pos_args) {
  2708. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2709. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2710. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2711. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2712. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2713. case 0: break;
  2714. default: goto __pyx_L5_argtuple_error;
  2715. }
  2716. kw_args = PyDict_Size(__pyx_kwds);
  2717. switch (pos_args) {
  2718. case 0:
  2719. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  2720. else goto __pyx_L5_argtuple_error;
  2721. case 1:
  2722. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  2723. else {
  2724. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2725. }
  2726. case 2:
  2727. if (kw_args > 0) {
  2728. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords);
  2729. if (value) { values[2] = value; kw_args--; }
  2730. }
  2731. case 3:
  2732. if (kw_args > 0) {
  2733. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  2734. if (value) { values[3] = value; kw_args--; }
  2735. }
  2736. case 4:
  2737. if (kw_args > 0) {
  2738. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_max);
  2739. if (value) { values[4] = value; kw_args--; }
  2740. }
  2741. }
  2742. if (unlikely(kw_args > 0)) {
  2743. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fieldnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2744. }
  2745. } else {
  2746. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2747. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2748. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2749. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2750. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2751. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2752. break;
  2753. default: goto __pyx_L5_argtuple_error;
  2754. }
  2755. }
  2756. __pyx_v_x = ((PyArrayObject *)values[0]);
  2757. __pyx_v_m = ((PyArrayObject *)values[1]);
  2758. __pyx_v_coords = ((PyArrayObject *)values[2]);
  2759. if (values[3]) {
  2760. __pyx_v_pl = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_pl == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2761. } else {
  2762. __pyx_v_pl = ((Py_ssize_t)0);
  2763. }
  2764. if (values[4]) {
  2765. __pyx_v_n_max = __Pyx_PyIndex_AsSsize_t(values[4]); if (unlikely((__pyx_v_n_max == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2766. } else {
  2767. __pyx_v_n_max = ((Py_ssize_t)0);
  2768. }
  2769. }
  2770. goto __pyx_L4_argument_unpacking_done;
  2771. __pyx_L5_argtuple_error:;
  2772. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2773. __pyx_L3_error:;
  2774. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2775. __Pyx_RefNannyFinishContext();
  2776. return NULL;
  2777. __pyx_L4_argument_unpacking_done:;
  2778. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2779. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2780. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2781. __pyx_r = __pyx_pf_9scattnlay_2fieldnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_coords, __pyx_v_pl, __pyx_v_n_max);
  2782. /* function exit code */
  2783. goto __pyx_L0;
  2784. __pyx_L1_error:;
  2785. __pyx_r = NULL;
  2786. __pyx_L0:;
  2787. __Pyx_RefNannyFinishContext();
  2788. return __pyx_r;
  2789. }
  2790. static PyObject *__pyx_pf_9scattnlay_2fieldnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_coords, Py_ssize_t __pyx_v_pl, Py_ssize_t __pyx_v_n_max) {
  2791. Py_ssize_t __pyx_v_i;
  2792. PyArrayObject *__pyx_v_terms = 0;
  2793. PyArrayObject *__pyx_v_E = 0;
  2794. PyArrayObject *__pyx_v_H = 0;
  2795. PyArrayObject *__pyx_v_Er = 0;
  2796. PyArrayObject *__pyx_v_Ei = 0;
  2797. PyArrayObject *__pyx_v_Hr = 0;
  2798. PyArrayObject *__pyx_v_Hi = 0;
  2799. __Pyx_LocalBuf_ND __pyx_pybuffernd_E;
  2800. __Pyx_Buffer __pyx_pybuffer_E;
  2801. __Pyx_LocalBuf_ND __pyx_pybuffernd_Ei;
  2802. __Pyx_Buffer __pyx_pybuffer_Ei;
  2803. __Pyx_LocalBuf_ND __pyx_pybuffernd_Er;
  2804. __Pyx_Buffer __pyx_pybuffer_Er;
  2805. __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
  2806. __Pyx_Buffer __pyx_pybuffer_H;
  2807. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hi;
  2808. __Pyx_Buffer __pyx_pybuffer_Hi;
  2809. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hr;
  2810. __Pyx_Buffer __pyx_pybuffer_Hr;
  2811. __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  2812. __Pyx_Buffer __pyx_pybuffer_coords;
  2813. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  2814. __Pyx_Buffer __pyx_pybuffer_m;
  2815. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  2816. __Pyx_Buffer __pyx_pybuffer_terms;
  2817. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  2818. __Pyx_Buffer __pyx_pybuffer_x;
  2819. PyObject *__pyx_r = NULL;
  2820. __Pyx_RefNannyDeclarations
  2821. PyObject *__pyx_t_1 = NULL;
  2822. PyObject *__pyx_t_2 = NULL;
  2823. PyObject *__pyx_t_3 = NULL;
  2824. PyObject *__pyx_t_4 = NULL;
  2825. PyObject *__pyx_t_5 = NULL;
  2826. PyArrayObject *__pyx_t_6 = NULL;
  2827. PyArrayObject *__pyx_t_7 = NULL;
  2828. PyArrayObject *__pyx_t_8 = NULL;
  2829. npy_intp __pyx_t_9;
  2830. Py_ssize_t __pyx_t_10;
  2831. PyArrayObject *__pyx_t_11 = NULL;
  2832. int __pyx_t_12;
  2833. PyObject *__pyx_t_13 = NULL;
  2834. PyObject *__pyx_t_14 = NULL;
  2835. PyObject *__pyx_t_15 = NULL;
  2836. PyArrayObject *__pyx_t_16 = NULL;
  2837. PyArrayObject *__pyx_t_17 = NULL;
  2838. PyArrayObject *__pyx_t_18 = NULL;
  2839. PyObject *__pyx_t_19 = NULL;
  2840. Py_ssize_t __pyx_t_20;
  2841. int __pyx_lineno = 0;
  2842. const char *__pyx_filename = NULL;
  2843. int __pyx_clineno = 0;
  2844. __Pyx_RefNannySetupContext("fieldnlay", 0);
  2845. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  2846. __pyx_pybuffer_terms.refcount = 0;
  2847. __pyx_pybuffernd_terms.data = NULL;
  2848. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  2849. __pyx_pybuffer_E.pybuffer.buf = NULL;
  2850. __pyx_pybuffer_E.refcount = 0;
  2851. __pyx_pybuffernd_E.data = NULL;
  2852. __pyx_pybuffernd_E.rcbuffer = &__pyx_pybuffer_E;
  2853. __pyx_pybuffer_H.pybuffer.buf = NULL;
  2854. __pyx_pybuffer_H.refcount = 0;
  2855. __pyx_pybuffernd_H.data = NULL;
  2856. __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
  2857. __pyx_pybuffer_Er.pybuffer.buf = NULL;
  2858. __pyx_pybuffer_Er.refcount = 0;
  2859. __pyx_pybuffernd_Er.data = NULL;
  2860. __pyx_pybuffernd_Er.rcbuffer = &__pyx_pybuffer_Er;
  2861. __pyx_pybuffer_Ei.pybuffer.buf = NULL;
  2862. __pyx_pybuffer_Ei.refcount = 0;
  2863. __pyx_pybuffernd_Ei.data = NULL;
  2864. __pyx_pybuffernd_Ei.rcbuffer = &__pyx_pybuffer_Ei;
  2865. __pyx_pybuffer_Hr.pybuffer.buf = NULL;
  2866. __pyx_pybuffer_Hr.refcount = 0;
  2867. __pyx_pybuffernd_Hr.data = NULL;
  2868. __pyx_pybuffernd_Hr.rcbuffer = &__pyx_pybuffer_Hr;
  2869. __pyx_pybuffer_Hi.pybuffer.buf = NULL;
  2870. __pyx_pybuffer_Hi.refcount = 0;
  2871. __pyx_pybuffernd_Hi.data = NULL;
  2872. __pyx_pybuffernd_Hi.rcbuffer = &__pyx_pybuffer_Hi;
  2873. __pyx_pybuffer_x.pybuffer.buf = NULL;
  2874. __pyx_pybuffer_x.refcount = 0;
  2875. __pyx_pybuffernd_x.data = NULL;
  2876. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  2877. __pyx_pybuffer_m.pybuffer.buf = NULL;
  2878. __pyx_pybuffer_m.refcount = 0;
  2879. __pyx_pybuffernd_m.data = NULL;
  2880. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  2881. __pyx_pybuffer_coords.pybuffer.buf = NULL;
  2882. __pyx_pybuffer_coords.refcount = 0;
  2883. __pyx_pybuffernd_coords.data = NULL;
  2884. __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
  2885. {
  2886. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2887. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2888. }
  2889. __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1];
  2890. {
  2891. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2892. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2893. }
  2894. __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
  2895. {
  2896. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2897. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_coords.rcbuffer->pybuffer, (PyObject*)__pyx_v_coords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2898. }
  2899. __pyx_pybuffernd_coords.diminfo[0].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_coords.diminfo[0].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_coords.diminfo[1].strides = __pyx_pybuffernd_coords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_coords.diminfo[1].shape = __pyx_pybuffernd_coords.rcbuffer->pybuffer.shape[1];
  2900. /* "scattnlay.pyx":79
  2901. * cdef Py_ssize_t i
  2902. *
  2903. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  2904. *
  2905. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  2906. */
  2907. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2908. __Pyx_GOTREF(__pyx_t_1);
  2909. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2910. __Pyx_GOTREF(__pyx_t_2);
  2911. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2912. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2913. __Pyx_GOTREF(__pyx_t_1);
  2914. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2915. __Pyx_GOTREF(__pyx_t_3);
  2916. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2917. __Pyx_GIVEREF(__pyx_t_1);
  2918. __pyx_t_1 = 0;
  2919. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2920. __Pyx_GOTREF(__pyx_t_1);
  2921. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2922. __Pyx_GOTREF(__pyx_t_4);
  2923. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2924. __Pyx_GOTREF(__pyx_t_5);
  2925. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2926. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2927. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2928. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2929. __Pyx_GOTREF(__pyx_t_5);
  2930. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2931. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2933. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2934. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  2935. {
  2936. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2937. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_terms.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
  2938. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  2939. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2940. } else {__pyx_pybuffernd_terms.diminfo[0].strides = __pyx_pybuffernd_terms.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_terms.diminfo[0].shape = __pyx_pybuffernd_terms.rcbuffer->pybuffer.shape[0];
  2941. }
  2942. }
  2943. __pyx_t_6 = 0;
  2944. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  2945. __pyx_t_5 = 0;
  2946. /* "scattnlay.pyx":81
  2947. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  2948. *
  2949. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2950. * cdef np.ndarray[np.complex128_t, ndim = 2] H = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  2951. *
  2952. */
  2953. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2954. __Pyx_GOTREF(__pyx_t_5);
  2955. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2956. __Pyx_GOTREF(__pyx_t_1);
  2957. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2958. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2959. __Pyx_GOTREF(__pyx_t_5);
  2960. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2961. __Pyx_GOTREF(__pyx_t_3);
  2962. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2963. __Pyx_GOTREF(__pyx_t_2);
  2964. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2965. __Pyx_GIVEREF(__pyx_t_5);
  2966. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2967. __Pyx_GIVEREF(__pyx_t_3);
  2968. __pyx_t_5 = 0;
  2969. __pyx_t_3 = 0;
  2970. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2971. __Pyx_GOTREF(__pyx_t_3);
  2972. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2973. __Pyx_GIVEREF(__pyx_t_2);
  2974. __pyx_t_2 = 0;
  2975. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2976. __Pyx_GOTREF(__pyx_t_2);
  2977. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2978. __Pyx_GOTREF(__pyx_t_5);
  2979. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2980. __Pyx_GOTREF(__pyx_t_4);
  2981. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2982. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2983. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2984. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2985. __Pyx_GOTREF(__pyx_t_4);
  2986. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2987. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2988. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2989. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2990. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  2991. {
  2992. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2993. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_E.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  2994. __pyx_v_E = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_E.rcbuffer->pybuffer.buf = NULL;
  2995. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2996. } else {__pyx_pybuffernd_E.diminfo[0].strides = __pyx_pybuffernd_E.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_E.diminfo[0].shape = __pyx_pybuffernd_E.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_E.diminfo[1].strides = __pyx_pybuffernd_E.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_E.diminfo[1].shape = __pyx_pybuffernd_E.rcbuffer->pybuffer.shape[1];
  2997. }
  2998. }
  2999. __pyx_t_7 = 0;
  3000. __pyx_v_E = ((PyArrayObject *)__pyx_t_4);
  3001. __pyx_t_4 = 0;
  3002. /* "scattnlay.pyx":82
  3003. *
  3004. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  3005. * cdef np.ndarray[np.complex128_t, ndim = 2] H = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  3006. *
  3007. * cdef np.ndarray[np.float64_t, ndim = 1] Er
  3008. */
  3009. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3010. __Pyx_GOTREF(__pyx_t_4);
  3011. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3012. __Pyx_GOTREF(__pyx_t_2);
  3013. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3014. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3015. __Pyx_GOTREF(__pyx_t_4);
  3016. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3017. __Pyx_GOTREF(__pyx_t_3);
  3018. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3019. __Pyx_GOTREF(__pyx_t_1);
  3020. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  3021. __Pyx_GIVEREF(__pyx_t_4);
  3022. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  3023. __Pyx_GIVEREF(__pyx_t_3);
  3024. __pyx_t_4 = 0;
  3025. __pyx_t_3 = 0;
  3026. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3027. __Pyx_GOTREF(__pyx_t_3);
  3028. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3029. __Pyx_GIVEREF(__pyx_t_1);
  3030. __pyx_t_1 = 0;
  3031. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3032. __Pyx_GOTREF(__pyx_t_1);
  3033. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3034. __Pyx_GOTREF(__pyx_t_4);
  3035. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_complex128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3036. __Pyx_GOTREF(__pyx_t_5);
  3037. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3038. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3039. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3040. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3041. __Pyx_GOTREF(__pyx_t_5);
  3042. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3043. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3044. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3045. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3046. __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  3047. {
  3048. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3049. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  3050. __pyx_v_H = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H.rcbuffer->pybuffer.buf = NULL;
  3051. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3052. } else {__pyx_pybuffernd_H.diminfo[0].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H.diminfo[0].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H.diminfo[1].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H.diminfo[1].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[1];
  3053. }
  3054. }
  3055. __pyx_t_8 = 0;
  3056. __pyx_v_H = ((PyArrayObject *)__pyx_t_5);
  3057. __pyx_t_5 = 0;
  3058. /* "scattnlay.pyx":89
  3059. * cdef np.ndarray[np.float64_t, ndim = 1] Hi
  3060. *
  3061. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  3062. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3063. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3064. */
  3065. __pyx_t_9 = (__pyx_v_x->dimensions[0]);
  3066. for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
  3067. __pyx_v_i = __pyx_t_10;
  3068. /* "scattnlay.pyx":90
  3069. *
  3070. * for i in range(x.shape[0]):
  3071. * Er = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3072. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3073. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3074. */
  3075. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3076. __Pyx_GOTREF(__pyx_t_5);
  3077. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3078. __Pyx_GOTREF(__pyx_t_1);
  3079. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3080. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3081. __Pyx_GOTREF(__pyx_t_5);
  3082. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3083. __Pyx_GOTREF(__pyx_t_3);
  3084. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3085. __Pyx_GIVEREF(__pyx_t_5);
  3086. __pyx_t_5 = 0;
  3087. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3088. __Pyx_GOTREF(__pyx_t_5);
  3089. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3090. __Pyx_GOTREF(__pyx_t_2);
  3091. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3092. __Pyx_GOTREF(__pyx_t_4);
  3093. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3094. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3095. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3096. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3097. __Pyx_GOTREF(__pyx_t_4);
  3098. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3099. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3100. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3101. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3102. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  3103. {
  3104. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3105. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3106. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Er.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3107. if (unlikely(__pyx_t_12 < 0)) {
  3108. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3109. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Er.rcbuffer->pybuffer, (PyObject*)__pyx_v_Er, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3110. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3111. __Pyx_RaiseBufferFallbackError();
  3112. } else {
  3113. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3114. }
  3115. }
  3116. __pyx_pybuffernd_Er.diminfo[0].strides = __pyx_pybuffernd_Er.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Er.diminfo[0].shape = __pyx_pybuffernd_Er.rcbuffer->pybuffer.shape[0];
  3117. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3118. }
  3119. __pyx_t_11 = 0;
  3120. __Pyx_XDECREF_SET(__pyx_v_Er, ((PyArrayObject *)__pyx_t_4));
  3121. __pyx_t_4 = 0;
  3122. /* "scattnlay.pyx":91
  3123. * for i in range(x.shape[0]):
  3124. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3125. * Ei = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3126. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3127. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3128. */
  3129. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3130. __Pyx_GOTREF(__pyx_t_4);
  3131. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3132. __Pyx_GOTREF(__pyx_t_5);
  3133. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3134. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3135. __Pyx_GOTREF(__pyx_t_4);
  3136. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3137. __Pyx_GOTREF(__pyx_t_3);
  3138. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3139. __Pyx_GIVEREF(__pyx_t_4);
  3140. __pyx_t_4 = 0;
  3141. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3142. __Pyx_GOTREF(__pyx_t_4);
  3143. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3144. __Pyx_GOTREF(__pyx_t_1);
  3145. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3146. __Pyx_GOTREF(__pyx_t_2);
  3147. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3148. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3149. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3150. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3151. __Pyx_GOTREF(__pyx_t_2);
  3152. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3153. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3154. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3155. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3156. __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  3157. {
  3158. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3159. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3160. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3161. if (unlikely(__pyx_t_12 < 0)) {
  3162. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3163. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer, (PyObject*)__pyx_v_Ei, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3164. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3165. __Pyx_RaiseBufferFallbackError();
  3166. } else {
  3167. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3168. }
  3169. }
  3170. __pyx_pybuffernd_Ei.diminfo[0].strides = __pyx_pybuffernd_Ei.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ei.diminfo[0].shape = __pyx_pybuffernd_Ei.rcbuffer->pybuffer.shape[0];
  3171. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3172. }
  3173. __pyx_t_16 = 0;
  3174. __Pyx_XDECREF_SET(__pyx_v_Ei, ((PyArrayObject *)__pyx_t_2));
  3175. __pyx_t_2 = 0;
  3176. /* "scattnlay.pyx":92
  3177. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3178. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3179. * Hr = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3180. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3181. *
  3182. */
  3183. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3184. __Pyx_GOTREF(__pyx_t_2);
  3185. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3186. __Pyx_GOTREF(__pyx_t_4);
  3187. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3188. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3189. __Pyx_GOTREF(__pyx_t_2);
  3190. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3191. __Pyx_GOTREF(__pyx_t_3);
  3192. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3193. __Pyx_GIVEREF(__pyx_t_2);
  3194. __pyx_t_2 = 0;
  3195. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3196. __Pyx_GOTREF(__pyx_t_2);
  3197. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3198. __Pyx_GOTREF(__pyx_t_5);
  3199. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3200. __Pyx_GOTREF(__pyx_t_1);
  3201. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3202. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3203. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3204. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3205. __Pyx_GOTREF(__pyx_t_1);
  3206. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3207. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3208. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3209. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3210. __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  3211. {
  3212. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3213. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3214. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3215. if (unlikely(__pyx_t_12 < 0)) {
  3216. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3217. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3218. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3219. __Pyx_RaiseBufferFallbackError();
  3220. } else {
  3221. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3222. }
  3223. }
  3224. __pyx_pybuffernd_Hr.diminfo[0].strides = __pyx_pybuffernd_Hr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hr.diminfo[0].shape = __pyx_pybuffernd_Hr.rcbuffer->pybuffer.shape[0];
  3225. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3226. }
  3227. __pyx_t_17 = 0;
  3228. __Pyx_XDECREF_SET(__pyx_v_Hr, ((PyArrayObject *)__pyx_t_1));
  3229. __pyx_t_1 = 0;
  3230. /* "scattnlay.pyx":93
  3231. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3232. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3233. * Hi = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3234. *
  3235. * terms[i] = nfMieField(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), n_max, coords.shape[0], npy2c(coords[:, 0]), npy2c(coords[:, 1]), npy2c(coords[:, 2]), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  3236. */
  3237. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3238. __Pyx_GOTREF(__pyx_t_1);
  3239. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3240. __Pyx_GOTREF(__pyx_t_2);
  3241. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3242. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3243. __Pyx_GOTREF(__pyx_t_1);
  3244. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3245. __Pyx_GOTREF(__pyx_t_3);
  3246. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3247. __Pyx_GIVEREF(__pyx_t_1);
  3248. __pyx_t_1 = 0;
  3249. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3250. __Pyx_GOTREF(__pyx_t_1);
  3251. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3252. __Pyx_GOTREF(__pyx_t_4);
  3253. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3254. __Pyx_GOTREF(__pyx_t_5);
  3255. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3256. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3257. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3258. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3259. __Pyx_GOTREF(__pyx_t_5);
  3260. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3261. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3262. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3263. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3264. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  3265. {
  3266. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3267. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3268. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3269. if (unlikely(__pyx_t_12 < 0)) {
  3270. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3271. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3272. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3273. __Pyx_RaiseBufferFallbackError();
  3274. } else {
  3275. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3276. }
  3277. }
  3278. __pyx_pybuffernd_Hi.diminfo[0].strides = __pyx_pybuffernd_Hi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hi.diminfo[0].shape = __pyx_pybuffernd_Hi.rcbuffer->pybuffer.shape[0];
  3279. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3280. }
  3281. __pyx_t_18 = 0;
  3282. __Pyx_XDECREF_SET(__pyx_v_Hi, ((PyArrayObject *)__pyx_t_5));
  3283. __pyx_t_5 = 0;
  3284. /* "scattnlay.pyx":95
  3285. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3286. *
  3287. * terms[i] = nfMieField(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), n_max, coords.shape[0], npy2c(coords[:, 0]), npy2c(coords[:, 1]), npy2c(coords[:, 2]), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi)) # <<<<<<<<<<<<<<
  3288. *
  3289. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  3290. */
  3291. __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_x), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3292. __Pyx_GOTREF(__pyx_t_5);
  3293. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3294. __Pyx_GOTREF(__pyx_t_1);
  3295. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3296. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3297. __Pyx_GOTREF(__pyx_t_5);
  3298. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3299. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3300. __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3301. __Pyx_GOTREF(__pyx_t_1);
  3302. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3303. __Pyx_GOTREF(__pyx_t_3);
  3304. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3305. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3306. __Pyx_GOTREF(__pyx_t_1);
  3307. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3308. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3309. __Pyx_GOTREF(__pyx_t_3);
  3310. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3311. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3312. __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3313. __Pyx_GOTREF(__pyx_t_1);
  3314. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3315. __Pyx_GOTREF(__pyx_t_2);
  3316. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3317. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3318. __Pyx_GOTREF(__pyx_t_1);
  3319. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3320. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3321. __Pyx_GOTREF(__pyx_t_2);
  3322. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3323. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3324. __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__15); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3325. __Pyx_GOTREF(__pyx_t_1);
  3326. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3327. __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__17); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3328. __Pyx_GOTREF(__pyx_t_4);
  3329. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3330. __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__19); if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3331. __Pyx_GOTREF(__pyx_t_19);
  3332. if (!(likely(((__pyx_t_19) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_19, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3333. __pyx_t_20 = __pyx_v_i;
  3334. __pyx_t_12 = -1;
  3335. if (__pyx_t_20 < 0) {
  3336. __pyx_t_20 += __pyx_pybuffernd_terms.diminfo[0].shape;
  3337. if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 0;
  3338. } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_12 = 0;
  3339. if (unlikely(__pyx_t_12 != -1)) {
  3340. __Pyx_RaiseBufferIndexError(__pyx_t_12);
  3341. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3342. }
  3343. *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_terms.diminfo[0].strides) = nfMieField((__pyx_v_x->dimensions[1]), __pyx_v_pl, __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_5)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_3)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_2)), __pyx_v_n_max, (__pyx_v_coords->dimensions[0]), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_1)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_4)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_t_19)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Er)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Ei)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hr)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hi)));
  3344. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3345. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3346. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3347. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3348. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3349. __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  3350. /* "scattnlay.pyx":97
  3351. * terms[i] = nfMieField(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), n_max, coords.shape[0], npy2c(coords[:, 0]), npy2c(coords[:, 1]), npy2c(coords[:, 2]), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  3352. *
  3353. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C') # <<<<<<<<<<<<<<
  3354. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  3355. *
  3356. */
  3357. __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Er), __pyx_n_s_copy); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3358. __Pyx_GOTREF(__pyx_t_19);
  3359. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3360. __Pyx_GOTREF(__pyx_t_4);
  3361. __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  3362. __pyx_t_19 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3363. __Pyx_GOTREF(__pyx_t_19);
  3364. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Ei), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3365. __Pyx_GOTREF(__pyx_t_1);
  3366. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3367. __Pyx_GOTREF(__pyx_t_2);
  3368. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3369. __pyx_t_1 = PyNumber_Multiply(__pyx_t_19, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3370. __Pyx_GOTREF(__pyx_t_1);
  3371. __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  3372. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3373. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3374. __Pyx_GOTREF(__pyx_t_2);
  3375. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3376. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3377. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_E), __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3378. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3379. /* "scattnlay.pyx":98
  3380. *
  3381. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  3382. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C') # <<<<<<<<<<<<<<
  3383. *
  3384. * return terms, E, H
  3385. */
  3386. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hr), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3387. __Pyx_GOTREF(__pyx_t_2);
  3388. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3389. __Pyx_GOTREF(__pyx_t_1);
  3390. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3391. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3392. __Pyx_GOTREF(__pyx_t_2);
  3393. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hi), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3394. __Pyx_GOTREF(__pyx_t_4);
  3395. __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3396. __Pyx_GOTREF(__pyx_t_19);
  3397. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3398. __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3399. __Pyx_GOTREF(__pyx_t_4);
  3400. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3401. __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  3402. __pyx_t_19 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3403. __Pyx_GOTREF(__pyx_t_19);
  3404. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3405. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3406. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_H), __pyx_v_i, __pyx_t_19, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3407. __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  3408. }
  3409. /* "scattnlay.pyx":100
  3410. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  3411. *
  3412. * return terms, E, H # <<<<<<<<<<<<<<
  3413. *
  3414. */
  3415. __Pyx_XDECREF(__pyx_r);
  3416. __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3417. __Pyx_GOTREF(__pyx_t_19);
  3418. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  3419. PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_terms));
  3420. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  3421. __Pyx_INCREF(((PyObject *)__pyx_v_E));
  3422. PyTuple_SET_ITEM(__pyx_t_19, 1, ((PyObject *)__pyx_v_E));
  3423. __Pyx_GIVEREF(((PyObject *)__pyx_v_E));
  3424. __Pyx_INCREF(((PyObject *)__pyx_v_H));
  3425. PyTuple_SET_ITEM(__pyx_t_19, 2, ((PyObject *)__pyx_v_H));
  3426. __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
  3427. __pyx_r = __pyx_t_19;
  3428. __pyx_t_19 = 0;
  3429. goto __pyx_L0;
  3430. /* "scattnlay.pyx":76
  3431. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  3432. *
  3433. * def fieldnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 2] coords = np.zeros((0, 3), dtype = np.float64), Py_ssize_t pl = 0, Py_ssize_t n_max = 0): # <<<<<<<<<<<<<<
  3434. * cdef Py_ssize_t i
  3435. *
  3436. */
  3437. /* function exit code */
  3438. __pyx_L1_error:;
  3439. __Pyx_XDECREF(__pyx_t_1);
  3440. __Pyx_XDECREF(__pyx_t_2);
  3441. __Pyx_XDECREF(__pyx_t_3);
  3442. __Pyx_XDECREF(__pyx_t_4);
  3443. __Pyx_XDECREF(__pyx_t_5);
  3444. __Pyx_XDECREF(__pyx_t_19);
  3445. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  3446. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  3447. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  3448. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3449. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3450. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  3451. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3452. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3453. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  3454. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  3455. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  3456. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  3457. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  3458. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3459. __pyx_r = NULL;
  3460. goto __pyx_L2;
  3461. __pyx_L0:;
  3462. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  3463. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3464. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3465. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  3466. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3467. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3468. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  3469. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  3470. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  3471. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  3472. __pyx_L2:;
  3473. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  3474. __Pyx_XDECREF((PyObject *)__pyx_v_E);
  3475. __Pyx_XDECREF((PyObject *)__pyx_v_H);
  3476. __Pyx_XDECREF((PyObject *)__pyx_v_Er);
  3477. __Pyx_XDECREF((PyObject *)__pyx_v_Ei);
  3478. __Pyx_XDECREF((PyObject *)__pyx_v_Hr);
  3479. __Pyx_XDECREF((PyObject *)__pyx_v_Hi);
  3480. __Pyx_XGIVEREF(__pyx_r);
  3481. __Pyx_RefNannyFinishContext();
  3482. return __pyx_r;
  3483. }
  3484. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  3485. * # experimental exception made for __getbuffer__ and __releasebuffer__
  3486. * # -- the details of this may change.
  3487. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  3488. * # This implementation of getbuffer is geared towards Cython
  3489. * # requirements, and does not yet fullfill the PEP.
  3490. */
  3491. /* Python wrapper */
  3492. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  3493. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  3494. int __pyx_r;
  3495. __Pyx_RefNannyDeclarations
  3496. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  3497. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  3498. /* function exit code */
  3499. __Pyx_RefNannyFinishContext();
  3500. return __pyx_r;
  3501. }
  3502. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  3503. int __pyx_v_copy_shape;
  3504. int __pyx_v_i;
  3505. int __pyx_v_ndim;
  3506. int __pyx_v_endian_detector;
  3507. int __pyx_v_little_endian;
  3508. int __pyx_v_t;
  3509. char *__pyx_v_f;
  3510. PyArray_Descr *__pyx_v_descr = 0;
  3511. int __pyx_v_offset;
  3512. int __pyx_v_hasfields;
  3513. int __pyx_r;
  3514. __Pyx_RefNannyDeclarations
  3515. int __pyx_t_1;
  3516. int __pyx_t_2;
  3517. int __pyx_t_3;
  3518. PyObject *__pyx_t_4 = NULL;
  3519. int __pyx_t_5;
  3520. int __pyx_t_6;
  3521. int __pyx_t_7;
  3522. PyObject *__pyx_t_8 = NULL;
  3523. char *__pyx_t_9;
  3524. int __pyx_lineno = 0;
  3525. const char *__pyx_filename = NULL;
  3526. int __pyx_clineno = 0;
  3527. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  3528. if (__pyx_v_info != NULL) {
  3529. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  3530. __Pyx_GIVEREF(__pyx_v_info->obj);
  3531. }
  3532. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200
  3533. * # of flags
  3534. *
  3535. * if info == NULL: return # <<<<<<<<<<<<<<
  3536. *
  3537. * cdef int copy_shape, i, ndim
  3538. */
  3539. __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  3540. if (__pyx_t_1) {
  3541. __pyx_r = 0;
  3542. goto __pyx_L0;
  3543. }
  3544. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
  3545. *
  3546. * cdef int copy_shape, i, ndim
  3547. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  3548. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  3549. *
  3550. */
  3551. __pyx_v_endian_detector = 1;
  3552. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
  3553. * cdef int copy_shape, i, ndim
  3554. * cdef int endian_detector = 1
  3555. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  3556. *
  3557. * ndim = PyArray_NDIM(self)
  3558. */
  3559. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  3560. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
  3561. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  3562. *
  3563. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  3564. *
  3565. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  3566. */
  3567. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  3568. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
  3569. * ndim = PyArray_NDIM(self)
  3570. *
  3571. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  3572. * copy_shape = 1
  3573. * else:
  3574. */
  3575. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  3576. if (__pyx_t_1) {
  3577. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
  3578. *
  3579. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  3580. * copy_shape = 1 # <<<<<<<<<<<<<<
  3581. * else:
  3582. * copy_shape = 0
  3583. */
  3584. __pyx_v_copy_shape = 1;
  3585. goto __pyx_L4;
  3586. }
  3587. /*else*/ {
  3588. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
  3589. * copy_shape = 1
  3590. * else:
  3591. * copy_shape = 0 # <<<<<<<<<<<<<<
  3592. *
  3593. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3594. */
  3595. __pyx_v_copy_shape = 0;
  3596. }
  3597. __pyx_L4:;
  3598. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
  3599. * copy_shape = 0
  3600. *
  3601. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  3602. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  3603. * raise ValueError(u"ndarray is not C contiguous")
  3604. */
  3605. __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  3606. if (__pyx_t_1) {
  3607. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
  3608. *
  3609. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3610. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  3611. * raise ValueError(u"ndarray is not C contiguous")
  3612. *
  3613. */
  3614. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  3615. __pyx_t_3 = __pyx_t_2;
  3616. } else {
  3617. __pyx_t_3 = __pyx_t_1;
  3618. }
  3619. if (__pyx_t_3) {
  3620. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  3621. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3622. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  3623. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  3624. *
  3625. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3626. */
  3627. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3628. __Pyx_GOTREF(__pyx_t_4);
  3629. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3630. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3631. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3632. }
  3633. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
  3634. * raise ValueError(u"ndarray is not C contiguous")
  3635. *
  3636. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  3637. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  3638. * raise ValueError(u"ndarray is not Fortran contiguous")
  3639. */
  3640. __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  3641. if (__pyx_t_3) {
  3642. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
  3643. *
  3644. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3645. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  3646. * raise ValueError(u"ndarray is not Fortran contiguous")
  3647. *
  3648. */
  3649. __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  3650. __pyx_t_2 = __pyx_t_1;
  3651. } else {
  3652. __pyx_t_2 = __pyx_t_3;
  3653. }
  3654. if (__pyx_t_2) {
  3655. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  3656. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3657. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  3658. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  3659. *
  3660. * info.buf = PyArray_DATA(self)
  3661. */
  3662. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3663. __Pyx_GOTREF(__pyx_t_4);
  3664. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3665. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3666. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3667. }
  3668. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
  3669. * raise ValueError(u"ndarray is not Fortran contiguous")
  3670. *
  3671. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  3672. * info.ndim = ndim
  3673. * if copy_shape:
  3674. */
  3675. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  3676. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
  3677. *
  3678. * info.buf = PyArray_DATA(self)
  3679. * info.ndim = ndim # <<<<<<<<<<<<<<
  3680. * if copy_shape:
  3681. * # Allocate new buffer for strides and shape info.
  3682. */
  3683. __pyx_v_info->ndim = __pyx_v_ndim;
  3684. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
  3685. * info.buf = PyArray_DATA(self)
  3686. * info.ndim = ndim
  3687. * if copy_shape: # <<<<<<<<<<<<<<
  3688. * # Allocate new buffer for strides and shape info.
  3689. * # This is allocated as one block, strides first.
  3690. */
  3691. __pyx_t_2 = (__pyx_v_copy_shape != 0);
  3692. if (__pyx_t_2) {
  3693. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
  3694. * # Allocate new buffer for strides and shape info.
  3695. * # This is allocated as one block, strides first.
  3696. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
  3697. * info.shape = info.strides + ndim
  3698. * for i in range(ndim):
  3699. */
  3700. __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
  3701. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
  3702. * # This is allocated as one block, strides first.
  3703. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  3704. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  3705. * for i in range(ndim):
  3706. * info.strides[i] = PyArray_STRIDES(self)[i]
  3707. */
  3708. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  3709. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
  3710. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  3711. * info.shape = info.strides + ndim
  3712. * for i in range(ndim): # <<<<<<<<<<<<<<
  3713. * info.strides[i] = PyArray_STRIDES(self)[i]
  3714. * info.shape[i] = PyArray_DIMS(self)[i]
  3715. */
  3716. __pyx_t_5 = __pyx_v_ndim;
  3717. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  3718. __pyx_v_i = __pyx_t_6;
  3719. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
  3720. * info.shape = info.strides + ndim
  3721. * for i in range(ndim):
  3722. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  3723. * info.shape[i] = PyArray_DIMS(self)[i]
  3724. * else:
  3725. */
  3726. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  3727. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
  3728. * for i in range(ndim):
  3729. * info.strides[i] = PyArray_STRIDES(self)[i]
  3730. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  3731. * else:
  3732. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3733. */
  3734. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  3735. }
  3736. goto __pyx_L7;
  3737. }
  3738. /*else*/ {
  3739. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
  3740. * info.shape[i] = PyArray_DIMS(self)[i]
  3741. * else:
  3742. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  3743. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3744. * info.suboffsets = NULL
  3745. */
  3746. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  3747. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
  3748. * else:
  3749. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3750. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  3751. * info.suboffsets = NULL
  3752. * info.itemsize = PyArray_ITEMSIZE(self)
  3753. */
  3754. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  3755. }
  3756. __pyx_L7:;
  3757. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
  3758. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3759. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3760. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  3761. * info.itemsize = PyArray_ITEMSIZE(self)
  3762. * info.readonly = not PyArray_ISWRITEABLE(self)
  3763. */
  3764. __pyx_v_info->suboffsets = NULL;
  3765. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
  3766. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3767. * info.suboffsets = NULL
  3768. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  3769. * info.readonly = not PyArray_ISWRITEABLE(self)
  3770. *
  3771. */
  3772. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  3773. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
  3774. * info.suboffsets = NULL
  3775. * info.itemsize = PyArray_ITEMSIZE(self)
  3776. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  3777. *
  3778. * cdef int t
  3779. */
  3780. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  3781. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
  3782. *
  3783. * cdef int t
  3784. * cdef char* f = NULL # <<<<<<<<<<<<<<
  3785. * cdef dtype descr = self.descr
  3786. * cdef list stack
  3787. */
  3788. __pyx_v_f = NULL;
  3789. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
  3790. * cdef int t
  3791. * cdef char* f = NULL
  3792. * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
  3793. * cdef list stack
  3794. * cdef int offset
  3795. */
  3796. __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  3797. __Pyx_INCREF(__pyx_t_4);
  3798. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  3799. __pyx_t_4 = 0;
  3800. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
  3801. * cdef int offset
  3802. *
  3803. * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
  3804. *
  3805. * if not hasfields and not copy_shape:
  3806. */
  3807. __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
  3808. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
  3809. * cdef bint hasfields = PyDataType_HASFIELDS(descr)
  3810. *
  3811. * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
  3812. * # do not call releasebuffer
  3813. * info.obj = None
  3814. */
  3815. __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  3816. if (__pyx_t_2) {
  3817. __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
  3818. __pyx_t_1 = __pyx_t_3;
  3819. } else {
  3820. __pyx_t_1 = __pyx_t_2;
  3821. }
  3822. if (__pyx_t_1) {
  3823. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
  3824. * if not hasfields and not copy_shape:
  3825. * # do not call releasebuffer
  3826. * info.obj = None # <<<<<<<<<<<<<<
  3827. * else:
  3828. * # need to call releasebuffer
  3829. */
  3830. __Pyx_INCREF(Py_None);
  3831. __Pyx_GIVEREF(Py_None);
  3832. __Pyx_GOTREF(__pyx_v_info->obj);
  3833. __Pyx_DECREF(__pyx_v_info->obj);
  3834. __pyx_v_info->obj = Py_None;
  3835. goto __pyx_L10;
  3836. }
  3837. /*else*/ {
  3838. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
  3839. * else:
  3840. * # need to call releasebuffer
  3841. * info.obj = self # <<<<<<<<<<<<<<
  3842. *
  3843. * if not hasfields:
  3844. */
  3845. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  3846. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  3847. __Pyx_GOTREF(__pyx_v_info->obj);
  3848. __Pyx_DECREF(__pyx_v_info->obj);
  3849. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  3850. }
  3851. __pyx_L10:;
  3852. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
  3853. * info.obj = self
  3854. *
  3855. * if not hasfields: # <<<<<<<<<<<<<<
  3856. * t = descr.type_num
  3857. * if ((descr.byteorder == c'>' and little_endian) or
  3858. */
  3859. __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  3860. if (__pyx_t_1) {
  3861. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
  3862. *
  3863. * if not hasfields:
  3864. * t = descr.type_num # <<<<<<<<<<<<<<
  3865. * if ((descr.byteorder == c'>' and little_endian) or
  3866. * (descr.byteorder == c'<' and not little_endian)):
  3867. */
  3868. __pyx_t_5 = __pyx_v_descr->type_num;
  3869. __pyx_v_t = __pyx_t_5;
  3870. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
  3871. * if not hasfields:
  3872. * t = descr.type_num
  3873. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  3874. * (descr.byteorder == c'<' and not little_endian)):
  3875. * raise ValueError(u"Non-native byte order not supported")
  3876. */
  3877. __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
  3878. if (__pyx_t_1) {
  3879. __pyx_t_2 = (__pyx_v_little_endian != 0);
  3880. } else {
  3881. __pyx_t_2 = __pyx_t_1;
  3882. }
  3883. if (!__pyx_t_2) {
  3884. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
  3885. * t = descr.type_num
  3886. * if ((descr.byteorder == c'>' and little_endian) or
  3887. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  3888. * raise ValueError(u"Non-native byte order not supported")
  3889. * if t == NPY_BYTE: f = "b"
  3890. */
  3891. __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
  3892. if (__pyx_t_1) {
  3893. __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
  3894. __pyx_t_7 = __pyx_t_3;
  3895. } else {
  3896. __pyx_t_7 = __pyx_t_1;
  3897. }
  3898. __pyx_t_1 = __pyx_t_7;
  3899. } else {
  3900. __pyx_t_1 = __pyx_t_2;
  3901. }
  3902. if (__pyx_t_1) {
  3903. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  3904. * if ((descr.byteorder == c'>' and little_endian) or
  3905. * (descr.byteorder == c'<' and not little_endian)):
  3906. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  3907. * if t == NPY_BYTE: f = "b"
  3908. * elif t == NPY_UBYTE: f = "B"
  3909. */
  3910. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3911. __Pyx_GOTREF(__pyx_t_4);
  3912. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3913. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3914. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3915. }
  3916. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  3917. * elif t == NPY_CDOUBLE: f = "Zd"
  3918. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  3919. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  3920. * else:
  3921. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  3922. */
  3923. switch (__pyx_v_t) {
  3924. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
  3925. * (descr.byteorder == c'<' and not little_endian)):
  3926. * raise ValueError(u"Non-native byte order not supported")
  3927. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  3928. * elif t == NPY_UBYTE: f = "B"
  3929. * elif t == NPY_SHORT: f = "h"
  3930. */
  3931. case NPY_BYTE:
  3932. __pyx_v_f = __pyx_k_b;
  3933. break;
  3934. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
  3935. * raise ValueError(u"Non-native byte order not supported")
  3936. * if t == NPY_BYTE: f = "b"
  3937. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  3938. * elif t == NPY_SHORT: f = "h"
  3939. * elif t == NPY_USHORT: f = "H"
  3940. */
  3941. case NPY_UBYTE:
  3942. __pyx_v_f = __pyx_k_B;
  3943. break;
  3944. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
  3945. * if t == NPY_BYTE: f = "b"
  3946. * elif t == NPY_UBYTE: f = "B"
  3947. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  3948. * elif t == NPY_USHORT: f = "H"
  3949. * elif t == NPY_INT: f = "i"
  3950. */
  3951. case NPY_SHORT:
  3952. __pyx_v_f = __pyx_k_h;
  3953. break;
  3954. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
  3955. * elif t == NPY_UBYTE: f = "B"
  3956. * elif t == NPY_SHORT: f = "h"
  3957. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  3958. * elif t == NPY_INT: f = "i"
  3959. * elif t == NPY_UINT: f = "I"
  3960. */
  3961. case NPY_USHORT:
  3962. __pyx_v_f = __pyx_k_H;
  3963. break;
  3964. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
  3965. * elif t == NPY_SHORT: f = "h"
  3966. * elif t == NPY_USHORT: f = "H"
  3967. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  3968. * elif t == NPY_UINT: f = "I"
  3969. * elif t == NPY_LONG: f = "l"
  3970. */
  3971. case NPY_INT:
  3972. __pyx_v_f = __pyx_k_i;
  3973. break;
  3974. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
  3975. * elif t == NPY_USHORT: f = "H"
  3976. * elif t == NPY_INT: f = "i"
  3977. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  3978. * elif t == NPY_LONG: f = "l"
  3979. * elif t == NPY_ULONG: f = "L"
  3980. */
  3981. case NPY_UINT:
  3982. __pyx_v_f = __pyx_k_I;
  3983. break;
  3984. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
  3985. * elif t == NPY_INT: f = "i"
  3986. * elif t == NPY_UINT: f = "I"
  3987. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  3988. * elif t == NPY_ULONG: f = "L"
  3989. * elif t == NPY_LONGLONG: f = "q"
  3990. */
  3991. case NPY_LONG:
  3992. __pyx_v_f = __pyx_k_l;
  3993. break;
  3994. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
  3995. * elif t == NPY_UINT: f = "I"
  3996. * elif t == NPY_LONG: f = "l"
  3997. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  3998. * elif t == NPY_LONGLONG: f = "q"
  3999. * elif t == NPY_ULONGLONG: f = "Q"
  4000. */
  4001. case NPY_ULONG:
  4002. __pyx_v_f = __pyx_k_L;
  4003. break;
  4004. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
  4005. * elif t == NPY_LONG: f = "l"
  4006. * elif t == NPY_ULONG: f = "L"
  4007. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  4008. * elif t == NPY_ULONGLONG: f = "Q"
  4009. * elif t == NPY_FLOAT: f = "f"
  4010. */
  4011. case NPY_LONGLONG:
  4012. __pyx_v_f = __pyx_k_q;
  4013. break;
  4014. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
  4015. * elif t == NPY_ULONG: f = "L"
  4016. * elif t == NPY_LONGLONG: f = "q"
  4017. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  4018. * elif t == NPY_FLOAT: f = "f"
  4019. * elif t == NPY_DOUBLE: f = "d"
  4020. */
  4021. case NPY_ULONGLONG:
  4022. __pyx_v_f = __pyx_k_Q;
  4023. break;
  4024. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
  4025. * elif t == NPY_LONGLONG: f = "q"
  4026. * elif t == NPY_ULONGLONG: f = "Q"
  4027. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  4028. * elif t == NPY_DOUBLE: f = "d"
  4029. * elif t == NPY_LONGDOUBLE: f = "g"
  4030. */
  4031. case NPY_FLOAT:
  4032. __pyx_v_f = __pyx_k_f;
  4033. break;
  4034. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
  4035. * elif t == NPY_ULONGLONG: f = "Q"
  4036. * elif t == NPY_FLOAT: f = "f"
  4037. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  4038. * elif t == NPY_LONGDOUBLE: f = "g"
  4039. * elif t == NPY_CFLOAT: f = "Zf"
  4040. */
  4041. case NPY_DOUBLE:
  4042. __pyx_v_f = __pyx_k_d;
  4043. break;
  4044. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
  4045. * elif t == NPY_FLOAT: f = "f"
  4046. * elif t == NPY_DOUBLE: f = "d"
  4047. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  4048. * elif t == NPY_CFLOAT: f = "Zf"
  4049. * elif t == NPY_CDOUBLE: f = "Zd"
  4050. */
  4051. case NPY_LONGDOUBLE:
  4052. __pyx_v_f = __pyx_k_g;
  4053. break;
  4054. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
  4055. * elif t == NPY_DOUBLE: f = "d"
  4056. * elif t == NPY_LONGDOUBLE: f = "g"
  4057. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  4058. * elif t == NPY_CDOUBLE: f = "Zd"
  4059. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4060. */
  4061. case NPY_CFLOAT:
  4062. __pyx_v_f = __pyx_k_Zf;
  4063. break;
  4064. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
  4065. * elif t == NPY_LONGDOUBLE: f = "g"
  4066. * elif t == NPY_CFLOAT: f = "Zf"
  4067. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  4068. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4069. * elif t == NPY_OBJECT: f = "O"
  4070. */
  4071. case NPY_CDOUBLE:
  4072. __pyx_v_f = __pyx_k_Zd;
  4073. break;
  4074. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
  4075. * elif t == NPY_CFLOAT: f = "Zf"
  4076. * elif t == NPY_CDOUBLE: f = "Zd"
  4077. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  4078. * elif t == NPY_OBJECT: f = "O"
  4079. * else:
  4080. */
  4081. case NPY_CLONGDOUBLE:
  4082. __pyx_v_f = __pyx_k_Zg;
  4083. break;
  4084. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4085. * elif t == NPY_CDOUBLE: f = "Zd"
  4086. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4087. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4088. * else:
  4089. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4090. */
  4091. case NPY_OBJECT:
  4092. __pyx_v_f = __pyx_k_O;
  4093. break;
  4094. default:
  4095. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
  4096. * elif t == NPY_OBJECT: f = "O"
  4097. * else:
  4098. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  4099. * info.format = f
  4100. * return
  4101. */
  4102. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4103. __Pyx_GOTREF(__pyx_t_4);
  4104. __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4105. __Pyx_GOTREF(__pyx_t_8);
  4106. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4107. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4108. __Pyx_GOTREF(__pyx_t_4);
  4109. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  4110. __Pyx_GIVEREF(__pyx_t_8);
  4111. __pyx_t_8 = 0;
  4112. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4113. __Pyx_GOTREF(__pyx_t_8);
  4114. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4115. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  4116. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4117. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4118. break;
  4119. }
  4120. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
  4121. * else:
  4122. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4123. * info.format = f # <<<<<<<<<<<<<<
  4124. * return
  4125. * else:
  4126. */
  4127. __pyx_v_info->format = __pyx_v_f;
  4128. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
  4129. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4130. * info.format = f
  4131. * return # <<<<<<<<<<<<<<
  4132. * else:
  4133. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4134. */
  4135. __pyx_r = 0;
  4136. goto __pyx_L0;
  4137. }
  4138. /*else*/ {
  4139. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
  4140. * return
  4141. * else:
  4142. * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  4143. * info.format[0] = c'^' # Native data types, manual alignment
  4144. * offset = 0
  4145. */
  4146. __pyx_v_info->format = ((char *)malloc(255));
  4147. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
  4148. * else:
  4149. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4150. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  4151. * offset = 0
  4152. * f = _util_dtypestring(descr, info.format + 1,
  4153. */
  4154. (__pyx_v_info->format[0]) = '^';
  4155. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
  4156. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4157. * info.format[0] = c'^' # Native data types, manual alignment
  4158. * offset = 0 # <<<<<<<<<<<<<<
  4159. * f = _util_dtypestring(descr, info.format + 1,
  4160. * info.format + _buffer_format_string_len,
  4161. */
  4162. __pyx_v_offset = 0;
  4163. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
  4164. * info.format[0] = c'^' # Native data types, manual alignment
  4165. * offset = 0
  4166. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  4167. * info.format + _buffer_format_string_len,
  4168. * &offset)
  4169. */
  4170. __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4171. __pyx_v_f = __pyx_t_9;
  4172. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
  4173. * info.format + _buffer_format_string_len,
  4174. * &offset)
  4175. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  4176. *
  4177. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4178. */
  4179. (__pyx_v_f[0]) = '\x00';
  4180. }
  4181. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4182. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4183. * # -- the details of this may change.
  4184. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4185. * # This implementation of getbuffer is geared towards Cython
  4186. * # requirements, and does not yet fullfill the PEP.
  4187. */
  4188. /* function exit code */
  4189. __pyx_r = 0;
  4190. goto __pyx_L0;
  4191. __pyx_L1_error:;
  4192. __Pyx_XDECREF(__pyx_t_4);
  4193. __Pyx_XDECREF(__pyx_t_8);
  4194. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4195. __pyx_r = -1;
  4196. if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
  4197. __Pyx_GOTREF(__pyx_v_info->obj);
  4198. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  4199. }
  4200. goto __pyx_L2;
  4201. __pyx_L0:;
  4202. if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
  4203. __Pyx_GOTREF(Py_None);
  4204. __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  4205. }
  4206. __pyx_L2:;
  4207. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  4208. __Pyx_RefNannyFinishContext();
  4209. return __pyx_r;
  4210. }
  4211. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4212. * f[0] = c'\0' # Terminate format string
  4213. *
  4214. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4215. * if PyArray_HASFIELDS(self):
  4216. * stdlib.free(info.format)
  4217. */
  4218. /* Python wrapper */
  4219. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  4220. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4221. __Pyx_RefNannyDeclarations
  4222. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  4223. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  4224. /* function exit code */
  4225. __Pyx_RefNannyFinishContext();
  4226. }
  4227. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4228. __Pyx_RefNannyDeclarations
  4229. int __pyx_t_1;
  4230. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  4231. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
  4232. *
  4233. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4234. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  4235. * stdlib.free(info.format)
  4236. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4237. */
  4238. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  4239. if (__pyx_t_1) {
  4240. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
  4241. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4242. * if PyArray_HASFIELDS(self):
  4243. * stdlib.free(info.format) # <<<<<<<<<<<<<<
  4244. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4245. * stdlib.free(info.strides)
  4246. */
  4247. free(__pyx_v_info->format);
  4248. goto __pyx_L3;
  4249. }
  4250. __pyx_L3:;
  4251. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
  4252. * if PyArray_HASFIELDS(self):
  4253. * stdlib.free(info.format)
  4254. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4255. * stdlib.free(info.strides)
  4256. * # info.shape was stored after info.strides in the same block
  4257. */
  4258. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4259. if (__pyx_t_1) {
  4260. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
  4261. * stdlib.free(info.format)
  4262. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4263. * stdlib.free(info.strides) # <<<<<<<<<<<<<<
  4264. * # info.shape was stored after info.strides in the same block
  4265. *
  4266. */
  4267. free(__pyx_v_info->strides);
  4268. goto __pyx_L4;
  4269. }
  4270. __pyx_L4:;
  4271. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4272. * f[0] = c'\0' # Terminate format string
  4273. *
  4274. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4275. * if PyArray_HASFIELDS(self):
  4276. * stdlib.free(info.format)
  4277. */
  4278. /* function exit code */
  4279. __Pyx_RefNannyFinishContext();
  4280. }
  4281. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4282. * ctypedef npy_cdouble complex_t
  4283. *
  4284. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4285. * return PyArray_MultiIterNew(1, <void*>a)
  4286. *
  4287. */
  4288. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  4289. PyObject *__pyx_r = NULL;
  4290. __Pyx_RefNannyDeclarations
  4291. PyObject *__pyx_t_1 = NULL;
  4292. int __pyx_lineno = 0;
  4293. const char *__pyx_filename = NULL;
  4294. int __pyx_clineno = 0;
  4295. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  4296. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
  4297. *
  4298. * cdef inline object PyArray_MultiIterNew1(a):
  4299. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  4300. *
  4301. * cdef inline object PyArray_MultiIterNew2(a, b):
  4302. */
  4303. __Pyx_XDECREF(__pyx_r);
  4304. __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4305. __Pyx_GOTREF(__pyx_t_1);
  4306. __pyx_r = __pyx_t_1;
  4307. __pyx_t_1 = 0;
  4308. goto __pyx_L0;
  4309. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4310. * ctypedef npy_cdouble complex_t
  4311. *
  4312. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4313. * return PyArray_MultiIterNew(1, <void*>a)
  4314. *
  4315. */
  4316. /* function exit code */
  4317. __pyx_L1_error:;
  4318. __Pyx_XDECREF(__pyx_t_1);
  4319. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4320. __pyx_r = 0;
  4321. __pyx_L0:;
  4322. __Pyx_XGIVEREF(__pyx_r);
  4323. __Pyx_RefNannyFinishContext();
  4324. return __pyx_r;
  4325. }
  4326. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  4327. * return PyArray_MultiIterNew(1, <void*>a)
  4328. *
  4329. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  4330. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4331. *
  4332. */
  4333. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  4334. PyObject *__pyx_r = NULL;
  4335. __Pyx_RefNannyDeclarations
  4336. PyObject *__pyx_t_1 = NULL;
  4337. int __pyx_lineno = 0;
  4338. const char *__pyx_filename = NULL;
  4339. int __pyx_clineno = 0;
  4340. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  4341. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
  4342. *
  4343. * cdef inline object PyArray_MultiIterNew2(a, b):
  4344. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  4345. *
  4346. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  4347. */
  4348. __Pyx_XDECREF(__pyx_r);
  4349. __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4350. __Pyx_GOTREF(__pyx_t_1);
  4351. __pyx_r = __pyx_t_1;
  4352. __pyx_t_1 = 0;
  4353. goto __pyx_L0;
  4354. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  4355. * return PyArray_MultiIterNew(1, <void*>a)
  4356. *
  4357. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  4358. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4359. *
  4360. */
  4361. /* function exit code */
  4362. __pyx_L1_error:;
  4363. __Pyx_XDECREF(__pyx_t_1);
  4364. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4365. __pyx_r = 0;
  4366. __pyx_L0:;
  4367. __Pyx_XGIVEREF(__pyx_r);
  4368. __Pyx_RefNannyFinishContext();
  4369. return __pyx_r;
  4370. }
  4371. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  4372. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4373. *
  4374. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  4375. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4376. *
  4377. */
  4378. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  4379. PyObject *__pyx_r = NULL;
  4380. __Pyx_RefNannyDeclarations
  4381. PyObject *__pyx_t_1 = NULL;
  4382. int __pyx_lineno = 0;
  4383. const char *__pyx_filename = NULL;
  4384. int __pyx_clineno = 0;
  4385. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  4386. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775
  4387. *
  4388. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  4389. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  4390. *
  4391. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  4392. */
  4393. __Pyx_XDECREF(__pyx_r);
  4394. __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4395. __Pyx_GOTREF(__pyx_t_1);
  4396. __pyx_r = __pyx_t_1;
  4397. __pyx_t_1 = 0;
  4398. goto __pyx_L0;
  4399. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  4400. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4401. *
  4402. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  4403. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4404. *
  4405. */
  4406. /* function exit code */
  4407. __pyx_L1_error:;
  4408. __Pyx_XDECREF(__pyx_t_1);
  4409. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4410. __pyx_r = 0;
  4411. __pyx_L0:;
  4412. __Pyx_XGIVEREF(__pyx_r);
  4413. __Pyx_RefNannyFinishContext();
  4414. return __pyx_r;
  4415. }
  4416. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  4417. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4418. *
  4419. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  4420. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4421. *
  4422. */
  4423. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  4424. PyObject *__pyx_r = NULL;
  4425. __Pyx_RefNannyDeclarations
  4426. PyObject *__pyx_t_1 = NULL;
  4427. int __pyx_lineno = 0;
  4428. const char *__pyx_filename = NULL;
  4429. int __pyx_clineno = 0;
  4430. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  4431. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778
  4432. *
  4433. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  4434. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  4435. *
  4436. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  4437. */
  4438. __Pyx_XDECREF(__pyx_r);
  4439. __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4440. __Pyx_GOTREF(__pyx_t_1);
  4441. __pyx_r = __pyx_t_1;
  4442. __pyx_t_1 = 0;
  4443. goto __pyx_L0;
  4444. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  4445. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4446. *
  4447. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  4448. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4449. *
  4450. */
  4451. /* function exit code */
  4452. __pyx_L1_error:;
  4453. __Pyx_XDECREF(__pyx_t_1);
  4454. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4455. __pyx_r = 0;
  4456. __pyx_L0:;
  4457. __Pyx_XGIVEREF(__pyx_r);
  4458. __Pyx_RefNannyFinishContext();
  4459. return __pyx_r;
  4460. }
  4461. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  4462. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4463. *
  4464. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  4465. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4466. *
  4467. */
  4468. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  4469. PyObject *__pyx_r = NULL;
  4470. __Pyx_RefNannyDeclarations
  4471. PyObject *__pyx_t_1 = NULL;
  4472. int __pyx_lineno = 0;
  4473. const char *__pyx_filename = NULL;
  4474. int __pyx_clineno = 0;
  4475. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  4476. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":781
  4477. *
  4478. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  4479. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  4480. *
  4481. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  4482. */
  4483. __Pyx_XDECREF(__pyx_r);
  4484. __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4485. __Pyx_GOTREF(__pyx_t_1);
  4486. __pyx_r = __pyx_t_1;
  4487. __pyx_t_1 = 0;
  4488. goto __pyx_L0;
  4489. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  4490. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4491. *
  4492. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  4493. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4494. *
  4495. */
  4496. /* function exit code */
  4497. __pyx_L1_error:;
  4498. __Pyx_XDECREF(__pyx_t_1);
  4499. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4500. __pyx_r = 0;
  4501. __pyx_L0:;
  4502. __Pyx_XGIVEREF(__pyx_r);
  4503. __Pyx_RefNannyFinishContext();
  4504. return __pyx_r;
  4505. }
  4506. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  4507. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4508. *
  4509. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  4510. * # Recursive utility function used in __getbuffer__ to get format
  4511. * # string. The new location in the format string is returned.
  4512. */
  4513. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  4514. PyArray_Descr *__pyx_v_child = 0;
  4515. int __pyx_v_endian_detector;
  4516. int __pyx_v_little_endian;
  4517. PyObject *__pyx_v_fields = 0;
  4518. PyObject *__pyx_v_childname = NULL;
  4519. PyObject *__pyx_v_new_offset = NULL;
  4520. PyObject *__pyx_v_t = NULL;
  4521. char *__pyx_r;
  4522. __Pyx_RefNannyDeclarations
  4523. PyObject *__pyx_t_1 = NULL;
  4524. Py_ssize_t __pyx_t_2;
  4525. PyObject *__pyx_t_3 = NULL;
  4526. PyObject *__pyx_t_4 = NULL;
  4527. int __pyx_t_5;
  4528. int __pyx_t_6;
  4529. int __pyx_t_7;
  4530. int __pyx_t_8;
  4531. int __pyx_t_9;
  4532. long __pyx_t_10;
  4533. char *__pyx_t_11;
  4534. int __pyx_lineno = 0;
  4535. const char *__pyx_filename = NULL;
  4536. int __pyx_clineno = 0;
  4537. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  4538. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
  4539. * cdef int delta_offset
  4540. * cdef tuple i
  4541. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  4542. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4543. * cdef tuple fields
  4544. */
  4545. __pyx_v_endian_detector = 1;
  4546. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
  4547. * cdef tuple i
  4548. * cdef int endian_detector = 1
  4549. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  4550. * cdef tuple fields
  4551. *
  4552. */
  4553. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  4554. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
  4555. * cdef tuple fields
  4556. *
  4557. * for childname in descr.names: # <<<<<<<<<<<<<<
  4558. * fields = descr.fields[childname]
  4559. * child, new_offset = fields
  4560. */
  4561. if (unlikely(__pyx_v_descr->names == Py_None)) {
  4562. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  4563. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4564. }
  4565. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  4566. for (;;) {
  4567. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  4568. #if CYTHON_COMPILING_IN_CPYTHON
  4569. __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4570. #else
  4571. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4572. #endif
  4573. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  4574. __pyx_t_3 = 0;
  4575. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795
  4576. *
  4577. * for childname in descr.names:
  4578. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  4579. * child, new_offset = fields
  4580. *
  4581. */
  4582. __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  4583. __Pyx_GOTREF(__pyx_t_3);
  4584. if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4585. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  4586. __pyx_t_3 = 0;
  4587. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
  4588. * for childname in descr.names:
  4589. * fields = descr.fields[childname]
  4590. * child, new_offset = fields # <<<<<<<<<<<<<<
  4591. *
  4592. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  4593. */
  4594. if (likely(__pyx_v_fields != Py_None)) {
  4595. PyObject* sequence = __pyx_v_fields;
  4596. #if CYTHON_COMPILING_IN_CPYTHON
  4597. Py_ssize_t size = Py_SIZE(sequence);
  4598. #else
  4599. Py_ssize_t size = PySequence_Size(sequence);
  4600. #endif
  4601. if (unlikely(size != 2)) {
  4602. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4603. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4604. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4605. }
  4606. #if CYTHON_COMPILING_IN_CPYTHON
  4607. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  4608. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  4609. __Pyx_INCREF(__pyx_t_3);
  4610. __Pyx_INCREF(__pyx_t_4);
  4611. #else
  4612. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4613. __Pyx_GOTREF(__pyx_t_3);
  4614. __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4615. __Pyx_GOTREF(__pyx_t_4);
  4616. #endif
  4617. } else {
  4618. __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4619. }
  4620. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4621. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  4622. __pyx_t_3 = 0;
  4623. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  4624. __pyx_t_4 = 0;
  4625. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
  4626. * child, new_offset = fields
  4627. *
  4628. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  4629. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  4630. *
  4631. */
  4632. __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4633. __Pyx_GOTREF(__pyx_t_4);
  4634. __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4635. __Pyx_GOTREF(__pyx_t_3);
  4636. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4637. __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4638. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4639. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  4640. if (__pyx_t_6) {
  4641. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  4642. *
  4643. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  4644. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  4645. *
  4646. * if ((child.byteorder == c'>' and little_endian) or
  4647. */
  4648. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4649. __Pyx_GOTREF(__pyx_t_3);
  4650. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  4651. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4652. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4653. }
  4654. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
  4655. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  4656. *
  4657. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  4658. * (child.byteorder == c'<' and not little_endian)):
  4659. * raise ValueError(u"Non-native byte order not supported")
  4660. */
  4661. __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
  4662. if (__pyx_t_6) {
  4663. __pyx_t_7 = (__pyx_v_little_endian != 0);
  4664. } else {
  4665. __pyx_t_7 = __pyx_t_6;
  4666. }
  4667. if (!__pyx_t_7) {
  4668. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
  4669. *
  4670. * if ((child.byteorder == c'>' and little_endian) or
  4671. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  4672. * raise ValueError(u"Non-native byte order not supported")
  4673. * # One could encode it in the format string and have Cython
  4674. */
  4675. __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
  4676. if (__pyx_t_6) {
  4677. __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
  4678. __pyx_t_9 = __pyx_t_8;
  4679. } else {
  4680. __pyx_t_9 = __pyx_t_6;
  4681. }
  4682. __pyx_t_6 = __pyx_t_9;
  4683. } else {
  4684. __pyx_t_6 = __pyx_t_7;
  4685. }
  4686. if (__pyx_t_6) {
  4687. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  4688. * if ((child.byteorder == c'>' and little_endian) or
  4689. * (child.byteorder == c'<' and not little_endian)):
  4690. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  4691. * # One could encode it in the format string and have Cython
  4692. * # complain instead, BUT: < and > in format strings also imply
  4693. */
  4694. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4695. __Pyx_GOTREF(__pyx_t_3);
  4696. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  4697. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4698. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4699. }
  4700. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
  4701. *
  4702. * # Output padding bytes
  4703. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  4704. * f[0] = 120 # "x"; pad byte
  4705. * f += 1
  4706. */
  4707. while (1) {
  4708. __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4709. __Pyx_GOTREF(__pyx_t_3);
  4710. __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4711. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4712. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4713. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4714. if (!__pyx_t_6) break;
  4715. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
  4716. * # Output padding bytes
  4717. * while offset[0] < new_offset:
  4718. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  4719. * f += 1
  4720. * offset[0] += 1
  4721. */
  4722. (__pyx_v_f[0]) = 120;
  4723. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
  4724. * while offset[0] < new_offset:
  4725. * f[0] = 120 # "x"; pad byte
  4726. * f += 1 # <<<<<<<<<<<<<<
  4727. * offset[0] += 1
  4728. *
  4729. */
  4730. __pyx_v_f = (__pyx_v_f + 1);
  4731. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
  4732. * f[0] = 120 # "x"; pad byte
  4733. * f += 1
  4734. * offset[0] += 1 # <<<<<<<<<<<<<<
  4735. *
  4736. * offset[0] += child.itemsize
  4737. */
  4738. __pyx_t_10 = 0;
  4739. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
  4740. }
  4741. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
  4742. * offset[0] += 1
  4743. *
  4744. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  4745. *
  4746. * if not PyDataType_HASFIELDS(child):
  4747. */
  4748. __pyx_t_10 = 0;
  4749. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
  4750. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
  4751. * offset[0] += child.itemsize
  4752. *
  4753. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  4754. * t = child.type_num
  4755. * if end - f < 5:
  4756. */
  4757. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  4758. if (__pyx_t_6) {
  4759. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821
  4760. *
  4761. * if not PyDataType_HASFIELDS(child):
  4762. * t = child.type_num # <<<<<<<<<<<<<<
  4763. * if end - f < 5:
  4764. * raise RuntimeError(u"Format string allocated too short.")
  4765. */
  4766. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4767. __Pyx_GOTREF(__pyx_t_4);
  4768. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  4769. __pyx_t_4 = 0;
  4770. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822
  4771. * if not PyDataType_HASFIELDS(child):
  4772. * t = child.type_num
  4773. * if end - f < 5: # <<<<<<<<<<<<<<
  4774. * raise RuntimeError(u"Format string allocated too short.")
  4775. *
  4776. */
  4777. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  4778. if (__pyx_t_6) {
  4779. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  4780. * t = child.type_num
  4781. * if end - f < 5:
  4782. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  4783. *
  4784. * # Until ticket #99 is fixed, use integers to avoid warnings
  4785. */
  4786. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4787. __Pyx_GOTREF(__pyx_t_4);
  4788. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4789. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4790. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4791. }
  4792. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
  4793. *
  4794. * # Until ticket #99 is fixed, use integers to avoid warnings
  4795. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  4796. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4797. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4798. */
  4799. __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4800. __Pyx_GOTREF(__pyx_t_4);
  4801. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4802. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4803. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4804. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4805. if (__pyx_t_6) {
  4806. (__pyx_v_f[0]) = 98;
  4807. goto __pyx_L11;
  4808. }
  4809. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827
  4810. * # Until ticket #99 is fixed, use integers to avoid warnings
  4811. * if t == NPY_BYTE: f[0] = 98 #"b"
  4812. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  4813. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4814. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4815. */
  4816. __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4817. __Pyx_GOTREF(__pyx_t_3);
  4818. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4819. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4820. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4821. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4822. if (__pyx_t_6) {
  4823. (__pyx_v_f[0]) = 66;
  4824. goto __pyx_L11;
  4825. }
  4826. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828
  4827. * if t == NPY_BYTE: f[0] = 98 #"b"
  4828. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4829. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  4830. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4831. * elif t == NPY_INT: f[0] = 105 #"i"
  4832. */
  4833. __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4834. __Pyx_GOTREF(__pyx_t_4);
  4835. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4836. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4837. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4838. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4839. if (__pyx_t_6) {
  4840. (__pyx_v_f[0]) = 104;
  4841. goto __pyx_L11;
  4842. }
  4843. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
  4844. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4845. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4846. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  4847. * elif t == NPY_INT: f[0] = 105 #"i"
  4848. * elif t == NPY_UINT: f[0] = 73 #"I"
  4849. */
  4850. __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4851. __Pyx_GOTREF(__pyx_t_3);
  4852. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4853. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4854. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4855. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4856. if (__pyx_t_6) {
  4857. (__pyx_v_f[0]) = 72;
  4858. goto __pyx_L11;
  4859. }
  4860. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830
  4861. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4862. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4863. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  4864. * elif t == NPY_UINT: f[0] = 73 #"I"
  4865. * elif t == NPY_LONG: f[0] = 108 #"l"
  4866. */
  4867. __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4868. __Pyx_GOTREF(__pyx_t_4);
  4869. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4870. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4871. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4872. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4873. if (__pyx_t_6) {
  4874. (__pyx_v_f[0]) = 105;
  4875. goto __pyx_L11;
  4876. }
  4877. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
  4878. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4879. * elif t == NPY_INT: f[0] = 105 #"i"
  4880. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  4881. * elif t == NPY_LONG: f[0] = 108 #"l"
  4882. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4883. */
  4884. __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4885. __Pyx_GOTREF(__pyx_t_3);
  4886. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4887. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4888. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4889. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4890. if (__pyx_t_6) {
  4891. (__pyx_v_f[0]) = 73;
  4892. goto __pyx_L11;
  4893. }
  4894. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832
  4895. * elif t == NPY_INT: f[0] = 105 #"i"
  4896. * elif t == NPY_UINT: f[0] = 73 #"I"
  4897. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  4898. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4899. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4900. */
  4901. __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4902. __Pyx_GOTREF(__pyx_t_4);
  4903. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4904. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4905. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4906. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4907. if (__pyx_t_6) {
  4908. (__pyx_v_f[0]) = 108;
  4909. goto __pyx_L11;
  4910. }
  4911. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
  4912. * elif t == NPY_UINT: f[0] = 73 #"I"
  4913. * elif t == NPY_LONG: f[0] = 108 #"l"
  4914. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  4915. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4916. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4917. */
  4918. __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4919. __Pyx_GOTREF(__pyx_t_3);
  4920. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4921. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4922. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4923. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4924. if (__pyx_t_6) {
  4925. (__pyx_v_f[0]) = 76;
  4926. goto __pyx_L11;
  4927. }
  4928. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834
  4929. * elif t == NPY_LONG: f[0] = 108 #"l"
  4930. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4931. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  4932. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4933. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4934. */
  4935. __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4936. __Pyx_GOTREF(__pyx_t_4);
  4937. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4938. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4939. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4940. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4941. if (__pyx_t_6) {
  4942. (__pyx_v_f[0]) = 113;
  4943. goto __pyx_L11;
  4944. }
  4945. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
  4946. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4947. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4948. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  4949. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4950. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  4951. */
  4952. __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4953. __Pyx_GOTREF(__pyx_t_3);
  4954. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4955. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4956. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4957. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4958. if (__pyx_t_6) {
  4959. (__pyx_v_f[0]) = 81;
  4960. goto __pyx_L11;
  4961. }
  4962. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836
  4963. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4964. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4965. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  4966. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  4967. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  4968. */
  4969. __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4970. __Pyx_GOTREF(__pyx_t_4);
  4971. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4972. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4973. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4974. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4975. if (__pyx_t_6) {
  4976. (__pyx_v_f[0]) = 102;
  4977. goto __pyx_L11;
  4978. }
  4979. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
  4980. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4981. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4982. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  4983. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  4984. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  4985. */
  4986. __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4987. __Pyx_GOTREF(__pyx_t_3);
  4988. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4989. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4990. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4991. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4992. if (__pyx_t_6) {
  4993. (__pyx_v_f[0]) = 100;
  4994. goto __pyx_L11;
  4995. }
  4996. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
  4997. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4998. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  4999. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  5000. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5001. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5002. */
  5003. __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5004. __Pyx_GOTREF(__pyx_t_4);
  5005. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5006. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5007. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5008. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5009. if (__pyx_t_6) {
  5010. (__pyx_v_f[0]) = 103;
  5011. goto __pyx_L11;
  5012. }
  5013. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
  5014. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5015. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5016. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  5017. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5018. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5019. */
  5020. __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5021. __Pyx_GOTREF(__pyx_t_3);
  5022. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5023. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5024. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5025. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5026. if (__pyx_t_6) {
  5027. (__pyx_v_f[0]) = 90;
  5028. (__pyx_v_f[1]) = 102;
  5029. __pyx_v_f = (__pyx_v_f + 1);
  5030. goto __pyx_L11;
  5031. }
  5032. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
  5033. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5034. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5035. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  5036. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5037. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5038. */
  5039. __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5040. __Pyx_GOTREF(__pyx_t_4);
  5041. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5042. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5043. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5044. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5045. if (__pyx_t_6) {
  5046. (__pyx_v_f[0]) = 90;
  5047. (__pyx_v_f[1]) = 100;
  5048. __pyx_v_f = (__pyx_v_f + 1);
  5049. goto __pyx_L11;
  5050. }
  5051. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
  5052. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5053. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5054. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  5055. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5056. * else:
  5057. */
  5058. __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5059. __Pyx_GOTREF(__pyx_t_3);
  5060. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5061. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5062. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5063. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5064. if (__pyx_t_6) {
  5065. (__pyx_v_f[0]) = 90;
  5066. (__pyx_v_f[1]) = 103;
  5067. __pyx_v_f = (__pyx_v_f + 1);
  5068. goto __pyx_L11;
  5069. }
  5070. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
  5071. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5072. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5073. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  5074. * else:
  5075. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5076. */
  5077. __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5078. __Pyx_GOTREF(__pyx_t_4);
  5079. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5080. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5081. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5082. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5083. if (__pyx_t_6) {
  5084. (__pyx_v_f[0]) = 79;
  5085. goto __pyx_L11;
  5086. }
  5087. /*else*/ {
  5088. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844
  5089. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5090. * else:
  5091. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  5092. * f += 1
  5093. * else:
  5094. */
  5095. __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5096. __Pyx_GOTREF(__pyx_t_3);
  5097. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5098. __Pyx_GOTREF(__pyx_t_4);
  5099. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  5100. __Pyx_GIVEREF(__pyx_t_3);
  5101. __pyx_t_3 = 0;
  5102. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5103. __Pyx_GOTREF(__pyx_t_3);
  5104. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5105. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5106. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5107. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5108. }
  5109. __pyx_L11:;
  5110. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
  5111. * else:
  5112. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5113. * f += 1 # <<<<<<<<<<<<<<
  5114. * else:
  5115. * # Cython ignores struct boundary information ("T{...}"),
  5116. */
  5117. __pyx_v_f = (__pyx_v_f + 1);
  5118. goto __pyx_L9;
  5119. }
  5120. /*else*/ {
  5121. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
  5122. * # Cython ignores struct boundary information ("T{...}"),
  5123. * # so don't output it
  5124. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  5125. * return f
  5126. *
  5127. */
  5128. __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5129. __pyx_v_f = __pyx_t_11;
  5130. }
  5131. __pyx_L9:;
  5132. }
  5133. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5134. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
  5135. * # so don't output it
  5136. * f = _util_dtypestring(child, f, end, offset)
  5137. * return f # <<<<<<<<<<<<<<
  5138. *
  5139. *
  5140. */
  5141. __pyx_r = __pyx_v_f;
  5142. goto __pyx_L0;
  5143. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5144. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5145. *
  5146. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5147. * # Recursive utility function used in __getbuffer__ to get format
  5148. * # string. The new location in the format string is returned.
  5149. */
  5150. /* function exit code */
  5151. __pyx_L1_error:;
  5152. __Pyx_XDECREF(__pyx_t_1);
  5153. __Pyx_XDECREF(__pyx_t_3);
  5154. __Pyx_XDECREF(__pyx_t_4);
  5155. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5156. __pyx_r = NULL;
  5157. __pyx_L0:;
  5158. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  5159. __Pyx_XDECREF(__pyx_v_fields);
  5160. __Pyx_XDECREF(__pyx_v_childname);
  5161. __Pyx_XDECREF(__pyx_v_new_offset);
  5162. __Pyx_XDECREF(__pyx_v_t);
  5163. __Pyx_RefNannyFinishContext();
  5164. return __pyx_r;
  5165. }
  5166. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5167. *
  5168. *
  5169. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5170. * cdef PyObject* baseptr
  5171. * if base is None:
  5172. */
  5173. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  5174. PyObject *__pyx_v_baseptr;
  5175. __Pyx_RefNannyDeclarations
  5176. int __pyx_t_1;
  5177. int __pyx_t_2;
  5178. __Pyx_RefNannySetupContext("set_array_base", 0);
  5179. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
  5180. * cdef inline void set_array_base(ndarray arr, object base):
  5181. * cdef PyObject* baseptr
  5182. * if base is None: # <<<<<<<<<<<<<<
  5183. * baseptr = NULL
  5184. * else:
  5185. */
  5186. __pyx_t_1 = (__pyx_v_base == Py_None);
  5187. __pyx_t_2 = (__pyx_t_1 != 0);
  5188. if (__pyx_t_2) {
  5189. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
  5190. * cdef PyObject* baseptr
  5191. * if base is None:
  5192. * baseptr = NULL # <<<<<<<<<<<<<<
  5193. * else:
  5194. * Py_INCREF(base) # important to do this before decref below!
  5195. */
  5196. __pyx_v_baseptr = NULL;
  5197. goto __pyx_L3;
  5198. }
  5199. /*else*/ {
  5200. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
  5201. * baseptr = NULL
  5202. * else:
  5203. * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
  5204. * baseptr = <PyObject*>base
  5205. * Py_XDECREF(arr.base)
  5206. */
  5207. Py_INCREF(__pyx_v_base);
  5208. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
  5209. * else:
  5210. * Py_INCREF(base) # important to do this before decref below!
  5211. * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
  5212. * Py_XDECREF(arr.base)
  5213. * arr.base = baseptr
  5214. */
  5215. __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  5216. }
  5217. __pyx_L3:;
  5218. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
  5219. * Py_INCREF(base) # important to do this before decref below!
  5220. * baseptr = <PyObject*>base
  5221. * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
  5222. * arr.base = baseptr
  5223. *
  5224. */
  5225. Py_XDECREF(__pyx_v_arr->base);
  5226. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
  5227. * baseptr = <PyObject*>base
  5228. * Py_XDECREF(arr.base)
  5229. * arr.base = baseptr # <<<<<<<<<<<<<<
  5230. *
  5231. * cdef inline object get_array_base(ndarray arr):
  5232. */
  5233. __pyx_v_arr->base = __pyx_v_baseptr;
  5234. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5235. *
  5236. *
  5237. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5238. * cdef PyObject* baseptr
  5239. * if base is None:
  5240. */
  5241. /* function exit code */
  5242. __Pyx_RefNannyFinishContext();
  5243. }
  5244. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5245. * arr.base = baseptr
  5246. *
  5247. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5248. * if arr.base is NULL:
  5249. * return None
  5250. */
  5251. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  5252. PyObject *__pyx_r = NULL;
  5253. __Pyx_RefNannyDeclarations
  5254. int __pyx_t_1;
  5255. __Pyx_RefNannySetupContext("get_array_base", 0);
  5256. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
  5257. *
  5258. * cdef inline object get_array_base(ndarray arr):
  5259. * if arr.base is NULL: # <<<<<<<<<<<<<<
  5260. * return None
  5261. * else:
  5262. */
  5263. __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  5264. if (__pyx_t_1) {
  5265. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
  5266. * cdef inline object get_array_base(ndarray arr):
  5267. * if arr.base is NULL:
  5268. * return None # <<<<<<<<<<<<<<
  5269. * else:
  5270. * return <object>arr.base
  5271. */
  5272. __Pyx_XDECREF(__pyx_r);
  5273. __Pyx_INCREF(Py_None);
  5274. __pyx_r = Py_None;
  5275. goto __pyx_L0;
  5276. }
  5277. /*else*/ {
  5278. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
  5279. * return None
  5280. * else:
  5281. * return <object>arr.base # <<<<<<<<<<<<<<
  5282. */
  5283. __Pyx_XDECREF(__pyx_r);
  5284. __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
  5285. __pyx_r = ((PyObject *)__pyx_v_arr->base);
  5286. goto __pyx_L0;
  5287. }
  5288. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5289. * arr.base = baseptr
  5290. *
  5291. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5292. * if arr.base is NULL:
  5293. * return None
  5294. */
  5295. /* function exit code */
  5296. __pyx_L0:;
  5297. __Pyx_XGIVEREF(__pyx_r);
  5298. __Pyx_RefNannyFinishContext();
  5299. return __pyx_r;
  5300. }
  5301. static PyMethodDef __pyx_methods[] = {
  5302. {0, 0, 0, 0}
  5303. };
  5304. #if PY_MAJOR_VERSION >= 3
  5305. static struct PyModuleDef __pyx_moduledef = {
  5306. #if PY_VERSION_HEX < 0x03020000
  5307. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  5308. #else
  5309. PyModuleDef_HEAD_INIT,
  5310. #endif
  5311. __Pyx_NAMESTR("scattnlay"),
  5312. 0, /* m_doc */
  5313. -1, /* m_size */
  5314. __pyx_methods /* m_methods */,
  5315. NULL, /* m_reload */
  5316. NULL, /* m_traverse */
  5317. NULL, /* m_clear */
  5318. NULL /* m_free */
  5319. };
  5320. #endif
  5321. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  5322. {&__pyx_n_s_Albedo, __pyx_k_Albedo, sizeof(__pyx_k_Albedo), 0, 0, 1, 1},
  5323. {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  5324. {&__pyx_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
  5325. {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
  5326. {&__pyx_n_s_Ei, __pyx_k_Ei, sizeof(__pyx_k_Ei), 0, 0, 1, 1},
  5327. {&__pyx_n_s_Er, __pyx_k_Er, sizeof(__pyx_k_Er), 0, 0, 1, 1},
  5328. {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  5329. {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  5330. {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
  5331. {&__pyx_n_s_Hi, __pyx_k_Hi, sizeof(__pyx_k_Hi), 0, 0, 1, 1},
  5332. {&__pyx_n_s_Hr, __pyx_k_Hr, sizeof(__pyx_k_Hr), 0, 0, 1, 1},
  5333. {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  5334. {&__pyx_n_s_Qabs, __pyx_k_Qabs, sizeof(__pyx_k_Qabs), 0, 0, 1, 1},
  5335. {&__pyx_n_s_Qbk, __pyx_k_Qbk, sizeof(__pyx_k_Qbk), 0, 0, 1, 1},
  5336. {&__pyx_n_s_Qext, __pyx_k_Qext, sizeof(__pyx_k_Qext), 0, 0, 1, 1},
  5337. {&__pyx_n_s_Qpr, __pyx_k_Qpr, sizeof(__pyx_k_Qpr), 0, 0, 1, 1},
  5338. {&__pyx_n_s_Qsca, __pyx_k_Qsca, sizeof(__pyx_k_Qsca), 0, 0, 1, 1},
  5339. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  5340. {&__pyx_n_s_S1, __pyx_k_S1, sizeof(__pyx_k_S1), 0, 0, 1, 1},
  5341. {&__pyx_n_s_S1i, __pyx_k_S1i, sizeof(__pyx_k_S1i), 0, 0, 1, 1},
  5342. {&__pyx_n_s_S1r, __pyx_k_S1r, sizeof(__pyx_k_S1r), 0, 0, 1, 1},
  5343. {&__pyx_n_s_S2, __pyx_k_S2, sizeof(__pyx_k_S2), 0, 0, 1, 1},
  5344. {&__pyx_n_s_S2i, __pyx_k_S2i, sizeof(__pyx_k_S2i), 0, 0, 1, 1},
  5345. {&__pyx_n_s_S2r, __pyx_k_S2r, sizeof(__pyx_k_S2r), 0, 0, 1, 1},
  5346. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  5347. {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1},
  5348. {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  5349. {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  5350. {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  5351. {&__pyx_n_s_fieldnlay, __pyx_k_fieldnlay, sizeof(__pyx_k_fieldnlay), 0, 0, 1, 1},
  5352. {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  5353. {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  5354. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  5355. {&__pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_k_home_ovidio_scattering_scattnla, sizeof(__pyx_k_home_ovidio_scattering_scattnla), 0, 0, 1, 0},
  5356. {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  5357. {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1},
  5358. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  5359. {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  5360. {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  5361. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  5362. {&__pyx_n_s_n_max, __pyx_k_n_max, sizeof(__pyx_k_n_max), 0, 0, 1, 1},
  5363. {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  5364. {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  5365. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  5366. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  5367. {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
  5368. {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  5369. {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1},
  5370. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  5371. {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  5372. {&__pyx_n_s_scattnlay, __pyx_k_scattnlay, sizeof(__pyx_k_scattnlay), 0, 0, 1, 1},
  5373. {&__pyx_n_s_terms, __pyx_k_terms, sizeof(__pyx_k_terms), 0, 0, 1, 1},
  5374. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  5375. {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  5376. {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  5377. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  5378. {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  5379. {0, 0, 0, 0, 0, 0, 0}
  5380. };
  5381. static int __Pyx_InitCachedBuiltins(void) {
  5382. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5383. __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5384. __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5385. return 0;
  5386. __pyx_L1_error:;
  5387. return -1;
  5388. }
  5389. static int __Pyx_InitCachedConstants(void) {
  5390. __Pyx_RefNannyDeclarations
  5391. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  5392. /* "scattnlay.pyx":33
  5393. *
  5394. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  5395. * a = a.copy('C') # <<<<<<<<<<<<<<
  5396. *
  5397. * # Return data pointer
  5398. */
  5399. __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5400. __Pyx_GOTREF(__pyx_tuple_);
  5401. __Pyx_GIVEREF(__pyx_tuple_);
  5402. /* "scattnlay.pyx":69
  5403. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  5404. *
  5405. * terms[i] = nfMieScatt(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), theta.shape[0], npy2c(theta), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  5406. *
  5407. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  5408. */
  5409. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5410. __Pyx_GOTREF(__pyx_tuple__3);
  5411. __Pyx_GIVEREF(__pyx_tuple__3);
  5412. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5413. __Pyx_GOTREF(__pyx_tuple__4);
  5414. __Pyx_GIVEREF(__pyx_tuple__4);
  5415. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5416. __Pyx_GOTREF(__pyx_tuple__5);
  5417. __Pyx_GIVEREF(__pyx_tuple__5);
  5418. /* "scattnlay.pyx":71
  5419. * terms[i] = nfMieScatt(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), theta.shape[0], npy2c(theta), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  5420. *
  5421. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  5422. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  5423. *
  5424. */
  5425. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5426. __Pyx_GOTREF(__pyx_tuple__6);
  5427. __Pyx_GIVEREF(__pyx_tuple__6);
  5428. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5429. __Pyx_GOTREF(__pyx_tuple__7);
  5430. __Pyx_GIVEREF(__pyx_tuple__7);
  5431. /* "scattnlay.pyx":72
  5432. *
  5433. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  5434. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  5435. *
  5436. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5437. */
  5438. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5439. __Pyx_GOTREF(__pyx_tuple__8);
  5440. __Pyx_GIVEREF(__pyx_tuple__8);
  5441. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5442. __Pyx_GOTREF(__pyx_tuple__9);
  5443. __Pyx_GIVEREF(__pyx_tuple__9);
  5444. /* "scattnlay.pyx":95
  5445. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  5446. *
  5447. * terms[i] = nfMieField(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), n_max, coords.shape[0], npy2c(coords[:, 0]), npy2c(coords[:, 1]), npy2c(coords[:, 2]), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi)) # <<<<<<<<<<<<<<
  5448. *
  5449. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  5450. */
  5451. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5452. __Pyx_GOTREF(__pyx_tuple__11);
  5453. __Pyx_GIVEREF(__pyx_tuple__11);
  5454. __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5455. __Pyx_GOTREF(__pyx_tuple__12);
  5456. __Pyx_GIVEREF(__pyx_tuple__12);
  5457. __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5458. __Pyx_GOTREF(__pyx_tuple__13);
  5459. __Pyx_GIVEREF(__pyx_tuple__13);
  5460. __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5461. __Pyx_GOTREF(__pyx_slice__14);
  5462. __Pyx_GIVEREF(__pyx_slice__14);
  5463. __pyx_tuple__15 = PyTuple_Pack(2, __pyx_slice__14, __pyx_int_0); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5464. __Pyx_GOTREF(__pyx_tuple__15);
  5465. __Pyx_GIVEREF(__pyx_tuple__15);
  5466. __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5467. __Pyx_GOTREF(__pyx_slice__16);
  5468. __Pyx_GIVEREF(__pyx_slice__16);
  5469. __pyx_tuple__17 = PyTuple_Pack(2, __pyx_slice__16, __pyx_int_1); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5470. __Pyx_GOTREF(__pyx_tuple__17);
  5471. __Pyx_GIVEREF(__pyx_tuple__17);
  5472. __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5473. __Pyx_GOTREF(__pyx_slice__18);
  5474. __Pyx_GIVEREF(__pyx_slice__18);
  5475. __pyx_tuple__19 = PyTuple_Pack(2, __pyx_slice__18, __pyx_int_2); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5476. __Pyx_GOTREF(__pyx_tuple__19);
  5477. __Pyx_GIVEREF(__pyx_tuple__19);
  5478. /* "scattnlay.pyx":97
  5479. * terms[i] = nfMieField(x.shape[1], pl, npy2c(x[i].copy('C')), npy2c(m[i].real.copy('C')), npy2c(m[i].imag.copy('C')), n_max, coords.shape[0], npy2c(coords[:, 0]), npy2c(coords[:, 1]), npy2c(coords[:, 2]), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  5480. *
  5481. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C') # <<<<<<<<<<<<<<
  5482. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  5483. *
  5484. */
  5485. __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5486. __Pyx_GOTREF(__pyx_tuple__20);
  5487. __Pyx_GIVEREF(__pyx_tuple__20);
  5488. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5489. __Pyx_GOTREF(__pyx_tuple__21);
  5490. __Pyx_GIVEREF(__pyx_tuple__21);
  5491. /* "scattnlay.pyx":98
  5492. *
  5493. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  5494. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C') # <<<<<<<<<<<<<<
  5495. *
  5496. * return terms, E, H
  5497. */
  5498. __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5499. __Pyx_GOTREF(__pyx_tuple__22);
  5500. __Pyx_GIVEREF(__pyx_tuple__22);
  5501. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5502. __Pyx_GOTREF(__pyx_tuple__23);
  5503. __Pyx_GIVEREF(__pyx_tuple__23);
  5504. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  5505. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  5506. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  5507. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  5508. *
  5509. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  5510. */
  5511. __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5512. __Pyx_GOTREF(__pyx_tuple__24);
  5513. __Pyx_GIVEREF(__pyx_tuple__24);
  5514. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  5515. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  5516. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  5517. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  5518. *
  5519. * info.buf = PyArray_DATA(self)
  5520. */
  5521. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5522. __Pyx_GOTREF(__pyx_tuple__25);
  5523. __Pyx_GIVEREF(__pyx_tuple__25);
  5524. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  5525. * if ((descr.byteorder == c'>' and little_endian) or
  5526. * (descr.byteorder == c'<' and not little_endian)):
  5527. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5528. * if t == NPY_BYTE: f = "b"
  5529. * elif t == NPY_UBYTE: f = "B"
  5530. */
  5531. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5532. __Pyx_GOTREF(__pyx_tuple__26);
  5533. __Pyx_GIVEREF(__pyx_tuple__26);
  5534. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  5535. *
  5536. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5537. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  5538. *
  5539. * if ((child.byteorder == c'>' and little_endian) or
  5540. */
  5541. __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5542. __Pyx_GOTREF(__pyx_tuple__27);
  5543. __Pyx_GIVEREF(__pyx_tuple__27);
  5544. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  5545. * if ((child.byteorder == c'>' and little_endian) or
  5546. * (child.byteorder == c'<' and not little_endian)):
  5547. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5548. * # One could encode it in the format string and have Cython
  5549. * # complain instead, BUT: < and > in format strings also imply
  5550. */
  5551. __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5552. __Pyx_GOTREF(__pyx_tuple__28);
  5553. __Pyx_GIVEREF(__pyx_tuple__28);
  5554. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  5555. * t = child.type_num
  5556. * if end - f < 5:
  5557. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  5558. *
  5559. * # Until ticket #99 is fixed, use integers to avoid warnings
  5560. */
  5561. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5562. __Pyx_GOTREF(__pyx_tuple__29);
  5563. __Pyx_GIVEREF(__pyx_tuple__29);
  5564. /* "scattnlay.pyx":42
  5565. * int nfMieField(int L, int pl, double x[], double mr[], double mi[], int n_max, int nCoords, double Xp[], double Yp[], double Zp[], double Er[], double Ei[], double Hr[], double Hi[])
  5566. *
  5567. * def scattnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 1] theta = np.zeros(0, dtype = np.float64), Py_ssize_t pl = -1, Py_ssize_t n_max = -1): # <<<<<<<<<<<<<<
  5568. * cdef Py_ssize_t i
  5569. *
  5570. */
  5571. __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5572. __Pyx_GOTREF(__pyx_tuple__30);
  5573. __Pyx_GIVEREF(__pyx_tuple__30);
  5574. __pyx_tuple__31 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_theta, __pyx_n_s_pl, __pyx_n_s_n_max, __pyx_n_s_i, __pyx_n_s_terms, __pyx_n_s_Qext, __pyx_n_s_Qabs, __pyx_n_s_Qsca, __pyx_n_s_Qbk, __pyx_n_s_Qpr, __pyx_n_s_g, __pyx_n_s_Albedo, __pyx_n_s_S1, __pyx_n_s_S2, __pyx_n_s_S1r, __pyx_n_s_S1i, __pyx_n_s_S2r, __pyx_n_s_S2i); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5575. __Pyx_GOTREF(__pyx_tuple__31);
  5576. __Pyx_GIVEREF(__pyx_tuple__31);
  5577. __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_scattnlay, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5578. /* "scattnlay.pyx":76
  5579. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5580. *
  5581. * def fieldnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 2] coords = np.zeros((0, 3), dtype = np.float64), Py_ssize_t pl = 0, Py_ssize_t n_max = 0): # <<<<<<<<<<<<<<
  5582. * cdef Py_ssize_t i
  5583. *
  5584. */
  5585. __pyx_tuple__33 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_3); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5586. __Pyx_GOTREF(__pyx_tuple__33);
  5587. __Pyx_GIVEREF(__pyx_tuple__33);
  5588. __pyx_tuple__34 = PyTuple_Pack(1, __pyx_tuple__33); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5589. __Pyx_GOTREF(__pyx_tuple__34);
  5590. __Pyx_GIVEREF(__pyx_tuple__34);
  5591. __pyx_tuple__35 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_coords, __pyx_n_s_pl, __pyx_n_s_n_max, __pyx_n_s_i, __pyx_n_s_terms, __pyx_n_s_E, __pyx_n_s_H, __pyx_n_s_Er, __pyx_n_s_Ei, __pyx_n_s_Hr, __pyx_n_s_Hi); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5592. __Pyx_GOTREF(__pyx_tuple__35);
  5593. __Pyx_GIVEREF(__pyx_tuple__35);
  5594. __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_fieldnlay, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5595. __Pyx_RefNannyFinishContext();
  5596. return 0;
  5597. __pyx_L1_error:;
  5598. __Pyx_RefNannyFinishContext();
  5599. return -1;
  5600. }
  5601. static int __Pyx_InitGlobals(void) {
  5602. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5603. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5604. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5605. __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5606. __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5607. return 0;
  5608. __pyx_L1_error:;
  5609. return -1;
  5610. }
  5611. #if PY_MAJOR_VERSION < 3
  5612. PyMODINIT_FUNC initscattnlay(void); /*proto*/
  5613. PyMODINIT_FUNC initscattnlay(void)
  5614. #else
  5615. PyMODINIT_FUNC PyInit_scattnlay(void); /*proto*/
  5616. PyMODINIT_FUNC PyInit_scattnlay(void)
  5617. #endif
  5618. {
  5619. PyObject *__pyx_t_1 = NULL;
  5620. PyObject *__pyx_t_2 = NULL;
  5621. PyObject *__pyx_t_3 = NULL;
  5622. PyObject *__pyx_t_4 = NULL;
  5623. int __pyx_lineno = 0;
  5624. const char *__pyx_filename = NULL;
  5625. int __pyx_clineno = 0;
  5626. __Pyx_RefNannyDeclarations
  5627. #if CYTHON_REFNANNY
  5628. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  5629. if (!__Pyx_RefNanny) {
  5630. PyErr_Clear();
  5631. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  5632. if (!__Pyx_RefNanny)
  5633. Py_FatalError("failed to import 'refnanny' module");
  5634. }
  5635. #endif
  5636. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scattnlay(void)", 0);
  5637. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5638. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5639. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5640. #ifdef __Pyx_CyFunction_USED
  5641. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5642. #endif
  5643. #ifdef __Pyx_FusedFunction_USED
  5644. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5645. #endif
  5646. #ifdef __Pyx_Generator_USED
  5647. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5648. #endif
  5649. /*--- Library function declarations ---*/
  5650. /*--- Threads initialization code ---*/
  5651. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  5652. #ifdef WITH_THREAD /* Python build with threading support? */
  5653. PyEval_InitThreads();
  5654. #endif
  5655. #endif
  5656. /*--- Module creation code ---*/
  5657. #if PY_MAJOR_VERSION < 3
  5658. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("scattnlay"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  5659. #else
  5660. __pyx_m = PyModule_Create(&__pyx_moduledef);
  5661. #endif
  5662. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5663. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5664. Py_INCREF(__pyx_d);
  5665. __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5666. #if CYTHON_COMPILING_IN_PYPY
  5667. Py_INCREF(__pyx_b);
  5668. #endif
  5669. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5670. /*--- Initialize various global constants etc. ---*/
  5671. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5672. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  5673. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5674. #endif
  5675. if (__pyx_module_is_main_scattnlay) {
  5676. if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5677. }
  5678. #if PY_MAJOR_VERSION >= 3
  5679. {
  5680. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5681. if (!PyDict_GetItemString(modules, "scattnlay")) {
  5682. if (unlikely(PyDict_SetItemString(modules, "scattnlay", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5683. }
  5684. }
  5685. #endif
  5686. /*--- Builtin init code ---*/
  5687. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5688. /*--- Constants init code ---*/
  5689. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5690. /*--- Global init code ---*/
  5691. /*--- Variable export code ---*/
  5692. /*--- Function export code ---*/
  5693. /*--- Type init code ---*/
  5694. /*--- Type import code ---*/
  5695. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
  5696. #if CYTHON_COMPILING_IN_PYPY
  5697. sizeof(PyTypeObject),
  5698. #else
  5699. sizeof(PyHeapTypeObject),
  5700. #endif
  5701. 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5702. __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5703. __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5704. __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5705. __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5706. __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5707. /*--- Variable import code ---*/
  5708. /*--- Function import code ---*/
  5709. /*--- Execution code ---*/
  5710. /* "scattnlay.pyx":26
  5711. *
  5712. * from __future__ import division
  5713. * import numpy as np # <<<<<<<<<<<<<<
  5714. * cimport numpy as np
  5715. *
  5716. */
  5717. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5718. __Pyx_GOTREF(__pyx_t_1);
  5719. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5720. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5721. /* "scattnlay.pyx":42
  5722. * int nfMieField(int L, int pl, double x[], double mr[], double mi[], int n_max, int nCoords, double Xp[], double Yp[], double Zp[], double Er[], double Ei[], double Hr[], double Hi[])
  5723. *
  5724. * def scattnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 1] theta = np.zeros(0, dtype = np.float64), Py_ssize_t pl = -1, Py_ssize_t n_max = -1): # <<<<<<<<<<<<<<
  5725. * cdef Py_ssize_t i
  5726. *
  5727. */
  5728. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5729. __Pyx_GOTREF(__pyx_t_1);
  5730. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5731. __Pyx_GOTREF(__pyx_t_2);
  5732. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5733. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5734. __Pyx_GOTREF(__pyx_t_1);
  5735. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5736. __Pyx_GOTREF(__pyx_t_3);
  5737. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5738. __Pyx_GOTREF(__pyx_t_4);
  5739. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5740. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5741. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5742. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5743. __Pyx_GOTREF(__pyx_t_4);
  5744. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5745. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5746. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5747. __pyx_k__2 = ((PyArrayObject *)__pyx_t_4);
  5748. __Pyx_GIVEREF(__pyx_t_4);
  5749. __pyx_t_4 = 0;
  5750. __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_9scattnlay_1scattnlay, NULL, __pyx_n_s_scattnlay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5751. __Pyx_GOTREF(__pyx_t_4);
  5752. if (PyDict_SetItem(__pyx_d, __pyx_n_s_scattnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5753. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5754. /* "scattnlay.pyx":76
  5755. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5756. *
  5757. * def fieldnlay(np.ndarray[np.float64_t, ndim = 2] x, np.ndarray[np.complex128_t, ndim = 2] m, np.ndarray[np.float64_t, ndim = 2] coords = np.zeros((0, 3), dtype = np.float64), Py_ssize_t pl = 0, Py_ssize_t n_max = 0): # <<<<<<<<<<<<<<
  5758. * cdef Py_ssize_t i
  5759. *
  5760. */
  5761. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5762. __Pyx_GOTREF(__pyx_t_4);
  5763. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5764. __Pyx_GOTREF(__pyx_t_1);
  5765. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5766. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5767. __Pyx_GOTREF(__pyx_t_4);
  5768. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5769. __Pyx_GOTREF(__pyx_t_2);
  5770. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5771. __Pyx_GOTREF(__pyx_t_3);
  5772. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5773. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5774. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5775. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5776. __Pyx_GOTREF(__pyx_t_3);
  5777. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5778. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5779. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5780. __pyx_k__10 = ((PyArrayObject *)__pyx_t_3);
  5781. __Pyx_GIVEREF(__pyx_t_3);
  5782. __pyx_t_3 = 0;
  5783. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9scattnlay_3fieldnlay, NULL, __pyx_n_s_scattnlay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5784. __Pyx_GOTREF(__pyx_t_3);
  5785. if (PyDict_SetItem(__pyx_d, __pyx_n_s_fieldnlay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5786. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5787. /* "scattnlay.pyx":1
  5788. * # Copyright (C) 2009-2015 Ovidio Pena <ovidio@bytesfall.com> # <<<<<<<<<<<<<<
  5789. * #
  5790. * # This file is part of python-scattnlay
  5791. */
  5792. __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5793. __Pyx_GOTREF(__pyx_t_3);
  5794. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5795. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5796. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5797. * arr.base = baseptr
  5798. *
  5799. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5800. * if arr.base is NULL:
  5801. * return None
  5802. */
  5803. goto __pyx_L0;
  5804. __pyx_L1_error:;
  5805. __Pyx_XDECREF(__pyx_t_1);
  5806. __Pyx_XDECREF(__pyx_t_2);
  5807. __Pyx_XDECREF(__pyx_t_3);
  5808. __Pyx_XDECREF(__pyx_t_4);
  5809. if (__pyx_m) {
  5810. __Pyx_AddTraceback("init scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5811. Py_DECREF(__pyx_m); __pyx_m = 0;
  5812. } else if (!PyErr_Occurred()) {
  5813. PyErr_SetString(PyExc_ImportError, "init scattnlay");
  5814. }
  5815. __pyx_L0:;
  5816. __Pyx_RefNannyFinishContext();
  5817. #if PY_MAJOR_VERSION < 3
  5818. return;
  5819. #else
  5820. return __pyx_m;
  5821. #endif
  5822. }
  5823. /* Runtime support code */
  5824. #if CYTHON_REFNANNY
  5825. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  5826. PyObject *m = NULL, *p = NULL;
  5827. void *r = NULL;
  5828. m = PyImport_ImportModule((char *)modname);
  5829. if (!m) goto end;
  5830. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  5831. if (!p) goto end;
  5832. r = PyLong_AsVoidPtr(p);
  5833. end:
  5834. Py_XDECREF(p);
  5835. Py_XDECREF(m);
  5836. return (__Pyx_RefNannyAPIStruct *)r;
  5837. }
  5838. #endif /* CYTHON_REFNANNY */
  5839. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  5840. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  5841. if (unlikely(!result)) {
  5842. PyErr_Format(PyExc_NameError,
  5843. #if PY_MAJOR_VERSION >= 3
  5844. "name '%U' is not defined", name);
  5845. #else
  5846. "name '%.200s' is not defined", PyString_AS_STRING(name));
  5847. #endif
  5848. }
  5849. return result;
  5850. }
  5851. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  5852. PyObject *result;
  5853. #if CYTHON_COMPILING_IN_CPYTHON
  5854. result = PyDict_GetItem(__pyx_d, name);
  5855. if (result) {
  5856. Py_INCREF(result);
  5857. } else {
  5858. #else
  5859. result = PyObject_GetItem(__pyx_d, name);
  5860. if (!result) {
  5861. PyErr_Clear();
  5862. #endif
  5863. result = __Pyx_GetBuiltinName(name);
  5864. }
  5865. return result;
  5866. }
  5867. #if CYTHON_COMPILING_IN_CPYTHON
  5868. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  5869. PyObject *result;
  5870. ternaryfunc call = func->ob_type->tp_call;
  5871. if (unlikely(!call))
  5872. return PyObject_Call(func, arg, kw);
  5873. #if PY_VERSION_HEX >= 0x02060000
  5874. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  5875. return NULL;
  5876. #endif
  5877. result = (*call)(func, arg, kw);
  5878. #if PY_VERSION_HEX >= 0x02060000
  5879. Py_LeaveRecursiveCall();
  5880. #endif
  5881. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  5882. PyErr_SetString(
  5883. PyExc_SystemError,
  5884. "NULL result without error in PyObject_Call");
  5885. }
  5886. return result;
  5887. }
  5888. #endif
  5889. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  5890. if (unlikely(!type)) {
  5891. PyErr_SetString(PyExc_SystemError, "Missing type object");
  5892. return 0;
  5893. }
  5894. if (likely(PyObject_TypeCheck(obj, type)))
  5895. return 1;
  5896. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  5897. Py_TYPE(obj)->tp_name, type->tp_name);
  5898. return 0;
  5899. }
  5900. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  5901. #if CYTHON_COMPILING_IN_CPYTHON
  5902. PyObject *tmp_type, *tmp_value, *tmp_tb;
  5903. PyThreadState *tstate = PyThreadState_GET();
  5904. tmp_type = tstate->curexc_type;
  5905. tmp_value = tstate->curexc_value;
  5906. tmp_tb = tstate->curexc_traceback;
  5907. tstate->curexc_type = type;
  5908. tstate->curexc_value = value;
  5909. tstate->curexc_traceback = tb;
  5910. Py_XDECREF(tmp_type);
  5911. Py_XDECREF(tmp_value);
  5912. Py_XDECREF(tmp_tb);
  5913. #else
  5914. PyErr_Restore(type, value, tb);
  5915. #endif
  5916. }
  5917. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  5918. #if CYTHON_COMPILING_IN_CPYTHON
  5919. PyThreadState *tstate = PyThreadState_GET();
  5920. *type = tstate->curexc_type;
  5921. *value = tstate->curexc_value;
  5922. *tb = tstate->curexc_traceback;
  5923. tstate->curexc_type = 0;
  5924. tstate->curexc_value = 0;
  5925. tstate->curexc_traceback = 0;
  5926. #else
  5927. PyErr_Fetch(type, value, tb);
  5928. #endif
  5929. }
  5930. static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
  5931. CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
  5932. int full_traceback) {
  5933. PyObject *old_exc, *old_val, *old_tb;
  5934. PyObject *ctx;
  5935. __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
  5936. if (full_traceback) {
  5937. Py_XINCREF(old_exc);
  5938. Py_XINCREF(old_val);
  5939. Py_XINCREF(old_tb);
  5940. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  5941. PyErr_PrintEx(1);
  5942. }
  5943. #if PY_MAJOR_VERSION < 3
  5944. ctx = PyString_FromString(name);
  5945. #else
  5946. ctx = PyUnicode_FromString(name);
  5947. #endif
  5948. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  5949. if (!ctx) {
  5950. PyErr_WriteUnraisable(Py_None);
  5951. } else {
  5952. PyErr_WriteUnraisable(ctx);
  5953. Py_DECREF(ctx);
  5954. }
  5955. }
  5956. static void __Pyx_RaiseArgtupleInvalid(
  5957. const char* func_name,
  5958. int exact,
  5959. Py_ssize_t num_min,
  5960. Py_ssize_t num_max,
  5961. Py_ssize_t num_found)
  5962. {
  5963. Py_ssize_t num_expected;
  5964. const char *more_or_less;
  5965. if (num_found < num_min) {
  5966. num_expected = num_min;
  5967. more_or_less = "at least";
  5968. } else {
  5969. num_expected = num_max;
  5970. more_or_less = "at most";
  5971. }
  5972. if (exact) {
  5973. more_or_less = "exactly";
  5974. }
  5975. PyErr_Format(PyExc_TypeError,
  5976. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  5977. func_name, more_or_less, num_expected,
  5978. (num_expected == 1) ? "" : "s", num_found);
  5979. }
  5980. static void __Pyx_RaiseDoubleKeywordsError(
  5981. const char* func_name,
  5982. PyObject* kw_name)
  5983. {
  5984. PyErr_Format(PyExc_TypeError,
  5985. #if PY_MAJOR_VERSION >= 3
  5986. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  5987. #else
  5988. "%s() got multiple values for keyword argument '%s'", func_name,
  5989. PyString_AsString(kw_name));
  5990. #endif
  5991. }
  5992. static int __Pyx_ParseOptionalKeywords(
  5993. PyObject *kwds,
  5994. PyObject **argnames[],
  5995. PyObject *kwds2,
  5996. PyObject *values[],
  5997. Py_ssize_t num_pos_args,
  5998. const char* function_name)
  5999. {
  6000. PyObject *key = 0, *value = 0;
  6001. Py_ssize_t pos = 0;
  6002. PyObject*** name;
  6003. PyObject*** first_kw_arg = argnames + num_pos_args;
  6004. while (PyDict_Next(kwds, &pos, &key, &value)) {
  6005. name = first_kw_arg;
  6006. while (*name && (**name != key)) name++;
  6007. if (*name) {
  6008. values[name-argnames] = value;
  6009. continue;
  6010. }
  6011. name = first_kw_arg;
  6012. #if PY_MAJOR_VERSION < 3
  6013. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  6014. while (*name) {
  6015. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  6016. && _PyString_Eq(**name, key)) {
  6017. values[name-argnames] = value;
  6018. break;
  6019. }
  6020. name++;
  6021. }
  6022. if (*name) continue;
  6023. else {
  6024. PyObject*** argname = argnames;
  6025. while (argname != first_kw_arg) {
  6026. if ((**argname == key) || (
  6027. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  6028. && _PyString_Eq(**argname, key))) {
  6029. goto arg_passed_twice;
  6030. }
  6031. argname++;
  6032. }
  6033. }
  6034. } else
  6035. #endif
  6036. if (likely(PyUnicode_Check(key))) {
  6037. while (*name) {
  6038. int cmp = (**name == key) ? 0 :
  6039. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6040. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  6041. #endif
  6042. PyUnicode_Compare(**name, key);
  6043. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6044. if (cmp == 0) {
  6045. values[name-argnames] = value;
  6046. break;
  6047. }
  6048. name++;
  6049. }
  6050. if (*name) continue;
  6051. else {
  6052. PyObject*** argname = argnames;
  6053. while (argname != first_kw_arg) {
  6054. int cmp = (**argname == key) ? 0 :
  6055. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6056. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  6057. #endif
  6058. PyUnicode_Compare(**argname, key);
  6059. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6060. if (cmp == 0) goto arg_passed_twice;
  6061. argname++;
  6062. }
  6063. }
  6064. } else
  6065. goto invalid_keyword_type;
  6066. if (kwds2) {
  6067. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  6068. } else {
  6069. goto invalid_keyword;
  6070. }
  6071. }
  6072. return 0;
  6073. arg_passed_twice:
  6074. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  6075. goto bad;
  6076. invalid_keyword_type:
  6077. PyErr_Format(PyExc_TypeError,
  6078. "%.200s() keywords must be strings", function_name);
  6079. goto bad;
  6080. invalid_keyword:
  6081. PyErr_Format(PyExc_TypeError,
  6082. #if PY_MAJOR_VERSION < 3
  6083. "%.200s() got an unexpected keyword argument '%.200s'",
  6084. function_name, PyString_AsString(key));
  6085. #else
  6086. "%s() got an unexpected keyword argument '%U'",
  6087. function_name, key);
  6088. #endif
  6089. bad:
  6090. return -1;
  6091. }
  6092. static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
  6093. PyErr_Format(PyExc_TypeError,
  6094. "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
  6095. name, type->tp_name, Py_TYPE(obj)->tp_name);
  6096. }
  6097. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  6098. const char *name, int exact)
  6099. {
  6100. if (unlikely(!type)) {
  6101. PyErr_SetString(PyExc_SystemError, "Missing type object");
  6102. return 0;
  6103. }
  6104. if (none_allowed && obj == Py_None) return 1;
  6105. else if (exact) {
  6106. if (likely(Py_TYPE(obj) == type)) return 1;
  6107. #if PY_MAJOR_VERSION == 2
  6108. else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
  6109. #endif
  6110. }
  6111. else {
  6112. if (likely(PyObject_TypeCheck(obj, type))) return 1;
  6113. }
  6114. __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
  6115. return 0;
  6116. }
  6117. static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  6118. unsigned int n = 1;
  6119. return *(unsigned char*)(&n) != 0;
  6120. }
  6121. static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
  6122. __Pyx_BufFmt_StackElem* stack,
  6123. __Pyx_TypeInfo* type) {
  6124. stack[0].field = &ctx->root;
  6125. stack[0].parent_offset = 0;
  6126. ctx->root.type = type;
  6127. ctx->root.name = "buffer dtype";
  6128. ctx->root.offset = 0;
  6129. ctx->head = stack;
  6130. ctx->head->field = &ctx->root;
  6131. ctx->fmt_offset = 0;
  6132. ctx->head->parent_offset = 0;
  6133. ctx->new_packmode = '@';
  6134. ctx->enc_packmode = '@';
  6135. ctx->new_count = 1;
  6136. ctx->enc_count = 0;
  6137. ctx->enc_type = 0;
  6138. ctx->is_complex = 0;
  6139. ctx->is_valid_array = 0;
  6140. ctx->struct_alignment = 0;
  6141. while (type->typegroup == 'S') {
  6142. ++ctx->head;
  6143. ctx->head->field = type->fields;
  6144. ctx->head->parent_offset = 0;
  6145. type = type->fields->type;
  6146. }
  6147. }
  6148. static int __Pyx_BufFmt_ParseNumber(const char** ts) {
  6149. int count;
  6150. const char* t = *ts;
  6151. if (*t < '0' || *t > '9') {
  6152. return -1;
  6153. } else {
  6154. count = *t++ - '0';
  6155. while (*t >= '0' && *t < '9') {
  6156. count *= 10;
  6157. count += *t++ - '0';
  6158. }
  6159. }
  6160. *ts = t;
  6161. return count;
  6162. }
  6163. static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
  6164. int number = __Pyx_BufFmt_ParseNumber(ts);
  6165. if (number == -1) /* First char was not a digit */
  6166. PyErr_Format(PyExc_ValueError,\
  6167. "Does not understand character buffer dtype format string ('%c')", **ts);
  6168. return number;
  6169. }
  6170. static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  6171. PyErr_Format(PyExc_ValueError,
  6172. "Unexpected format string character: '%c'", ch);
  6173. }
  6174. static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  6175. switch (ch) {
  6176. case 'c': return "'char'";
  6177. case 'b': return "'signed char'";
  6178. case 'B': return "'unsigned char'";
  6179. case 'h': return "'short'";
  6180. case 'H': return "'unsigned short'";
  6181. case 'i': return "'int'";
  6182. case 'I': return "'unsigned int'";
  6183. case 'l': return "'long'";
  6184. case 'L': return "'unsigned long'";
  6185. case 'q': return "'long long'";
  6186. case 'Q': return "'unsigned long long'";
  6187. case 'f': return (is_complex ? "'complex float'" : "'float'");
  6188. case 'd': return (is_complex ? "'complex double'" : "'double'");
  6189. case 'g': return (is_complex ? "'complex long double'" : "'long double'");
  6190. case 'T': return "a struct";
  6191. case 'O': return "Python object";
  6192. case 'P': return "a pointer";
  6193. case 's': case 'p': return "a string";
  6194. case 0: return "end";
  6195. default: return "unparseable format string";
  6196. }
  6197. }
  6198. static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  6199. switch (ch) {
  6200. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6201. case 'h': case 'H': return 2;
  6202. case 'i': case 'I': case 'l': case 'L': return 4;
  6203. case 'q': case 'Q': return 8;
  6204. case 'f': return (is_complex ? 8 : 4);
  6205. case 'd': return (is_complex ? 16 : 8);
  6206. case 'g': {
  6207. PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
  6208. return 0;
  6209. }
  6210. case 'O': case 'P': return sizeof(void*);
  6211. default:
  6212. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6213. return 0;
  6214. }
  6215. }
  6216. static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  6217. switch (ch) {
  6218. case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6219. case 'h': case 'H': return sizeof(short);
  6220. case 'i': case 'I': return sizeof(int);
  6221. case 'l': case 'L': return sizeof(long);
  6222. #ifdef HAVE_LONG_LONG
  6223. case 'q': case 'Q': return sizeof(PY_LONG_LONG);
  6224. #endif
  6225. case 'f': return sizeof(float) * (is_complex ? 2 : 1);
  6226. case 'd': return sizeof(double) * (is_complex ? 2 : 1);
  6227. case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
  6228. case 'O': case 'P': return sizeof(void*);
  6229. default: {
  6230. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6231. return 0;
  6232. }
  6233. }
  6234. }
  6235. typedef struct { char c; short x; } __Pyx_st_short;
  6236. typedef struct { char c; int x; } __Pyx_st_int;
  6237. typedef struct { char c; long x; } __Pyx_st_long;
  6238. typedef struct { char c; float x; } __Pyx_st_float;
  6239. typedef struct { char c; double x; } __Pyx_st_double;
  6240. typedef struct { char c; long double x; } __Pyx_st_longdouble;
  6241. typedef struct { char c; void *x; } __Pyx_st_void_p;
  6242. #ifdef HAVE_LONG_LONG
  6243. typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
  6244. #endif
  6245. static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  6246. switch (ch) {
  6247. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6248. case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
  6249. case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
  6250. case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
  6251. #ifdef HAVE_LONG_LONG
  6252. case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
  6253. #endif
  6254. case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
  6255. case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
  6256. case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
  6257. case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
  6258. default:
  6259. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6260. return 0;
  6261. }
  6262. }
  6263. /* These are for computing the padding at the end of the struct to align
  6264. on the first member of the struct. This will probably the same as above,
  6265. but we don't have any guarantees.
  6266. */
  6267. typedef struct { short x; char c; } __Pyx_pad_short;
  6268. typedef struct { int x; char c; } __Pyx_pad_int;
  6269. typedef struct { long x; char c; } __Pyx_pad_long;
  6270. typedef struct { float x; char c; } __Pyx_pad_float;
  6271. typedef struct { double x; char c; } __Pyx_pad_double;
  6272. typedef struct { long double x; char c; } __Pyx_pad_longdouble;
  6273. typedef struct { void *x; char c; } __Pyx_pad_void_p;
  6274. #ifdef HAVE_LONG_LONG
  6275. typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
  6276. #endif
  6277. static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  6278. switch (ch) {
  6279. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6280. case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
  6281. case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
  6282. case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
  6283. #ifdef HAVE_LONG_LONG
  6284. case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
  6285. #endif
  6286. case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
  6287. case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
  6288. case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
  6289. case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
  6290. default:
  6291. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6292. return 0;
  6293. }
  6294. }
  6295. static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  6296. switch (ch) {
  6297. case 'c':
  6298. return 'H';
  6299. case 'b': case 'h': case 'i':
  6300. case 'l': case 'q': case 's': case 'p':
  6301. return 'I';
  6302. case 'B': case 'H': case 'I': case 'L': case 'Q':
  6303. return 'U';
  6304. case 'f': case 'd': case 'g':
  6305. return (is_complex ? 'C' : 'R');
  6306. case 'O':
  6307. return 'O';
  6308. case 'P':
  6309. return 'P';
  6310. default: {
  6311. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6312. return 0;
  6313. }
  6314. }
  6315. }
  6316. static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  6317. if (ctx->head == NULL || ctx->head->field == &ctx->root) {
  6318. const char* expected;
  6319. const char* quote;
  6320. if (ctx->head == NULL) {
  6321. expected = "end";
  6322. quote = "";
  6323. } else {
  6324. expected = ctx->head->field->type->name;
  6325. quote = "'";
  6326. }
  6327. PyErr_Format(PyExc_ValueError,
  6328. "Buffer dtype mismatch, expected %s%s%s but got %s",
  6329. quote, expected, quote,
  6330. __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  6331. } else {
  6332. __Pyx_StructField* field = ctx->head->field;
  6333. __Pyx_StructField* parent = (ctx->head - 1)->field;
  6334. PyErr_Format(PyExc_ValueError,
  6335. "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
  6336. field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
  6337. parent->type->name, field->name);
  6338. }
  6339. }
  6340. static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  6341. char group;
  6342. size_t size, offset, arraysize = 1;
  6343. if (ctx->enc_type == 0) return 0;
  6344. if (ctx->head->field->type->arraysize[0]) {
  6345. int i, ndim = 0;
  6346. if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
  6347. ctx->is_valid_array = ctx->head->field->type->ndim == 1;
  6348. ndim = 1;
  6349. if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
  6350. PyErr_Format(PyExc_ValueError,
  6351. "Expected a dimension of size %zu, got %zu",
  6352. ctx->head->field->type->arraysize[0], ctx->enc_count);
  6353. return -1;
  6354. }
  6355. }
  6356. if (!ctx->is_valid_array) {
  6357. PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
  6358. ctx->head->field->type->ndim, ndim);
  6359. return -1;
  6360. }
  6361. for (i = 0; i < ctx->head->field->type->ndim; i++) {
  6362. arraysize *= ctx->head->field->type->arraysize[i];
  6363. }
  6364. ctx->is_valid_array = 0;
  6365. ctx->enc_count = 1;
  6366. }
  6367. group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  6368. do {
  6369. __Pyx_StructField* field = ctx->head->field;
  6370. __Pyx_TypeInfo* type = field->type;
  6371. if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
  6372. size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
  6373. } else {
  6374. size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
  6375. }
  6376. if (ctx->enc_packmode == '@') {
  6377. size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
  6378. size_t align_mod_offset;
  6379. if (align_at == 0) return -1;
  6380. align_mod_offset = ctx->fmt_offset % align_at;
  6381. if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
  6382. if (ctx->struct_alignment == 0)
  6383. ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
  6384. ctx->is_complex);
  6385. }
  6386. if (type->size != size || type->typegroup != group) {
  6387. if (type->typegroup == 'C' && type->fields != NULL) {
  6388. size_t parent_offset = ctx->head->parent_offset + field->offset;
  6389. ++ctx->head;
  6390. ctx->head->field = type->fields;
  6391. ctx->head->parent_offset = parent_offset;
  6392. continue;
  6393. }
  6394. if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
  6395. } else {
  6396. __Pyx_BufFmt_RaiseExpected(ctx);
  6397. return -1;
  6398. }
  6399. }
  6400. offset = ctx->head->parent_offset + field->offset;
  6401. if (ctx->fmt_offset != offset) {
  6402. PyErr_Format(PyExc_ValueError,
  6403. "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
  6404. (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
  6405. return -1;
  6406. }
  6407. ctx->fmt_offset += size;
  6408. if (arraysize)
  6409. ctx->fmt_offset += (arraysize - 1) * size;
  6410. --ctx->enc_count; /* Consume from buffer string */
  6411. while (1) {
  6412. if (field == &ctx->root) {
  6413. ctx->head = NULL;
  6414. if (ctx->enc_count != 0) {
  6415. __Pyx_BufFmt_RaiseExpected(ctx);
  6416. return -1;
  6417. }
  6418. break; /* breaks both loops as ctx->enc_count == 0 */
  6419. }
  6420. ctx->head->field = ++field;
  6421. if (field->type == NULL) {
  6422. --ctx->head;
  6423. field = ctx->head->field;
  6424. continue;
  6425. } else if (field->type->typegroup == 'S') {
  6426. size_t parent_offset = ctx->head->parent_offset + field->offset;
  6427. if (field->type->fields->type == NULL) continue; /* empty struct */
  6428. field = field->type->fields;
  6429. ++ctx->head;
  6430. ctx->head->field = field;
  6431. ctx->head->parent_offset = parent_offset;
  6432. break;
  6433. } else {
  6434. break;
  6435. }
  6436. }
  6437. } while (ctx->enc_count);
  6438. ctx->enc_type = 0;
  6439. ctx->is_complex = 0;
  6440. return 0;
  6441. }
  6442. static CYTHON_INLINE PyObject *
  6443. __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
  6444. {
  6445. const char *ts = *tsp;
  6446. int i = 0, number;
  6447. int ndim = ctx->head->field->type->ndim;
  6448. ;
  6449. ++ts;
  6450. if (ctx->new_count != 1) {
  6451. PyErr_SetString(PyExc_ValueError,
  6452. "Cannot handle repeated arrays in format string");
  6453. return NULL;
  6454. }
  6455. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6456. while (*ts && *ts != ')') {
  6457. switch (*ts) {
  6458. case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
  6459. default: break; /* not a 'break' in the loop */
  6460. }
  6461. number = __Pyx_BufFmt_ExpectNumber(&ts);
  6462. if (number == -1) return NULL;
  6463. if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
  6464. return PyErr_Format(PyExc_ValueError,
  6465. "Expected a dimension of size %zu, got %d",
  6466. ctx->head->field->type->arraysize[i], number);
  6467. if (*ts != ',' && *ts != ')')
  6468. return PyErr_Format(PyExc_ValueError,
  6469. "Expected a comma in format string, got '%c'", *ts);
  6470. if (*ts == ',') ts++;
  6471. i++;
  6472. }
  6473. if (i != ndim)
  6474. return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
  6475. ctx->head->field->type->ndim, i);
  6476. if (!*ts) {
  6477. PyErr_SetString(PyExc_ValueError,
  6478. "Unexpected end of format string, expected ')'");
  6479. return NULL;
  6480. }
  6481. ctx->is_valid_array = 1;
  6482. ctx->new_count = 1;
  6483. *tsp = ++ts;
  6484. return Py_None;
  6485. }
  6486. static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  6487. int got_Z = 0;
  6488. while (1) {
  6489. switch(*ts) {
  6490. case 0:
  6491. if (ctx->enc_type != 0 && ctx->head == NULL) {
  6492. __Pyx_BufFmt_RaiseExpected(ctx);
  6493. return NULL;
  6494. }
  6495. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6496. if (ctx->head != NULL) {
  6497. __Pyx_BufFmt_RaiseExpected(ctx);
  6498. return NULL;
  6499. }
  6500. return ts;
  6501. case ' ':
  6502. case '\r':
  6503. case '\n':
  6504. ++ts;
  6505. break;
  6506. case '<':
  6507. if (!__Pyx_IsLittleEndian()) {
  6508. PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
  6509. return NULL;
  6510. }
  6511. ctx->new_packmode = '=';
  6512. ++ts;
  6513. break;
  6514. case '>':
  6515. case '!':
  6516. if (__Pyx_IsLittleEndian()) {
  6517. PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
  6518. return NULL;
  6519. }
  6520. ctx->new_packmode = '=';
  6521. ++ts;
  6522. break;
  6523. case '=':
  6524. case '@':
  6525. case '^':
  6526. ctx->new_packmode = *ts++;
  6527. break;
  6528. case 'T': /* substruct */
  6529. {
  6530. const char* ts_after_sub;
  6531. size_t i, struct_count = ctx->new_count;
  6532. size_t struct_alignment = ctx->struct_alignment;
  6533. ctx->new_count = 1;
  6534. ++ts;
  6535. if (*ts != '{') {
  6536. PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
  6537. return NULL;
  6538. }
  6539. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6540. ctx->enc_type = 0; /* Erase processed last struct element */
  6541. ctx->enc_count = 0;
  6542. ctx->struct_alignment = 0;
  6543. ++ts;
  6544. ts_after_sub = ts;
  6545. for (i = 0; i != struct_count; ++i) {
  6546. ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
  6547. if (!ts_after_sub) return NULL;
  6548. }
  6549. ts = ts_after_sub;
  6550. if (struct_alignment) ctx->struct_alignment = struct_alignment;
  6551. }
  6552. break;
  6553. case '}': /* end of substruct; either repeat or move on */
  6554. {
  6555. size_t alignment = ctx->struct_alignment;
  6556. ++ts;
  6557. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6558. ctx->enc_type = 0; /* Erase processed last struct element */
  6559. if (alignment && ctx->fmt_offset % alignment) {
  6560. ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
  6561. }
  6562. }
  6563. return ts;
  6564. case 'x':
  6565. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6566. ctx->fmt_offset += ctx->new_count;
  6567. ctx->new_count = 1;
  6568. ctx->enc_count = 0;
  6569. ctx->enc_type = 0;
  6570. ctx->enc_packmode = ctx->new_packmode;
  6571. ++ts;
  6572. break;
  6573. case 'Z':
  6574. got_Z = 1;
  6575. ++ts;
  6576. if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
  6577. __Pyx_BufFmt_RaiseUnexpectedChar('Z');
  6578. return NULL;
  6579. }
  6580. case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
  6581. case 'l': case 'L': case 'q': case 'Q':
  6582. case 'f': case 'd': case 'g':
  6583. case 'O': case 'p':
  6584. if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
  6585. ctx->enc_packmode == ctx->new_packmode) {
  6586. ctx->enc_count += ctx->new_count;
  6587. ctx->new_count = 1;
  6588. got_Z = 0;
  6589. ++ts;
  6590. break;
  6591. }
  6592. case 's':
  6593. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6594. ctx->enc_count = ctx->new_count;
  6595. ctx->enc_packmode = ctx->new_packmode;
  6596. ctx->enc_type = *ts;
  6597. ctx->is_complex = got_Z;
  6598. ++ts;
  6599. ctx->new_count = 1;
  6600. got_Z = 0;
  6601. break;
  6602. case ':':
  6603. ++ts;
  6604. while(*ts != ':') ++ts;
  6605. ++ts;
  6606. break;
  6607. case '(':
  6608. if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
  6609. break;
  6610. default:
  6611. {
  6612. int number = __Pyx_BufFmt_ExpectNumber(&ts);
  6613. if (number == -1) return NULL;
  6614. ctx->new_count = (size_t)number;
  6615. }
  6616. }
  6617. }
  6618. }
  6619. static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  6620. buf->buf = NULL;
  6621. buf->obj = NULL;
  6622. buf->strides = __Pyx_zeros;
  6623. buf->shape = __Pyx_zeros;
  6624. buf->suboffsets = __Pyx_minusones;
  6625. }
  6626. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
  6627. Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
  6628. int nd, int cast, __Pyx_BufFmt_StackElem* stack)
  6629. {
  6630. if (obj == Py_None || obj == NULL) {
  6631. __Pyx_ZeroBuffer(buf);
  6632. return 0;
  6633. }
  6634. buf->buf = NULL;
  6635. if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  6636. if (buf->ndim != nd) {
  6637. PyErr_Format(PyExc_ValueError,
  6638. "Buffer has wrong number of dimensions (expected %d, got %d)",
  6639. nd, buf->ndim);
  6640. goto fail;
  6641. }
  6642. if (!cast) {
  6643. __Pyx_BufFmt_Context ctx;
  6644. __Pyx_BufFmt_Init(&ctx, stack, dtype);
  6645. if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  6646. }
  6647. if ((unsigned)buf->itemsize != dtype->size) {
  6648. PyErr_Format(PyExc_ValueError,
  6649. "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
  6650. buf->itemsize, (buf->itemsize > 1) ? "s" : "",
  6651. dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
  6652. goto fail;
  6653. }
  6654. if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  6655. return 0;
  6656. fail:;
  6657. __Pyx_ZeroBuffer(buf);
  6658. return -1;
  6659. }
  6660. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  6661. if (info->buf == NULL) return;
  6662. if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  6663. __Pyx_ReleaseBuffer(info);
  6664. }
  6665. static void __Pyx_RaiseBufferFallbackError(void) {
  6666. PyErr_SetString(PyExc_ValueError,
  6667. "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
  6668. }
  6669. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  6670. PyObject *r;
  6671. if (!j) return NULL;
  6672. r = PyObject_GetItem(o, j);
  6673. Py_DECREF(j);
  6674. return r;
  6675. }
  6676. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  6677. int wraparound, int boundscheck) {
  6678. #if CYTHON_COMPILING_IN_CPYTHON
  6679. if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
  6680. if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
  6681. PyObject *r = PyList_GET_ITEM(o, i);
  6682. Py_INCREF(r);
  6683. return r;
  6684. }
  6685. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6686. #else
  6687. return PySequence_GetItem(o, i);
  6688. #endif
  6689. }
  6690. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  6691. int wraparound, int boundscheck) {
  6692. #if CYTHON_COMPILING_IN_CPYTHON
  6693. if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
  6694. if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
  6695. PyObject *r = PyTuple_GET_ITEM(o, i);
  6696. Py_INCREF(r);
  6697. return r;
  6698. }
  6699. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6700. #else
  6701. return PySequence_GetItem(o, i);
  6702. #endif
  6703. }
  6704. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  6705. int is_list, int wraparound, int boundscheck) {
  6706. #if CYTHON_COMPILING_IN_CPYTHON
  6707. if (is_list || PyList_CheckExact(o)) {
  6708. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  6709. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  6710. PyObject *r = PyList_GET_ITEM(o, n);
  6711. Py_INCREF(r);
  6712. return r;
  6713. }
  6714. }
  6715. else if (PyTuple_CheckExact(o)) {
  6716. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  6717. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  6718. PyObject *r = PyTuple_GET_ITEM(o, n);
  6719. Py_INCREF(r);
  6720. return r;
  6721. }
  6722. } else {
  6723. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  6724. if (likely(m && m->sq_item)) {
  6725. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  6726. Py_ssize_t l = m->sq_length(o);
  6727. if (likely(l >= 0)) {
  6728. i += l;
  6729. } else {
  6730. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  6731. PyErr_Clear();
  6732. else
  6733. return NULL;
  6734. }
  6735. }
  6736. return m->sq_item(o, i);
  6737. }
  6738. }
  6739. #else
  6740. if (is_list || PySequence_Check(o)) {
  6741. return PySequence_GetItem(o, i);
  6742. }
  6743. #endif
  6744. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6745. }
  6746. static void __Pyx_RaiseBufferIndexError(int axis) {
  6747. PyErr_Format(PyExc_IndexError,
  6748. "Out of bounds on buffer access (axis %d)", axis);
  6749. }
  6750. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
  6751. int r;
  6752. if (!j) return -1;
  6753. r = PyObject_SetItem(o, j, v);
  6754. Py_DECREF(j);
  6755. return r;
  6756. }
  6757. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  6758. int is_list, int wraparound, int boundscheck) {
  6759. #if CYTHON_COMPILING_IN_CPYTHON
  6760. if (is_list || PyList_CheckExact(o)) {
  6761. Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
  6762. if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
  6763. PyObject* old = PyList_GET_ITEM(o, n);
  6764. Py_INCREF(v);
  6765. PyList_SET_ITEM(o, n, v);
  6766. Py_DECREF(old);
  6767. return 1;
  6768. }
  6769. } else {
  6770. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  6771. if (likely(m && m->sq_ass_item)) {
  6772. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  6773. Py_ssize_t l = m->sq_length(o);
  6774. if (likely(l >= 0)) {
  6775. i += l;
  6776. } else {
  6777. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  6778. PyErr_Clear();
  6779. else
  6780. return -1;
  6781. }
  6782. }
  6783. return m->sq_ass_item(o, i, v);
  6784. }
  6785. }
  6786. #else
  6787. #if CYTHON_COMPILING_IN_PYPY
  6788. if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
  6789. #else
  6790. if (is_list || PySequence_Check(o)) {
  6791. #endif
  6792. return PySequence_SetItem(o, i, v);
  6793. }
  6794. #endif
  6795. return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
  6796. }
  6797. #if PY_MAJOR_VERSION < 3
  6798. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  6799. CYTHON_UNUSED PyObject *cause) {
  6800. Py_XINCREF(type);
  6801. if (!value || value == Py_None)
  6802. value = NULL;
  6803. else
  6804. Py_INCREF(value);
  6805. if (!tb || tb == Py_None)
  6806. tb = NULL;
  6807. else {
  6808. Py_INCREF(tb);
  6809. if (!PyTraceBack_Check(tb)) {
  6810. PyErr_SetString(PyExc_TypeError,
  6811. "raise: arg 3 must be a traceback or None");
  6812. goto raise_error;
  6813. }
  6814. }
  6815. #if PY_VERSION_HEX < 0x02050000
  6816. if (PyClass_Check(type)) {
  6817. #else
  6818. if (PyType_Check(type)) {
  6819. #endif
  6820. #if CYTHON_COMPILING_IN_PYPY
  6821. if (!value) {
  6822. Py_INCREF(Py_None);
  6823. value = Py_None;
  6824. }
  6825. #endif
  6826. PyErr_NormalizeException(&type, &value, &tb);
  6827. } else {
  6828. if (value) {
  6829. PyErr_SetString(PyExc_TypeError,
  6830. "instance exception may not have a separate value");
  6831. goto raise_error;
  6832. }
  6833. value = type;
  6834. #if PY_VERSION_HEX < 0x02050000
  6835. if (PyInstance_Check(type)) {
  6836. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  6837. Py_INCREF(type);
  6838. } else {
  6839. type = 0;
  6840. PyErr_SetString(PyExc_TypeError,
  6841. "raise: exception must be an old-style class or instance");
  6842. goto raise_error;
  6843. }
  6844. #else
  6845. type = (PyObject*) Py_TYPE(type);
  6846. Py_INCREF(type);
  6847. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  6848. PyErr_SetString(PyExc_TypeError,
  6849. "raise: exception class must be a subclass of BaseException");
  6850. goto raise_error;
  6851. }
  6852. #endif
  6853. }
  6854. __Pyx_ErrRestore(type, value, tb);
  6855. return;
  6856. raise_error:
  6857. Py_XDECREF(value);
  6858. Py_XDECREF(type);
  6859. Py_XDECREF(tb);
  6860. return;
  6861. }
  6862. #else /* Python 3+ */
  6863. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  6864. PyObject* owned_instance = NULL;
  6865. if (tb == Py_None) {
  6866. tb = 0;
  6867. } else if (tb && !PyTraceBack_Check(tb)) {
  6868. PyErr_SetString(PyExc_TypeError,
  6869. "raise: arg 3 must be a traceback or None");
  6870. goto bad;
  6871. }
  6872. if (value == Py_None)
  6873. value = 0;
  6874. if (PyExceptionInstance_Check(type)) {
  6875. if (value) {
  6876. PyErr_SetString(PyExc_TypeError,
  6877. "instance exception may not have a separate value");
  6878. goto bad;
  6879. }
  6880. value = type;
  6881. type = (PyObject*) Py_TYPE(value);
  6882. } else if (PyExceptionClass_Check(type)) {
  6883. PyObject *instance_class = NULL;
  6884. if (value && PyExceptionInstance_Check(value)) {
  6885. instance_class = (PyObject*) Py_TYPE(value);
  6886. if (instance_class != type) {
  6887. if (PyObject_IsSubclass(instance_class, type)) {
  6888. type = instance_class;
  6889. } else {
  6890. instance_class = NULL;
  6891. }
  6892. }
  6893. }
  6894. if (!instance_class) {
  6895. PyObject *args;
  6896. if (!value)
  6897. args = PyTuple_New(0);
  6898. else if (PyTuple_Check(value)) {
  6899. Py_INCREF(value);
  6900. args = value;
  6901. } else
  6902. args = PyTuple_Pack(1, value);
  6903. if (!args)
  6904. goto bad;
  6905. owned_instance = PyObject_Call(type, args, NULL);
  6906. Py_DECREF(args);
  6907. if (!owned_instance)
  6908. goto bad;
  6909. value = owned_instance;
  6910. if (!PyExceptionInstance_Check(value)) {
  6911. PyErr_Format(PyExc_TypeError,
  6912. "calling %R should have returned an instance of "
  6913. "BaseException, not %R",
  6914. type, Py_TYPE(value));
  6915. goto bad;
  6916. }
  6917. }
  6918. } else {
  6919. PyErr_SetString(PyExc_TypeError,
  6920. "raise: exception class must be a subclass of BaseException");
  6921. goto bad;
  6922. }
  6923. #if PY_VERSION_HEX >= 0x03030000
  6924. if (cause) {
  6925. #else
  6926. if (cause && cause != Py_None) {
  6927. #endif
  6928. PyObject *fixed_cause;
  6929. if (cause == Py_None) {
  6930. fixed_cause = NULL;
  6931. } else if (PyExceptionClass_Check(cause)) {
  6932. fixed_cause = PyObject_CallObject(cause, NULL);
  6933. if (fixed_cause == NULL)
  6934. goto bad;
  6935. } else if (PyExceptionInstance_Check(cause)) {
  6936. fixed_cause = cause;
  6937. Py_INCREF(fixed_cause);
  6938. } else {
  6939. PyErr_SetString(PyExc_TypeError,
  6940. "exception causes must derive from "
  6941. "BaseException");
  6942. goto bad;
  6943. }
  6944. PyException_SetCause(value, fixed_cause);
  6945. }
  6946. PyErr_SetObject(type, value);
  6947. if (tb) {
  6948. PyThreadState *tstate = PyThreadState_GET();
  6949. PyObject* tmp_tb = tstate->curexc_traceback;
  6950. if (tb != tmp_tb) {
  6951. Py_INCREF(tb);
  6952. tstate->curexc_traceback = tb;
  6953. Py_XDECREF(tmp_tb);
  6954. }
  6955. }
  6956. bad:
  6957. Py_XDECREF(owned_instance);
  6958. return;
  6959. }
  6960. #endif
  6961. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  6962. PyErr_Format(PyExc_ValueError,
  6963. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  6964. }
  6965. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  6966. PyErr_Format(PyExc_ValueError,
  6967. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  6968. index, (index == 1) ? "" : "s");
  6969. }
  6970. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  6971. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  6972. }
  6973. #if PY_MAJOR_VERSION < 3
  6974. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  6975. #if PY_VERSION_HEX >= 0x02060000
  6976. if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  6977. #endif
  6978. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
  6979. #if PY_VERSION_HEX < 0x02060000
  6980. if (obj->ob_type->tp_dict) {
  6981. PyObject *getbuffer_cobj = PyObject_GetItem(
  6982. obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer);
  6983. if (getbuffer_cobj) {
  6984. getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
  6985. Py_DECREF(getbuffer_cobj);
  6986. if (!func)
  6987. goto fail;
  6988. return func(obj, view, flags);
  6989. } else {
  6990. PyErr_Clear();
  6991. }
  6992. }
  6993. #endif
  6994. PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  6995. #if PY_VERSION_HEX < 0x02060000
  6996. fail:
  6997. #endif
  6998. return -1;
  6999. }
  7000. static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  7001. PyObject *obj = view->obj;
  7002. if (!obj) return;
  7003. #if PY_VERSION_HEX >= 0x02060000
  7004. if (PyObject_CheckBuffer(obj)) {
  7005. PyBuffer_Release(view);
  7006. return;
  7007. }
  7008. #endif
  7009. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  7010. #if PY_VERSION_HEX < 0x02060000
  7011. if (obj->ob_type->tp_dict) {
  7012. PyObject *releasebuffer_cobj = PyObject_GetItem(
  7013. obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer);
  7014. if (releasebuffer_cobj) {
  7015. releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
  7016. Py_DECREF(releasebuffer_cobj);
  7017. if (!func)
  7018. goto fail;
  7019. func(obj, view);
  7020. return;
  7021. } else {
  7022. PyErr_Clear();
  7023. }
  7024. }
  7025. #endif
  7026. goto nofail;
  7027. #if PY_VERSION_HEX < 0x02060000
  7028. fail:
  7029. #endif
  7030. PyErr_WriteUnraisable(obj);
  7031. nofail:
  7032. Py_DECREF(obj);
  7033. view->obj = NULL;
  7034. }
  7035. #endif /* PY_MAJOR_VERSION < 3 */
  7036. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  7037. PyObject *empty_list = 0;
  7038. PyObject *module = 0;
  7039. PyObject *global_dict = 0;
  7040. PyObject *empty_dict = 0;
  7041. PyObject *list;
  7042. #if PY_VERSION_HEX < 0x03030000
  7043. PyObject *py_import;
  7044. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  7045. if (!py_import)
  7046. goto bad;
  7047. #endif
  7048. if (from_list)
  7049. list = from_list;
  7050. else {
  7051. empty_list = PyList_New(0);
  7052. if (!empty_list)
  7053. goto bad;
  7054. list = empty_list;
  7055. }
  7056. global_dict = PyModule_GetDict(__pyx_m);
  7057. if (!global_dict)
  7058. goto bad;
  7059. empty_dict = PyDict_New();
  7060. if (!empty_dict)
  7061. goto bad;
  7062. #if PY_VERSION_HEX >= 0x02050000
  7063. {
  7064. #if PY_MAJOR_VERSION >= 3
  7065. if (level == -1) {
  7066. if (strchr(__Pyx_MODULE_NAME, '.')) {
  7067. #if PY_VERSION_HEX < 0x03030000
  7068. PyObject *py_level = PyInt_FromLong(1);
  7069. if (!py_level)
  7070. goto bad;
  7071. module = PyObject_CallFunctionObjArgs(py_import,
  7072. name, global_dict, empty_dict, list, py_level, NULL);
  7073. Py_DECREF(py_level);
  7074. #else
  7075. module = PyImport_ImportModuleLevelObject(
  7076. name, global_dict, empty_dict, list, 1);
  7077. #endif
  7078. if (!module) {
  7079. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  7080. goto bad;
  7081. PyErr_Clear();
  7082. }
  7083. }
  7084. level = 0; /* try absolute import on failure */
  7085. }
  7086. #endif
  7087. if (!module) {
  7088. #if PY_VERSION_HEX < 0x03030000
  7089. PyObject *py_level = PyInt_FromLong(level);
  7090. if (!py_level)
  7091. goto bad;
  7092. module = PyObject_CallFunctionObjArgs(py_import,
  7093. name, global_dict, empty_dict, list, py_level, NULL);
  7094. Py_DECREF(py_level);
  7095. #else
  7096. module = PyImport_ImportModuleLevelObject(
  7097. name, global_dict, empty_dict, list, level);
  7098. #endif
  7099. }
  7100. }
  7101. #else
  7102. if (level>0) {
  7103. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  7104. goto bad;
  7105. }
  7106. module = PyObject_CallFunctionObjArgs(py_import,
  7107. name, global_dict, empty_dict, list, NULL);
  7108. #endif
  7109. bad:
  7110. #if PY_VERSION_HEX < 0x03030000
  7111. Py_XDECREF(py_import);
  7112. #endif
  7113. Py_XDECREF(empty_list);
  7114. Py_XDECREF(empty_dict);
  7115. return module;
  7116. }
  7117. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
  7118. const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
  7119. const int is_unsigned = neg_one > const_zero;
  7120. if (is_unsigned) {
  7121. if (sizeof(Py_intptr_t) < sizeof(long)) {
  7122. return PyInt_FromLong((long) value);
  7123. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
  7124. return PyLong_FromUnsignedLong((unsigned long) value);
  7125. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
  7126. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7127. }
  7128. } else {
  7129. if (sizeof(Py_intptr_t) <= sizeof(long)) {
  7130. return PyInt_FromLong((long) value);
  7131. } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
  7132. return PyLong_FromLongLong((long long) value);
  7133. }
  7134. }
  7135. {
  7136. int one = 1; int little = (int)*(unsigned char *)&one;
  7137. unsigned char *bytes = (unsigned char *)&value;
  7138. return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
  7139. little, !is_unsigned);
  7140. }
  7141. }
  7142. #if CYTHON_CCOMPLEX
  7143. #ifdef __cplusplus
  7144. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7145. return ::std::complex< double >(x, y);
  7146. }
  7147. #else
  7148. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7149. return x + y*(__pyx_t_double_complex)_Complex_I;
  7150. }
  7151. #endif
  7152. #else
  7153. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7154. __pyx_t_double_complex z;
  7155. z.real = x;
  7156. z.imag = y;
  7157. return z;
  7158. }
  7159. #endif
  7160. #if CYTHON_CCOMPLEX
  7161. #else
  7162. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7163. return (a.real == b.real) && (a.imag == b.imag);
  7164. }
  7165. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7166. __pyx_t_double_complex z;
  7167. z.real = a.real + b.real;
  7168. z.imag = a.imag + b.imag;
  7169. return z;
  7170. }
  7171. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7172. __pyx_t_double_complex z;
  7173. z.real = a.real - b.real;
  7174. z.imag = a.imag - b.imag;
  7175. return z;
  7176. }
  7177. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7178. __pyx_t_double_complex z;
  7179. z.real = a.real * b.real - a.imag * b.imag;
  7180. z.imag = a.real * b.imag + a.imag * b.real;
  7181. return z;
  7182. }
  7183. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7184. __pyx_t_double_complex z;
  7185. double denom = b.real * b.real + b.imag * b.imag;
  7186. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  7187. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  7188. return z;
  7189. }
  7190. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
  7191. __pyx_t_double_complex z;
  7192. z.real = -a.real;
  7193. z.imag = -a.imag;
  7194. return z;
  7195. }
  7196. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
  7197. return (a.real == 0) && (a.imag == 0);
  7198. }
  7199. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
  7200. __pyx_t_double_complex z;
  7201. z.real = a.real;
  7202. z.imag = -a.imag;
  7203. return z;
  7204. }
  7205. #if 1
  7206. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
  7207. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  7208. return sqrt(z.real*z.real + z.imag*z.imag);
  7209. #else
  7210. return hypot(z.real, z.imag);
  7211. #endif
  7212. }
  7213. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7214. __pyx_t_double_complex z;
  7215. double r, lnr, theta, z_r, z_theta;
  7216. if (b.imag == 0 && b.real == (int)b.real) {
  7217. if (b.real < 0) {
  7218. double denom = a.real * a.real + a.imag * a.imag;
  7219. a.real = a.real / denom;
  7220. a.imag = -a.imag / denom;
  7221. b.real = -b.real;
  7222. }
  7223. switch ((int)b.real) {
  7224. case 0:
  7225. z.real = 1;
  7226. z.imag = 0;
  7227. return z;
  7228. case 1:
  7229. return a;
  7230. case 2:
  7231. z = __Pyx_c_prod(a, a);
  7232. return __Pyx_c_prod(a, a);
  7233. case 3:
  7234. z = __Pyx_c_prod(a, a);
  7235. return __Pyx_c_prod(z, a);
  7236. case 4:
  7237. z = __Pyx_c_prod(a, a);
  7238. return __Pyx_c_prod(z, z);
  7239. }
  7240. }
  7241. if (a.imag == 0) {
  7242. if (a.real == 0) {
  7243. return a;
  7244. }
  7245. r = a.real;
  7246. theta = 0;
  7247. } else {
  7248. r = __Pyx_c_abs(a);
  7249. theta = atan2(a.imag, a.real);
  7250. }
  7251. lnr = log(r);
  7252. z_r = exp(lnr * b.real - theta * b.imag);
  7253. z_theta = theta * b.real + lnr * b.imag;
  7254. z.real = z_r * cos(z_theta);
  7255. z.imag = z_r * sin(z_theta);
  7256. return z;
  7257. }
  7258. #endif
  7259. #endif
  7260. #if CYTHON_CCOMPLEX
  7261. #ifdef __cplusplus
  7262. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7263. return ::std::complex< float >(x, y);
  7264. }
  7265. #else
  7266. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7267. return x + y*(__pyx_t_float_complex)_Complex_I;
  7268. }
  7269. #endif
  7270. #else
  7271. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7272. __pyx_t_float_complex z;
  7273. z.real = x;
  7274. z.imag = y;
  7275. return z;
  7276. }
  7277. #endif
  7278. #if CYTHON_CCOMPLEX
  7279. #else
  7280. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7281. return (a.real == b.real) && (a.imag == b.imag);
  7282. }
  7283. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7284. __pyx_t_float_complex z;
  7285. z.real = a.real + b.real;
  7286. z.imag = a.imag + b.imag;
  7287. return z;
  7288. }
  7289. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7290. __pyx_t_float_complex z;
  7291. z.real = a.real - b.real;
  7292. z.imag = a.imag - b.imag;
  7293. return z;
  7294. }
  7295. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7296. __pyx_t_float_complex z;
  7297. z.real = a.real * b.real - a.imag * b.imag;
  7298. z.imag = a.real * b.imag + a.imag * b.real;
  7299. return z;
  7300. }
  7301. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7302. __pyx_t_float_complex z;
  7303. float denom = b.real * b.real + b.imag * b.imag;
  7304. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  7305. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  7306. return z;
  7307. }
  7308. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
  7309. __pyx_t_float_complex z;
  7310. z.real = -a.real;
  7311. z.imag = -a.imag;
  7312. return z;
  7313. }
  7314. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
  7315. return (a.real == 0) && (a.imag == 0);
  7316. }
  7317. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
  7318. __pyx_t_float_complex z;
  7319. z.real = a.real;
  7320. z.imag = -a.imag;
  7321. return z;
  7322. }
  7323. #if 1
  7324. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
  7325. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  7326. return sqrtf(z.real*z.real + z.imag*z.imag);
  7327. #else
  7328. return hypotf(z.real, z.imag);
  7329. #endif
  7330. }
  7331. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7332. __pyx_t_float_complex z;
  7333. float r, lnr, theta, z_r, z_theta;
  7334. if (b.imag == 0 && b.real == (int)b.real) {
  7335. if (b.real < 0) {
  7336. float denom = a.real * a.real + a.imag * a.imag;
  7337. a.real = a.real / denom;
  7338. a.imag = -a.imag / denom;
  7339. b.real = -b.real;
  7340. }
  7341. switch ((int)b.real) {
  7342. case 0:
  7343. z.real = 1;
  7344. z.imag = 0;
  7345. return z;
  7346. case 1:
  7347. return a;
  7348. case 2:
  7349. z = __Pyx_c_prodf(a, a);
  7350. return __Pyx_c_prodf(a, a);
  7351. case 3:
  7352. z = __Pyx_c_prodf(a, a);
  7353. return __Pyx_c_prodf(z, a);
  7354. case 4:
  7355. z = __Pyx_c_prodf(a, a);
  7356. return __Pyx_c_prodf(z, z);
  7357. }
  7358. }
  7359. if (a.imag == 0) {
  7360. if (a.real == 0) {
  7361. return a;
  7362. }
  7363. r = a.real;
  7364. theta = 0;
  7365. } else {
  7366. r = __Pyx_c_absf(a);
  7367. theta = atan2f(a.imag, a.real);
  7368. }
  7369. lnr = logf(r);
  7370. z_r = expf(lnr * b.real - theta * b.imag);
  7371. z_theta = theta * b.real + lnr * b.imag;
  7372. z.real = z_r * cosf(z_theta);
  7373. z.imag = z_r * sinf(z_theta);
  7374. return z;
  7375. }
  7376. #endif
  7377. #endif
  7378. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  7379. const int neg_one = (int) -1, const_zero = 0;
  7380. const int is_unsigned = neg_one > const_zero;
  7381. if (is_unsigned) {
  7382. if (sizeof(int) < sizeof(long)) {
  7383. return PyInt_FromLong((long) value);
  7384. } else if (sizeof(int) <= sizeof(unsigned long)) {
  7385. return PyLong_FromUnsignedLong((unsigned long) value);
  7386. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  7387. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7388. }
  7389. } else {
  7390. if (sizeof(int) <= sizeof(long)) {
  7391. return PyInt_FromLong((long) value);
  7392. } else if (sizeof(int) <= sizeof(long long)) {
  7393. return PyLong_FromLongLong((long long) value);
  7394. }
  7395. }
  7396. {
  7397. int one = 1; int little = (int)*(unsigned char *)&one;
  7398. unsigned char *bytes = (unsigned char *)&value;
  7399. return _PyLong_FromByteArray(bytes, sizeof(int),
  7400. little, !is_unsigned);
  7401. }
  7402. }
  7403. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  7404. { \
  7405. func_type value = func(x); \
  7406. if (sizeof(target_type) < sizeof(func_type)) { \
  7407. if (unlikely(value != (func_type) (target_type) value)) { \
  7408. func_type zero = 0; \
  7409. PyErr_SetString(PyExc_OverflowError, \
  7410. (is_unsigned && unlikely(value < zero)) ? \
  7411. "can't convert negative value to " #target_type : \
  7412. "value too large to convert to " #target_type); \
  7413. return (target_type) -1; \
  7414. } \
  7415. } \
  7416. return (target_type) value; \
  7417. }
  7418. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7419. #if CYTHON_USE_PYLONG_INTERNALS
  7420. #include "longintrepr.h"
  7421. #endif
  7422. #endif
  7423. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  7424. const int neg_one = (int) -1, const_zero = 0;
  7425. const int is_unsigned = neg_one > const_zero;
  7426. #if PY_MAJOR_VERSION < 3
  7427. if (likely(PyInt_Check(x))) {
  7428. if (sizeof(int) < sizeof(long)) {
  7429. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  7430. } else {
  7431. long val = PyInt_AS_LONG(x);
  7432. if (is_unsigned && unlikely(val < 0)) {
  7433. PyErr_SetString(PyExc_OverflowError,
  7434. "can't convert negative value to int");
  7435. return (int) -1;
  7436. }
  7437. return (int) val;
  7438. }
  7439. } else
  7440. #endif
  7441. if (likely(PyLong_Check(x))) {
  7442. if (is_unsigned) {
  7443. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7444. #if CYTHON_USE_PYLONG_INTERNALS
  7445. if (sizeof(digit) <= sizeof(int)) {
  7446. switch (Py_SIZE(x)) {
  7447. case 0: return 0;
  7448. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  7449. }
  7450. }
  7451. #endif
  7452. #endif
  7453. if (unlikely(Py_SIZE(x) < 0)) {
  7454. PyErr_SetString(PyExc_OverflowError,
  7455. "can't convert negative value to int");
  7456. return (int) -1;
  7457. }
  7458. if (sizeof(int) <= sizeof(unsigned long)) {
  7459. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  7460. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  7461. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  7462. }
  7463. } else {
  7464. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7465. #if CYTHON_USE_PYLONG_INTERNALS
  7466. if (sizeof(digit) <= sizeof(int)) {
  7467. switch (Py_SIZE(x)) {
  7468. case 0: return 0;
  7469. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  7470. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  7471. }
  7472. }
  7473. #endif
  7474. #endif
  7475. if (sizeof(int) <= sizeof(long)) {
  7476. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  7477. } else if (sizeof(int) <= sizeof(long long)) {
  7478. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  7479. }
  7480. }
  7481. {
  7482. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7483. PyErr_SetString(PyExc_RuntimeError,
  7484. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7485. #else
  7486. int val;
  7487. PyObject *v = __Pyx_PyNumber_Int(x);
  7488. #if PY_MAJOR_VERSION < 3
  7489. if (likely(v) && !PyLong_Check(v)) {
  7490. PyObject *tmp = v;
  7491. v = PyNumber_Long(tmp);
  7492. Py_DECREF(tmp);
  7493. }
  7494. #endif
  7495. if (likely(v)) {
  7496. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7497. unsigned char *bytes = (unsigned char *)&val;
  7498. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7499. bytes, sizeof(val),
  7500. is_little, !is_unsigned);
  7501. Py_DECREF(v);
  7502. if (likely(!ret))
  7503. return val;
  7504. }
  7505. #endif
  7506. return (int) -1;
  7507. }
  7508. } else {
  7509. int val;
  7510. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7511. if (!tmp) return (int) -1;
  7512. val = __Pyx_PyInt_As_int(tmp);
  7513. Py_DECREF(tmp);
  7514. return val;
  7515. }
  7516. }
  7517. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  7518. const long neg_one = (long) -1, const_zero = 0;
  7519. const int is_unsigned = neg_one > const_zero;
  7520. if (is_unsigned) {
  7521. if (sizeof(long) < sizeof(long)) {
  7522. return PyInt_FromLong((long) value);
  7523. } else if (sizeof(long) <= sizeof(unsigned long)) {
  7524. return PyLong_FromUnsignedLong((unsigned long) value);
  7525. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7526. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7527. }
  7528. } else {
  7529. if (sizeof(long) <= sizeof(long)) {
  7530. return PyInt_FromLong((long) value);
  7531. } else if (sizeof(long) <= sizeof(long long)) {
  7532. return PyLong_FromLongLong((long long) value);
  7533. }
  7534. }
  7535. {
  7536. int one = 1; int little = (int)*(unsigned char *)&one;
  7537. unsigned char *bytes = (unsigned char *)&value;
  7538. return _PyLong_FromByteArray(bytes, sizeof(long),
  7539. little, !is_unsigned);
  7540. }
  7541. }
  7542. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7543. #if CYTHON_USE_PYLONG_INTERNALS
  7544. #include "longintrepr.h"
  7545. #endif
  7546. #endif
  7547. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  7548. const long neg_one = (long) -1, const_zero = 0;
  7549. const int is_unsigned = neg_one > const_zero;
  7550. #if PY_MAJOR_VERSION < 3
  7551. if (likely(PyInt_Check(x))) {
  7552. if (sizeof(long) < sizeof(long)) {
  7553. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  7554. } else {
  7555. long val = PyInt_AS_LONG(x);
  7556. if (is_unsigned && unlikely(val < 0)) {
  7557. PyErr_SetString(PyExc_OverflowError,
  7558. "can't convert negative value to long");
  7559. return (long) -1;
  7560. }
  7561. return (long) val;
  7562. }
  7563. } else
  7564. #endif
  7565. if (likely(PyLong_Check(x))) {
  7566. if (is_unsigned) {
  7567. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7568. #if CYTHON_USE_PYLONG_INTERNALS
  7569. if (sizeof(digit) <= sizeof(long)) {
  7570. switch (Py_SIZE(x)) {
  7571. case 0: return 0;
  7572. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  7573. }
  7574. }
  7575. #endif
  7576. #endif
  7577. if (unlikely(Py_SIZE(x) < 0)) {
  7578. PyErr_SetString(PyExc_OverflowError,
  7579. "can't convert negative value to long");
  7580. return (long) -1;
  7581. }
  7582. if (sizeof(long) <= sizeof(unsigned long)) {
  7583. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  7584. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7585. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  7586. }
  7587. } else {
  7588. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7589. #if CYTHON_USE_PYLONG_INTERNALS
  7590. if (sizeof(digit) <= sizeof(long)) {
  7591. switch (Py_SIZE(x)) {
  7592. case 0: return 0;
  7593. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  7594. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  7595. }
  7596. }
  7597. #endif
  7598. #endif
  7599. if (sizeof(long) <= sizeof(long)) {
  7600. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  7601. } else if (sizeof(long) <= sizeof(long long)) {
  7602. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  7603. }
  7604. }
  7605. {
  7606. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7607. PyErr_SetString(PyExc_RuntimeError,
  7608. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7609. #else
  7610. long val;
  7611. PyObject *v = __Pyx_PyNumber_Int(x);
  7612. #if PY_MAJOR_VERSION < 3
  7613. if (likely(v) && !PyLong_Check(v)) {
  7614. PyObject *tmp = v;
  7615. v = PyNumber_Long(tmp);
  7616. Py_DECREF(tmp);
  7617. }
  7618. #endif
  7619. if (likely(v)) {
  7620. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7621. unsigned char *bytes = (unsigned char *)&val;
  7622. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7623. bytes, sizeof(val),
  7624. is_little, !is_unsigned);
  7625. Py_DECREF(v);
  7626. if (likely(!ret))
  7627. return val;
  7628. }
  7629. #endif
  7630. return (long) -1;
  7631. }
  7632. } else {
  7633. long val;
  7634. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7635. if (!tmp) return (long) -1;
  7636. val = __Pyx_PyInt_As_long(tmp);
  7637. Py_DECREF(tmp);
  7638. return val;
  7639. }
  7640. }
  7641. static int __Pyx_check_binary_version(void) {
  7642. char ctversion[4], rtversion[4];
  7643. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  7644. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  7645. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  7646. char message[200];
  7647. PyOS_snprintf(message, sizeof(message),
  7648. "compiletime version %s of module '%.100s' "
  7649. "does not match runtime version %s",
  7650. ctversion, __Pyx_MODULE_NAME, rtversion);
  7651. #if PY_VERSION_HEX < 0x02050000
  7652. return PyErr_Warn(NULL, message);
  7653. #else
  7654. return PyErr_WarnEx(NULL, message, 1);
  7655. #endif
  7656. }
  7657. return 0;
  7658. }
  7659. #ifndef __PYX_HAVE_RT_ImportModule
  7660. #define __PYX_HAVE_RT_ImportModule
  7661. static PyObject *__Pyx_ImportModule(const char *name) {
  7662. PyObject *py_name = 0;
  7663. PyObject *py_module = 0;
  7664. py_name = __Pyx_PyIdentifier_FromString(name);
  7665. if (!py_name)
  7666. goto bad;
  7667. py_module = PyImport_Import(py_name);
  7668. Py_DECREF(py_name);
  7669. return py_module;
  7670. bad:
  7671. Py_XDECREF(py_name);
  7672. return 0;
  7673. }
  7674. #endif
  7675. #ifndef __PYX_HAVE_RT_ImportType
  7676. #define __PYX_HAVE_RT_ImportType
  7677. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
  7678. size_t size, int strict)
  7679. {
  7680. PyObject *py_module = 0;
  7681. PyObject *result = 0;
  7682. PyObject *py_name = 0;
  7683. char warning[200];
  7684. Py_ssize_t basicsize;
  7685. #ifdef Py_LIMITED_API
  7686. PyObject *py_basicsize;
  7687. #endif
  7688. py_module = __Pyx_ImportModule(module_name);
  7689. if (!py_module)
  7690. goto bad;
  7691. py_name = __Pyx_PyIdentifier_FromString(class_name);
  7692. if (!py_name)
  7693. goto bad;
  7694. result = PyObject_GetAttr(py_module, py_name);
  7695. Py_DECREF(py_name);
  7696. py_name = 0;
  7697. Py_DECREF(py_module);
  7698. py_module = 0;
  7699. if (!result)
  7700. goto bad;
  7701. if (!PyType_Check(result)) {
  7702. PyErr_Format(PyExc_TypeError,
  7703. "%.200s.%.200s is not a type object",
  7704. module_name, class_name);
  7705. goto bad;
  7706. }
  7707. #ifndef Py_LIMITED_API
  7708. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  7709. #else
  7710. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  7711. if (!py_basicsize)
  7712. goto bad;
  7713. basicsize = PyLong_AsSsize_t(py_basicsize);
  7714. Py_DECREF(py_basicsize);
  7715. py_basicsize = 0;
  7716. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  7717. goto bad;
  7718. #endif
  7719. if (!strict && (size_t)basicsize > size) {
  7720. PyOS_snprintf(warning, sizeof(warning),
  7721. "%s.%s size changed, may indicate binary incompatibility",
  7722. module_name, class_name);
  7723. #if PY_VERSION_HEX < 0x02050000
  7724. if (PyErr_Warn(NULL, warning) < 0) goto bad;
  7725. #else
  7726. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  7727. #endif
  7728. }
  7729. else if ((size_t)basicsize != size) {
  7730. PyErr_Format(PyExc_ValueError,
  7731. "%.200s.%.200s has the wrong size, try recompiling",
  7732. module_name, class_name);
  7733. goto bad;
  7734. }
  7735. return (PyTypeObject *)result;
  7736. bad:
  7737. Py_XDECREF(py_module);
  7738. Py_XDECREF(result);
  7739. return NULL;
  7740. }
  7741. #endif
  7742. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  7743. int start = 0, mid = 0, end = count - 1;
  7744. if (end >= 0 && code_line > entries[end].code_line) {
  7745. return count;
  7746. }
  7747. while (start < end) {
  7748. mid = (start + end) / 2;
  7749. if (code_line < entries[mid].code_line) {
  7750. end = mid;
  7751. } else if (code_line > entries[mid].code_line) {
  7752. start = mid + 1;
  7753. } else {
  7754. return mid;
  7755. }
  7756. }
  7757. if (code_line <= entries[mid].code_line) {
  7758. return mid;
  7759. } else {
  7760. return mid + 1;
  7761. }
  7762. }
  7763. static PyCodeObject *__pyx_find_code_object(int code_line) {
  7764. PyCodeObject* code_object;
  7765. int pos;
  7766. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  7767. return NULL;
  7768. }
  7769. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  7770. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  7771. return NULL;
  7772. }
  7773. code_object = __pyx_code_cache.entries[pos].code_object;
  7774. Py_INCREF(code_object);
  7775. return code_object;
  7776. }
  7777. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  7778. int pos, i;
  7779. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  7780. if (unlikely(!code_line)) {
  7781. return;
  7782. }
  7783. if (unlikely(!entries)) {
  7784. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  7785. if (likely(entries)) {
  7786. __pyx_code_cache.entries = entries;
  7787. __pyx_code_cache.max_count = 64;
  7788. __pyx_code_cache.count = 1;
  7789. entries[0].code_line = code_line;
  7790. entries[0].code_object = code_object;
  7791. Py_INCREF(code_object);
  7792. }
  7793. return;
  7794. }
  7795. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  7796. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  7797. PyCodeObject* tmp = entries[pos].code_object;
  7798. entries[pos].code_object = code_object;
  7799. Py_DECREF(tmp);
  7800. return;
  7801. }
  7802. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  7803. int new_max = __pyx_code_cache.max_count + 64;
  7804. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  7805. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  7806. if (unlikely(!entries)) {
  7807. return;
  7808. }
  7809. __pyx_code_cache.entries = entries;
  7810. __pyx_code_cache.max_count = new_max;
  7811. }
  7812. for (i=__pyx_code_cache.count; i>pos; i--) {
  7813. entries[i] = entries[i-1];
  7814. }
  7815. entries[pos].code_line = code_line;
  7816. entries[pos].code_object = code_object;
  7817. __pyx_code_cache.count++;
  7818. Py_INCREF(code_object);
  7819. }
  7820. #include "compile.h"
  7821. #include "frameobject.h"
  7822. #include "traceback.h"
  7823. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  7824. const char *funcname, int c_line,
  7825. int py_line, const char *filename) {
  7826. PyCodeObject *py_code = 0;
  7827. PyObject *py_srcfile = 0;
  7828. PyObject *py_funcname = 0;
  7829. #if PY_MAJOR_VERSION < 3
  7830. py_srcfile = PyString_FromString(filename);
  7831. #else
  7832. py_srcfile = PyUnicode_FromString(filename);
  7833. #endif
  7834. if (!py_srcfile) goto bad;
  7835. if (c_line) {
  7836. #if PY_MAJOR_VERSION < 3
  7837. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  7838. #else
  7839. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  7840. #endif
  7841. }
  7842. else {
  7843. #if PY_MAJOR_VERSION < 3
  7844. py_funcname = PyString_FromString(funcname);
  7845. #else
  7846. py_funcname = PyUnicode_FromString(funcname);
  7847. #endif
  7848. }
  7849. if (!py_funcname) goto bad;
  7850. py_code = __Pyx_PyCode_New(
  7851. 0, /*int argcount,*/
  7852. 0, /*int kwonlyargcount,*/
  7853. 0, /*int nlocals,*/
  7854. 0, /*int stacksize,*/
  7855. 0, /*int flags,*/
  7856. __pyx_empty_bytes, /*PyObject *code,*/
  7857. __pyx_empty_tuple, /*PyObject *consts,*/
  7858. __pyx_empty_tuple, /*PyObject *names,*/
  7859. __pyx_empty_tuple, /*PyObject *varnames,*/
  7860. __pyx_empty_tuple, /*PyObject *freevars,*/
  7861. __pyx_empty_tuple, /*PyObject *cellvars,*/
  7862. py_srcfile, /*PyObject *filename,*/
  7863. py_funcname, /*PyObject *name,*/
  7864. py_line, /*int firstlineno,*/
  7865. __pyx_empty_bytes /*PyObject *lnotab*/
  7866. );
  7867. Py_DECREF(py_srcfile);
  7868. Py_DECREF(py_funcname);
  7869. return py_code;
  7870. bad:
  7871. Py_XDECREF(py_srcfile);
  7872. Py_XDECREF(py_funcname);
  7873. return NULL;
  7874. }
  7875. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  7876. int py_line, const char *filename) {
  7877. PyCodeObject *py_code = 0;
  7878. PyObject *py_globals = 0;
  7879. PyFrameObject *py_frame = 0;
  7880. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  7881. if (!py_code) {
  7882. py_code = __Pyx_CreateCodeObjectForTraceback(
  7883. funcname, c_line, py_line, filename);
  7884. if (!py_code) goto bad;
  7885. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  7886. }
  7887. py_globals = PyModule_GetDict(__pyx_m);
  7888. if (!py_globals) goto bad;
  7889. py_frame = PyFrame_New(
  7890. PyThreadState_GET(), /*PyThreadState *tstate,*/
  7891. py_code, /*PyCodeObject *code,*/
  7892. py_globals, /*PyObject *globals,*/
  7893. 0 /*PyObject *locals*/
  7894. );
  7895. if (!py_frame) goto bad;
  7896. py_frame->f_lineno = py_line;
  7897. PyTraceBack_Here(py_frame);
  7898. bad:
  7899. Py_XDECREF(py_code);
  7900. Py_XDECREF(py_frame);
  7901. }
  7902. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  7903. while (t->p) {
  7904. #if PY_MAJOR_VERSION < 3
  7905. if (t->is_unicode) {
  7906. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  7907. } else if (t->intern) {
  7908. *t->p = PyString_InternFromString(t->s);
  7909. } else {
  7910. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  7911. }
  7912. #else /* Python 3+ has unicode identifiers */
  7913. if (t->is_unicode | t->is_str) {
  7914. if (t->intern) {
  7915. *t->p = PyUnicode_InternFromString(t->s);
  7916. } else if (t->encoding) {
  7917. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  7918. } else {
  7919. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  7920. }
  7921. } else {
  7922. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  7923. }
  7924. #endif
  7925. if (!*t->p)
  7926. return -1;
  7927. ++t;
  7928. }
  7929. return 0;
  7930. }
  7931. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  7932. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  7933. }
  7934. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  7935. Py_ssize_t ignore;
  7936. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  7937. }
  7938. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  7939. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  7940. if (
  7941. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7942. __Pyx_sys_getdefaultencoding_not_ascii &&
  7943. #endif
  7944. PyUnicode_Check(o)) {
  7945. #if PY_VERSION_HEX < 0x03030000
  7946. char* defenc_c;
  7947. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  7948. if (!defenc) return NULL;
  7949. defenc_c = PyBytes_AS_STRING(defenc);
  7950. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7951. {
  7952. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  7953. char* c;
  7954. for (c = defenc_c; c < end; c++) {
  7955. if ((unsigned char) (*c) >= 128) {
  7956. PyUnicode_AsASCIIString(o);
  7957. return NULL;
  7958. }
  7959. }
  7960. }
  7961. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  7962. *length = PyBytes_GET_SIZE(defenc);
  7963. return defenc_c;
  7964. #else /* PY_VERSION_HEX < 0x03030000 */
  7965. if (PyUnicode_READY(o) == -1) return NULL;
  7966. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  7967. if (PyUnicode_IS_ASCII(o)) {
  7968. *length = PyUnicode_GET_LENGTH(o);
  7969. return PyUnicode_AsUTF8(o);
  7970. } else {
  7971. PyUnicode_AsASCIIString(o);
  7972. return NULL;
  7973. }
  7974. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  7975. return PyUnicode_AsUTF8AndSize(o, length);
  7976. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  7977. #endif /* PY_VERSION_HEX < 0x03030000 */
  7978. } else
  7979. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  7980. #if !CYTHON_COMPILING_IN_PYPY
  7981. #if PY_VERSION_HEX >= 0x02060000
  7982. if (PyByteArray_Check(o)) {
  7983. *length = PyByteArray_GET_SIZE(o);
  7984. return PyByteArray_AS_STRING(o);
  7985. } else
  7986. #endif
  7987. #endif
  7988. {
  7989. char* result;
  7990. int r = PyBytes_AsStringAndSize(o, &result, length);
  7991. if (unlikely(r < 0)) {
  7992. return NULL;
  7993. } else {
  7994. return result;
  7995. }
  7996. }
  7997. }
  7998. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  7999. int is_true = x == Py_True;
  8000. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  8001. else return PyObject_IsTrue(x);
  8002. }
  8003. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  8004. PyNumberMethods *m;
  8005. const char *name = NULL;
  8006. PyObject *res = NULL;
  8007. #if PY_MAJOR_VERSION < 3
  8008. if (PyInt_Check(x) || PyLong_Check(x))
  8009. #else
  8010. if (PyLong_Check(x))
  8011. #endif
  8012. return Py_INCREF(x), x;
  8013. m = Py_TYPE(x)->tp_as_number;
  8014. #if PY_MAJOR_VERSION < 3
  8015. if (m && m->nb_int) {
  8016. name = "int";
  8017. res = PyNumber_Int(x);
  8018. }
  8019. else if (m && m->nb_long) {
  8020. name = "long";
  8021. res = PyNumber_Long(x);
  8022. }
  8023. #else
  8024. if (m && m->nb_int) {
  8025. name = "int";
  8026. res = PyNumber_Long(x);
  8027. }
  8028. #endif
  8029. if (res) {
  8030. #if PY_MAJOR_VERSION < 3
  8031. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  8032. #else
  8033. if (!PyLong_Check(res)) {
  8034. #endif
  8035. PyErr_Format(PyExc_TypeError,
  8036. "__%.4s__ returned non-%.4s (type %.200s)",
  8037. name, name, Py_TYPE(res)->tp_name);
  8038. Py_DECREF(res);
  8039. return NULL;
  8040. }
  8041. }
  8042. else if (!PyErr_Occurred()) {
  8043. PyErr_SetString(PyExc_TypeError,
  8044. "an integer is required");
  8045. }
  8046. return res;
  8047. }
  8048. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8049. #if CYTHON_USE_PYLONG_INTERNALS
  8050. #include "longintrepr.h"
  8051. #endif
  8052. #endif
  8053. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  8054. Py_ssize_t ival;
  8055. PyObject *x;
  8056. #if PY_MAJOR_VERSION < 3
  8057. if (likely(PyInt_CheckExact(b)))
  8058. return PyInt_AS_LONG(b);
  8059. #endif
  8060. if (likely(PyLong_CheckExact(b))) {
  8061. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8062. #if CYTHON_USE_PYLONG_INTERNALS
  8063. switch (Py_SIZE(b)) {
  8064. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  8065. case 0: return 0;
  8066. case 1: return ((PyLongObject*)b)->ob_digit[0];
  8067. }
  8068. #endif
  8069. #endif
  8070. #if PY_VERSION_HEX < 0x02060000
  8071. return PyInt_AsSsize_t(b);
  8072. #else
  8073. return PyLong_AsSsize_t(b);
  8074. #endif
  8075. }
  8076. x = PyNumber_Index(b);
  8077. if (!x) return -1;
  8078. ival = PyInt_AsSsize_t(x);
  8079. Py_DECREF(x);
  8080. return ival;
  8081. }
  8082. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  8083. #if PY_VERSION_HEX < 0x02050000
  8084. if (ival <= LONG_MAX)
  8085. return PyInt_FromLong((long)ival);
  8086. else {
  8087. unsigned char *bytes = (unsigned char *) &ival;
  8088. int one = 1; int little = (int)*(unsigned char*)&one;
  8089. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  8090. }
  8091. #else
  8092. return PyInt_FromSize_t(ival);
  8093. #endif
  8094. }
  8095. #endif /* Py_PYTHON_H */