scattnlay.cc 466 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528
  1. /* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1ubuntu2) on Tue Mar 24 20:48:35 2015 */
  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 <vector>
  350. #include "py_nmie.h"
  351. #ifdef _OPENMP
  352. #include <omp.h>
  353. #endif /* _OPENMP */
  354. #ifdef PYREX_WITHOUT_ASSERTIONS
  355. #define CYTHON_WITHOUT_ASSERTIONS
  356. #endif
  357. #ifndef CYTHON_UNUSED
  358. # if defined(__GNUC__)
  359. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  360. # define CYTHON_UNUSED __attribute__ ((__unused__))
  361. # else
  362. # define CYTHON_UNUSED
  363. # endif
  364. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  365. # define CYTHON_UNUSED __attribute__ ((__unused__))
  366. # else
  367. # define CYTHON_UNUSED
  368. # endif
  369. #endif
  370. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  371. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  372. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  373. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  374. #define __PYX_DEFAULT_STRING_ENCODING ""
  375. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  376. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  377. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  378. (sizeof(type) < sizeof(Py_ssize_t)) || \
  379. (sizeof(type) > sizeof(Py_ssize_t) && \
  380. likely(v < (type)PY_SSIZE_T_MAX || \
  381. v == (type)PY_SSIZE_T_MAX) && \
  382. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  383. v == (type)PY_SSIZE_T_MIN))) || \
  384. (sizeof(type) == sizeof(Py_ssize_t) && \
  385. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  386. v == (type)PY_SSIZE_T_MAX))) )
  387. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  388. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  389. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  390. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  391. #define __Pyx_PyBytes_FromString PyBytes_FromString
  392. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  393. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  394. #if PY_MAJOR_VERSION < 3
  395. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  396. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  397. #else
  398. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  399. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  400. #endif
  401. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  402. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  403. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
  404. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
  405. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
  406. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
  407. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
  408. #if PY_MAJOR_VERSION < 3
  409. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  410. {
  411. const Py_UNICODE *u_end = u;
  412. while (*u_end++) ;
  413. return u_end - u - 1;
  414. }
  415. #else
  416. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  417. #endif
  418. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  419. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  420. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  421. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  422. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  423. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  424. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  425. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  426. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  427. #if CYTHON_COMPILING_IN_CPYTHON
  428. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  429. #else
  430. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  431. #endif
  432. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  433. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  434. static int __Pyx_sys_getdefaultencoding_not_ascii;
  435. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  436. PyObject* sys = NULL;
  437. PyObject* default_encoding = NULL;
  438. PyObject* ascii_chars_u = NULL;
  439. PyObject* ascii_chars_b = NULL;
  440. sys = PyImport_ImportModule("sys");
  441. if (sys == NULL) goto bad;
  442. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  443. if (default_encoding == NULL) goto bad;
  444. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  445. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  446. } else {
  447. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  448. char ascii_chars[128];
  449. int c;
  450. for (c = 0; c < 128; c++) {
  451. ascii_chars[c] = c;
  452. }
  453. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  454. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  455. if (ascii_chars_u == NULL) goto bad;
  456. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  457. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  458. PyErr_Format(
  459. PyExc_ValueError,
  460. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  461. default_encoding_c);
  462. goto bad;
  463. }
  464. }
  465. Py_XDECREF(sys);
  466. Py_XDECREF(default_encoding);
  467. Py_XDECREF(ascii_chars_u);
  468. Py_XDECREF(ascii_chars_b);
  469. return 0;
  470. bad:
  471. Py_XDECREF(sys);
  472. Py_XDECREF(default_encoding);
  473. Py_XDECREF(ascii_chars_u);
  474. Py_XDECREF(ascii_chars_b);
  475. return -1;
  476. }
  477. #endif
  478. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  479. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  480. #else
  481. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  482. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  483. static char* __PYX_DEFAULT_STRING_ENCODING;
  484. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  485. PyObject* sys = NULL;
  486. PyObject* default_encoding = NULL;
  487. char* default_encoding_c;
  488. sys = PyImport_ImportModule("sys");
  489. if (sys == NULL) goto bad;
  490. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  491. if (default_encoding == NULL) goto bad;
  492. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  493. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  494. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  495. Py_DECREF(sys);
  496. Py_DECREF(default_encoding);
  497. return 0;
  498. bad:
  499. Py_XDECREF(sys);
  500. Py_XDECREF(default_encoding);
  501. return -1;
  502. }
  503. #endif
  504. #endif
  505. /* Test for GCC > 2.95 */
  506. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  507. #define likely(x) __builtin_expect(!!(x), 1)
  508. #define unlikely(x) __builtin_expect(!!(x), 0)
  509. #else /* !__GNUC__ or GCC < 2.95 */
  510. #define likely(x) (x)
  511. #define unlikely(x) (x)
  512. #endif /* __GNUC__ */
  513. static PyObject *__pyx_m;
  514. static PyObject *__pyx_d;
  515. static PyObject *__pyx_b;
  516. static PyObject *__pyx_empty_tuple;
  517. static PyObject *__pyx_empty_bytes;
  518. static int __pyx_lineno;
  519. static int __pyx_clineno = 0;
  520. static const char * __pyx_cfilenm= __FILE__;
  521. static const char *__pyx_filename;
  522. #if !defined(CYTHON_CCOMPLEX)
  523. #if defined(__cplusplus)
  524. #define CYTHON_CCOMPLEX 1
  525. #elif defined(_Complex_I)
  526. #define CYTHON_CCOMPLEX 1
  527. #else
  528. #define CYTHON_CCOMPLEX 0
  529. #endif
  530. #endif
  531. #if CYTHON_CCOMPLEX
  532. #ifdef __cplusplus
  533. #include <complex>
  534. #else
  535. #include <complex.h>
  536. #endif
  537. #endif
  538. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  539. #undef _Complex_I
  540. #define _Complex_I 1.0fj
  541. #endif
  542. static const char *__pyx_f[] = {
  543. "scattnlay.pyx",
  544. "__init__.pxd",
  545. "stringsource",
  546. "stringsource",
  547. "type.pxd",
  548. };
  549. #define IS_UNSIGNED(type) (((type) -1) > 0)
  550. struct __Pyx_StructField_;
  551. #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
  552. typedef struct {
  553. const char* name; /* for error messages only */
  554. struct __Pyx_StructField_* fields;
  555. size_t size; /* sizeof(type) */
  556. size_t arraysize[8]; /* length of array in each dimension */
  557. int ndim;
  558. char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  559. char is_unsigned;
  560. int flags;
  561. } __Pyx_TypeInfo;
  562. typedef struct __Pyx_StructField_ {
  563. __Pyx_TypeInfo* type;
  564. const char* name;
  565. size_t offset;
  566. } __Pyx_StructField;
  567. typedef struct {
  568. __Pyx_StructField* field;
  569. size_t parent_offset;
  570. } __Pyx_BufFmt_StackElem;
  571. typedef struct {
  572. __Pyx_StructField root;
  573. __Pyx_BufFmt_StackElem* head;
  574. size_t fmt_offset;
  575. size_t new_count, enc_count;
  576. size_t struct_alignment;
  577. int is_complex;
  578. char enc_type;
  579. char new_packmode;
  580. char enc_packmode;
  581. char is_valid_array;
  582. } __Pyx_BufFmt_Context;
  583. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
  584. * # in Cython to enable them only on the right systems.
  585. *
  586. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  587. * ctypedef npy_int16 int16_t
  588. * ctypedef npy_int32 int32_t
  589. */
  590. typedef npy_int8 __pyx_t_5numpy_int8_t;
  591. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
  592. *
  593. * ctypedef npy_int8 int8_t
  594. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  595. * ctypedef npy_int32 int32_t
  596. * ctypedef npy_int64 int64_t
  597. */
  598. typedef npy_int16 __pyx_t_5numpy_int16_t;
  599. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
  600. * ctypedef npy_int8 int8_t
  601. * ctypedef npy_int16 int16_t
  602. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  603. * ctypedef npy_int64 int64_t
  604. * #ctypedef npy_int96 int96_t
  605. */
  606. typedef npy_int32 __pyx_t_5numpy_int32_t;
  607. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
  608. * ctypedef npy_int16 int16_t
  609. * ctypedef npy_int32 int32_t
  610. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  611. * #ctypedef npy_int96 int96_t
  612. * #ctypedef npy_int128 int128_t
  613. */
  614. typedef npy_int64 __pyx_t_5numpy_int64_t;
  615. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
  616. * #ctypedef npy_int128 int128_t
  617. *
  618. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  619. * ctypedef npy_uint16 uint16_t
  620. * ctypedef npy_uint32 uint32_t
  621. */
  622. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  623. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
  624. *
  625. * ctypedef npy_uint8 uint8_t
  626. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  627. * ctypedef npy_uint32 uint32_t
  628. * ctypedef npy_uint64 uint64_t
  629. */
  630. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  631. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
  632. * ctypedef npy_uint8 uint8_t
  633. * ctypedef npy_uint16 uint16_t
  634. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  635. * ctypedef npy_uint64 uint64_t
  636. * #ctypedef npy_uint96 uint96_t
  637. */
  638. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  639. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
  640. * ctypedef npy_uint16 uint16_t
  641. * ctypedef npy_uint32 uint32_t
  642. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  643. * #ctypedef npy_uint96 uint96_t
  644. * #ctypedef npy_uint128 uint128_t
  645. */
  646. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  647. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
  648. * #ctypedef npy_uint128 uint128_t
  649. *
  650. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  651. * ctypedef npy_float64 float64_t
  652. * #ctypedef npy_float80 float80_t
  653. */
  654. typedef npy_float32 __pyx_t_5numpy_float32_t;
  655. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
  656. *
  657. * ctypedef npy_float32 float32_t
  658. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  659. * #ctypedef npy_float80 float80_t
  660. * #ctypedef npy_float128 float128_t
  661. */
  662. typedef npy_float64 __pyx_t_5numpy_float64_t;
  663. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
  664. * # The int types are mapped a bit surprising --
  665. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  666. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  667. * ctypedef npy_longlong long_t
  668. * ctypedef npy_longlong longlong_t
  669. */
  670. typedef npy_long __pyx_t_5numpy_int_t;
  671. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
  672. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  673. * ctypedef npy_long int_t
  674. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  675. * ctypedef npy_longlong longlong_t
  676. *
  677. */
  678. typedef npy_longlong __pyx_t_5numpy_long_t;
  679. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
  680. * ctypedef npy_long int_t
  681. * ctypedef npy_longlong long_t
  682. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  683. *
  684. * ctypedef npy_ulong uint_t
  685. */
  686. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  687. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
  688. * ctypedef npy_longlong longlong_t
  689. *
  690. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  691. * ctypedef npy_ulonglong ulong_t
  692. * ctypedef npy_ulonglong ulonglong_t
  693. */
  694. typedef npy_ulong __pyx_t_5numpy_uint_t;
  695. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
  696. *
  697. * ctypedef npy_ulong uint_t
  698. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  699. * ctypedef npy_ulonglong ulonglong_t
  700. *
  701. */
  702. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  703. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
  704. * ctypedef npy_ulong uint_t
  705. * ctypedef npy_ulonglong ulong_t
  706. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  707. *
  708. * ctypedef npy_intp intp_t
  709. */
  710. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  711. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
  712. * ctypedef npy_ulonglong ulonglong_t
  713. *
  714. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  715. * ctypedef npy_uintp uintp_t
  716. *
  717. */
  718. typedef npy_intp __pyx_t_5numpy_intp_t;
  719. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
  720. *
  721. * ctypedef npy_intp intp_t
  722. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  723. *
  724. * ctypedef npy_double float_t
  725. */
  726. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  727. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
  728. * ctypedef npy_uintp uintp_t
  729. *
  730. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  731. * ctypedef npy_double double_t
  732. * ctypedef npy_longdouble longdouble_t
  733. */
  734. typedef npy_double __pyx_t_5numpy_float_t;
  735. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
  736. *
  737. * ctypedef npy_double float_t
  738. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  739. * ctypedef npy_longdouble longdouble_t
  740. *
  741. */
  742. typedef npy_double __pyx_t_5numpy_double_t;
  743. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
  744. * ctypedef npy_double float_t
  745. * ctypedef npy_double double_t
  746. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  747. *
  748. * ctypedef npy_cfloat cfloat_t
  749. */
  750. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  751. #if CYTHON_CCOMPLEX
  752. #ifdef __cplusplus
  753. typedef ::std::complex< double > __pyx_t_double_complex;
  754. #else
  755. typedef double _Complex __pyx_t_double_complex;
  756. #endif
  757. #else
  758. typedef struct { double real, imag; } __pyx_t_double_complex;
  759. #endif
  760. #if CYTHON_CCOMPLEX
  761. #ifdef __cplusplus
  762. typedef ::std::complex< float > __pyx_t_float_complex;
  763. #else
  764. typedef float _Complex __pyx_t_float_complex;
  765. #endif
  766. #else
  767. typedef struct { float real, imag; } __pyx_t_float_complex;
  768. #endif
  769. /*--- Type declarations ---*/
  770. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
  771. * ctypedef npy_longdouble longdouble_t
  772. *
  773. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  774. * ctypedef npy_cdouble cdouble_t
  775. * ctypedef npy_clongdouble clongdouble_t
  776. */
  777. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  778. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
  779. *
  780. * ctypedef npy_cfloat cfloat_t
  781. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  782. * ctypedef npy_clongdouble clongdouble_t
  783. *
  784. */
  785. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  786. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
  787. * ctypedef npy_cfloat cfloat_t
  788. * ctypedef npy_cdouble cdouble_t
  789. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  790. *
  791. * ctypedef npy_cdouble complex_t
  792. */
  793. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  794. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
  795. * ctypedef npy_clongdouble clongdouble_t
  796. *
  797. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  798. *
  799. * cdef inline object PyArray_MultiIterNew1(a):
  800. */
  801. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  802. #ifndef CYTHON_REFNANNY
  803. #define CYTHON_REFNANNY 0
  804. #endif
  805. #if CYTHON_REFNANNY
  806. typedef struct {
  807. void (*INCREF)(void*, PyObject*, int);
  808. void (*DECREF)(void*, PyObject*, int);
  809. void (*GOTREF)(void*, PyObject*, int);
  810. void (*GIVEREF)(void*, PyObject*, int);
  811. void* (*SetupContext)(const char*, int, const char*);
  812. void (*FinishContext)(void**);
  813. } __Pyx_RefNannyAPIStruct;
  814. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  815. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  816. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  817. #ifdef WITH_THREAD
  818. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  819. if (acquire_gil) { \
  820. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  821. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  822. PyGILState_Release(__pyx_gilstate_save); \
  823. } else { \
  824. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  825. }
  826. #else
  827. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  828. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  829. #endif
  830. #define __Pyx_RefNannyFinishContext() \
  831. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  832. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  833. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  834. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  835. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  836. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  837. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  838. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  839. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  840. #else
  841. #define __Pyx_RefNannyDeclarations
  842. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  843. #define __Pyx_RefNannyFinishContext()
  844. #define __Pyx_INCREF(r) Py_INCREF(r)
  845. #define __Pyx_DECREF(r) Py_DECREF(r)
  846. #define __Pyx_GOTREF(r)
  847. #define __Pyx_GIVEREF(r)
  848. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  849. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  850. #define __Pyx_XGOTREF(r)
  851. #define __Pyx_XGIVEREF(r)
  852. #endif /* CYTHON_REFNANNY */
  853. #define __Pyx_XDECREF_SET(r, v) do { \
  854. PyObject *tmp = (PyObject *) r; \
  855. r = v; __Pyx_XDECREF(tmp); \
  856. } while (0)
  857. #define __Pyx_DECREF_SET(r, v) do { \
  858. PyObject *tmp = (PyObject *) r; \
  859. r = v; __Pyx_DECREF(tmp); \
  860. } while (0)
  861. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  862. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  863. #if CYTHON_COMPILING_IN_CPYTHON
  864. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  865. PyTypeObject* tp = Py_TYPE(obj);
  866. if (likely(tp->tp_getattro))
  867. return tp->tp_getattro(obj, attr_name);
  868. #if PY_MAJOR_VERSION < 3
  869. if (likely(tp->tp_getattr))
  870. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  871. #endif
  872. return PyObject_GetAttr(obj, attr_name);
  873. }
  874. #else
  875. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  876. #endif
  877. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  878. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  879. #if CYTHON_COMPILING_IN_CPYTHON
  880. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  881. #else
  882. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  883. #endif
  884. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
  885. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  886. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  887. static void __Pyx_WriteUnraisable(const char *name, int clineno,
  888. int lineno, const char *filename,
  889. int full_traceback); /*proto*/
  890. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  891. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  892. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  893. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  894. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  895. const char* function_name); /*proto*/
  896. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  897. const char *name, int exact); /*proto*/
  898. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  899. __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
  900. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
  901. static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
  902. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  903. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  904. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
  905. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
  906. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  907. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  908. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  909. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  910. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  911. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  912. int wraparound, int boundscheck);
  913. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  914. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  915. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  916. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  917. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  918. int wraparound, int boundscheck);
  919. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  920. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  921. int is_list, int wraparound, int boundscheck);
  922. static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
  923. #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
  924. #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  925. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  926. __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
  927. (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
  928. __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
  929. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
  930. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  931. int is_list, int wraparound, int boundscheck);
  932. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  933. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  934. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  935. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  936. typedef struct {
  937. Py_ssize_t shape, strides, suboffsets;
  938. } __Pyx_Buf_DimInfo;
  939. typedef struct {
  940. size_t refcount;
  941. Py_buffer pybuffer;
  942. } __Pyx_Buffer;
  943. typedef struct {
  944. __Pyx_Buffer *rcbuffer;
  945. char *data;
  946. __Pyx_Buf_DimInfo diminfo[8];
  947. } __Pyx_LocalBuf_ND;
  948. #if PY_MAJOR_VERSION < 3
  949. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
  950. static void __Pyx_ReleaseBuffer(Py_buffer *view);
  951. #else
  952. #define __Pyx_GetBuffer PyObject_GetBuffer
  953. #define __Pyx_ReleaseBuffer PyBuffer_Release
  954. #endif
  955. static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
  956. static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
  957. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  958. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *);
  959. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
  960. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  961. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);
  962. #if CYTHON_CCOMPLEX
  963. #ifdef __cplusplus
  964. #define __Pyx_CREAL(z) ((z).real())
  965. #define __Pyx_CIMAG(z) ((z).imag())
  966. #else
  967. #define __Pyx_CREAL(z) (__real__(z))
  968. #define __Pyx_CIMAG(z) (__imag__(z))
  969. #endif
  970. #else
  971. #define __Pyx_CREAL(z) ((z).real)
  972. #define __Pyx_CIMAG(z) ((z).imag)
  973. #endif
  974. #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
  975. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  976. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  977. #else
  978. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  979. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  980. #endif
  981. #if CYTHON_CCOMPLEX
  982. #define __Pyx_c_eq(a, b) ((a)==(b))
  983. #define __Pyx_c_sum(a, b) ((a)+(b))
  984. #define __Pyx_c_diff(a, b) ((a)-(b))
  985. #define __Pyx_c_prod(a, b) ((a)*(b))
  986. #define __Pyx_c_quot(a, b) ((a)/(b))
  987. #define __Pyx_c_neg(a) (-(a))
  988. #ifdef __cplusplus
  989. #define __Pyx_c_is_zero(z) ((z)==(double)0)
  990. #define __Pyx_c_conj(z) (::std::conj(z))
  991. #if 1
  992. #define __Pyx_c_abs(z) (::std::abs(z))
  993. #define __Pyx_c_pow(a, b) (::std::pow(a, b))
  994. #endif
  995. #else
  996. #define __Pyx_c_is_zero(z) ((z)==0)
  997. #define __Pyx_c_conj(z) (conj(z))
  998. #if 1
  999. #define __Pyx_c_abs(z) (cabs(z))
  1000. #define __Pyx_c_pow(a, b) (cpow(a, b))
  1001. #endif
  1002. #endif
  1003. #else
  1004. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
  1005. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
  1006. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
  1007. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
  1008. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
  1009. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
  1010. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
  1011. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
  1012. #if 1
  1013. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
  1014. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
  1015. #endif
  1016. #endif
  1017. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1018. #if CYTHON_CCOMPLEX
  1019. #define __Pyx_c_eqf(a, b) ((a)==(b))
  1020. #define __Pyx_c_sumf(a, b) ((a)+(b))
  1021. #define __Pyx_c_difff(a, b) ((a)-(b))
  1022. #define __Pyx_c_prodf(a, b) ((a)*(b))
  1023. #define __Pyx_c_quotf(a, b) ((a)/(b))
  1024. #define __Pyx_c_negf(a) (-(a))
  1025. #ifdef __cplusplus
  1026. #define __Pyx_c_is_zerof(z) ((z)==(float)0)
  1027. #define __Pyx_c_conjf(z) (::std::conj(z))
  1028. #if 1
  1029. #define __Pyx_c_absf(z) (::std::abs(z))
  1030. #define __Pyx_c_powf(a, b) (::std::pow(a, b))
  1031. #endif
  1032. #else
  1033. #define __Pyx_c_is_zerof(z) ((z)==0)
  1034. #define __Pyx_c_conjf(z) (conjf(z))
  1035. #if 1
  1036. #define __Pyx_c_absf(z) (cabsf(z))
  1037. #define __Pyx_c_powf(a, b) (cpowf(a, b))
  1038. #endif
  1039. #endif
  1040. #else
  1041. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
  1042. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
  1043. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
  1044. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
  1045. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
  1046. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
  1047. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
  1048. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
  1049. #if 1
  1050. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
  1051. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
  1052. #endif
  1053. #endif
  1054. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1055. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1056. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1057. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1058. static int __Pyx_check_binary_version(void);
  1059. #if !defined(__Pyx_PyIdentifier_FromString)
  1060. #if PY_MAJOR_VERSION < 3
  1061. #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
  1062. #else
  1063. #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
  1064. #endif
  1065. #endif
  1066. static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
  1067. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
  1068. typedef struct {
  1069. int code_line;
  1070. PyCodeObject* code_object;
  1071. } __Pyx_CodeObjectCacheEntry;
  1072. struct __Pyx_CodeObjectCache {
  1073. int count;
  1074. int max_count;
  1075. __Pyx_CodeObjectCacheEntry* entries;
  1076. };
  1077. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1078. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1079. static PyCodeObject *__pyx_find_code_object(int code_line);
  1080. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1081. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1082. int py_line, const char *filename); /*proto*/
  1083. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  1084. /* Module declarations from 'cpython.buffer' */
  1085. /* Module declarations from 'cpython.ref' */
  1086. /* Module declarations from 'libc.string' */
  1087. /* Module declarations from 'libc.stdio' */
  1088. /* Module declarations from 'cpython.object' */
  1089. /* Module declarations from '__builtin__' */
  1090. /* Module declarations from 'cpython.type' */
  1091. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1092. /* Module declarations from 'libc.stdlib' */
  1093. /* Module declarations from 'numpy' */
  1094. /* Module declarations from 'numpy' */
  1095. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1096. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1097. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1098. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1099. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1100. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1101. /* Module declarations from 'scattnlay' */
  1102. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *); /*proto*/
  1103. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1104. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *); /*proto*/
  1105. 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 };
  1106. static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
  1107. 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 };
  1108. #define __Pyx_MODULE_NAME "scattnlay"
  1109. int __pyx_module_is_main_scattnlay = 0;
  1110. /* Implementation of 'scattnlay' */
  1111. static PyObject *__pyx_builtin_range;
  1112. static PyObject *__pyx_builtin_ValueError;
  1113. static PyObject *__pyx_builtin_RuntimeError;
  1114. static PyObject *__pyx_pf_9scattnlay_scattnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_theta, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_nmax); /* proto */
  1115. static PyObject *__pyx_pf_9scattnlay_2fieldnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_coords, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_nmax); /* proto */
  1116. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  1117. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  1118. static char __pyx_k_B[] = "B";
  1119. static char __pyx_k_C[] = "C";
  1120. static char __pyx_k_E[] = "E";
  1121. static char __pyx_k_H[] = "H";
  1122. static char __pyx_k_I[] = "I";
  1123. static char __pyx_k_L[] = "L";
  1124. static char __pyx_k_O[] = "O";
  1125. static char __pyx_k_Q[] = "Q";
  1126. static char __pyx_k_b[] = "b";
  1127. static char __pyx_k_d[] = "d";
  1128. static char __pyx_k_f[] = "f";
  1129. static char __pyx_k_g[] = "g";
  1130. static char __pyx_k_h[] = "h";
  1131. static char __pyx_k_i[] = "i";
  1132. static char __pyx_k_l[] = "l";
  1133. static char __pyx_k_m[] = "m";
  1134. static char __pyx_k_q[] = "q";
  1135. static char __pyx_k_x[] = "x";
  1136. static char __pyx_k_S1[] = "S1";
  1137. static char __pyx_k_S2[] = "S2";
  1138. static char __pyx_k_Zd[] = "Zd";
  1139. static char __pyx_k_Zf[] = "Zf";
  1140. static char __pyx_k_Zg[] = "Zg";
  1141. static char __pyx_k_np[] = "np";
  1142. static char __pyx_k_pl[] = "pl";
  1143. static char __pyx_k_Eix[] = "Eix";
  1144. static char __pyx_k_Eiy[] = "Eiy";
  1145. static char __pyx_k_Eiz[] = "Eiz";
  1146. static char __pyx_k_Erx[] = "Erx";
  1147. static char __pyx_k_Ery[] = "Ery";
  1148. static char __pyx_k_Erz[] = "Erz";
  1149. static char __pyx_k_Hix[] = "Hix";
  1150. static char __pyx_k_Hiy[] = "Hiy";
  1151. static char __pyx_k_Hiz[] = "Hiz";
  1152. static char __pyx_k_Hrx[] = "Hrx";
  1153. static char __pyx_k_Hry[] = "Hry";
  1154. static char __pyx_k_Hrz[] = "Hrz";
  1155. static char __pyx_k_Qbk[] = "Qbk";
  1156. static char __pyx_k_Qpr[] = "Qpr";
  1157. static char __pyx_k_S1i[] = "S1i";
  1158. static char __pyx_k_S1r[] = "S1r";
  1159. static char __pyx_k_S2i[] = "S2i";
  1160. static char __pyx_k_S2r[] = "S2r";
  1161. static char __pyx_k_int[] = "int";
  1162. static char __pyx_k_Qabs[] = "Qabs";
  1163. static char __pyx_k_Qext[] = "Qext";
  1164. static char __pyx_k_Qsca[] = "Qsca";
  1165. static char __pyx_k_copy[] = "copy";
  1166. static char __pyx_k_main[] = "__main__";
  1167. static char __pyx_k_nmax[] = "nmax";
  1168. static char __pyx_k_test[] = "__test__";
  1169. static char __pyx_k_dtype[] = "dtype";
  1170. static char __pyx_k_flags[] = "flags";
  1171. static char __pyx_k_numpy[] = "numpy";
  1172. static char __pyx_k_range[] = "range";
  1173. static char __pyx_k_terms[] = "terms";
  1174. static char __pyx_k_theta[] = "theta";
  1175. static char __pyx_k_zeros[] = "zeros";
  1176. static char __pyx_k_Albedo[] = "Albedo";
  1177. static char __pyx_k_coords[] = "coords";
  1178. static char __pyx_k_import[] = "__import__";
  1179. static char __pyx_k_vstack[] = "vstack";
  1180. static char __pyx_k_float64[] = "float64";
  1181. static char __pyx_k_fieldnlay[] = "fieldnlay";
  1182. static char __pyx_k_scattnlay[] = "scattnlay";
  1183. static char __pyx_k_transpose[] = "transpose";
  1184. static char __pyx_k_ValueError[] = "ValueError";
  1185. static char __pyx_k_complex128[] = "complex128";
  1186. static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
  1187. static char __pyx_k_RuntimeError[] = "RuntimeError";
  1188. static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
  1189. static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer";
  1190. static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  1191. static char __pyx_k_home_ovidio_scattering_scattnla[] = "/home/ovidio/scattering/scattnlay/python-scattnlay-0.3.1/scattnlay.pyx";
  1192. static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  1193. static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  1194. static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  1195. static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  1196. static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  1197. static PyObject *__pyx_n_s_Albedo;
  1198. static PyObject *__pyx_n_s_C;
  1199. static PyObject *__pyx_n_s_C_CONTIGUOUS;
  1200. static PyObject *__pyx_n_s_E;
  1201. static PyObject *__pyx_n_s_Eix;
  1202. static PyObject *__pyx_n_s_Eiy;
  1203. static PyObject *__pyx_n_s_Eiz;
  1204. static PyObject *__pyx_n_s_Erx;
  1205. static PyObject *__pyx_n_s_Ery;
  1206. static PyObject *__pyx_n_s_Erz;
  1207. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  1208. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  1209. static PyObject *__pyx_n_s_H;
  1210. static PyObject *__pyx_n_s_Hix;
  1211. static PyObject *__pyx_n_s_Hiy;
  1212. static PyObject *__pyx_n_s_Hiz;
  1213. static PyObject *__pyx_n_s_Hrx;
  1214. static PyObject *__pyx_n_s_Hry;
  1215. static PyObject *__pyx_n_s_Hrz;
  1216. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  1217. static PyObject *__pyx_n_s_Qabs;
  1218. static PyObject *__pyx_n_s_Qbk;
  1219. static PyObject *__pyx_n_s_Qext;
  1220. static PyObject *__pyx_n_s_Qpr;
  1221. static PyObject *__pyx_n_s_Qsca;
  1222. static PyObject *__pyx_n_s_RuntimeError;
  1223. static PyObject *__pyx_n_s_S1;
  1224. static PyObject *__pyx_n_s_S1i;
  1225. static PyObject *__pyx_n_s_S1r;
  1226. static PyObject *__pyx_n_s_S2;
  1227. static PyObject *__pyx_n_s_S2i;
  1228. static PyObject *__pyx_n_s_S2r;
  1229. static PyObject *__pyx_n_s_ValueError;
  1230. static PyObject *__pyx_n_s_complex128;
  1231. static PyObject *__pyx_n_s_coords;
  1232. static PyObject *__pyx_n_s_copy;
  1233. static PyObject *__pyx_n_s_dtype;
  1234. static PyObject *__pyx_n_s_fieldnlay;
  1235. static PyObject *__pyx_n_s_flags;
  1236. static PyObject *__pyx_n_s_float64;
  1237. static PyObject *__pyx_n_s_g;
  1238. static PyObject *__pyx_kp_s_home_ovidio_scattering_scattnla;
  1239. static PyObject *__pyx_n_s_i;
  1240. static PyObject *__pyx_n_s_import;
  1241. static PyObject *__pyx_n_s_int;
  1242. static PyObject *__pyx_n_s_m;
  1243. static PyObject *__pyx_n_s_main;
  1244. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  1245. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  1246. static PyObject *__pyx_n_s_nmax;
  1247. static PyObject *__pyx_n_s_np;
  1248. static PyObject *__pyx_n_s_numpy;
  1249. static PyObject *__pyx_n_s_pl;
  1250. static PyObject *__pyx_n_s_pyx_getbuffer;
  1251. static PyObject *__pyx_n_s_pyx_releasebuffer;
  1252. static PyObject *__pyx_n_s_range;
  1253. static PyObject *__pyx_n_s_scattnlay;
  1254. static PyObject *__pyx_n_s_terms;
  1255. static PyObject *__pyx_n_s_test;
  1256. static PyObject *__pyx_n_s_theta;
  1257. static PyObject *__pyx_n_s_transpose;
  1258. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  1259. static PyObject *__pyx_n_s_vstack;
  1260. static PyObject *__pyx_n_s_x;
  1261. static PyObject *__pyx_n_s_zeros;
  1262. static PyObject *__pyx_int_0;
  1263. static PyObject *__pyx_int_1;
  1264. static PyObject *__pyx_int_2;
  1265. static PyObject *__pyx_int_3;
  1266. static PyArrayObject *__pyx_k__2;
  1267. static PyObject *__pyx_tuple_;
  1268. static PyObject *__pyx_tuple__3;
  1269. static PyObject *__pyx_tuple__4;
  1270. static PyObject *__pyx_tuple__5;
  1271. static PyObject *__pyx_tuple__6;
  1272. static PyObject *__pyx_tuple__7;
  1273. static PyObject *__pyx_tuple__8;
  1274. static PyObject *__pyx_tuple__9;
  1275. static PyObject *__pyx_slice__12;
  1276. static PyObject *__pyx_slice__15;
  1277. static PyObject *__pyx_slice__18;
  1278. static PyObject *__pyx_tuple__10;
  1279. static PyObject *__pyx_tuple__11;
  1280. static PyObject *__pyx_tuple__13;
  1281. static PyObject *__pyx_tuple__14;
  1282. static PyObject *__pyx_tuple__16;
  1283. static PyObject *__pyx_tuple__17;
  1284. static PyObject *__pyx_tuple__19;
  1285. static PyObject *__pyx_tuple__20;
  1286. static PyObject *__pyx_tuple__21;
  1287. static PyObject *__pyx_tuple__22;
  1288. static PyObject *__pyx_tuple__23;
  1289. static PyObject *__pyx_tuple__24;
  1290. static PyObject *__pyx_tuple__25;
  1291. static PyObject *__pyx_tuple__26;
  1292. static PyObject *__pyx_tuple__27;
  1293. static PyObject *__pyx_tuple__28;
  1294. static PyObject *__pyx_tuple__29;
  1295. static PyObject *__pyx_tuple__30;
  1296. static PyObject *__pyx_tuple__31;
  1297. static PyObject *__pyx_tuple__32;
  1298. static PyObject *__pyx_tuple__33;
  1299. static PyObject *__pyx_tuple__34;
  1300. static PyObject *__pyx_tuple__35;
  1301. static PyObject *__pyx_tuple__36;
  1302. static PyObject *__pyx_tuple__37;
  1303. static PyObject *__pyx_tuple__38;
  1304. static PyObject *__pyx_tuple__39;
  1305. static PyObject *__pyx_tuple__40;
  1306. static PyObject *__pyx_tuple__42;
  1307. static PyObject *__pyx_codeobj__41;
  1308. static PyObject *__pyx_codeobj__43;
  1309. /* "scattnlay.pyx":43
  1310. * iterator end()
  1311. *
  1312. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1313. * assert a.dtype == np.float64
  1314. *
  1315. */
  1316. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *__pyx_v_a) {
  1317. double *__pyx_r;
  1318. __Pyx_RefNannyDeclarations
  1319. PyObject *__pyx_t_1 = NULL;
  1320. PyObject *__pyx_t_2 = NULL;
  1321. PyObject *__pyx_t_3 = NULL;
  1322. int __pyx_t_4;
  1323. int __pyx_t_5;
  1324. int __pyx_lineno = 0;
  1325. const char *__pyx_filename = NULL;
  1326. int __pyx_clineno = 0;
  1327. __Pyx_RefNannySetupContext("npy2c", 0);
  1328. __Pyx_INCREF((PyObject *)__pyx_v_a);
  1329. /* "scattnlay.pyx":44
  1330. *
  1331. * cdef inline double *npy2c(np.ndarray a):
  1332. * assert a.dtype == np.float64 # <<<<<<<<<<<<<<
  1333. *
  1334. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1335. */
  1336. #ifndef CYTHON_WITHOUT_ASSERTIONS
  1337. if (unlikely(!Py_OptimizeFlag)) {
  1338. __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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1339. __Pyx_GOTREF(__pyx_t_1);
  1340. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1341. __Pyx_GOTREF(__pyx_t_2);
  1342. __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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1343. __Pyx_GOTREF(__pyx_t_3);
  1344. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1345. __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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1346. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1347. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1348. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1349. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1350. if (unlikely(!__pyx_t_4)) {
  1351. PyErr_SetNone(PyExc_AssertionError);
  1352. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1353. }
  1354. }
  1355. #endif
  1356. /* "scattnlay.pyx":46
  1357. * assert a.dtype == np.float64
  1358. *
  1359. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy # <<<<<<<<<<<<<<
  1360. * a = a.copy('C')
  1361. *
  1362. */
  1363. __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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1364. __Pyx_GOTREF(__pyx_t_2);
  1365. __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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  1366. __Pyx_GOTREF(__pyx_t_3);
  1367. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1368. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1369. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1370. __pyx_t_5 = ((!__pyx_t_4) != 0);
  1371. if (__pyx_t_5) {
  1372. /* "scattnlay.pyx":47
  1373. *
  1374. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1375. * a = a.copy('C') # <<<<<<<<<<<<<<
  1376. *
  1377. * # Return data pointer
  1378. */
  1379. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1380. __Pyx_GOTREF(__pyx_t_3);
  1381. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1382. __Pyx_GOTREF(__pyx_t_2);
  1383. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1384. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1385. __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
  1386. __pyx_t_2 = 0;
  1387. goto __pyx_L3;
  1388. }
  1389. __pyx_L3:;
  1390. /* "scattnlay.pyx":50
  1391. *
  1392. * # Return data pointer
  1393. * return <double *>(a.data) # <<<<<<<<<<<<<<
  1394. *
  1395. * cdef extern from "py_nmie.h":
  1396. */
  1397. __pyx_r = ((double *)__pyx_v_a->data);
  1398. goto __pyx_L0;
  1399. /* "scattnlay.pyx":43
  1400. * iterator end()
  1401. *
  1402. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1403. * assert a.dtype == np.float64
  1404. *
  1405. */
  1406. /* function exit code */
  1407. __pyx_L1_error:;
  1408. __Pyx_XDECREF(__pyx_t_1);
  1409. __Pyx_XDECREF(__pyx_t_2);
  1410. __Pyx_XDECREF(__pyx_t_3);
  1411. __Pyx_WriteUnraisable("scattnlay.npy2c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  1412. __pyx_r = 0;
  1413. __pyx_L0:;
  1414. __Pyx_XDECREF((PyObject *)__pyx_v_a);
  1415. __Pyx_RefNannyFinishContext();
  1416. return __pyx_r;
  1417. }
  1418. /* "scattnlay.pyx":56
  1419. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int nmax, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Erx[], double Ery[], double Erz[], double Eix[], double Eiy[], double Eiz[], double Hrx[], double Hry[], double Hrz[], double Hix[], double Hiy[], double Hiz[])
  1420. *
  1421. * 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), np.int_t pl = -1, np.int_t nmax = -1): # <<<<<<<<<<<<<<
  1422. * cdef Py_ssize_t i
  1423. *
  1424. */
  1425. /* Python wrapper */
  1426. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1427. static PyMethodDef __pyx_mdef_9scattnlay_1scattnlay = {__Pyx_NAMESTR("scattnlay"), (PyCFunction)__pyx_pw_9scattnlay_1scattnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1428. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1429. PyArrayObject *__pyx_v_x = 0;
  1430. PyArrayObject *__pyx_v_m = 0;
  1431. PyArrayObject *__pyx_v_theta = 0;
  1432. __pyx_t_5numpy_int_t __pyx_v_pl;
  1433. __pyx_t_5numpy_int_t __pyx_v_nmax;
  1434. int __pyx_lineno = 0;
  1435. const char *__pyx_filename = NULL;
  1436. int __pyx_clineno = 0;
  1437. PyObject *__pyx_r = 0;
  1438. __Pyx_RefNannyDeclarations
  1439. __Pyx_RefNannySetupContext("scattnlay (wrapper)", 0);
  1440. {
  1441. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_theta,&__pyx_n_s_pl,&__pyx_n_s_nmax,0};
  1442. PyObject* values[5] = {0,0,0,0,0};
  1443. values[2] = (PyObject *)__pyx_k__2;
  1444. if (unlikely(__pyx_kwds)) {
  1445. Py_ssize_t kw_args;
  1446. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1447. switch (pos_args) {
  1448. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1449. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1450. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1451. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1452. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1453. case 0: break;
  1454. default: goto __pyx_L5_argtuple_error;
  1455. }
  1456. kw_args = PyDict_Size(__pyx_kwds);
  1457. switch (pos_args) {
  1458. case 0:
  1459. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  1460. else goto __pyx_L5_argtuple_error;
  1461. case 1:
  1462. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  1463. else {
  1464. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1465. }
  1466. case 2:
  1467. if (kw_args > 0) {
  1468. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta);
  1469. if (value) { values[2] = value; kw_args--; }
  1470. }
  1471. case 3:
  1472. if (kw_args > 0) {
  1473. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  1474. if (value) { values[3] = value; kw_args--; }
  1475. }
  1476. case 4:
  1477. if (kw_args > 0) {
  1478. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nmax);
  1479. if (value) { values[4] = value; kw_args--; }
  1480. }
  1481. }
  1482. if (unlikely(kw_args > 0)) {
  1483. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scattnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1484. }
  1485. } else {
  1486. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1487. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1488. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1489. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1490. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1491. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1492. break;
  1493. default: goto __pyx_L5_argtuple_error;
  1494. }
  1495. }
  1496. __pyx_v_x = ((PyArrayObject *)values[0]);
  1497. __pyx_v_m = ((PyArrayObject *)values[1]);
  1498. __pyx_v_theta = ((PyArrayObject *)values[2]);
  1499. if (values[3]) {
  1500. __pyx_v_pl = __Pyx_PyInt_As_npy_long(values[3]); if (unlikely((__pyx_v_pl == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1501. } else {
  1502. __pyx_v_pl = ((__pyx_t_5numpy_int_t)-1);
  1503. }
  1504. if (values[4]) {
  1505. __pyx_v_nmax = __Pyx_PyInt_As_npy_long(values[4]); if (unlikely((__pyx_v_nmax == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1506. } else {
  1507. __pyx_v_nmax = ((__pyx_t_5numpy_int_t)-1);
  1508. }
  1509. }
  1510. goto __pyx_L4_argument_unpacking_done;
  1511. __pyx_L5_argtuple_error:;
  1512. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1513. __pyx_L3_error:;
  1514. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1515. __Pyx_RefNannyFinishContext();
  1516. return NULL;
  1517. __pyx_L4_argument_unpacking_done:;
  1518. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1519. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1520. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1521. __pyx_r = __pyx_pf_9scattnlay_scattnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_theta, __pyx_v_pl, __pyx_v_nmax);
  1522. /* function exit code */
  1523. goto __pyx_L0;
  1524. __pyx_L1_error:;
  1525. __pyx_r = NULL;
  1526. __pyx_L0:;
  1527. __Pyx_RefNannyFinishContext();
  1528. return __pyx_r;
  1529. }
  1530. static PyObject *__pyx_pf_9scattnlay_scattnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_theta, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_nmax) {
  1531. Py_ssize_t __pyx_v_i;
  1532. PyArrayObject *__pyx_v_terms = 0;
  1533. PyArrayObject *__pyx_v_Qext = 0;
  1534. PyArrayObject *__pyx_v_Qabs = 0;
  1535. PyArrayObject *__pyx_v_Qsca = 0;
  1536. PyArrayObject *__pyx_v_Qbk = 0;
  1537. PyArrayObject *__pyx_v_Qpr = 0;
  1538. PyArrayObject *__pyx_v_g = 0;
  1539. PyArrayObject *__pyx_v_Albedo = 0;
  1540. PyArrayObject *__pyx_v_S1 = 0;
  1541. PyArrayObject *__pyx_v_S2 = 0;
  1542. PyArrayObject *__pyx_v_S1r = 0;
  1543. PyArrayObject *__pyx_v_S1i = 0;
  1544. PyArrayObject *__pyx_v_S2r = 0;
  1545. PyArrayObject *__pyx_v_S2i = 0;
  1546. __Pyx_LocalBuf_ND __pyx_pybuffernd_Albedo;
  1547. __Pyx_Buffer __pyx_pybuffer_Albedo;
  1548. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qabs;
  1549. __Pyx_Buffer __pyx_pybuffer_Qabs;
  1550. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qbk;
  1551. __Pyx_Buffer __pyx_pybuffer_Qbk;
  1552. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qext;
  1553. __Pyx_Buffer __pyx_pybuffer_Qext;
  1554. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qpr;
  1555. __Pyx_Buffer __pyx_pybuffer_Qpr;
  1556. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qsca;
  1557. __Pyx_Buffer __pyx_pybuffer_Qsca;
  1558. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1;
  1559. __Pyx_Buffer __pyx_pybuffer_S1;
  1560. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1i;
  1561. __Pyx_Buffer __pyx_pybuffer_S1i;
  1562. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1r;
  1563. __Pyx_Buffer __pyx_pybuffer_S1r;
  1564. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2;
  1565. __Pyx_Buffer __pyx_pybuffer_S2;
  1566. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2i;
  1567. __Pyx_Buffer __pyx_pybuffer_S2i;
  1568. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2r;
  1569. __Pyx_Buffer __pyx_pybuffer_S2r;
  1570. __Pyx_LocalBuf_ND __pyx_pybuffernd_g;
  1571. __Pyx_Buffer __pyx_pybuffer_g;
  1572. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  1573. __Pyx_Buffer __pyx_pybuffer_m;
  1574. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  1575. __Pyx_Buffer __pyx_pybuffer_terms;
  1576. __Pyx_LocalBuf_ND __pyx_pybuffernd_theta;
  1577. __Pyx_Buffer __pyx_pybuffer_theta;
  1578. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  1579. __Pyx_Buffer __pyx_pybuffer_x;
  1580. PyObject *__pyx_r = NULL;
  1581. __Pyx_RefNannyDeclarations
  1582. PyObject *__pyx_t_1 = NULL;
  1583. PyObject *__pyx_t_2 = NULL;
  1584. PyObject *__pyx_t_3 = NULL;
  1585. PyObject *__pyx_t_4 = NULL;
  1586. PyObject *__pyx_t_5 = NULL;
  1587. PyArrayObject *__pyx_t_6 = NULL;
  1588. PyArrayObject *__pyx_t_7 = NULL;
  1589. PyArrayObject *__pyx_t_8 = NULL;
  1590. PyArrayObject *__pyx_t_9 = NULL;
  1591. PyArrayObject *__pyx_t_10 = NULL;
  1592. PyArrayObject *__pyx_t_11 = NULL;
  1593. PyArrayObject *__pyx_t_12 = NULL;
  1594. PyArrayObject *__pyx_t_13 = NULL;
  1595. PyArrayObject *__pyx_t_14 = NULL;
  1596. PyArrayObject *__pyx_t_15 = NULL;
  1597. npy_intp __pyx_t_16;
  1598. Py_ssize_t __pyx_t_17;
  1599. PyArrayObject *__pyx_t_18 = NULL;
  1600. int __pyx_t_19;
  1601. PyObject *__pyx_t_20 = NULL;
  1602. PyObject *__pyx_t_21 = NULL;
  1603. PyObject *__pyx_t_22 = NULL;
  1604. PyArrayObject *__pyx_t_23 = NULL;
  1605. PyArrayObject *__pyx_t_24 = NULL;
  1606. PyArrayObject *__pyx_t_25 = NULL;
  1607. std::vector<double> __pyx_t_26;
  1608. std::vector<__pyx_t_double_complex> __pyx_t_27;
  1609. std::vector<double> __pyx_t_28;
  1610. Py_ssize_t __pyx_t_29;
  1611. Py_ssize_t __pyx_t_30;
  1612. Py_ssize_t __pyx_t_31;
  1613. Py_ssize_t __pyx_t_32;
  1614. Py_ssize_t __pyx_t_33;
  1615. Py_ssize_t __pyx_t_34;
  1616. Py_ssize_t __pyx_t_35;
  1617. Py_ssize_t __pyx_t_36;
  1618. int __pyx_lineno = 0;
  1619. const char *__pyx_filename = NULL;
  1620. int __pyx_clineno = 0;
  1621. __Pyx_RefNannySetupContext("scattnlay", 0);
  1622. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  1623. __pyx_pybuffer_terms.refcount = 0;
  1624. __pyx_pybuffernd_terms.data = NULL;
  1625. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  1626. __pyx_pybuffer_Qext.pybuffer.buf = NULL;
  1627. __pyx_pybuffer_Qext.refcount = 0;
  1628. __pyx_pybuffernd_Qext.data = NULL;
  1629. __pyx_pybuffernd_Qext.rcbuffer = &__pyx_pybuffer_Qext;
  1630. __pyx_pybuffer_Qabs.pybuffer.buf = NULL;
  1631. __pyx_pybuffer_Qabs.refcount = 0;
  1632. __pyx_pybuffernd_Qabs.data = NULL;
  1633. __pyx_pybuffernd_Qabs.rcbuffer = &__pyx_pybuffer_Qabs;
  1634. __pyx_pybuffer_Qsca.pybuffer.buf = NULL;
  1635. __pyx_pybuffer_Qsca.refcount = 0;
  1636. __pyx_pybuffernd_Qsca.data = NULL;
  1637. __pyx_pybuffernd_Qsca.rcbuffer = &__pyx_pybuffer_Qsca;
  1638. __pyx_pybuffer_Qbk.pybuffer.buf = NULL;
  1639. __pyx_pybuffer_Qbk.refcount = 0;
  1640. __pyx_pybuffernd_Qbk.data = NULL;
  1641. __pyx_pybuffernd_Qbk.rcbuffer = &__pyx_pybuffer_Qbk;
  1642. __pyx_pybuffer_Qpr.pybuffer.buf = NULL;
  1643. __pyx_pybuffer_Qpr.refcount = 0;
  1644. __pyx_pybuffernd_Qpr.data = NULL;
  1645. __pyx_pybuffernd_Qpr.rcbuffer = &__pyx_pybuffer_Qpr;
  1646. __pyx_pybuffer_g.pybuffer.buf = NULL;
  1647. __pyx_pybuffer_g.refcount = 0;
  1648. __pyx_pybuffernd_g.data = NULL;
  1649. __pyx_pybuffernd_g.rcbuffer = &__pyx_pybuffer_g;
  1650. __pyx_pybuffer_Albedo.pybuffer.buf = NULL;
  1651. __pyx_pybuffer_Albedo.refcount = 0;
  1652. __pyx_pybuffernd_Albedo.data = NULL;
  1653. __pyx_pybuffernd_Albedo.rcbuffer = &__pyx_pybuffer_Albedo;
  1654. __pyx_pybuffer_S1.pybuffer.buf = NULL;
  1655. __pyx_pybuffer_S1.refcount = 0;
  1656. __pyx_pybuffernd_S1.data = NULL;
  1657. __pyx_pybuffernd_S1.rcbuffer = &__pyx_pybuffer_S1;
  1658. __pyx_pybuffer_S2.pybuffer.buf = NULL;
  1659. __pyx_pybuffer_S2.refcount = 0;
  1660. __pyx_pybuffernd_S2.data = NULL;
  1661. __pyx_pybuffernd_S2.rcbuffer = &__pyx_pybuffer_S2;
  1662. __pyx_pybuffer_S1r.pybuffer.buf = NULL;
  1663. __pyx_pybuffer_S1r.refcount = 0;
  1664. __pyx_pybuffernd_S1r.data = NULL;
  1665. __pyx_pybuffernd_S1r.rcbuffer = &__pyx_pybuffer_S1r;
  1666. __pyx_pybuffer_S1i.pybuffer.buf = NULL;
  1667. __pyx_pybuffer_S1i.refcount = 0;
  1668. __pyx_pybuffernd_S1i.data = NULL;
  1669. __pyx_pybuffernd_S1i.rcbuffer = &__pyx_pybuffer_S1i;
  1670. __pyx_pybuffer_S2r.pybuffer.buf = NULL;
  1671. __pyx_pybuffer_S2r.refcount = 0;
  1672. __pyx_pybuffernd_S2r.data = NULL;
  1673. __pyx_pybuffernd_S2r.rcbuffer = &__pyx_pybuffer_S2r;
  1674. __pyx_pybuffer_S2i.pybuffer.buf = NULL;
  1675. __pyx_pybuffer_S2i.refcount = 0;
  1676. __pyx_pybuffernd_S2i.data = NULL;
  1677. __pyx_pybuffernd_S2i.rcbuffer = &__pyx_pybuffer_S2i;
  1678. __pyx_pybuffer_x.pybuffer.buf = NULL;
  1679. __pyx_pybuffer_x.refcount = 0;
  1680. __pyx_pybuffernd_x.data = NULL;
  1681. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  1682. __pyx_pybuffer_m.pybuffer.buf = NULL;
  1683. __pyx_pybuffer_m.refcount = 0;
  1684. __pyx_pybuffernd_m.data = NULL;
  1685. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  1686. __pyx_pybuffer_theta.pybuffer.buf = NULL;
  1687. __pyx_pybuffer_theta.refcount = 0;
  1688. __pyx_pybuffernd_theta.data = NULL;
  1689. __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta;
  1690. {
  1691. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1692. 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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1693. }
  1694. __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];
  1695. {
  1696. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1697. 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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1698. }
  1699. __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];
  1700. {
  1701. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1702. 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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1703. }
  1704. __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];
  1705. /* "scattnlay.pyx":59
  1706. * cdef Py_ssize_t i
  1707. *
  1708. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  1709. *
  1710. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1711. */
  1712. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1713. __Pyx_GOTREF(__pyx_t_1);
  1714. __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1715. __Pyx_GOTREF(__pyx_t_2);
  1716. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1717. __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1718. __Pyx_GOTREF(__pyx_t_1);
  1719. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1720. __Pyx_GOTREF(__pyx_t_3);
  1721. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1722. __Pyx_GIVEREF(__pyx_t_1);
  1723. __pyx_t_1 = 0;
  1724. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1725. __Pyx_GOTREF(__pyx_t_1);
  1726. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1727. __Pyx_GOTREF(__pyx_t_4);
  1728. __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1729. __Pyx_GOTREF(__pyx_t_5);
  1730. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1731. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1732. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1733. __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1734. __Pyx_GOTREF(__pyx_t_5);
  1735. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1736. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1737. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1738. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1739. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  1740. {
  1741. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1742. 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)) {
  1743. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  1744. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1745. } 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];
  1746. }
  1747. }
  1748. __pyx_t_6 = 0;
  1749. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  1750. __pyx_t_5 = 0;
  1751. /* "scattnlay.pyx":61
  1752. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  1753. *
  1754. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1755. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1756. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1757. */
  1758. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1759. __Pyx_GOTREF(__pyx_t_5);
  1760. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1761. __Pyx_GOTREF(__pyx_t_1);
  1762. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1763. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1764. __Pyx_GOTREF(__pyx_t_5);
  1765. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1766. __Pyx_GOTREF(__pyx_t_3);
  1767. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1768. __Pyx_GIVEREF(__pyx_t_5);
  1769. __pyx_t_5 = 0;
  1770. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1771. __Pyx_GOTREF(__pyx_t_5);
  1772. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1773. __Pyx_GOTREF(__pyx_t_2);
  1774. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1775. __Pyx_GOTREF(__pyx_t_4);
  1776. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1777. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1778. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1779. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1780. __Pyx_GOTREF(__pyx_t_4);
  1781. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1782. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1783. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1784. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1785. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  1786. {
  1787. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1788. 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)) {
  1789. __pyx_v_Qext = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf = NULL;
  1790. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1791. } 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];
  1792. }
  1793. }
  1794. __pyx_t_7 = 0;
  1795. __pyx_v_Qext = ((PyArrayObject *)__pyx_t_4);
  1796. __pyx_t_4 = 0;
  1797. /* "scattnlay.pyx":62
  1798. *
  1799. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1800. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1801. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1802. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1803. */
  1804. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1805. __Pyx_GOTREF(__pyx_t_4);
  1806. __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1807. __Pyx_GOTREF(__pyx_t_5);
  1808. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1809. __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1810. __Pyx_GOTREF(__pyx_t_4);
  1811. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1812. __Pyx_GOTREF(__pyx_t_3);
  1813. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1814. __Pyx_GIVEREF(__pyx_t_4);
  1815. __pyx_t_4 = 0;
  1816. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1817. __Pyx_GOTREF(__pyx_t_4);
  1818. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1819. __Pyx_GOTREF(__pyx_t_1);
  1820. __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1821. __Pyx_GOTREF(__pyx_t_2);
  1822. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1823. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1824. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1825. __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1826. __Pyx_GOTREF(__pyx_t_2);
  1827. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1828. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1829. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1830. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1831. __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  1832. {
  1833. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1834. 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)) {
  1835. __pyx_v_Qabs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf = NULL;
  1836. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1837. } 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];
  1838. }
  1839. }
  1840. __pyx_t_8 = 0;
  1841. __pyx_v_Qabs = ((PyArrayObject *)__pyx_t_2);
  1842. __pyx_t_2 = 0;
  1843. /* "scattnlay.pyx":63
  1844. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1845. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1846. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1847. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1848. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1849. */
  1850. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1851. __Pyx_GOTREF(__pyx_t_2);
  1852. __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1853. __Pyx_GOTREF(__pyx_t_4);
  1854. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1855. __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1856. __Pyx_GOTREF(__pyx_t_2);
  1857. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1858. __Pyx_GOTREF(__pyx_t_3);
  1859. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  1860. __Pyx_GIVEREF(__pyx_t_2);
  1861. __pyx_t_2 = 0;
  1862. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1863. __Pyx_GOTREF(__pyx_t_2);
  1864. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1865. __Pyx_GOTREF(__pyx_t_5);
  1866. __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1867. __Pyx_GOTREF(__pyx_t_1);
  1868. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1869. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1870. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1871. __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1872. __Pyx_GOTREF(__pyx_t_1);
  1873. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1874. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1875. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1876. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1877. __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
  1878. {
  1879. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1880. 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)) {
  1881. __pyx_v_Qsca = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf = NULL;
  1882. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1883. } 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];
  1884. }
  1885. }
  1886. __pyx_t_9 = 0;
  1887. __pyx_v_Qsca = ((PyArrayObject *)__pyx_t_1);
  1888. __pyx_t_1 = 0;
  1889. /* "scattnlay.pyx":64
  1890. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1891. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1892. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1893. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1894. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1895. */
  1896. __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;}
  1897. __Pyx_GOTREF(__pyx_t_1);
  1898. __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;}
  1899. __Pyx_GOTREF(__pyx_t_2);
  1900. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1901. __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1902. __Pyx_GOTREF(__pyx_t_1);
  1903. __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;}
  1904. __Pyx_GOTREF(__pyx_t_3);
  1905. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1906. __Pyx_GIVEREF(__pyx_t_1);
  1907. __pyx_t_1 = 0;
  1908. __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;}
  1909. __Pyx_GOTREF(__pyx_t_1);
  1910. __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;}
  1911. __Pyx_GOTREF(__pyx_t_4);
  1912. __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;}
  1913. __Pyx_GOTREF(__pyx_t_5);
  1914. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1915. 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;}
  1916. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1917. __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;}
  1918. __Pyx_GOTREF(__pyx_t_5);
  1919. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1920. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1921. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1922. 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;}
  1923. __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
  1924. {
  1925. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1926. 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)) {
  1927. __pyx_v_Qbk = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf = NULL;
  1928. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1929. } 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];
  1930. }
  1931. }
  1932. __pyx_t_10 = 0;
  1933. __pyx_v_Qbk = ((PyArrayObject *)__pyx_t_5);
  1934. __pyx_t_5 = 0;
  1935. /* "scattnlay.pyx":65
  1936. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1937. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1938. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1939. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1940. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1941. */
  1942. __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;}
  1943. __Pyx_GOTREF(__pyx_t_5);
  1944. __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;}
  1945. __Pyx_GOTREF(__pyx_t_1);
  1946. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1947. __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1948. __Pyx_GOTREF(__pyx_t_5);
  1949. __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;}
  1950. __Pyx_GOTREF(__pyx_t_3);
  1951. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1952. __Pyx_GIVEREF(__pyx_t_5);
  1953. __pyx_t_5 = 0;
  1954. __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;}
  1955. __Pyx_GOTREF(__pyx_t_5);
  1956. __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;}
  1957. __Pyx_GOTREF(__pyx_t_2);
  1958. __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;}
  1959. __Pyx_GOTREF(__pyx_t_4);
  1960. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1961. 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;}
  1962. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1963. __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;}
  1964. __Pyx_GOTREF(__pyx_t_4);
  1965. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1966. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1967. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1968. 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;}
  1969. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  1970. {
  1971. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1972. 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)) {
  1973. __pyx_v_Qpr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf = NULL;
  1974. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1975. } 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];
  1976. }
  1977. }
  1978. __pyx_t_11 = 0;
  1979. __pyx_v_Qpr = ((PyArrayObject *)__pyx_t_4);
  1980. __pyx_t_4 = 0;
  1981. /* "scattnlay.pyx":66
  1982. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1983. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1984. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1985. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1986. *
  1987. */
  1988. __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;}
  1989. __Pyx_GOTREF(__pyx_t_4);
  1990. __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;}
  1991. __Pyx_GOTREF(__pyx_t_5);
  1992. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1993. __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 = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1994. __Pyx_GOTREF(__pyx_t_4);
  1995. __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;}
  1996. __Pyx_GOTREF(__pyx_t_3);
  1997. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1998. __Pyx_GIVEREF(__pyx_t_4);
  1999. __pyx_t_4 = 0;
  2000. __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;}
  2001. __Pyx_GOTREF(__pyx_t_4);
  2002. __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;}
  2003. __Pyx_GOTREF(__pyx_t_1);
  2004. __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;}
  2005. __Pyx_GOTREF(__pyx_t_2);
  2006. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2007. 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;}
  2008. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2009. __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;}
  2010. __Pyx_GOTREF(__pyx_t_2);
  2011. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2012. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2013. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2014. 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;}
  2015. __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  2016. {
  2017. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2018. 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)) {
  2019. __pyx_v_g = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_g.rcbuffer->pybuffer.buf = NULL;
  2020. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2021. } 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];
  2022. }
  2023. }
  2024. __pyx_t_12 = 0;
  2025. __pyx_v_g = ((PyArrayObject *)__pyx_t_2);
  2026. __pyx_t_2 = 0;
  2027. /* "scattnlay.pyx":67
  2028. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  2029. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  2030. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2031. *
  2032. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2033. */
  2034. __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;}
  2035. __Pyx_GOTREF(__pyx_t_2);
  2036. __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;}
  2037. __Pyx_GOTREF(__pyx_t_4);
  2038. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2039. __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 = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2040. __Pyx_GOTREF(__pyx_t_2);
  2041. __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;}
  2042. __Pyx_GOTREF(__pyx_t_3);
  2043. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2044. __Pyx_GIVEREF(__pyx_t_2);
  2045. __pyx_t_2 = 0;
  2046. __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;}
  2047. __Pyx_GOTREF(__pyx_t_2);
  2048. __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;}
  2049. __Pyx_GOTREF(__pyx_t_5);
  2050. __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;}
  2051. __Pyx_GOTREF(__pyx_t_1);
  2052. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2053. 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;}
  2054. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2055. __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;}
  2056. __Pyx_GOTREF(__pyx_t_1);
  2057. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2058. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2059. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2060. 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;}
  2061. __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
  2062. {
  2063. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2064. 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)) {
  2065. __pyx_v_Albedo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf = NULL;
  2066. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2067. } 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];
  2068. }
  2069. }
  2070. __pyx_t_13 = 0;
  2071. __pyx_v_Albedo = ((PyArrayObject *)__pyx_t_1);
  2072. __pyx_t_1 = 0;
  2073. /* "scattnlay.pyx":69
  2074. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  2075. *
  2076. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2077. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2078. *
  2079. */
  2080. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2081. __Pyx_GOTREF(__pyx_t_1);
  2082. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2083. __Pyx_GOTREF(__pyx_t_2);
  2084. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2085. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2086. __Pyx_GOTREF(__pyx_t_1);
  2087. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2088. __Pyx_GOTREF(__pyx_t_3);
  2089. __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2090. __Pyx_GOTREF(__pyx_t_4);
  2091. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2092. __Pyx_GIVEREF(__pyx_t_1);
  2093. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  2094. __Pyx_GIVEREF(__pyx_t_3);
  2095. __pyx_t_1 = 0;
  2096. __pyx_t_3 = 0;
  2097. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2098. __Pyx_GOTREF(__pyx_t_3);
  2099. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2100. __Pyx_GIVEREF(__pyx_t_4);
  2101. __pyx_t_4 = 0;
  2102. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2103. __Pyx_GOTREF(__pyx_t_4);
  2104. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2105. __Pyx_GOTREF(__pyx_t_1);
  2106. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2107. __Pyx_GOTREF(__pyx_t_5);
  2108. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2109. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2110. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2111. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2112. __Pyx_GOTREF(__pyx_t_5);
  2113. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2114. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2115. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2116. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2117. __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
  2118. {
  2119. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2120. 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)) {
  2121. __pyx_v_S1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S1.rcbuffer->pybuffer.buf = NULL;
  2122. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2123. } 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];
  2124. }
  2125. }
  2126. __pyx_t_14 = 0;
  2127. __pyx_v_S1 = ((PyArrayObject *)__pyx_t_5);
  2128. __pyx_t_5 = 0;
  2129. /* "scattnlay.pyx":70
  2130. *
  2131. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2132. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2133. *
  2134. * cdef np.ndarray[np.float64_t, ndim = 1] S1r
  2135. */
  2136. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2137. __Pyx_GOTREF(__pyx_t_5);
  2138. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2139. __Pyx_GOTREF(__pyx_t_4);
  2140. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2141. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2142. __Pyx_GOTREF(__pyx_t_5);
  2143. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2144. __Pyx_GOTREF(__pyx_t_3);
  2145. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2146. __Pyx_GOTREF(__pyx_t_2);
  2147. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2148. __Pyx_GIVEREF(__pyx_t_5);
  2149. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2150. __Pyx_GIVEREF(__pyx_t_3);
  2151. __pyx_t_5 = 0;
  2152. __pyx_t_3 = 0;
  2153. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2154. __Pyx_GOTREF(__pyx_t_3);
  2155. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2156. __Pyx_GIVEREF(__pyx_t_2);
  2157. __pyx_t_2 = 0;
  2158. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2159. __Pyx_GOTREF(__pyx_t_2);
  2160. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2161. __Pyx_GOTREF(__pyx_t_5);
  2162. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2163. __Pyx_GOTREF(__pyx_t_1);
  2164. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2165. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2166. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2167. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2168. __Pyx_GOTREF(__pyx_t_1);
  2169. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2170. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2171. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2172. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2173. __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
  2174. {
  2175. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2176. 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)) {
  2177. __pyx_v_S2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S2.rcbuffer->pybuffer.buf = NULL;
  2178. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2179. } 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];
  2180. }
  2181. }
  2182. __pyx_t_15 = 0;
  2183. __pyx_v_S2 = ((PyArrayObject *)__pyx_t_1);
  2184. __pyx_t_1 = 0;
  2185. /* "scattnlay.pyx":77
  2186. * cdef np.ndarray[np.float64_t, ndim = 1] S2i
  2187. *
  2188. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  2189. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2190. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2191. */
  2192. __pyx_t_16 = (__pyx_v_x->dimensions[0]);
  2193. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  2194. __pyx_v_i = __pyx_t_17;
  2195. /* "scattnlay.pyx":78
  2196. *
  2197. * for i in range(x.shape[0]):
  2198. * S1r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2199. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2200. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2201. */
  2202. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2203. __Pyx_GOTREF(__pyx_t_1);
  2204. __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2205. __Pyx_GOTREF(__pyx_t_2);
  2206. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2207. __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2208. __Pyx_GOTREF(__pyx_t_1);
  2209. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2210. __Pyx_GOTREF(__pyx_t_3);
  2211. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2212. __Pyx_GIVEREF(__pyx_t_1);
  2213. __pyx_t_1 = 0;
  2214. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2215. __Pyx_GOTREF(__pyx_t_1);
  2216. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2217. __Pyx_GOTREF(__pyx_t_4);
  2218. __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2219. __Pyx_GOTREF(__pyx_t_5);
  2220. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2221. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2222. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2223. __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2224. __Pyx_GOTREF(__pyx_t_5);
  2225. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2226. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2227. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2228. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2229. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  2230. {
  2231. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2232. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2233. __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);
  2234. if (unlikely(__pyx_t_19 < 0)) {
  2235. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2236. 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)) {
  2237. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2238. __Pyx_RaiseBufferFallbackError();
  2239. } else {
  2240. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2241. }
  2242. }
  2243. __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];
  2244. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2245. }
  2246. __pyx_t_18 = 0;
  2247. __Pyx_XDECREF_SET(__pyx_v_S1r, ((PyArrayObject *)__pyx_t_5));
  2248. __pyx_t_5 = 0;
  2249. /* "scattnlay.pyx":79
  2250. * for i in range(x.shape[0]):
  2251. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2252. * S1i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2253. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2254. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2255. */
  2256. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2257. __Pyx_GOTREF(__pyx_t_5);
  2258. __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2259. __Pyx_GOTREF(__pyx_t_1);
  2260. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2261. __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2262. __Pyx_GOTREF(__pyx_t_5);
  2263. __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;}
  2264. __Pyx_GOTREF(__pyx_t_3);
  2265. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  2266. __Pyx_GIVEREF(__pyx_t_5);
  2267. __pyx_t_5 = 0;
  2268. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2269. __Pyx_GOTREF(__pyx_t_5);
  2270. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2271. __Pyx_GOTREF(__pyx_t_2);
  2272. __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2273. __Pyx_GOTREF(__pyx_t_4);
  2274. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2275. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2276. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2277. __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2278. __Pyx_GOTREF(__pyx_t_4);
  2279. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2280. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2281. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2282. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2283. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  2284. {
  2285. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2286. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2287. __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);
  2288. if (unlikely(__pyx_t_19 < 0)) {
  2289. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2290. 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)) {
  2291. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2292. __Pyx_RaiseBufferFallbackError();
  2293. } else {
  2294. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2295. }
  2296. }
  2297. __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];
  2298. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2299. }
  2300. __pyx_t_23 = 0;
  2301. __Pyx_XDECREF_SET(__pyx_v_S1i, ((PyArrayObject *)__pyx_t_4));
  2302. __pyx_t_4 = 0;
  2303. /* "scattnlay.pyx":80
  2304. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2305. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2306. * S2r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2307. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2308. *
  2309. */
  2310. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2311. __Pyx_GOTREF(__pyx_t_4);
  2312. __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2313. __Pyx_GOTREF(__pyx_t_5);
  2314. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2315. __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2316. __Pyx_GOTREF(__pyx_t_4);
  2317. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2318. __Pyx_GOTREF(__pyx_t_3);
  2319. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2320. __Pyx_GIVEREF(__pyx_t_4);
  2321. __pyx_t_4 = 0;
  2322. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2323. __Pyx_GOTREF(__pyx_t_4);
  2324. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2325. __Pyx_GOTREF(__pyx_t_1);
  2326. __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2327. __Pyx_GOTREF(__pyx_t_2);
  2328. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2329. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2330. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2331. __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2332. __Pyx_GOTREF(__pyx_t_2);
  2333. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2334. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2335. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2336. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2337. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  2338. {
  2339. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2340. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2341. __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);
  2342. if (unlikely(__pyx_t_19 < 0)) {
  2343. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2344. 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)) {
  2345. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2346. __Pyx_RaiseBufferFallbackError();
  2347. } else {
  2348. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2349. }
  2350. }
  2351. __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];
  2352. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2353. }
  2354. __pyx_t_24 = 0;
  2355. __Pyx_XDECREF_SET(__pyx_v_S2r, ((PyArrayObject *)__pyx_t_2));
  2356. __pyx_t_2 = 0;
  2357. /* "scattnlay.pyx":81
  2358. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2359. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2360. * S2i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2361. *
  2362. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), nmax, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2363. */
  2364. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2365. __Pyx_GOTREF(__pyx_t_2);
  2366. __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2367. __Pyx_GOTREF(__pyx_t_4);
  2368. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2369. __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2370. __Pyx_GOTREF(__pyx_t_2);
  2371. __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;}
  2372. __Pyx_GOTREF(__pyx_t_3);
  2373. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2374. __Pyx_GIVEREF(__pyx_t_2);
  2375. __pyx_t_2 = 0;
  2376. __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;}
  2377. __Pyx_GOTREF(__pyx_t_2);
  2378. __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;}
  2379. __Pyx_GOTREF(__pyx_t_5);
  2380. __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2381. __Pyx_GOTREF(__pyx_t_1);
  2382. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2383. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2384. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2385. __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2386. __Pyx_GOTREF(__pyx_t_1);
  2387. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2388. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2389. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2390. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2391. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  2392. {
  2393. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2394. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2395. __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);
  2396. if (unlikely(__pyx_t_19 < 0)) {
  2397. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2398. 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)) {
  2399. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2400. __Pyx_RaiseBufferFallbackError();
  2401. } else {
  2402. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2403. }
  2404. }
  2405. __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];
  2406. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2407. }
  2408. __pyx_t_25 = 0;
  2409. __Pyx_XDECREF_SET(__pyx_v_S2i, ((PyArrayObject *)__pyx_t_1));
  2410. __pyx_t_1 = 0;
  2411. /* "scattnlay.pyx":83
  2412. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2413. *
  2414. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), nmax, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  2415. *
  2416. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2417. */
  2418. __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2419. __Pyx_GOTREF(__pyx_t_1);
  2420. __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2421. __Pyx_GOTREF(__pyx_t_2);
  2422. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2423. __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2424. __Pyx_GOTREF(__pyx_t_1);
  2425. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2426. __pyx_t_26 = __pyx_convert_vector_from_py_double(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2427. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2428. __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2429. __Pyx_GOTREF(__pyx_t_1);
  2430. __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2431. __Pyx_GOTREF(__pyx_t_2);
  2432. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2433. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2434. __Pyx_GOTREF(__pyx_t_1);
  2435. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2436. __pyx_t_27 = __pyx_convert_vector_from_py___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2437. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2438. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_theta), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2439. __Pyx_GOTREF(__pyx_t_1);
  2440. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2441. __Pyx_GOTREF(__pyx_t_2);
  2442. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2443. __pyx_t_28 = __pyx_convert_vector_from_py_double(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2444. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2445. __pyx_t_29 = __pyx_v_i;
  2446. __pyx_t_19 = -1;
  2447. if (__pyx_t_29 < 0) {
  2448. __pyx_t_29 += __pyx_pybuffernd_Qext.diminfo[0].shape;
  2449. if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
  2450. } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_Qext.diminfo[0].shape)) __pyx_t_19 = 0;
  2451. if (unlikely(__pyx_t_19 != -1)) {
  2452. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2453. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2454. }
  2455. __pyx_t_30 = __pyx_v_i;
  2456. __pyx_t_19 = -1;
  2457. if (__pyx_t_30 < 0) {
  2458. __pyx_t_30 += __pyx_pybuffernd_Qsca.diminfo[0].shape;
  2459. if (unlikely(__pyx_t_30 < 0)) __pyx_t_19 = 0;
  2460. } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_Qsca.diminfo[0].shape)) __pyx_t_19 = 0;
  2461. if (unlikely(__pyx_t_19 != -1)) {
  2462. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2463. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2464. }
  2465. __pyx_t_31 = __pyx_v_i;
  2466. __pyx_t_19 = -1;
  2467. if (__pyx_t_31 < 0) {
  2468. __pyx_t_31 += __pyx_pybuffernd_Qabs.diminfo[0].shape;
  2469. if (unlikely(__pyx_t_31 < 0)) __pyx_t_19 = 0;
  2470. } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_Qabs.diminfo[0].shape)) __pyx_t_19 = 0;
  2471. if (unlikely(__pyx_t_19 != -1)) {
  2472. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2473. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2474. }
  2475. __pyx_t_32 = __pyx_v_i;
  2476. __pyx_t_19 = -1;
  2477. if (__pyx_t_32 < 0) {
  2478. __pyx_t_32 += __pyx_pybuffernd_Qbk.diminfo[0].shape;
  2479. if (unlikely(__pyx_t_32 < 0)) __pyx_t_19 = 0;
  2480. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_Qbk.diminfo[0].shape)) __pyx_t_19 = 0;
  2481. if (unlikely(__pyx_t_19 != -1)) {
  2482. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2483. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2484. }
  2485. __pyx_t_33 = __pyx_v_i;
  2486. __pyx_t_19 = -1;
  2487. if (__pyx_t_33 < 0) {
  2488. __pyx_t_33 += __pyx_pybuffernd_Qpr.diminfo[0].shape;
  2489. if (unlikely(__pyx_t_33 < 0)) __pyx_t_19 = 0;
  2490. } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_Qpr.diminfo[0].shape)) __pyx_t_19 = 0;
  2491. if (unlikely(__pyx_t_19 != -1)) {
  2492. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2493. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2494. }
  2495. __pyx_t_34 = __pyx_v_i;
  2496. __pyx_t_19 = -1;
  2497. if (__pyx_t_34 < 0) {
  2498. __pyx_t_34 += __pyx_pybuffernd_g.diminfo[0].shape;
  2499. if (unlikely(__pyx_t_34 < 0)) __pyx_t_19 = 0;
  2500. } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_g.diminfo[0].shape)) __pyx_t_19 = 0;
  2501. if (unlikely(__pyx_t_19 != -1)) {
  2502. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2503. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2504. }
  2505. __pyx_t_35 = __pyx_v_i;
  2506. __pyx_t_19 = -1;
  2507. if (__pyx_t_35 < 0) {
  2508. __pyx_t_35 += __pyx_pybuffernd_Albedo.diminfo[0].shape;
  2509. if (unlikely(__pyx_t_35 < 0)) __pyx_t_19 = 0;
  2510. } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_Albedo.diminfo[0].shape)) __pyx_t_19 = 0;
  2511. if (unlikely(__pyx_t_19 != -1)) {
  2512. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2513. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2514. }
  2515. __pyx_t_36 = __pyx_v_i;
  2516. __pyx_t_19 = -1;
  2517. if (__pyx_t_36 < 0) {
  2518. __pyx_t_36 += __pyx_pybuffernd_terms.diminfo[0].shape;
  2519. if (unlikely(__pyx_t_36 < 0)) __pyx_t_19 = 0;
  2520. } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_19 = 0;
  2521. if (unlikely(__pyx_t_19 != -1)) {
  2522. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2523. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2524. }
  2525. *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_terms.diminfo[0].strides) = nMie((__pyx_v_x->dimensions[1]), __pyx_v_pl, __pyx_t_26, __pyx_t_27, (__pyx_v_theta->dimensions[0]), __pyx_t_28, __pyx_v_nmax, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_Qext.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_Qsca.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_Qabs.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_Qbk.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_Qpr.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_g.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_g.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf, __pyx_t_35, __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)));
  2526. /* "scattnlay.pyx":85
  2527. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), nmax, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2528. *
  2529. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  2530. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2531. *
  2532. */
  2533. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1r), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2534. __Pyx_GOTREF(__pyx_t_2);
  2535. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2536. __Pyx_GOTREF(__pyx_t_1);
  2537. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2538. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2539. __Pyx_GOTREF(__pyx_t_2);
  2540. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1i), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2541. __Pyx_GOTREF(__pyx_t_3);
  2542. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2543. __Pyx_GOTREF(__pyx_t_4);
  2544. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2545. __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2546. __Pyx_GOTREF(__pyx_t_3);
  2547. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2548. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2549. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2550. __Pyx_GOTREF(__pyx_t_4);
  2551. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2552. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2553. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S1), __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2554. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2555. /* "scattnlay.pyx":86
  2556. *
  2557. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2558. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  2559. *
  2560. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2561. */
  2562. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2r), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2563. __Pyx_GOTREF(__pyx_t_4);
  2564. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2565. __Pyx_GOTREF(__pyx_t_3);
  2566. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2567. __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2568. __Pyx_GOTREF(__pyx_t_4);
  2569. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2i), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2570. __Pyx_GOTREF(__pyx_t_1);
  2571. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2572. __Pyx_GOTREF(__pyx_t_2);
  2573. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2574. __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2575. __Pyx_GOTREF(__pyx_t_1);
  2576. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2577. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2578. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2579. __Pyx_GOTREF(__pyx_t_2);
  2580. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2581. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2582. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S2), __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2583. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2584. }
  2585. /* "scattnlay.pyx":88
  2586. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2587. *
  2588. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 # <<<<<<<<<<<<<<
  2589. *
  2590. * #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), np.int_t pl = 0, np.int_t nmax = 0):
  2591. */
  2592. __Pyx_XDECREF(__pyx_r);
  2593. __pyx_t_2 = PyTuple_New(10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2594. __Pyx_GOTREF(__pyx_t_2);
  2595. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  2596. PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_terms));
  2597. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  2598. __Pyx_INCREF(((PyObject *)__pyx_v_Qext));
  2599. PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Qext));
  2600. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qext));
  2601. __Pyx_INCREF(((PyObject *)__pyx_v_Qsca));
  2602. PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_Qsca));
  2603. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qsca));
  2604. __Pyx_INCREF(((PyObject *)__pyx_v_Qabs));
  2605. PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_Qabs));
  2606. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qabs));
  2607. __Pyx_INCREF(((PyObject *)__pyx_v_Qbk));
  2608. PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_Qbk));
  2609. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qbk));
  2610. __Pyx_INCREF(((PyObject *)__pyx_v_Qpr));
  2611. PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_v_Qpr));
  2612. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qpr));
  2613. __Pyx_INCREF(((PyObject *)__pyx_v_g));
  2614. PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_v_g));
  2615. __Pyx_GIVEREF(((PyObject *)__pyx_v_g));
  2616. __Pyx_INCREF(((PyObject *)__pyx_v_Albedo));
  2617. PyTuple_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_v_Albedo));
  2618. __Pyx_GIVEREF(((PyObject *)__pyx_v_Albedo));
  2619. __Pyx_INCREF(((PyObject *)__pyx_v_S1));
  2620. PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_S1));
  2621. __Pyx_GIVEREF(((PyObject *)__pyx_v_S1));
  2622. __Pyx_INCREF(((PyObject *)__pyx_v_S2));
  2623. PyTuple_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_v_S2));
  2624. __Pyx_GIVEREF(((PyObject *)__pyx_v_S2));
  2625. __pyx_r = __pyx_t_2;
  2626. __pyx_t_2 = 0;
  2627. goto __pyx_L0;
  2628. /* "scattnlay.pyx":56
  2629. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int nmax, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Erx[], double Ery[], double Erz[], double Eix[], double Eiy[], double Eiz[], double Hrx[], double Hry[], double Hrz[], double Hix[], double Hiy[], double Hiz[])
  2630. *
  2631. * 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), np.int_t pl = -1, np.int_t nmax = -1): # <<<<<<<<<<<<<<
  2632. * cdef Py_ssize_t i
  2633. *
  2634. */
  2635. /* function exit code */
  2636. __pyx_L1_error:;
  2637. __Pyx_XDECREF(__pyx_t_1);
  2638. __Pyx_XDECREF(__pyx_t_2);
  2639. __Pyx_XDECREF(__pyx_t_3);
  2640. __Pyx_XDECREF(__pyx_t_4);
  2641. __Pyx_XDECREF(__pyx_t_5);
  2642. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  2643. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  2644. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2645. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2646. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2647. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2648. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2649. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2650. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2651. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2652. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2653. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2654. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2655. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2656. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2657. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2658. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2659. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2660. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2661. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  2662. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2663. __pyx_r = NULL;
  2664. goto __pyx_L2;
  2665. __pyx_L0:;
  2666. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2667. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2668. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2669. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2670. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2671. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2672. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2673. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2674. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2675. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2676. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2677. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2678. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2679. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2680. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2681. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2682. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2683. __pyx_L2:;
  2684. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  2685. __Pyx_XDECREF((PyObject *)__pyx_v_Qext);
  2686. __Pyx_XDECREF((PyObject *)__pyx_v_Qabs);
  2687. __Pyx_XDECREF((PyObject *)__pyx_v_Qsca);
  2688. __Pyx_XDECREF((PyObject *)__pyx_v_Qbk);
  2689. __Pyx_XDECREF((PyObject *)__pyx_v_Qpr);
  2690. __Pyx_XDECREF((PyObject *)__pyx_v_g);
  2691. __Pyx_XDECREF((PyObject *)__pyx_v_Albedo);
  2692. __Pyx_XDECREF((PyObject *)__pyx_v_S1);
  2693. __Pyx_XDECREF((PyObject *)__pyx_v_S2);
  2694. __Pyx_XDECREF((PyObject *)__pyx_v_S1r);
  2695. __Pyx_XDECREF((PyObject *)__pyx_v_S1i);
  2696. __Pyx_XDECREF((PyObject *)__pyx_v_S2r);
  2697. __Pyx_XDECREF((PyObject *)__pyx_v_S2i);
  2698. __Pyx_XGIVEREF(__pyx_r);
  2699. __Pyx_RefNannyFinishContext();
  2700. return __pyx_r;
  2701. }
  2702. /* "scattnlay.pyx":91
  2703. *
  2704. * #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), np.int_t pl = 0, np.int_t nmax = 0):
  2705. * 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.int_t pl = 0, np.int_t nmax = 0): # <<<<<<<<<<<<<<
  2706. * cdef Py_ssize_t i
  2707. *
  2708. */
  2709. /* Python wrapper */
  2710. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2711. static PyMethodDef __pyx_mdef_9scattnlay_3fieldnlay = {__Pyx_NAMESTR("fieldnlay"), (PyCFunction)__pyx_pw_9scattnlay_3fieldnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2712. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2713. PyArrayObject *__pyx_v_x = 0;
  2714. PyArrayObject *__pyx_v_m = 0;
  2715. PyArrayObject *__pyx_v_coords = 0;
  2716. __pyx_t_5numpy_int_t __pyx_v_pl;
  2717. __pyx_t_5numpy_int_t __pyx_v_nmax;
  2718. int __pyx_lineno = 0;
  2719. const char *__pyx_filename = NULL;
  2720. int __pyx_clineno = 0;
  2721. PyObject *__pyx_r = 0;
  2722. __Pyx_RefNannyDeclarations
  2723. __Pyx_RefNannySetupContext("fieldnlay (wrapper)", 0);
  2724. {
  2725. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_coords,&__pyx_n_s_pl,&__pyx_n_s_nmax,0};
  2726. PyObject* values[5] = {0,0,0,0,0};
  2727. if (unlikely(__pyx_kwds)) {
  2728. Py_ssize_t kw_args;
  2729. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2730. switch (pos_args) {
  2731. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2732. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2733. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2734. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2735. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2736. case 0: break;
  2737. default: goto __pyx_L5_argtuple_error;
  2738. }
  2739. kw_args = PyDict_Size(__pyx_kwds);
  2740. switch (pos_args) {
  2741. case 0:
  2742. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  2743. else goto __pyx_L5_argtuple_error;
  2744. case 1:
  2745. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  2746. else {
  2747. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2748. }
  2749. case 2:
  2750. if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
  2751. else {
  2752. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2753. }
  2754. case 3:
  2755. if (kw_args > 0) {
  2756. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  2757. if (value) { values[3] = value; kw_args--; }
  2758. }
  2759. case 4:
  2760. if (kw_args > 0) {
  2761. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nmax);
  2762. if (value) { values[4] = value; kw_args--; }
  2763. }
  2764. }
  2765. if (unlikely(kw_args > 0)) {
  2766. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fieldnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2767. }
  2768. } else {
  2769. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2770. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2771. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2772. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2773. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2774. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2775. break;
  2776. default: goto __pyx_L5_argtuple_error;
  2777. }
  2778. }
  2779. __pyx_v_x = ((PyArrayObject *)values[0]);
  2780. __pyx_v_m = ((PyArrayObject *)values[1]);
  2781. __pyx_v_coords = ((PyArrayObject *)values[2]);
  2782. if (values[3]) {
  2783. __pyx_v_pl = __Pyx_PyInt_As_npy_long(values[3]); if (unlikely((__pyx_v_pl == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2784. } else {
  2785. __pyx_v_pl = ((__pyx_t_5numpy_int_t)0);
  2786. }
  2787. if (values[4]) {
  2788. __pyx_v_nmax = __Pyx_PyInt_As_npy_long(values[4]); if (unlikely((__pyx_v_nmax == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2789. } else {
  2790. __pyx_v_nmax = ((__pyx_t_5numpy_int_t)0);
  2791. }
  2792. }
  2793. goto __pyx_L4_argument_unpacking_done;
  2794. __pyx_L5_argtuple_error:;
  2795. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2796. __pyx_L3_error:;
  2797. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2798. __Pyx_RefNannyFinishContext();
  2799. return NULL;
  2800. __pyx_L4_argument_unpacking_done:;
  2801. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2802. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2803. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2804. __pyx_r = __pyx_pf_9scattnlay_2fieldnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_coords, __pyx_v_pl, __pyx_v_nmax);
  2805. /* function exit code */
  2806. goto __pyx_L0;
  2807. __pyx_L1_error:;
  2808. __pyx_r = NULL;
  2809. __pyx_L0:;
  2810. __Pyx_RefNannyFinishContext();
  2811. return __pyx_r;
  2812. }
  2813. static PyObject *__pyx_pf_9scattnlay_2fieldnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_coords, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_nmax) {
  2814. Py_ssize_t __pyx_v_i;
  2815. PyArrayObject *__pyx_v_terms = 0;
  2816. PyArrayObject *__pyx_v_E = 0;
  2817. PyArrayObject *__pyx_v_H = 0;
  2818. PyArrayObject *__pyx_v_Erx = 0;
  2819. PyArrayObject *__pyx_v_Ery = 0;
  2820. PyArrayObject *__pyx_v_Erz = 0;
  2821. PyArrayObject *__pyx_v_Eix = 0;
  2822. PyArrayObject *__pyx_v_Eiy = 0;
  2823. PyArrayObject *__pyx_v_Eiz = 0;
  2824. PyArrayObject *__pyx_v_Hrx = 0;
  2825. PyArrayObject *__pyx_v_Hry = 0;
  2826. PyArrayObject *__pyx_v_Hrz = 0;
  2827. PyArrayObject *__pyx_v_Hix = 0;
  2828. PyArrayObject *__pyx_v_Hiy = 0;
  2829. PyArrayObject *__pyx_v_Hiz = 0;
  2830. __Pyx_LocalBuf_ND __pyx_pybuffernd_E;
  2831. __Pyx_Buffer __pyx_pybuffer_E;
  2832. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eix;
  2833. __Pyx_Buffer __pyx_pybuffer_Eix;
  2834. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eiy;
  2835. __Pyx_Buffer __pyx_pybuffer_Eiy;
  2836. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eiz;
  2837. __Pyx_Buffer __pyx_pybuffer_Eiz;
  2838. __Pyx_LocalBuf_ND __pyx_pybuffernd_Erx;
  2839. __Pyx_Buffer __pyx_pybuffer_Erx;
  2840. __Pyx_LocalBuf_ND __pyx_pybuffernd_Ery;
  2841. __Pyx_Buffer __pyx_pybuffer_Ery;
  2842. __Pyx_LocalBuf_ND __pyx_pybuffernd_Erz;
  2843. __Pyx_Buffer __pyx_pybuffer_Erz;
  2844. __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
  2845. __Pyx_Buffer __pyx_pybuffer_H;
  2846. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hix;
  2847. __Pyx_Buffer __pyx_pybuffer_Hix;
  2848. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hiy;
  2849. __Pyx_Buffer __pyx_pybuffer_Hiy;
  2850. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hiz;
  2851. __Pyx_Buffer __pyx_pybuffer_Hiz;
  2852. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hrx;
  2853. __Pyx_Buffer __pyx_pybuffer_Hrx;
  2854. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hry;
  2855. __Pyx_Buffer __pyx_pybuffer_Hry;
  2856. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hrz;
  2857. __Pyx_Buffer __pyx_pybuffer_Hrz;
  2858. __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  2859. __Pyx_Buffer __pyx_pybuffer_coords;
  2860. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  2861. __Pyx_Buffer __pyx_pybuffer_m;
  2862. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  2863. __Pyx_Buffer __pyx_pybuffer_terms;
  2864. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  2865. __Pyx_Buffer __pyx_pybuffer_x;
  2866. PyObject *__pyx_r = NULL;
  2867. __Pyx_RefNannyDeclarations
  2868. PyObject *__pyx_t_1 = NULL;
  2869. PyObject *__pyx_t_2 = NULL;
  2870. PyObject *__pyx_t_3 = NULL;
  2871. PyObject *__pyx_t_4 = NULL;
  2872. PyObject *__pyx_t_5 = NULL;
  2873. PyArrayObject *__pyx_t_6 = NULL;
  2874. PyArrayObject *__pyx_t_7 = NULL;
  2875. PyArrayObject *__pyx_t_8 = NULL;
  2876. npy_intp __pyx_t_9;
  2877. Py_ssize_t __pyx_t_10;
  2878. PyArrayObject *__pyx_t_11 = NULL;
  2879. int __pyx_t_12;
  2880. PyObject *__pyx_t_13 = NULL;
  2881. PyObject *__pyx_t_14 = NULL;
  2882. PyObject *__pyx_t_15 = NULL;
  2883. PyArrayObject *__pyx_t_16 = NULL;
  2884. PyArrayObject *__pyx_t_17 = NULL;
  2885. PyArrayObject *__pyx_t_18 = NULL;
  2886. PyArrayObject *__pyx_t_19 = NULL;
  2887. PyArrayObject *__pyx_t_20 = NULL;
  2888. PyArrayObject *__pyx_t_21 = NULL;
  2889. PyArrayObject *__pyx_t_22 = NULL;
  2890. PyArrayObject *__pyx_t_23 = NULL;
  2891. PyArrayObject *__pyx_t_24 = NULL;
  2892. PyArrayObject *__pyx_t_25 = NULL;
  2893. PyArrayObject *__pyx_t_26 = NULL;
  2894. std::vector<double> __pyx_t_27;
  2895. std::vector<__pyx_t_double_complex> __pyx_t_28;
  2896. std::vector<double> __pyx_t_29;
  2897. std::vector<double> __pyx_t_30;
  2898. std::vector<double> __pyx_t_31;
  2899. Py_ssize_t __pyx_t_32;
  2900. PyObject *__pyx_t_33 = NULL;
  2901. PyObject *__pyx_t_34 = NULL;
  2902. int __pyx_lineno = 0;
  2903. const char *__pyx_filename = NULL;
  2904. int __pyx_clineno = 0;
  2905. __Pyx_RefNannySetupContext("fieldnlay", 0);
  2906. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  2907. __pyx_pybuffer_terms.refcount = 0;
  2908. __pyx_pybuffernd_terms.data = NULL;
  2909. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  2910. __pyx_pybuffer_E.pybuffer.buf = NULL;
  2911. __pyx_pybuffer_E.refcount = 0;
  2912. __pyx_pybuffernd_E.data = NULL;
  2913. __pyx_pybuffernd_E.rcbuffer = &__pyx_pybuffer_E;
  2914. __pyx_pybuffer_H.pybuffer.buf = NULL;
  2915. __pyx_pybuffer_H.refcount = 0;
  2916. __pyx_pybuffernd_H.data = NULL;
  2917. __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
  2918. __pyx_pybuffer_Erx.pybuffer.buf = NULL;
  2919. __pyx_pybuffer_Erx.refcount = 0;
  2920. __pyx_pybuffernd_Erx.data = NULL;
  2921. __pyx_pybuffernd_Erx.rcbuffer = &__pyx_pybuffer_Erx;
  2922. __pyx_pybuffer_Ery.pybuffer.buf = NULL;
  2923. __pyx_pybuffer_Ery.refcount = 0;
  2924. __pyx_pybuffernd_Ery.data = NULL;
  2925. __pyx_pybuffernd_Ery.rcbuffer = &__pyx_pybuffer_Ery;
  2926. __pyx_pybuffer_Erz.pybuffer.buf = NULL;
  2927. __pyx_pybuffer_Erz.refcount = 0;
  2928. __pyx_pybuffernd_Erz.data = NULL;
  2929. __pyx_pybuffernd_Erz.rcbuffer = &__pyx_pybuffer_Erz;
  2930. __pyx_pybuffer_Eix.pybuffer.buf = NULL;
  2931. __pyx_pybuffer_Eix.refcount = 0;
  2932. __pyx_pybuffernd_Eix.data = NULL;
  2933. __pyx_pybuffernd_Eix.rcbuffer = &__pyx_pybuffer_Eix;
  2934. __pyx_pybuffer_Eiy.pybuffer.buf = NULL;
  2935. __pyx_pybuffer_Eiy.refcount = 0;
  2936. __pyx_pybuffernd_Eiy.data = NULL;
  2937. __pyx_pybuffernd_Eiy.rcbuffer = &__pyx_pybuffer_Eiy;
  2938. __pyx_pybuffer_Eiz.pybuffer.buf = NULL;
  2939. __pyx_pybuffer_Eiz.refcount = 0;
  2940. __pyx_pybuffernd_Eiz.data = NULL;
  2941. __pyx_pybuffernd_Eiz.rcbuffer = &__pyx_pybuffer_Eiz;
  2942. __pyx_pybuffer_Hrx.pybuffer.buf = NULL;
  2943. __pyx_pybuffer_Hrx.refcount = 0;
  2944. __pyx_pybuffernd_Hrx.data = NULL;
  2945. __pyx_pybuffernd_Hrx.rcbuffer = &__pyx_pybuffer_Hrx;
  2946. __pyx_pybuffer_Hry.pybuffer.buf = NULL;
  2947. __pyx_pybuffer_Hry.refcount = 0;
  2948. __pyx_pybuffernd_Hry.data = NULL;
  2949. __pyx_pybuffernd_Hry.rcbuffer = &__pyx_pybuffer_Hry;
  2950. __pyx_pybuffer_Hrz.pybuffer.buf = NULL;
  2951. __pyx_pybuffer_Hrz.refcount = 0;
  2952. __pyx_pybuffernd_Hrz.data = NULL;
  2953. __pyx_pybuffernd_Hrz.rcbuffer = &__pyx_pybuffer_Hrz;
  2954. __pyx_pybuffer_Hix.pybuffer.buf = NULL;
  2955. __pyx_pybuffer_Hix.refcount = 0;
  2956. __pyx_pybuffernd_Hix.data = NULL;
  2957. __pyx_pybuffernd_Hix.rcbuffer = &__pyx_pybuffer_Hix;
  2958. __pyx_pybuffer_Hiy.pybuffer.buf = NULL;
  2959. __pyx_pybuffer_Hiy.refcount = 0;
  2960. __pyx_pybuffernd_Hiy.data = NULL;
  2961. __pyx_pybuffernd_Hiy.rcbuffer = &__pyx_pybuffer_Hiy;
  2962. __pyx_pybuffer_Hiz.pybuffer.buf = NULL;
  2963. __pyx_pybuffer_Hiz.refcount = 0;
  2964. __pyx_pybuffernd_Hiz.data = NULL;
  2965. __pyx_pybuffernd_Hiz.rcbuffer = &__pyx_pybuffer_Hiz;
  2966. __pyx_pybuffer_x.pybuffer.buf = NULL;
  2967. __pyx_pybuffer_x.refcount = 0;
  2968. __pyx_pybuffernd_x.data = NULL;
  2969. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  2970. __pyx_pybuffer_m.pybuffer.buf = NULL;
  2971. __pyx_pybuffer_m.refcount = 0;
  2972. __pyx_pybuffernd_m.data = NULL;
  2973. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  2974. __pyx_pybuffer_coords.pybuffer.buf = NULL;
  2975. __pyx_pybuffer_coords.refcount = 0;
  2976. __pyx_pybuffernd_coords.data = NULL;
  2977. __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
  2978. {
  2979. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2980. 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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2981. }
  2982. __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];
  2983. {
  2984. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2985. 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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2986. }
  2987. __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];
  2988. {
  2989. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2990. 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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2991. }
  2992. __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];
  2993. /* "scattnlay.pyx":94
  2994. * cdef Py_ssize_t i
  2995. *
  2996. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  2997. *
  2998. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  2999. */
  3000. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3001. __Pyx_GOTREF(__pyx_t_1);
  3002. __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3003. __Pyx_GOTREF(__pyx_t_2);
  3004. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3005. __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3006. __Pyx_GOTREF(__pyx_t_1);
  3007. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3008. __Pyx_GOTREF(__pyx_t_3);
  3009. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3010. __Pyx_GIVEREF(__pyx_t_1);
  3011. __pyx_t_1 = 0;
  3012. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3013. __Pyx_GOTREF(__pyx_t_1);
  3014. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3015. __Pyx_GOTREF(__pyx_t_4);
  3016. __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3017. __Pyx_GOTREF(__pyx_t_5);
  3018. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3019. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3020. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3021. __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 = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3022. __Pyx_GOTREF(__pyx_t_5);
  3023. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3024. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3025. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3026. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3027. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  3028. {
  3029. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3030. 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)) {
  3031. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  3032. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3033. } 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];
  3034. }
  3035. }
  3036. __pyx_t_6 = 0;
  3037. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  3038. __pyx_t_5 = 0;
  3039. /* "scattnlay.pyx":96
  3040. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  3041. *
  3042. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128) # <<<<<<<<<<<<<<
  3043. * cdef np.ndarray[np.complex128_t, ndim = 3] H = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  3044. *
  3045. */
  3046. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3047. __Pyx_GOTREF(__pyx_t_5);
  3048. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3049. __Pyx_GOTREF(__pyx_t_1);
  3050. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3051. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3052. __Pyx_GOTREF(__pyx_t_5);
  3053. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3054. __Pyx_GOTREF(__pyx_t_3);
  3055. __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3056. __Pyx_GOTREF(__pyx_t_2);
  3057. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  3058. __Pyx_GIVEREF(__pyx_t_5);
  3059. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  3060. __Pyx_GIVEREF(__pyx_t_3);
  3061. __Pyx_INCREF(__pyx_int_3);
  3062. PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_3);
  3063. __Pyx_GIVEREF(__pyx_int_3);
  3064. __pyx_t_5 = 0;
  3065. __pyx_t_3 = 0;
  3066. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3067. __Pyx_GOTREF(__pyx_t_3);
  3068. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3069. __Pyx_GIVEREF(__pyx_t_2);
  3070. __pyx_t_2 = 0;
  3071. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3072. __Pyx_GOTREF(__pyx_t_2);
  3073. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3074. __Pyx_GOTREF(__pyx_t_5);
  3075. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3076. __Pyx_GOTREF(__pyx_t_4);
  3077. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3078. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3079. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3080. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3081. __Pyx_GOTREF(__pyx_t_4);
  3082. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3083. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3084. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3085. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3086. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  3087. {
  3088. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3089. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_E.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
  3090. __pyx_v_E = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_E.rcbuffer->pybuffer.buf = NULL;
  3091. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3092. } 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]; __pyx_pybuffernd_E.diminfo[2].strides = __pyx_pybuffernd_E.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_E.diminfo[2].shape = __pyx_pybuffernd_E.rcbuffer->pybuffer.shape[2];
  3093. }
  3094. }
  3095. __pyx_t_7 = 0;
  3096. __pyx_v_E = ((PyArrayObject *)__pyx_t_4);
  3097. __pyx_t_4 = 0;
  3098. /* "scattnlay.pyx":97
  3099. *
  3100. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  3101. * cdef np.ndarray[np.complex128_t, ndim = 3] H = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128) # <<<<<<<<<<<<<<
  3102. *
  3103. * cdef np.ndarray[np.float64_t, ndim = 1] Erx
  3104. */
  3105. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3106. __Pyx_GOTREF(__pyx_t_4);
  3107. __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3108. __Pyx_GOTREF(__pyx_t_2);
  3109. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3110. __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3111. __Pyx_GOTREF(__pyx_t_4);
  3112. __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3113. __Pyx_GOTREF(__pyx_t_3);
  3114. __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3115. __Pyx_GOTREF(__pyx_t_1);
  3116. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  3117. __Pyx_GIVEREF(__pyx_t_4);
  3118. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  3119. __Pyx_GIVEREF(__pyx_t_3);
  3120. __Pyx_INCREF(__pyx_int_3);
  3121. PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_3);
  3122. __Pyx_GIVEREF(__pyx_int_3);
  3123. __pyx_t_4 = 0;
  3124. __pyx_t_3 = 0;
  3125. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3126. __Pyx_GOTREF(__pyx_t_3);
  3127. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3128. __Pyx_GIVEREF(__pyx_t_1);
  3129. __pyx_t_1 = 0;
  3130. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3131. __Pyx_GOTREF(__pyx_t_1);
  3132. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3133. __Pyx_GOTREF(__pyx_t_4);
  3134. __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3135. __Pyx_GOTREF(__pyx_t_5);
  3136. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3137. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3138. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3139. __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 = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3140. __Pyx_GOTREF(__pyx_t_5);
  3141. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3142. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3143. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3144. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3145. __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  3146. {
  3147. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3148. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
  3149. __pyx_v_H = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H.rcbuffer->pybuffer.buf = NULL;
  3150. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3151. } 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]; __pyx_pybuffernd_H.diminfo[2].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_H.diminfo[2].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[2];
  3152. }
  3153. }
  3154. __pyx_t_8 = 0;
  3155. __pyx_v_H = ((PyArrayObject *)__pyx_t_5);
  3156. __pyx_t_5 = 0;
  3157. /* "scattnlay.pyx":112
  3158. * cdef np.ndarray[np.float64_t, ndim = 1] Hiz
  3159. *
  3160. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  3161. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3162. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3163. */
  3164. __pyx_t_9 = (__pyx_v_x->dimensions[0]);
  3165. for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
  3166. __pyx_v_i = __pyx_t_10;
  3167. /* "scattnlay.pyx":113
  3168. *
  3169. * for i in range(x.shape[0]):
  3170. * Erx = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3171. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3172. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3173. */
  3174. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3175. __Pyx_GOTREF(__pyx_t_5);
  3176. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3177. __Pyx_GOTREF(__pyx_t_1);
  3178. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3179. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3180. __Pyx_GOTREF(__pyx_t_5);
  3181. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3182. __Pyx_GOTREF(__pyx_t_3);
  3183. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3184. __Pyx_GIVEREF(__pyx_t_5);
  3185. __pyx_t_5 = 0;
  3186. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3187. __Pyx_GOTREF(__pyx_t_5);
  3188. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3189. __Pyx_GOTREF(__pyx_t_2);
  3190. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3191. __Pyx_GOTREF(__pyx_t_4);
  3192. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3193. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3194. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3195. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3196. __Pyx_GOTREF(__pyx_t_4);
  3197. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3198. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3199. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3200. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3201. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  3202. {
  3203. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3204. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  3205. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3206. if (unlikely(__pyx_t_12 < 0)) {
  3207. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3208. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer, (PyObject*)__pyx_v_Erx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3209. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3210. __Pyx_RaiseBufferFallbackError();
  3211. } else {
  3212. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3213. }
  3214. }
  3215. __pyx_pybuffernd_Erx.diminfo[0].strides = __pyx_pybuffernd_Erx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Erx.diminfo[0].shape = __pyx_pybuffernd_Erx.rcbuffer->pybuffer.shape[0];
  3216. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3217. }
  3218. __pyx_t_11 = 0;
  3219. __Pyx_XDECREF_SET(__pyx_v_Erx, ((PyArrayObject *)__pyx_t_4));
  3220. __pyx_t_4 = 0;
  3221. /* "scattnlay.pyx":114
  3222. * for i in range(x.shape[0]):
  3223. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3224. * Ery = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3225. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3226. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3227. */
  3228. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3229. __Pyx_GOTREF(__pyx_t_4);
  3230. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3231. __Pyx_GOTREF(__pyx_t_5);
  3232. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3233. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3234. __Pyx_GOTREF(__pyx_t_4);
  3235. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3236. __Pyx_GOTREF(__pyx_t_3);
  3237. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3238. __Pyx_GIVEREF(__pyx_t_4);
  3239. __pyx_t_4 = 0;
  3240. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3241. __Pyx_GOTREF(__pyx_t_4);
  3242. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3243. __Pyx_GOTREF(__pyx_t_1);
  3244. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3245. __Pyx_GOTREF(__pyx_t_2);
  3246. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3247. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3248. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3249. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3250. __Pyx_GOTREF(__pyx_t_2);
  3251. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3252. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3253. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3254. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3255. __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  3256. {
  3257. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3258. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  3259. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3260. if (unlikely(__pyx_t_12 < 0)) {
  3261. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3262. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer, (PyObject*)__pyx_v_Ery, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3263. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3264. __Pyx_RaiseBufferFallbackError();
  3265. } else {
  3266. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3267. }
  3268. }
  3269. __pyx_pybuffernd_Ery.diminfo[0].strides = __pyx_pybuffernd_Ery.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ery.diminfo[0].shape = __pyx_pybuffernd_Ery.rcbuffer->pybuffer.shape[0];
  3270. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3271. }
  3272. __pyx_t_16 = 0;
  3273. __Pyx_XDECREF_SET(__pyx_v_Ery, ((PyArrayObject *)__pyx_t_2));
  3274. __pyx_t_2 = 0;
  3275. /* "scattnlay.pyx":115
  3276. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3277. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3278. * Erz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3279. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3280. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3281. */
  3282. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3283. __Pyx_GOTREF(__pyx_t_2);
  3284. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3285. __Pyx_GOTREF(__pyx_t_4);
  3286. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3287. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3288. __Pyx_GOTREF(__pyx_t_2);
  3289. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3290. __Pyx_GOTREF(__pyx_t_3);
  3291. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3292. __Pyx_GIVEREF(__pyx_t_2);
  3293. __pyx_t_2 = 0;
  3294. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3295. __Pyx_GOTREF(__pyx_t_2);
  3296. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3297. __Pyx_GOTREF(__pyx_t_5);
  3298. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3299. __Pyx_GOTREF(__pyx_t_1);
  3300. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3301. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3302. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3303. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3304. __Pyx_GOTREF(__pyx_t_1);
  3305. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3306. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3307. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3308. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3309. __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  3310. {
  3311. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3312. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  3313. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3314. if (unlikely(__pyx_t_12 < 0)) {
  3315. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3316. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer, (PyObject*)__pyx_v_Erz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3317. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3318. __Pyx_RaiseBufferFallbackError();
  3319. } else {
  3320. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3321. }
  3322. }
  3323. __pyx_pybuffernd_Erz.diminfo[0].strides = __pyx_pybuffernd_Erz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Erz.diminfo[0].shape = __pyx_pybuffernd_Erz.rcbuffer->pybuffer.shape[0];
  3324. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3325. }
  3326. __pyx_t_17 = 0;
  3327. __Pyx_XDECREF_SET(__pyx_v_Erz, ((PyArrayObject *)__pyx_t_1));
  3328. __pyx_t_1 = 0;
  3329. /* "scattnlay.pyx":116
  3330. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3331. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3332. * Eix = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3333. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3334. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3335. */
  3336. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3337. __Pyx_GOTREF(__pyx_t_1);
  3338. __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3339. __Pyx_GOTREF(__pyx_t_2);
  3340. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3341. __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3342. __Pyx_GOTREF(__pyx_t_1);
  3343. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3344. __Pyx_GOTREF(__pyx_t_3);
  3345. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3346. __Pyx_GIVEREF(__pyx_t_1);
  3347. __pyx_t_1 = 0;
  3348. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3349. __Pyx_GOTREF(__pyx_t_1);
  3350. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3351. __Pyx_GOTREF(__pyx_t_4);
  3352. __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3353. __Pyx_GOTREF(__pyx_t_5);
  3354. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3355. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3356. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3357. __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3358. __Pyx_GOTREF(__pyx_t_5);
  3359. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3360. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3361. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3362. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3363. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  3364. {
  3365. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3366. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  3367. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3368. if (unlikely(__pyx_t_12 < 0)) {
  3369. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3370. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer, (PyObject*)__pyx_v_Eix, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3371. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3372. __Pyx_RaiseBufferFallbackError();
  3373. } else {
  3374. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3375. }
  3376. }
  3377. __pyx_pybuffernd_Eix.diminfo[0].strides = __pyx_pybuffernd_Eix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Eix.diminfo[0].shape = __pyx_pybuffernd_Eix.rcbuffer->pybuffer.shape[0];
  3378. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3379. }
  3380. __pyx_t_18 = 0;
  3381. __Pyx_XDECREF_SET(__pyx_v_Eix, ((PyArrayObject *)__pyx_t_5));
  3382. __pyx_t_5 = 0;
  3383. /* "scattnlay.pyx":117
  3384. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3385. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3386. * Eiy = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3387. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3388. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3389. */
  3390. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3391. __Pyx_GOTREF(__pyx_t_5);
  3392. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3393. __Pyx_GOTREF(__pyx_t_1);
  3394. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3395. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3396. __Pyx_GOTREF(__pyx_t_5);
  3397. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3398. __Pyx_GOTREF(__pyx_t_3);
  3399. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3400. __Pyx_GIVEREF(__pyx_t_5);
  3401. __pyx_t_5 = 0;
  3402. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3403. __Pyx_GOTREF(__pyx_t_5);
  3404. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3405. __Pyx_GOTREF(__pyx_t_2);
  3406. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3407. __Pyx_GOTREF(__pyx_t_4);
  3408. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3409. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3410. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3411. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3412. __Pyx_GOTREF(__pyx_t_4);
  3413. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3414. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3415. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3416. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3417. __pyx_t_19 = ((PyArrayObject *)__pyx_t_4);
  3418. {
  3419. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3420. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  3421. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3422. if (unlikely(__pyx_t_12 < 0)) {
  3423. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3424. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer, (PyObject*)__pyx_v_Eiy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3425. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3426. __Pyx_RaiseBufferFallbackError();
  3427. } else {
  3428. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3429. }
  3430. }
  3431. __pyx_pybuffernd_Eiy.diminfo[0].strides = __pyx_pybuffernd_Eiy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Eiy.diminfo[0].shape = __pyx_pybuffernd_Eiy.rcbuffer->pybuffer.shape[0];
  3432. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3433. }
  3434. __pyx_t_19 = 0;
  3435. __Pyx_XDECREF_SET(__pyx_v_Eiy, ((PyArrayObject *)__pyx_t_4));
  3436. __pyx_t_4 = 0;
  3437. /* "scattnlay.pyx":118
  3438. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3439. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3440. * Eiz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3441. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3442. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3443. */
  3444. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3445. __Pyx_GOTREF(__pyx_t_4);
  3446. __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3447. __Pyx_GOTREF(__pyx_t_5);
  3448. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3449. __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3450. __Pyx_GOTREF(__pyx_t_4);
  3451. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3452. __Pyx_GOTREF(__pyx_t_3);
  3453. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3454. __Pyx_GIVEREF(__pyx_t_4);
  3455. __pyx_t_4 = 0;
  3456. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3457. __Pyx_GOTREF(__pyx_t_4);
  3458. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3459. __Pyx_GOTREF(__pyx_t_1);
  3460. __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3461. __Pyx_GOTREF(__pyx_t_2);
  3462. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3463. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3464. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3465. __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 = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3466. __Pyx_GOTREF(__pyx_t_2);
  3467. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3468. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3469. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3470. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3471. __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
  3472. {
  3473. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3474. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  3475. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3476. if (unlikely(__pyx_t_12 < 0)) {
  3477. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3478. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer, (PyObject*)__pyx_v_Eiz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3479. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3480. __Pyx_RaiseBufferFallbackError();
  3481. } else {
  3482. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3483. }
  3484. }
  3485. __pyx_pybuffernd_Eiz.diminfo[0].strides = __pyx_pybuffernd_Eiz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Eiz.diminfo[0].shape = __pyx_pybuffernd_Eiz.rcbuffer->pybuffer.shape[0];
  3486. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3487. }
  3488. __pyx_t_20 = 0;
  3489. __Pyx_XDECREF_SET(__pyx_v_Eiz, ((PyArrayObject *)__pyx_t_2));
  3490. __pyx_t_2 = 0;
  3491. /* "scattnlay.pyx":119
  3492. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3493. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3494. * Hrx = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3495. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3496. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3497. */
  3498. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3499. __Pyx_GOTREF(__pyx_t_2);
  3500. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3501. __Pyx_GOTREF(__pyx_t_4);
  3502. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3503. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3504. __Pyx_GOTREF(__pyx_t_2);
  3505. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3506. __Pyx_GOTREF(__pyx_t_3);
  3507. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3508. __Pyx_GIVEREF(__pyx_t_2);
  3509. __pyx_t_2 = 0;
  3510. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3511. __Pyx_GOTREF(__pyx_t_2);
  3512. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3513. __Pyx_GOTREF(__pyx_t_5);
  3514. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3515. __Pyx_GOTREF(__pyx_t_1);
  3516. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3517. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3518. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3519. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3520. __Pyx_GOTREF(__pyx_t_1);
  3521. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3522. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3523. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3524. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3525. __pyx_t_21 = ((PyArrayObject *)__pyx_t_1);
  3526. {
  3527. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3528. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  3529. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3530. if (unlikely(__pyx_t_12 < 0)) {
  3531. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3532. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hrx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3533. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3534. __Pyx_RaiseBufferFallbackError();
  3535. } else {
  3536. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3537. }
  3538. }
  3539. __pyx_pybuffernd_Hrx.diminfo[0].strides = __pyx_pybuffernd_Hrx.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hrx.diminfo[0].shape = __pyx_pybuffernd_Hrx.rcbuffer->pybuffer.shape[0];
  3540. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3541. }
  3542. __pyx_t_21 = 0;
  3543. __Pyx_XDECREF_SET(__pyx_v_Hrx, ((PyArrayObject *)__pyx_t_1));
  3544. __pyx_t_1 = 0;
  3545. /* "scattnlay.pyx":120
  3546. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3547. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3548. * Hry = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3549. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3550. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3551. */
  3552. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3553. __Pyx_GOTREF(__pyx_t_1);
  3554. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3555. __Pyx_GOTREF(__pyx_t_2);
  3556. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3557. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3558. __Pyx_GOTREF(__pyx_t_1);
  3559. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3560. __Pyx_GOTREF(__pyx_t_3);
  3561. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3562. __Pyx_GIVEREF(__pyx_t_1);
  3563. __pyx_t_1 = 0;
  3564. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3565. __Pyx_GOTREF(__pyx_t_1);
  3566. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3567. __Pyx_GOTREF(__pyx_t_4);
  3568. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3569. __Pyx_GOTREF(__pyx_t_5);
  3570. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3571. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3572. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3573. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3574. __Pyx_GOTREF(__pyx_t_5);
  3575. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3576. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3577. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3578. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3579. __pyx_t_22 = ((PyArrayObject *)__pyx_t_5);
  3580. {
  3581. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3582. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  3583. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3584. if (unlikely(__pyx_t_12 < 0)) {
  3585. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3586. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hry, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3587. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3588. __Pyx_RaiseBufferFallbackError();
  3589. } else {
  3590. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3591. }
  3592. }
  3593. __pyx_pybuffernd_Hry.diminfo[0].strides = __pyx_pybuffernd_Hry.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hry.diminfo[0].shape = __pyx_pybuffernd_Hry.rcbuffer->pybuffer.shape[0];
  3594. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3595. }
  3596. __pyx_t_22 = 0;
  3597. __Pyx_XDECREF_SET(__pyx_v_Hry, ((PyArrayObject *)__pyx_t_5));
  3598. __pyx_t_5 = 0;
  3599. /* "scattnlay.pyx":121
  3600. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3601. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3602. * Hrz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3603. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3604. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3605. */
  3606. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3607. __Pyx_GOTREF(__pyx_t_5);
  3608. __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 = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3609. __Pyx_GOTREF(__pyx_t_1);
  3610. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3611. __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 = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3612. __Pyx_GOTREF(__pyx_t_5);
  3613. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3614. __Pyx_GOTREF(__pyx_t_3);
  3615. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3616. __Pyx_GIVEREF(__pyx_t_5);
  3617. __pyx_t_5 = 0;
  3618. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3619. __Pyx_GOTREF(__pyx_t_5);
  3620. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3621. __Pyx_GOTREF(__pyx_t_2);
  3622. __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 = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3623. __Pyx_GOTREF(__pyx_t_4);
  3624. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3625. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3626. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3627. __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 = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3628. __Pyx_GOTREF(__pyx_t_4);
  3629. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3630. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3631. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3632. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3633. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  3634. {
  3635. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3636. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  3637. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer, (PyObject*)__pyx_t_23, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3638. if (unlikely(__pyx_t_12 < 0)) {
  3639. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3640. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hrz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3641. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3642. __Pyx_RaiseBufferFallbackError();
  3643. } else {
  3644. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3645. }
  3646. }
  3647. __pyx_pybuffernd_Hrz.diminfo[0].strides = __pyx_pybuffernd_Hrz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hrz.diminfo[0].shape = __pyx_pybuffernd_Hrz.rcbuffer->pybuffer.shape[0];
  3648. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3649. }
  3650. __pyx_t_23 = 0;
  3651. __Pyx_XDECREF_SET(__pyx_v_Hrz, ((PyArrayObject *)__pyx_t_4));
  3652. __pyx_t_4 = 0;
  3653. /* "scattnlay.pyx":122
  3654. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3655. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3656. * Hix = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3657. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3658. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3659. */
  3660. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3661. __Pyx_GOTREF(__pyx_t_4);
  3662. __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3663. __Pyx_GOTREF(__pyx_t_5);
  3664. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3665. __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3666. __Pyx_GOTREF(__pyx_t_4);
  3667. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3668. __Pyx_GOTREF(__pyx_t_3);
  3669. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3670. __Pyx_GIVEREF(__pyx_t_4);
  3671. __pyx_t_4 = 0;
  3672. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3673. __Pyx_GOTREF(__pyx_t_4);
  3674. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3675. __Pyx_GOTREF(__pyx_t_1);
  3676. __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3677. __Pyx_GOTREF(__pyx_t_2);
  3678. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3679. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3680. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3681. __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3682. __Pyx_GOTREF(__pyx_t_2);
  3683. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3684. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3685. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3686. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3687. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  3688. {
  3689. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3690. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  3691. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3692. if (unlikely(__pyx_t_12 < 0)) {
  3693. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3694. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hix, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3695. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3696. __Pyx_RaiseBufferFallbackError();
  3697. } else {
  3698. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3699. }
  3700. }
  3701. __pyx_pybuffernd_Hix.diminfo[0].strides = __pyx_pybuffernd_Hix.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hix.diminfo[0].shape = __pyx_pybuffernd_Hix.rcbuffer->pybuffer.shape[0];
  3702. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3703. }
  3704. __pyx_t_24 = 0;
  3705. __Pyx_XDECREF_SET(__pyx_v_Hix, ((PyArrayObject *)__pyx_t_2));
  3706. __pyx_t_2 = 0;
  3707. /* "scattnlay.pyx":123
  3708. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3709. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3710. * Hiy = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3711. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3712. *
  3713. */
  3714. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3715. __Pyx_GOTREF(__pyx_t_2);
  3716. __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3717. __Pyx_GOTREF(__pyx_t_4);
  3718. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3719. __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3720. __Pyx_GOTREF(__pyx_t_2);
  3721. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3722. __Pyx_GOTREF(__pyx_t_3);
  3723. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3724. __Pyx_GIVEREF(__pyx_t_2);
  3725. __pyx_t_2 = 0;
  3726. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3727. __Pyx_GOTREF(__pyx_t_2);
  3728. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3729. __Pyx_GOTREF(__pyx_t_5);
  3730. __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3731. __Pyx_GOTREF(__pyx_t_1);
  3732. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3733. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3734. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3735. __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3736. __Pyx_GOTREF(__pyx_t_1);
  3737. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3738. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3739. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3740. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3741. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  3742. {
  3743. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3744. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  3745. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3746. if (unlikely(__pyx_t_12 < 0)) {
  3747. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3748. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hiy, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3749. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3750. __Pyx_RaiseBufferFallbackError();
  3751. } else {
  3752. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3753. }
  3754. }
  3755. __pyx_pybuffernd_Hiy.diminfo[0].strides = __pyx_pybuffernd_Hiy.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hiy.diminfo[0].shape = __pyx_pybuffernd_Hiy.rcbuffer->pybuffer.shape[0];
  3756. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3757. }
  3758. __pyx_t_25 = 0;
  3759. __Pyx_XDECREF_SET(__pyx_v_Hiy, ((PyArrayObject *)__pyx_t_1));
  3760. __pyx_t_1 = 0;
  3761. /* "scattnlay.pyx":124
  3762. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3763. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3764. * Hiz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3765. *
  3766. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), nmax, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Erx), npy2c(Ery), npy2c(Erz), npy2c(Eix), npy2c(Eiy), npy2c(Eiz), npy2c(Hrx), npy2c(Hry), npy2c(Hrz), npy2c(Hix), npy2c(Hiy), npy2c(Hiz))
  3767. */
  3768. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3769. __Pyx_GOTREF(__pyx_t_1);
  3770. __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 = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3771. __Pyx_GOTREF(__pyx_t_2);
  3772. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3773. __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 = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3774. __Pyx_GOTREF(__pyx_t_1);
  3775. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3776. __Pyx_GOTREF(__pyx_t_3);
  3777. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3778. __Pyx_GIVEREF(__pyx_t_1);
  3779. __pyx_t_1 = 0;
  3780. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3781. __Pyx_GOTREF(__pyx_t_1);
  3782. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3783. __Pyx_GOTREF(__pyx_t_4);
  3784. __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 = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3785. __Pyx_GOTREF(__pyx_t_5);
  3786. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3787. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3788. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3789. __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 = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3790. __Pyx_GOTREF(__pyx_t_5);
  3791. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3792. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3793. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3794. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3795. __pyx_t_26 = ((PyArrayObject *)__pyx_t_5);
  3796. {
  3797. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3798. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  3799. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3800. if (unlikely(__pyx_t_12 < 0)) {
  3801. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3802. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hiz, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3803. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3804. __Pyx_RaiseBufferFallbackError();
  3805. } else {
  3806. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3807. }
  3808. }
  3809. __pyx_pybuffernd_Hiz.diminfo[0].strides = __pyx_pybuffernd_Hiz.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hiz.diminfo[0].shape = __pyx_pybuffernd_Hiz.rcbuffer->pybuffer.shape[0];
  3810. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3811. }
  3812. __pyx_t_26 = 0;
  3813. __Pyx_XDECREF_SET(__pyx_v_Hiz, ((PyArrayObject *)__pyx_t_5));
  3814. __pyx_t_5 = 0;
  3815. /* "scattnlay.pyx":126
  3816. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3817. *
  3818. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), nmax, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Erx), npy2c(Ery), npy2c(Erz), npy2c(Eix), npy2c(Eiy), npy2c(Eiz), npy2c(Hrx), npy2c(Hry), npy2c(Hrz), npy2c(Hix), npy2c(Hiy), npy2c(Hiz)) # <<<<<<<<<<<<<<
  3819. *
  3820. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose()
  3821. */
  3822. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3823. __Pyx_GOTREF(__pyx_t_5);
  3824. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3825. __Pyx_GOTREF(__pyx_t_1);
  3826. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3827. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3828. __Pyx_GOTREF(__pyx_t_5);
  3829. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3830. __pyx_t_27 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3831. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3832. __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3833. __Pyx_GOTREF(__pyx_t_5);
  3834. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3835. __Pyx_GOTREF(__pyx_t_1);
  3836. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3837. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3838. __Pyx_GOTREF(__pyx_t_5);
  3839. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3840. __pyx_t_28 = __pyx_convert_vector_from_py___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3841. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3842. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__13); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3843. __Pyx_GOTREF(__pyx_t_5);
  3844. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3845. __Pyx_GOTREF(__pyx_t_1);
  3846. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3847. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3848. __Pyx_GOTREF(__pyx_t_5);
  3849. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3850. __pyx_t_29 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3851. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3852. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__16); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3853. __Pyx_GOTREF(__pyx_t_5);
  3854. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3855. __Pyx_GOTREF(__pyx_t_1);
  3856. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3857. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3858. __Pyx_GOTREF(__pyx_t_5);
  3859. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3860. __pyx_t_30 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3861. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3862. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__19); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3863. __Pyx_GOTREF(__pyx_t_5);
  3864. __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3865. __Pyx_GOTREF(__pyx_t_1);
  3866. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3867. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3868. __Pyx_GOTREF(__pyx_t_5);
  3869. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3870. __pyx_t_31 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3871. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3872. __pyx_t_32 = __pyx_v_i;
  3873. __pyx_t_12 = -1;
  3874. if (__pyx_t_32 < 0) {
  3875. __pyx_t_32 += __pyx_pybuffernd_terms.diminfo[0].shape;
  3876. if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0;
  3877. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_12 = 0;
  3878. if (unlikely(__pyx_t_12 != -1)) {
  3879. __Pyx_RaiseBufferIndexError(__pyx_t_12);
  3880. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3881. }
  3882. *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_terms.diminfo[0].strides) = nField((__pyx_v_x->dimensions[1]), __pyx_v_pl, __pyx_t_27, __pyx_t_28, __pyx_v_nmax, (__pyx_v_coords->dimensions[0]), __pyx_t_29, __pyx_t_30, __pyx_t_31, __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Erx)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Ery)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Erz)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Eix)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Eiy)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Eiz)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hrx)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hry)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hrz)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hix)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hiy)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hiz)));
  3883. /* "scattnlay.pyx":128
  3884. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), nmax, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Erx), npy2c(Ery), npy2c(Erz), npy2c(Eix), npy2c(Eiy), npy2c(Eiz), npy2c(Hrx), npy2c(Hry), npy2c(Hrz), npy2c(Hix), npy2c(Hiy), npy2c(Hiz))
  3885. *
  3886. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose() # <<<<<<<<<<<<<<
  3887. * H[i] = np.vstack((Hrx.copy('C') + 1.0j*Hix.copy('C'), Hry.copy('C') + 1.0j*Hiy.copy('C'), Hrz.copy('C') + 1.0j*Hiz.copy('C'))).transpose()
  3888. *
  3889. */
  3890. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3891. __Pyx_GOTREF(__pyx_t_5);
  3892. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_vstack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3893. __Pyx_GOTREF(__pyx_t_1);
  3894. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3895. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Erx), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3896. __Pyx_GOTREF(__pyx_t_5);
  3897. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3898. __Pyx_GOTREF(__pyx_t_3);
  3899. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3900. __pyx_t_5 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3901. __Pyx_GOTREF(__pyx_t_5);
  3902. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Eix), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3903. __Pyx_GOTREF(__pyx_t_2);
  3904. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3905. __Pyx_GOTREF(__pyx_t_4);
  3906. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3907. __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3908. __Pyx_GOTREF(__pyx_t_2);
  3909. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3910. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3911. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3912. __Pyx_GOTREF(__pyx_t_4);
  3913. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3914. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3915. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Ery), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3916. __Pyx_GOTREF(__pyx_t_2);
  3917. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3918. __Pyx_GOTREF(__pyx_t_3);
  3919. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3920. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3921. __Pyx_GOTREF(__pyx_t_2);
  3922. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Eiy), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3923. __Pyx_GOTREF(__pyx_t_5);
  3924. __pyx_t_33 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3925. __Pyx_GOTREF(__pyx_t_33);
  3926. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3927. __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3928. __Pyx_GOTREF(__pyx_t_5);
  3929. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3930. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  3931. __pyx_t_33 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3932. __Pyx_GOTREF(__pyx_t_33);
  3933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3934. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3935. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Erz), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3936. __Pyx_GOTREF(__pyx_t_5);
  3937. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3938. __Pyx_GOTREF(__pyx_t_3);
  3939. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3940. __pyx_t_5 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3941. __Pyx_GOTREF(__pyx_t_5);
  3942. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Eiz), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3943. __Pyx_GOTREF(__pyx_t_2);
  3944. __pyx_t_34 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3945. __Pyx_GOTREF(__pyx_t_34);
  3946. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3947. __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3948. __Pyx_GOTREF(__pyx_t_2);
  3949. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3950. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3951. __pyx_t_34 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3952. __Pyx_GOTREF(__pyx_t_34);
  3953. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3954. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3955. __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3956. __Pyx_GOTREF(__pyx_t_2);
  3957. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  3958. __Pyx_GIVEREF(__pyx_t_4);
  3959. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_33);
  3960. __Pyx_GIVEREF(__pyx_t_33);
  3961. PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_34);
  3962. __Pyx_GIVEREF(__pyx_t_34);
  3963. __pyx_t_4 = 0;
  3964. __pyx_t_33 = 0;
  3965. __pyx_t_34 = 0;
  3966. __pyx_t_34 = PyTuple_New(1); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3967. __Pyx_GOTREF(__pyx_t_34);
  3968. PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_2);
  3969. __Pyx_GIVEREF(__pyx_t_2);
  3970. __pyx_t_2 = 0;
  3971. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3972. __Pyx_GOTREF(__pyx_t_2);
  3973. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3974. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3975. __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_transpose); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3976. __Pyx_GOTREF(__pyx_t_34);
  3977. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3978. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3979. __Pyx_GOTREF(__pyx_t_2);
  3980. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3981. 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 = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3982. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3983. /* "scattnlay.pyx":129
  3984. *
  3985. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose()
  3986. * H[i] = np.vstack((Hrx.copy('C') + 1.0j*Hix.copy('C'), Hry.copy('C') + 1.0j*Hiy.copy('C'), Hrz.copy('C') + 1.0j*Hiz.copy('C'))).transpose() # <<<<<<<<<<<<<<
  3987. *
  3988. * return terms, E, H
  3989. */
  3990. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3991. __Pyx_GOTREF(__pyx_t_2);
  3992. __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_vstack); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3993. __Pyx_GOTREF(__pyx_t_34);
  3994. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3995. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hrx), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3996. __Pyx_GOTREF(__pyx_t_2);
  3997. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3998. __Pyx_GOTREF(__pyx_t_1);
  3999. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4000. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4001. __Pyx_GOTREF(__pyx_t_2);
  4002. __pyx_t_33 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hix), __pyx_n_s_copy); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4003. __Pyx_GOTREF(__pyx_t_33);
  4004. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4005. __Pyx_GOTREF(__pyx_t_4);
  4006. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4007. __pyx_t_33 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4008. __Pyx_GOTREF(__pyx_t_33);
  4009. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4010. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4011. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_33); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4012. __Pyx_GOTREF(__pyx_t_4);
  4013. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4014. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4015. __pyx_t_33 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hry), __pyx_n_s_copy); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4016. __Pyx_GOTREF(__pyx_t_33);
  4017. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4018. __Pyx_GOTREF(__pyx_t_1);
  4019. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4020. __pyx_t_33 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4021. __Pyx_GOTREF(__pyx_t_33);
  4022. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hiy), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4023. __Pyx_GOTREF(__pyx_t_2);
  4024. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4025. __Pyx_GOTREF(__pyx_t_3);
  4026. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4027. __pyx_t_2 = PyNumber_Multiply(__pyx_t_33, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4028. __Pyx_GOTREF(__pyx_t_2);
  4029. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4030. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4031. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4032. __Pyx_GOTREF(__pyx_t_3);
  4033. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4034. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4035. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hrz), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4036. __Pyx_GOTREF(__pyx_t_2);
  4037. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4038. __Pyx_GOTREF(__pyx_t_1);
  4039. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4040. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4041. __Pyx_GOTREF(__pyx_t_2);
  4042. __pyx_t_33 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hiz), __pyx_n_s_copy); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4043. __Pyx_GOTREF(__pyx_t_33);
  4044. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_33, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4045. __Pyx_GOTREF(__pyx_t_5);
  4046. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4047. __pyx_t_33 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4048. __Pyx_GOTREF(__pyx_t_33);
  4049. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4050. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4051. __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4052. __Pyx_GOTREF(__pyx_t_5);
  4053. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4054. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4055. __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4056. __Pyx_GOTREF(__pyx_t_33);
  4057. PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4);
  4058. __Pyx_GIVEREF(__pyx_t_4);
  4059. PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_t_3);
  4060. __Pyx_GIVEREF(__pyx_t_3);
  4061. PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_t_5);
  4062. __Pyx_GIVEREF(__pyx_t_5);
  4063. __pyx_t_4 = 0;
  4064. __pyx_t_3 = 0;
  4065. __pyx_t_5 = 0;
  4066. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4067. __Pyx_GOTREF(__pyx_t_5);
  4068. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_33);
  4069. __Pyx_GIVEREF(__pyx_t_33);
  4070. __pyx_t_33 = 0;
  4071. __pyx_t_33 = __Pyx_PyObject_Call(__pyx_t_34, __pyx_t_5, NULL); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4072. __Pyx_GOTREF(__pyx_t_33);
  4073. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  4074. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4075. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_33, __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4076. __Pyx_GOTREF(__pyx_t_5);
  4077. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4078. __pyx_t_33 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4079. __Pyx_GOTREF(__pyx_t_33);
  4080. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4081. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_H), __pyx_v_i, __pyx_t_33, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4082. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4083. }
  4084. /* "scattnlay.pyx":131
  4085. * H[i] = np.vstack((Hrx.copy('C') + 1.0j*Hix.copy('C'), Hry.copy('C') + 1.0j*Hiy.copy('C'), Hrz.copy('C') + 1.0j*Hiz.copy('C'))).transpose()
  4086. *
  4087. * return terms, E, H # <<<<<<<<<<<<<<
  4088. *
  4089. */
  4090. __Pyx_XDECREF(__pyx_r);
  4091. __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4092. __Pyx_GOTREF(__pyx_t_33);
  4093. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  4094. PyTuple_SET_ITEM(__pyx_t_33, 0, ((PyObject *)__pyx_v_terms));
  4095. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  4096. __Pyx_INCREF(((PyObject *)__pyx_v_E));
  4097. PyTuple_SET_ITEM(__pyx_t_33, 1, ((PyObject *)__pyx_v_E));
  4098. __Pyx_GIVEREF(((PyObject *)__pyx_v_E));
  4099. __Pyx_INCREF(((PyObject *)__pyx_v_H));
  4100. PyTuple_SET_ITEM(__pyx_t_33, 2, ((PyObject *)__pyx_v_H));
  4101. __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
  4102. __pyx_r = __pyx_t_33;
  4103. __pyx_t_33 = 0;
  4104. goto __pyx_L0;
  4105. /* "scattnlay.pyx":91
  4106. *
  4107. * #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), np.int_t pl = 0, np.int_t nmax = 0):
  4108. * 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.int_t pl = 0, np.int_t nmax = 0): # <<<<<<<<<<<<<<
  4109. * cdef Py_ssize_t i
  4110. *
  4111. */
  4112. /* function exit code */
  4113. __pyx_L1_error:;
  4114. __Pyx_XDECREF(__pyx_t_1);
  4115. __Pyx_XDECREF(__pyx_t_2);
  4116. __Pyx_XDECREF(__pyx_t_3);
  4117. __Pyx_XDECREF(__pyx_t_4);
  4118. __Pyx_XDECREF(__pyx_t_5);
  4119. __Pyx_XDECREF(__pyx_t_33);
  4120. __Pyx_XDECREF(__pyx_t_34);
  4121. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  4122. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  4123. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  4124. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  4125. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  4126. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  4127. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  4128. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  4129. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  4130. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  4131. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  4132. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  4133. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  4134. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  4135. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  4136. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  4137. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  4138. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  4139. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  4140. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  4141. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  4142. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4143. __pyx_r = NULL;
  4144. goto __pyx_L2;
  4145. __pyx_L0:;
  4146. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  4147. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  4148. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  4149. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  4150. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  4151. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  4152. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  4153. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  4154. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  4155. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  4156. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  4157. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  4158. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  4159. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  4160. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  4161. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  4162. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  4163. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  4164. __pyx_L2:;
  4165. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  4166. __Pyx_XDECREF((PyObject *)__pyx_v_E);
  4167. __Pyx_XDECREF((PyObject *)__pyx_v_H);
  4168. __Pyx_XDECREF((PyObject *)__pyx_v_Erx);
  4169. __Pyx_XDECREF((PyObject *)__pyx_v_Ery);
  4170. __Pyx_XDECREF((PyObject *)__pyx_v_Erz);
  4171. __Pyx_XDECREF((PyObject *)__pyx_v_Eix);
  4172. __Pyx_XDECREF((PyObject *)__pyx_v_Eiy);
  4173. __Pyx_XDECREF((PyObject *)__pyx_v_Eiz);
  4174. __Pyx_XDECREF((PyObject *)__pyx_v_Hrx);
  4175. __Pyx_XDECREF((PyObject *)__pyx_v_Hry);
  4176. __Pyx_XDECREF((PyObject *)__pyx_v_Hrz);
  4177. __Pyx_XDECREF((PyObject *)__pyx_v_Hix);
  4178. __Pyx_XDECREF((PyObject *)__pyx_v_Hiy);
  4179. __Pyx_XDECREF((PyObject *)__pyx_v_Hiz);
  4180. __Pyx_XGIVEREF(__pyx_r);
  4181. __Pyx_RefNannyFinishContext();
  4182. return __pyx_r;
  4183. }
  4184. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4185. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4186. * # -- the details of this may change.
  4187. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4188. * # This implementation of getbuffer is geared towards Cython
  4189. * # requirements, and does not yet fullfill the PEP.
  4190. */
  4191. /* Python wrapper */
  4192. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  4193. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  4194. int __pyx_r;
  4195. __Pyx_RefNannyDeclarations
  4196. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  4197. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  4198. /* function exit code */
  4199. __Pyx_RefNannyFinishContext();
  4200. return __pyx_r;
  4201. }
  4202. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  4203. int __pyx_v_copy_shape;
  4204. int __pyx_v_i;
  4205. int __pyx_v_ndim;
  4206. int __pyx_v_endian_detector;
  4207. int __pyx_v_little_endian;
  4208. int __pyx_v_t;
  4209. char *__pyx_v_f;
  4210. PyArray_Descr *__pyx_v_descr = 0;
  4211. int __pyx_v_offset;
  4212. int __pyx_v_hasfields;
  4213. int __pyx_r;
  4214. __Pyx_RefNannyDeclarations
  4215. int __pyx_t_1;
  4216. int __pyx_t_2;
  4217. int __pyx_t_3;
  4218. PyObject *__pyx_t_4 = NULL;
  4219. int __pyx_t_5;
  4220. int __pyx_t_6;
  4221. int __pyx_t_7;
  4222. PyObject *__pyx_t_8 = NULL;
  4223. char *__pyx_t_9;
  4224. int __pyx_lineno = 0;
  4225. const char *__pyx_filename = NULL;
  4226. int __pyx_clineno = 0;
  4227. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  4228. if (__pyx_v_info != NULL) {
  4229. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  4230. __Pyx_GIVEREF(__pyx_v_info->obj);
  4231. }
  4232. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200
  4233. * # of flags
  4234. *
  4235. * if info == NULL: return # <<<<<<<<<<<<<<
  4236. *
  4237. * cdef int copy_shape, i, ndim
  4238. */
  4239. __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  4240. if (__pyx_t_1) {
  4241. __pyx_r = 0;
  4242. goto __pyx_L0;
  4243. }
  4244. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
  4245. *
  4246. * cdef int copy_shape, i, ndim
  4247. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  4248. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4249. *
  4250. */
  4251. __pyx_v_endian_detector = 1;
  4252. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
  4253. * cdef int copy_shape, i, ndim
  4254. * cdef int endian_detector = 1
  4255. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  4256. *
  4257. * ndim = PyArray_NDIM(self)
  4258. */
  4259. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  4260. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
  4261. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4262. *
  4263. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  4264. *
  4265. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4266. */
  4267. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  4268. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
  4269. * ndim = PyArray_NDIM(self)
  4270. *
  4271. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4272. * copy_shape = 1
  4273. * else:
  4274. */
  4275. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4276. if (__pyx_t_1) {
  4277. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
  4278. *
  4279. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4280. * copy_shape = 1 # <<<<<<<<<<<<<<
  4281. * else:
  4282. * copy_shape = 0
  4283. */
  4284. __pyx_v_copy_shape = 1;
  4285. goto __pyx_L4;
  4286. }
  4287. /*else*/ {
  4288. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
  4289. * copy_shape = 1
  4290. * else:
  4291. * copy_shape = 0 # <<<<<<<<<<<<<<
  4292. *
  4293. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4294. */
  4295. __pyx_v_copy_shape = 0;
  4296. }
  4297. __pyx_L4:;
  4298. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
  4299. * copy_shape = 0
  4300. *
  4301. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  4302. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  4303. * raise ValueError(u"ndarray is not C contiguous")
  4304. */
  4305. __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  4306. if (__pyx_t_1) {
  4307. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
  4308. *
  4309. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4310. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  4311. * raise ValueError(u"ndarray is not C contiguous")
  4312. *
  4313. */
  4314. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  4315. __pyx_t_3 = __pyx_t_2;
  4316. } else {
  4317. __pyx_t_3 = __pyx_t_1;
  4318. }
  4319. if (__pyx_t_3) {
  4320. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  4321. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4322. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  4323. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  4324. *
  4325. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4326. */
  4327. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4328. __Pyx_GOTREF(__pyx_t_4);
  4329. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4330. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4331. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4332. }
  4333. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
  4334. * raise ValueError(u"ndarray is not C contiguous")
  4335. *
  4336. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  4337. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  4338. * raise ValueError(u"ndarray is not Fortran contiguous")
  4339. */
  4340. __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  4341. if (__pyx_t_3) {
  4342. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
  4343. *
  4344. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4345. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  4346. * raise ValueError(u"ndarray is not Fortran contiguous")
  4347. *
  4348. */
  4349. __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  4350. __pyx_t_2 = __pyx_t_1;
  4351. } else {
  4352. __pyx_t_2 = __pyx_t_3;
  4353. }
  4354. if (__pyx_t_2) {
  4355. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  4356. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4357. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  4358. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  4359. *
  4360. * info.buf = PyArray_DATA(self)
  4361. */
  4362. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4363. __Pyx_GOTREF(__pyx_t_4);
  4364. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4365. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4366. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4367. }
  4368. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
  4369. * raise ValueError(u"ndarray is not Fortran contiguous")
  4370. *
  4371. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  4372. * info.ndim = ndim
  4373. * if copy_shape:
  4374. */
  4375. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  4376. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
  4377. *
  4378. * info.buf = PyArray_DATA(self)
  4379. * info.ndim = ndim # <<<<<<<<<<<<<<
  4380. * if copy_shape:
  4381. * # Allocate new buffer for strides and shape info.
  4382. */
  4383. __pyx_v_info->ndim = __pyx_v_ndim;
  4384. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
  4385. * info.buf = PyArray_DATA(self)
  4386. * info.ndim = ndim
  4387. * if copy_shape: # <<<<<<<<<<<<<<
  4388. * # Allocate new buffer for strides and shape info.
  4389. * # This is allocated as one block, strides first.
  4390. */
  4391. __pyx_t_2 = (__pyx_v_copy_shape != 0);
  4392. if (__pyx_t_2) {
  4393. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
  4394. * # Allocate new buffer for strides and shape info.
  4395. * # This is allocated as one block, strides first.
  4396. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
  4397. * info.shape = info.strides + ndim
  4398. * for i in range(ndim):
  4399. */
  4400. __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
  4401. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
  4402. * # This is allocated as one block, strides first.
  4403. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  4404. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  4405. * for i in range(ndim):
  4406. * info.strides[i] = PyArray_STRIDES(self)[i]
  4407. */
  4408. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  4409. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
  4410. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  4411. * info.shape = info.strides + ndim
  4412. * for i in range(ndim): # <<<<<<<<<<<<<<
  4413. * info.strides[i] = PyArray_STRIDES(self)[i]
  4414. * info.shape[i] = PyArray_DIMS(self)[i]
  4415. */
  4416. __pyx_t_5 = __pyx_v_ndim;
  4417. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  4418. __pyx_v_i = __pyx_t_6;
  4419. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
  4420. * info.shape = info.strides + ndim
  4421. * for i in range(ndim):
  4422. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  4423. * info.shape[i] = PyArray_DIMS(self)[i]
  4424. * else:
  4425. */
  4426. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  4427. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
  4428. * for i in range(ndim):
  4429. * info.strides[i] = PyArray_STRIDES(self)[i]
  4430. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  4431. * else:
  4432. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4433. */
  4434. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  4435. }
  4436. goto __pyx_L7;
  4437. }
  4438. /*else*/ {
  4439. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
  4440. * info.shape[i] = PyArray_DIMS(self)[i]
  4441. * else:
  4442. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  4443. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4444. * info.suboffsets = NULL
  4445. */
  4446. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  4447. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
  4448. * else:
  4449. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4450. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  4451. * info.suboffsets = NULL
  4452. * info.itemsize = PyArray_ITEMSIZE(self)
  4453. */
  4454. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  4455. }
  4456. __pyx_L7:;
  4457. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
  4458. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4459. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4460. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  4461. * info.itemsize = PyArray_ITEMSIZE(self)
  4462. * info.readonly = not PyArray_ISWRITEABLE(self)
  4463. */
  4464. __pyx_v_info->suboffsets = NULL;
  4465. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
  4466. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4467. * info.suboffsets = NULL
  4468. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  4469. * info.readonly = not PyArray_ISWRITEABLE(self)
  4470. *
  4471. */
  4472. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  4473. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
  4474. * info.suboffsets = NULL
  4475. * info.itemsize = PyArray_ITEMSIZE(self)
  4476. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  4477. *
  4478. * cdef int t
  4479. */
  4480. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  4481. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
  4482. *
  4483. * cdef int t
  4484. * cdef char* f = NULL # <<<<<<<<<<<<<<
  4485. * cdef dtype descr = self.descr
  4486. * cdef list stack
  4487. */
  4488. __pyx_v_f = NULL;
  4489. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
  4490. * cdef int t
  4491. * cdef char* f = NULL
  4492. * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
  4493. * cdef list stack
  4494. * cdef int offset
  4495. */
  4496. __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  4497. __Pyx_INCREF(__pyx_t_4);
  4498. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  4499. __pyx_t_4 = 0;
  4500. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
  4501. * cdef int offset
  4502. *
  4503. * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
  4504. *
  4505. * if not hasfields and not copy_shape:
  4506. */
  4507. __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
  4508. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
  4509. * cdef bint hasfields = PyDataType_HASFIELDS(descr)
  4510. *
  4511. * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
  4512. * # do not call releasebuffer
  4513. * info.obj = None
  4514. */
  4515. __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  4516. if (__pyx_t_2) {
  4517. __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
  4518. __pyx_t_1 = __pyx_t_3;
  4519. } else {
  4520. __pyx_t_1 = __pyx_t_2;
  4521. }
  4522. if (__pyx_t_1) {
  4523. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
  4524. * if not hasfields and not copy_shape:
  4525. * # do not call releasebuffer
  4526. * info.obj = None # <<<<<<<<<<<<<<
  4527. * else:
  4528. * # need to call releasebuffer
  4529. */
  4530. __Pyx_INCREF(Py_None);
  4531. __Pyx_GIVEREF(Py_None);
  4532. __Pyx_GOTREF(__pyx_v_info->obj);
  4533. __Pyx_DECREF(__pyx_v_info->obj);
  4534. __pyx_v_info->obj = Py_None;
  4535. goto __pyx_L10;
  4536. }
  4537. /*else*/ {
  4538. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
  4539. * else:
  4540. * # need to call releasebuffer
  4541. * info.obj = self # <<<<<<<<<<<<<<
  4542. *
  4543. * if not hasfields:
  4544. */
  4545. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  4546. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  4547. __Pyx_GOTREF(__pyx_v_info->obj);
  4548. __Pyx_DECREF(__pyx_v_info->obj);
  4549. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  4550. }
  4551. __pyx_L10:;
  4552. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
  4553. * info.obj = self
  4554. *
  4555. * if not hasfields: # <<<<<<<<<<<<<<
  4556. * t = descr.type_num
  4557. * if ((descr.byteorder == c'>' and little_endian) or
  4558. */
  4559. __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  4560. if (__pyx_t_1) {
  4561. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
  4562. *
  4563. * if not hasfields:
  4564. * t = descr.type_num # <<<<<<<<<<<<<<
  4565. * if ((descr.byteorder == c'>' and little_endian) or
  4566. * (descr.byteorder == c'<' and not little_endian)):
  4567. */
  4568. __pyx_t_5 = __pyx_v_descr->type_num;
  4569. __pyx_v_t = __pyx_t_5;
  4570. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
  4571. * if not hasfields:
  4572. * t = descr.type_num
  4573. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  4574. * (descr.byteorder == c'<' and not little_endian)):
  4575. * raise ValueError(u"Non-native byte order not supported")
  4576. */
  4577. __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
  4578. if (__pyx_t_1) {
  4579. __pyx_t_2 = (__pyx_v_little_endian != 0);
  4580. } else {
  4581. __pyx_t_2 = __pyx_t_1;
  4582. }
  4583. if (!__pyx_t_2) {
  4584. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
  4585. * t = descr.type_num
  4586. * if ((descr.byteorder == c'>' and little_endian) or
  4587. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  4588. * raise ValueError(u"Non-native byte order not supported")
  4589. * if t == NPY_BYTE: f = "b"
  4590. */
  4591. __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
  4592. if (__pyx_t_1) {
  4593. __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
  4594. __pyx_t_7 = __pyx_t_3;
  4595. } else {
  4596. __pyx_t_7 = __pyx_t_1;
  4597. }
  4598. __pyx_t_1 = __pyx_t_7;
  4599. } else {
  4600. __pyx_t_1 = __pyx_t_2;
  4601. }
  4602. if (__pyx_t_1) {
  4603. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  4604. * if ((descr.byteorder == c'>' and little_endian) or
  4605. * (descr.byteorder == c'<' and not little_endian)):
  4606. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  4607. * if t == NPY_BYTE: f = "b"
  4608. * elif t == NPY_UBYTE: f = "B"
  4609. */
  4610. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4611. __Pyx_GOTREF(__pyx_t_4);
  4612. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4613. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4614. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4615. }
  4616. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4617. * elif t == NPY_CDOUBLE: f = "Zd"
  4618. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4619. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4620. * else:
  4621. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4622. */
  4623. switch (__pyx_v_t) {
  4624. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
  4625. * (descr.byteorder == c'<' and not little_endian)):
  4626. * raise ValueError(u"Non-native byte order not supported")
  4627. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  4628. * elif t == NPY_UBYTE: f = "B"
  4629. * elif t == NPY_SHORT: f = "h"
  4630. */
  4631. case NPY_BYTE:
  4632. __pyx_v_f = __pyx_k_b;
  4633. break;
  4634. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
  4635. * raise ValueError(u"Non-native byte order not supported")
  4636. * if t == NPY_BYTE: f = "b"
  4637. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  4638. * elif t == NPY_SHORT: f = "h"
  4639. * elif t == NPY_USHORT: f = "H"
  4640. */
  4641. case NPY_UBYTE:
  4642. __pyx_v_f = __pyx_k_B;
  4643. break;
  4644. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
  4645. * if t == NPY_BYTE: f = "b"
  4646. * elif t == NPY_UBYTE: f = "B"
  4647. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  4648. * elif t == NPY_USHORT: f = "H"
  4649. * elif t == NPY_INT: f = "i"
  4650. */
  4651. case NPY_SHORT:
  4652. __pyx_v_f = __pyx_k_h;
  4653. break;
  4654. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
  4655. * elif t == NPY_UBYTE: f = "B"
  4656. * elif t == NPY_SHORT: f = "h"
  4657. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  4658. * elif t == NPY_INT: f = "i"
  4659. * elif t == NPY_UINT: f = "I"
  4660. */
  4661. case NPY_USHORT:
  4662. __pyx_v_f = __pyx_k_H;
  4663. break;
  4664. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
  4665. * elif t == NPY_SHORT: f = "h"
  4666. * elif t == NPY_USHORT: f = "H"
  4667. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  4668. * elif t == NPY_UINT: f = "I"
  4669. * elif t == NPY_LONG: f = "l"
  4670. */
  4671. case NPY_INT:
  4672. __pyx_v_f = __pyx_k_i;
  4673. break;
  4674. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
  4675. * elif t == NPY_USHORT: f = "H"
  4676. * elif t == NPY_INT: f = "i"
  4677. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  4678. * elif t == NPY_LONG: f = "l"
  4679. * elif t == NPY_ULONG: f = "L"
  4680. */
  4681. case NPY_UINT:
  4682. __pyx_v_f = __pyx_k_I;
  4683. break;
  4684. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
  4685. * elif t == NPY_INT: f = "i"
  4686. * elif t == NPY_UINT: f = "I"
  4687. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  4688. * elif t == NPY_ULONG: f = "L"
  4689. * elif t == NPY_LONGLONG: f = "q"
  4690. */
  4691. case NPY_LONG:
  4692. __pyx_v_f = __pyx_k_l;
  4693. break;
  4694. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
  4695. * elif t == NPY_UINT: f = "I"
  4696. * elif t == NPY_LONG: f = "l"
  4697. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  4698. * elif t == NPY_LONGLONG: f = "q"
  4699. * elif t == NPY_ULONGLONG: f = "Q"
  4700. */
  4701. case NPY_ULONG:
  4702. __pyx_v_f = __pyx_k_L;
  4703. break;
  4704. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
  4705. * elif t == NPY_LONG: f = "l"
  4706. * elif t == NPY_ULONG: f = "L"
  4707. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  4708. * elif t == NPY_ULONGLONG: f = "Q"
  4709. * elif t == NPY_FLOAT: f = "f"
  4710. */
  4711. case NPY_LONGLONG:
  4712. __pyx_v_f = __pyx_k_q;
  4713. break;
  4714. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
  4715. * elif t == NPY_ULONG: f = "L"
  4716. * elif t == NPY_LONGLONG: f = "q"
  4717. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  4718. * elif t == NPY_FLOAT: f = "f"
  4719. * elif t == NPY_DOUBLE: f = "d"
  4720. */
  4721. case NPY_ULONGLONG:
  4722. __pyx_v_f = __pyx_k_Q;
  4723. break;
  4724. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
  4725. * elif t == NPY_LONGLONG: f = "q"
  4726. * elif t == NPY_ULONGLONG: f = "Q"
  4727. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  4728. * elif t == NPY_DOUBLE: f = "d"
  4729. * elif t == NPY_LONGDOUBLE: f = "g"
  4730. */
  4731. case NPY_FLOAT:
  4732. __pyx_v_f = __pyx_k_f;
  4733. break;
  4734. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
  4735. * elif t == NPY_ULONGLONG: f = "Q"
  4736. * elif t == NPY_FLOAT: f = "f"
  4737. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  4738. * elif t == NPY_LONGDOUBLE: f = "g"
  4739. * elif t == NPY_CFLOAT: f = "Zf"
  4740. */
  4741. case NPY_DOUBLE:
  4742. __pyx_v_f = __pyx_k_d;
  4743. break;
  4744. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
  4745. * elif t == NPY_FLOAT: f = "f"
  4746. * elif t == NPY_DOUBLE: f = "d"
  4747. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  4748. * elif t == NPY_CFLOAT: f = "Zf"
  4749. * elif t == NPY_CDOUBLE: f = "Zd"
  4750. */
  4751. case NPY_LONGDOUBLE:
  4752. __pyx_v_f = __pyx_k_g;
  4753. break;
  4754. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
  4755. * elif t == NPY_DOUBLE: f = "d"
  4756. * elif t == NPY_LONGDOUBLE: f = "g"
  4757. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  4758. * elif t == NPY_CDOUBLE: f = "Zd"
  4759. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4760. */
  4761. case NPY_CFLOAT:
  4762. __pyx_v_f = __pyx_k_Zf;
  4763. break;
  4764. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
  4765. * elif t == NPY_LONGDOUBLE: f = "g"
  4766. * elif t == NPY_CFLOAT: f = "Zf"
  4767. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  4768. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4769. * elif t == NPY_OBJECT: f = "O"
  4770. */
  4771. case NPY_CDOUBLE:
  4772. __pyx_v_f = __pyx_k_Zd;
  4773. break;
  4774. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
  4775. * elif t == NPY_CFLOAT: f = "Zf"
  4776. * elif t == NPY_CDOUBLE: f = "Zd"
  4777. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  4778. * elif t == NPY_OBJECT: f = "O"
  4779. * else:
  4780. */
  4781. case NPY_CLONGDOUBLE:
  4782. __pyx_v_f = __pyx_k_Zg;
  4783. break;
  4784. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4785. * elif t == NPY_CDOUBLE: f = "Zd"
  4786. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4787. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4788. * else:
  4789. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4790. */
  4791. case NPY_OBJECT:
  4792. __pyx_v_f = __pyx_k_O;
  4793. break;
  4794. default:
  4795. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
  4796. * elif t == NPY_OBJECT: f = "O"
  4797. * else:
  4798. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  4799. * info.format = f
  4800. * return
  4801. */
  4802. __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;}
  4803. __Pyx_GOTREF(__pyx_t_4);
  4804. __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;}
  4805. __Pyx_GOTREF(__pyx_t_8);
  4806. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4807. __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;}
  4808. __Pyx_GOTREF(__pyx_t_4);
  4809. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  4810. __Pyx_GIVEREF(__pyx_t_8);
  4811. __pyx_t_8 = 0;
  4812. __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;}
  4813. __Pyx_GOTREF(__pyx_t_8);
  4814. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4815. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  4816. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4817. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4818. break;
  4819. }
  4820. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
  4821. * else:
  4822. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4823. * info.format = f # <<<<<<<<<<<<<<
  4824. * return
  4825. * else:
  4826. */
  4827. __pyx_v_info->format = __pyx_v_f;
  4828. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
  4829. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4830. * info.format = f
  4831. * return # <<<<<<<<<<<<<<
  4832. * else:
  4833. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4834. */
  4835. __pyx_r = 0;
  4836. goto __pyx_L0;
  4837. }
  4838. /*else*/ {
  4839. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
  4840. * return
  4841. * else:
  4842. * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  4843. * info.format[0] = c'^' # Native data types, manual alignment
  4844. * offset = 0
  4845. */
  4846. __pyx_v_info->format = ((char *)malloc(255));
  4847. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
  4848. * else:
  4849. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4850. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  4851. * offset = 0
  4852. * f = _util_dtypestring(descr, info.format + 1,
  4853. */
  4854. (__pyx_v_info->format[0]) = '^';
  4855. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
  4856. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4857. * info.format[0] = c'^' # Native data types, manual alignment
  4858. * offset = 0 # <<<<<<<<<<<<<<
  4859. * f = _util_dtypestring(descr, info.format + 1,
  4860. * info.format + _buffer_format_string_len,
  4861. */
  4862. __pyx_v_offset = 0;
  4863. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
  4864. * info.format[0] = c'^' # Native data types, manual alignment
  4865. * offset = 0
  4866. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  4867. * info.format + _buffer_format_string_len,
  4868. * &offset)
  4869. */
  4870. __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;}
  4871. __pyx_v_f = __pyx_t_9;
  4872. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
  4873. * info.format + _buffer_format_string_len,
  4874. * &offset)
  4875. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  4876. *
  4877. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4878. */
  4879. (__pyx_v_f[0]) = '\x00';
  4880. }
  4881. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4882. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4883. * # -- the details of this may change.
  4884. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4885. * # This implementation of getbuffer is geared towards Cython
  4886. * # requirements, and does not yet fullfill the PEP.
  4887. */
  4888. /* function exit code */
  4889. __pyx_r = 0;
  4890. goto __pyx_L0;
  4891. __pyx_L1_error:;
  4892. __Pyx_XDECREF(__pyx_t_4);
  4893. __Pyx_XDECREF(__pyx_t_8);
  4894. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4895. __pyx_r = -1;
  4896. if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
  4897. __Pyx_GOTREF(__pyx_v_info->obj);
  4898. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  4899. }
  4900. goto __pyx_L2;
  4901. __pyx_L0:;
  4902. if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
  4903. __Pyx_GOTREF(Py_None);
  4904. __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  4905. }
  4906. __pyx_L2:;
  4907. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  4908. __Pyx_RefNannyFinishContext();
  4909. return __pyx_r;
  4910. }
  4911. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4912. * f[0] = c'\0' # Terminate format string
  4913. *
  4914. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4915. * if PyArray_HASFIELDS(self):
  4916. * stdlib.free(info.format)
  4917. */
  4918. /* Python wrapper */
  4919. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  4920. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4921. __Pyx_RefNannyDeclarations
  4922. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  4923. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  4924. /* function exit code */
  4925. __Pyx_RefNannyFinishContext();
  4926. }
  4927. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4928. __Pyx_RefNannyDeclarations
  4929. int __pyx_t_1;
  4930. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  4931. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
  4932. *
  4933. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4934. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  4935. * stdlib.free(info.format)
  4936. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4937. */
  4938. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  4939. if (__pyx_t_1) {
  4940. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
  4941. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4942. * if PyArray_HASFIELDS(self):
  4943. * stdlib.free(info.format) # <<<<<<<<<<<<<<
  4944. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4945. * stdlib.free(info.strides)
  4946. */
  4947. free(__pyx_v_info->format);
  4948. goto __pyx_L3;
  4949. }
  4950. __pyx_L3:;
  4951. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
  4952. * if PyArray_HASFIELDS(self):
  4953. * stdlib.free(info.format)
  4954. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4955. * stdlib.free(info.strides)
  4956. * # info.shape was stored after info.strides in the same block
  4957. */
  4958. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4959. if (__pyx_t_1) {
  4960. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
  4961. * stdlib.free(info.format)
  4962. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4963. * stdlib.free(info.strides) # <<<<<<<<<<<<<<
  4964. * # info.shape was stored after info.strides in the same block
  4965. *
  4966. */
  4967. free(__pyx_v_info->strides);
  4968. goto __pyx_L4;
  4969. }
  4970. __pyx_L4:;
  4971. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4972. * f[0] = c'\0' # Terminate format string
  4973. *
  4974. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4975. * if PyArray_HASFIELDS(self):
  4976. * stdlib.free(info.format)
  4977. */
  4978. /* function exit code */
  4979. __Pyx_RefNannyFinishContext();
  4980. }
  4981. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4982. * ctypedef npy_cdouble complex_t
  4983. *
  4984. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4985. * return PyArray_MultiIterNew(1, <void*>a)
  4986. *
  4987. */
  4988. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  4989. PyObject *__pyx_r = NULL;
  4990. __Pyx_RefNannyDeclarations
  4991. PyObject *__pyx_t_1 = NULL;
  4992. int __pyx_lineno = 0;
  4993. const char *__pyx_filename = NULL;
  4994. int __pyx_clineno = 0;
  4995. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  4996. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
  4997. *
  4998. * cdef inline object PyArray_MultiIterNew1(a):
  4999. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  5000. *
  5001. * cdef inline object PyArray_MultiIterNew2(a, b):
  5002. */
  5003. __Pyx_XDECREF(__pyx_r);
  5004. __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;}
  5005. __Pyx_GOTREF(__pyx_t_1);
  5006. __pyx_r = __pyx_t_1;
  5007. __pyx_t_1 = 0;
  5008. goto __pyx_L0;
  5009. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  5010. * ctypedef npy_cdouble complex_t
  5011. *
  5012. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  5013. * return PyArray_MultiIterNew(1, <void*>a)
  5014. *
  5015. */
  5016. /* function exit code */
  5017. __pyx_L1_error:;
  5018. __Pyx_XDECREF(__pyx_t_1);
  5019. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5020. __pyx_r = 0;
  5021. __pyx_L0:;
  5022. __Pyx_XGIVEREF(__pyx_r);
  5023. __Pyx_RefNannyFinishContext();
  5024. return __pyx_r;
  5025. }
  5026. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  5027. * return PyArray_MultiIterNew(1, <void*>a)
  5028. *
  5029. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  5030. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5031. *
  5032. */
  5033. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  5034. PyObject *__pyx_r = NULL;
  5035. __Pyx_RefNannyDeclarations
  5036. PyObject *__pyx_t_1 = NULL;
  5037. int __pyx_lineno = 0;
  5038. const char *__pyx_filename = NULL;
  5039. int __pyx_clineno = 0;
  5040. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  5041. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
  5042. *
  5043. * cdef inline object PyArray_MultiIterNew2(a, b):
  5044. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  5045. *
  5046. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  5047. */
  5048. __Pyx_XDECREF(__pyx_r);
  5049. __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;}
  5050. __Pyx_GOTREF(__pyx_t_1);
  5051. __pyx_r = __pyx_t_1;
  5052. __pyx_t_1 = 0;
  5053. goto __pyx_L0;
  5054. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  5055. * return PyArray_MultiIterNew(1, <void*>a)
  5056. *
  5057. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  5058. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5059. *
  5060. */
  5061. /* function exit code */
  5062. __pyx_L1_error:;
  5063. __Pyx_XDECREF(__pyx_t_1);
  5064. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5065. __pyx_r = 0;
  5066. __pyx_L0:;
  5067. __Pyx_XGIVEREF(__pyx_r);
  5068. __Pyx_RefNannyFinishContext();
  5069. return __pyx_r;
  5070. }
  5071. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  5072. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5073. *
  5074. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  5075. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5076. *
  5077. */
  5078. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  5079. PyObject *__pyx_r = NULL;
  5080. __Pyx_RefNannyDeclarations
  5081. PyObject *__pyx_t_1 = NULL;
  5082. int __pyx_lineno = 0;
  5083. const char *__pyx_filename = NULL;
  5084. int __pyx_clineno = 0;
  5085. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  5086. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775
  5087. *
  5088. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  5089. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  5090. *
  5091. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  5092. */
  5093. __Pyx_XDECREF(__pyx_r);
  5094. __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;}
  5095. __Pyx_GOTREF(__pyx_t_1);
  5096. __pyx_r = __pyx_t_1;
  5097. __pyx_t_1 = 0;
  5098. goto __pyx_L0;
  5099. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  5100. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5101. *
  5102. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  5103. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5104. *
  5105. */
  5106. /* function exit code */
  5107. __pyx_L1_error:;
  5108. __Pyx_XDECREF(__pyx_t_1);
  5109. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5110. __pyx_r = 0;
  5111. __pyx_L0:;
  5112. __Pyx_XGIVEREF(__pyx_r);
  5113. __Pyx_RefNannyFinishContext();
  5114. return __pyx_r;
  5115. }
  5116. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  5117. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5118. *
  5119. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  5120. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5121. *
  5122. */
  5123. 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) {
  5124. PyObject *__pyx_r = NULL;
  5125. __Pyx_RefNannyDeclarations
  5126. PyObject *__pyx_t_1 = NULL;
  5127. int __pyx_lineno = 0;
  5128. const char *__pyx_filename = NULL;
  5129. int __pyx_clineno = 0;
  5130. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  5131. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778
  5132. *
  5133. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  5134. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  5135. *
  5136. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  5137. */
  5138. __Pyx_XDECREF(__pyx_r);
  5139. __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;}
  5140. __Pyx_GOTREF(__pyx_t_1);
  5141. __pyx_r = __pyx_t_1;
  5142. __pyx_t_1 = 0;
  5143. goto __pyx_L0;
  5144. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  5145. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5146. *
  5147. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  5148. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5149. *
  5150. */
  5151. /* function exit code */
  5152. __pyx_L1_error:;
  5153. __Pyx_XDECREF(__pyx_t_1);
  5154. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5155. __pyx_r = 0;
  5156. __pyx_L0:;
  5157. __Pyx_XGIVEREF(__pyx_r);
  5158. __Pyx_RefNannyFinishContext();
  5159. return __pyx_r;
  5160. }
  5161. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  5162. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5163. *
  5164. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  5165. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5166. *
  5167. */
  5168. 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) {
  5169. PyObject *__pyx_r = NULL;
  5170. __Pyx_RefNannyDeclarations
  5171. PyObject *__pyx_t_1 = NULL;
  5172. int __pyx_lineno = 0;
  5173. const char *__pyx_filename = NULL;
  5174. int __pyx_clineno = 0;
  5175. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  5176. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":781
  5177. *
  5178. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  5179. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  5180. *
  5181. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  5182. */
  5183. __Pyx_XDECREF(__pyx_r);
  5184. __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;}
  5185. __Pyx_GOTREF(__pyx_t_1);
  5186. __pyx_r = __pyx_t_1;
  5187. __pyx_t_1 = 0;
  5188. goto __pyx_L0;
  5189. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  5190. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5191. *
  5192. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  5193. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5194. *
  5195. */
  5196. /* function exit code */
  5197. __pyx_L1_error:;
  5198. __Pyx_XDECREF(__pyx_t_1);
  5199. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5200. __pyx_r = 0;
  5201. __pyx_L0:;
  5202. __Pyx_XGIVEREF(__pyx_r);
  5203. __Pyx_RefNannyFinishContext();
  5204. return __pyx_r;
  5205. }
  5206. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5207. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5208. *
  5209. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5210. * # Recursive utility function used in __getbuffer__ to get format
  5211. * # string. The new location in the format string is returned.
  5212. */
  5213. 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) {
  5214. PyArray_Descr *__pyx_v_child = 0;
  5215. int __pyx_v_endian_detector;
  5216. int __pyx_v_little_endian;
  5217. PyObject *__pyx_v_fields = 0;
  5218. PyObject *__pyx_v_childname = NULL;
  5219. PyObject *__pyx_v_new_offset = NULL;
  5220. PyObject *__pyx_v_t = NULL;
  5221. char *__pyx_r;
  5222. __Pyx_RefNannyDeclarations
  5223. PyObject *__pyx_t_1 = NULL;
  5224. Py_ssize_t __pyx_t_2;
  5225. PyObject *__pyx_t_3 = NULL;
  5226. PyObject *__pyx_t_4 = NULL;
  5227. int __pyx_t_5;
  5228. int __pyx_t_6;
  5229. int __pyx_t_7;
  5230. int __pyx_t_8;
  5231. int __pyx_t_9;
  5232. long __pyx_t_10;
  5233. char *__pyx_t_11;
  5234. int __pyx_lineno = 0;
  5235. const char *__pyx_filename = NULL;
  5236. int __pyx_clineno = 0;
  5237. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  5238. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
  5239. * cdef int delta_offset
  5240. * cdef tuple i
  5241. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  5242. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  5243. * cdef tuple fields
  5244. */
  5245. __pyx_v_endian_detector = 1;
  5246. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
  5247. * cdef tuple i
  5248. * cdef int endian_detector = 1
  5249. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  5250. * cdef tuple fields
  5251. *
  5252. */
  5253. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  5254. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
  5255. * cdef tuple fields
  5256. *
  5257. * for childname in descr.names: # <<<<<<<<<<<<<<
  5258. * fields = descr.fields[childname]
  5259. * child, new_offset = fields
  5260. */
  5261. if (unlikely(__pyx_v_descr->names == Py_None)) {
  5262. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  5263. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5264. }
  5265. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  5266. for (;;) {
  5267. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  5268. #if CYTHON_COMPILING_IN_CPYTHON
  5269. __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;}
  5270. #else
  5271. __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;}
  5272. #endif
  5273. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  5274. __pyx_t_3 = 0;
  5275. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795
  5276. *
  5277. * for childname in descr.names:
  5278. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  5279. * child, new_offset = fields
  5280. *
  5281. */
  5282. __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;};
  5283. __Pyx_GOTREF(__pyx_t_3);
  5284. 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;}
  5285. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  5286. __pyx_t_3 = 0;
  5287. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
  5288. * for childname in descr.names:
  5289. * fields = descr.fields[childname]
  5290. * child, new_offset = fields # <<<<<<<<<<<<<<
  5291. *
  5292. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5293. */
  5294. if (likely(__pyx_v_fields != Py_None)) {
  5295. PyObject* sequence = __pyx_v_fields;
  5296. #if CYTHON_COMPILING_IN_CPYTHON
  5297. Py_ssize_t size = Py_SIZE(sequence);
  5298. #else
  5299. Py_ssize_t size = PySequence_Size(sequence);
  5300. #endif
  5301. if (unlikely(size != 2)) {
  5302. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5303. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5304. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5305. }
  5306. #if CYTHON_COMPILING_IN_CPYTHON
  5307. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  5308. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  5309. __Pyx_INCREF(__pyx_t_3);
  5310. __Pyx_INCREF(__pyx_t_4);
  5311. #else
  5312. __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;}
  5313. __Pyx_GOTREF(__pyx_t_3);
  5314. __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;}
  5315. __Pyx_GOTREF(__pyx_t_4);
  5316. #endif
  5317. } else {
  5318. __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5319. }
  5320. 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;}
  5321. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  5322. __pyx_t_3 = 0;
  5323. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  5324. __pyx_t_4 = 0;
  5325. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
  5326. * child, new_offset = fields
  5327. *
  5328. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  5329. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  5330. *
  5331. */
  5332. __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;}
  5333. __Pyx_GOTREF(__pyx_t_4);
  5334. __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;}
  5335. __Pyx_GOTREF(__pyx_t_3);
  5336. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5337. __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;}
  5338. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5339. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  5340. if (__pyx_t_6) {
  5341. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  5342. *
  5343. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5344. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  5345. *
  5346. * if ((child.byteorder == c'>' and little_endian) or
  5347. */
  5348. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5349. __Pyx_GOTREF(__pyx_t_3);
  5350. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5351. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5352. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5353. }
  5354. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
  5355. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  5356. *
  5357. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  5358. * (child.byteorder == c'<' and not little_endian)):
  5359. * raise ValueError(u"Non-native byte order not supported")
  5360. */
  5361. __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
  5362. if (__pyx_t_6) {
  5363. __pyx_t_7 = (__pyx_v_little_endian != 0);
  5364. } else {
  5365. __pyx_t_7 = __pyx_t_6;
  5366. }
  5367. if (!__pyx_t_7) {
  5368. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
  5369. *
  5370. * if ((child.byteorder == c'>' and little_endian) or
  5371. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  5372. * raise ValueError(u"Non-native byte order not supported")
  5373. * # One could encode it in the format string and have Cython
  5374. */
  5375. __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
  5376. if (__pyx_t_6) {
  5377. __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
  5378. __pyx_t_9 = __pyx_t_8;
  5379. } else {
  5380. __pyx_t_9 = __pyx_t_6;
  5381. }
  5382. __pyx_t_6 = __pyx_t_9;
  5383. } else {
  5384. __pyx_t_6 = __pyx_t_7;
  5385. }
  5386. if (__pyx_t_6) {
  5387. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  5388. * if ((child.byteorder == c'>' and little_endian) or
  5389. * (child.byteorder == c'<' and not little_endian)):
  5390. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5391. * # One could encode it in the format string and have Cython
  5392. * # complain instead, BUT: < and > in format strings also imply
  5393. */
  5394. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5395. __Pyx_GOTREF(__pyx_t_3);
  5396. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5397. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5398. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5399. }
  5400. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
  5401. *
  5402. * # Output padding bytes
  5403. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  5404. * f[0] = 120 # "x"; pad byte
  5405. * f += 1
  5406. */
  5407. while (1) {
  5408. __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;}
  5409. __Pyx_GOTREF(__pyx_t_3);
  5410. __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;}
  5411. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5412. __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;}
  5413. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5414. if (!__pyx_t_6) break;
  5415. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
  5416. * # Output padding bytes
  5417. * while offset[0] < new_offset:
  5418. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  5419. * f += 1
  5420. * offset[0] += 1
  5421. */
  5422. (__pyx_v_f[0]) = 120;
  5423. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
  5424. * while offset[0] < new_offset:
  5425. * f[0] = 120 # "x"; pad byte
  5426. * f += 1 # <<<<<<<<<<<<<<
  5427. * offset[0] += 1
  5428. *
  5429. */
  5430. __pyx_v_f = (__pyx_v_f + 1);
  5431. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
  5432. * f[0] = 120 # "x"; pad byte
  5433. * f += 1
  5434. * offset[0] += 1 # <<<<<<<<<<<<<<
  5435. *
  5436. * offset[0] += child.itemsize
  5437. */
  5438. __pyx_t_10 = 0;
  5439. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
  5440. }
  5441. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
  5442. * offset[0] += 1
  5443. *
  5444. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  5445. *
  5446. * if not PyDataType_HASFIELDS(child):
  5447. */
  5448. __pyx_t_10 = 0;
  5449. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
  5450. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
  5451. * offset[0] += child.itemsize
  5452. *
  5453. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  5454. * t = child.type_num
  5455. * if end - f < 5:
  5456. */
  5457. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  5458. if (__pyx_t_6) {
  5459. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821
  5460. *
  5461. * if not PyDataType_HASFIELDS(child):
  5462. * t = child.type_num # <<<<<<<<<<<<<<
  5463. * if end - f < 5:
  5464. * raise RuntimeError(u"Format string allocated too short.")
  5465. */
  5466. __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;}
  5467. __Pyx_GOTREF(__pyx_t_4);
  5468. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  5469. __pyx_t_4 = 0;
  5470. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822
  5471. * if not PyDataType_HASFIELDS(child):
  5472. * t = child.type_num
  5473. * if end - f < 5: # <<<<<<<<<<<<<<
  5474. * raise RuntimeError(u"Format string allocated too short.")
  5475. *
  5476. */
  5477. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  5478. if (__pyx_t_6) {
  5479. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  5480. * t = child.type_num
  5481. * if end - f < 5:
  5482. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  5483. *
  5484. * # Until ticket #99 is fixed, use integers to avoid warnings
  5485. */
  5486. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5487. __Pyx_GOTREF(__pyx_t_4);
  5488. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  5489. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5490. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5491. }
  5492. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
  5493. *
  5494. * # Until ticket #99 is fixed, use integers to avoid warnings
  5495. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  5496. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5497. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5498. */
  5499. __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;}
  5500. __Pyx_GOTREF(__pyx_t_4);
  5501. __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;}
  5502. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5503. __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;}
  5504. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5505. if (__pyx_t_6) {
  5506. (__pyx_v_f[0]) = 98;
  5507. goto __pyx_L11;
  5508. }
  5509. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827
  5510. * # Until ticket #99 is fixed, use integers to avoid warnings
  5511. * if t == NPY_BYTE: f[0] = 98 #"b"
  5512. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  5513. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5514. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5515. */
  5516. __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;}
  5517. __Pyx_GOTREF(__pyx_t_3);
  5518. __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;}
  5519. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5520. __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;}
  5521. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5522. if (__pyx_t_6) {
  5523. (__pyx_v_f[0]) = 66;
  5524. goto __pyx_L11;
  5525. }
  5526. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828
  5527. * if t == NPY_BYTE: f[0] = 98 #"b"
  5528. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5529. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  5530. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5531. * elif t == NPY_INT: f[0] = 105 #"i"
  5532. */
  5533. __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;}
  5534. __Pyx_GOTREF(__pyx_t_4);
  5535. __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;}
  5536. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5537. __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;}
  5538. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5539. if (__pyx_t_6) {
  5540. (__pyx_v_f[0]) = 104;
  5541. goto __pyx_L11;
  5542. }
  5543. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
  5544. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5545. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5546. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  5547. * elif t == NPY_INT: f[0] = 105 #"i"
  5548. * elif t == NPY_UINT: f[0] = 73 #"I"
  5549. */
  5550. __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;}
  5551. __Pyx_GOTREF(__pyx_t_3);
  5552. __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;}
  5553. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5554. __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;}
  5555. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5556. if (__pyx_t_6) {
  5557. (__pyx_v_f[0]) = 72;
  5558. goto __pyx_L11;
  5559. }
  5560. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830
  5561. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5562. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5563. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  5564. * elif t == NPY_UINT: f[0] = 73 #"I"
  5565. * elif t == NPY_LONG: f[0] = 108 #"l"
  5566. */
  5567. __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;}
  5568. __Pyx_GOTREF(__pyx_t_4);
  5569. __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;}
  5570. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5571. __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;}
  5572. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5573. if (__pyx_t_6) {
  5574. (__pyx_v_f[0]) = 105;
  5575. goto __pyx_L11;
  5576. }
  5577. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
  5578. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5579. * elif t == NPY_INT: f[0] = 105 #"i"
  5580. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  5581. * elif t == NPY_LONG: f[0] = 108 #"l"
  5582. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5583. */
  5584. __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;}
  5585. __Pyx_GOTREF(__pyx_t_3);
  5586. __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;}
  5587. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5588. __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;}
  5589. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5590. if (__pyx_t_6) {
  5591. (__pyx_v_f[0]) = 73;
  5592. goto __pyx_L11;
  5593. }
  5594. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832
  5595. * elif t == NPY_INT: f[0] = 105 #"i"
  5596. * elif t == NPY_UINT: f[0] = 73 #"I"
  5597. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  5598. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5599. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5600. */
  5601. __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;}
  5602. __Pyx_GOTREF(__pyx_t_4);
  5603. __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;}
  5604. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5605. __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;}
  5606. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5607. if (__pyx_t_6) {
  5608. (__pyx_v_f[0]) = 108;
  5609. goto __pyx_L11;
  5610. }
  5611. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
  5612. * elif t == NPY_UINT: f[0] = 73 #"I"
  5613. * elif t == NPY_LONG: f[0] = 108 #"l"
  5614. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  5615. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5616. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5617. */
  5618. __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;}
  5619. __Pyx_GOTREF(__pyx_t_3);
  5620. __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;}
  5621. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5622. __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;}
  5623. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5624. if (__pyx_t_6) {
  5625. (__pyx_v_f[0]) = 76;
  5626. goto __pyx_L11;
  5627. }
  5628. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834
  5629. * elif t == NPY_LONG: f[0] = 108 #"l"
  5630. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5631. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  5632. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5633. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5634. */
  5635. __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;}
  5636. __Pyx_GOTREF(__pyx_t_4);
  5637. __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;}
  5638. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5639. __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;}
  5640. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5641. if (__pyx_t_6) {
  5642. (__pyx_v_f[0]) = 113;
  5643. goto __pyx_L11;
  5644. }
  5645. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
  5646. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5647. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5648. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  5649. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5650. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5651. */
  5652. __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;}
  5653. __Pyx_GOTREF(__pyx_t_3);
  5654. __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;}
  5655. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5656. __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;}
  5657. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5658. if (__pyx_t_6) {
  5659. (__pyx_v_f[0]) = 81;
  5660. goto __pyx_L11;
  5661. }
  5662. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836
  5663. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5664. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5665. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  5666. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5667. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5668. */
  5669. __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;}
  5670. __Pyx_GOTREF(__pyx_t_4);
  5671. __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;}
  5672. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5673. __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;}
  5674. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5675. if (__pyx_t_6) {
  5676. (__pyx_v_f[0]) = 102;
  5677. goto __pyx_L11;
  5678. }
  5679. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
  5680. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5681. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5682. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  5683. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5684. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5685. */
  5686. __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;}
  5687. __Pyx_GOTREF(__pyx_t_3);
  5688. __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;}
  5689. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5690. __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;}
  5691. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5692. if (__pyx_t_6) {
  5693. (__pyx_v_f[0]) = 100;
  5694. goto __pyx_L11;
  5695. }
  5696. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
  5697. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5698. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5699. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  5700. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5701. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5702. */
  5703. __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;}
  5704. __Pyx_GOTREF(__pyx_t_4);
  5705. __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;}
  5706. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5707. __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;}
  5708. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5709. if (__pyx_t_6) {
  5710. (__pyx_v_f[0]) = 103;
  5711. goto __pyx_L11;
  5712. }
  5713. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
  5714. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5715. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5716. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  5717. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5718. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5719. */
  5720. __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;}
  5721. __Pyx_GOTREF(__pyx_t_3);
  5722. __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;}
  5723. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5724. __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;}
  5725. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5726. if (__pyx_t_6) {
  5727. (__pyx_v_f[0]) = 90;
  5728. (__pyx_v_f[1]) = 102;
  5729. __pyx_v_f = (__pyx_v_f + 1);
  5730. goto __pyx_L11;
  5731. }
  5732. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
  5733. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5734. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5735. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  5736. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5737. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5738. */
  5739. __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;}
  5740. __Pyx_GOTREF(__pyx_t_4);
  5741. __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;}
  5742. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5743. __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;}
  5744. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5745. if (__pyx_t_6) {
  5746. (__pyx_v_f[0]) = 90;
  5747. (__pyx_v_f[1]) = 100;
  5748. __pyx_v_f = (__pyx_v_f + 1);
  5749. goto __pyx_L11;
  5750. }
  5751. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
  5752. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5753. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5754. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  5755. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5756. * else:
  5757. */
  5758. __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;}
  5759. __Pyx_GOTREF(__pyx_t_3);
  5760. __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;}
  5761. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5762. __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;}
  5763. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5764. if (__pyx_t_6) {
  5765. (__pyx_v_f[0]) = 90;
  5766. (__pyx_v_f[1]) = 103;
  5767. __pyx_v_f = (__pyx_v_f + 1);
  5768. goto __pyx_L11;
  5769. }
  5770. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
  5771. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5772. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5773. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  5774. * else:
  5775. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5776. */
  5777. __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;}
  5778. __Pyx_GOTREF(__pyx_t_4);
  5779. __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;}
  5780. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5781. __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;}
  5782. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5783. if (__pyx_t_6) {
  5784. (__pyx_v_f[0]) = 79;
  5785. goto __pyx_L11;
  5786. }
  5787. /*else*/ {
  5788. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844
  5789. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5790. * else:
  5791. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  5792. * f += 1
  5793. * else:
  5794. */
  5795. __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;}
  5796. __Pyx_GOTREF(__pyx_t_3);
  5797. __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;}
  5798. __Pyx_GOTREF(__pyx_t_4);
  5799. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  5800. __Pyx_GIVEREF(__pyx_t_3);
  5801. __pyx_t_3 = 0;
  5802. __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;}
  5803. __Pyx_GOTREF(__pyx_t_3);
  5804. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5805. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5806. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5807. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5808. }
  5809. __pyx_L11:;
  5810. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
  5811. * else:
  5812. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5813. * f += 1 # <<<<<<<<<<<<<<
  5814. * else:
  5815. * # Cython ignores struct boundary information ("T{...}"),
  5816. */
  5817. __pyx_v_f = (__pyx_v_f + 1);
  5818. goto __pyx_L9;
  5819. }
  5820. /*else*/ {
  5821. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
  5822. * # Cython ignores struct boundary information ("T{...}"),
  5823. * # so don't output it
  5824. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  5825. * return f
  5826. *
  5827. */
  5828. __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;}
  5829. __pyx_v_f = __pyx_t_11;
  5830. }
  5831. __pyx_L9:;
  5832. }
  5833. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5834. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
  5835. * # so don't output it
  5836. * f = _util_dtypestring(child, f, end, offset)
  5837. * return f # <<<<<<<<<<<<<<
  5838. *
  5839. *
  5840. */
  5841. __pyx_r = __pyx_v_f;
  5842. goto __pyx_L0;
  5843. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5844. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5845. *
  5846. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5847. * # Recursive utility function used in __getbuffer__ to get format
  5848. * # string. The new location in the format string is returned.
  5849. */
  5850. /* function exit code */
  5851. __pyx_L1_error:;
  5852. __Pyx_XDECREF(__pyx_t_1);
  5853. __Pyx_XDECREF(__pyx_t_3);
  5854. __Pyx_XDECREF(__pyx_t_4);
  5855. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5856. __pyx_r = NULL;
  5857. __pyx_L0:;
  5858. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  5859. __Pyx_XDECREF(__pyx_v_fields);
  5860. __Pyx_XDECREF(__pyx_v_childname);
  5861. __Pyx_XDECREF(__pyx_v_new_offset);
  5862. __Pyx_XDECREF(__pyx_v_t);
  5863. __Pyx_RefNannyFinishContext();
  5864. return __pyx_r;
  5865. }
  5866. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5867. *
  5868. *
  5869. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5870. * cdef PyObject* baseptr
  5871. * if base is None:
  5872. */
  5873. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  5874. PyObject *__pyx_v_baseptr;
  5875. __Pyx_RefNannyDeclarations
  5876. int __pyx_t_1;
  5877. int __pyx_t_2;
  5878. __Pyx_RefNannySetupContext("set_array_base", 0);
  5879. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
  5880. * cdef inline void set_array_base(ndarray arr, object base):
  5881. * cdef PyObject* baseptr
  5882. * if base is None: # <<<<<<<<<<<<<<
  5883. * baseptr = NULL
  5884. * else:
  5885. */
  5886. __pyx_t_1 = (__pyx_v_base == Py_None);
  5887. __pyx_t_2 = (__pyx_t_1 != 0);
  5888. if (__pyx_t_2) {
  5889. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
  5890. * cdef PyObject* baseptr
  5891. * if base is None:
  5892. * baseptr = NULL # <<<<<<<<<<<<<<
  5893. * else:
  5894. * Py_INCREF(base) # important to do this before decref below!
  5895. */
  5896. __pyx_v_baseptr = NULL;
  5897. goto __pyx_L3;
  5898. }
  5899. /*else*/ {
  5900. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
  5901. * baseptr = NULL
  5902. * else:
  5903. * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
  5904. * baseptr = <PyObject*>base
  5905. * Py_XDECREF(arr.base)
  5906. */
  5907. Py_INCREF(__pyx_v_base);
  5908. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
  5909. * else:
  5910. * Py_INCREF(base) # important to do this before decref below!
  5911. * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
  5912. * Py_XDECREF(arr.base)
  5913. * arr.base = baseptr
  5914. */
  5915. __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  5916. }
  5917. __pyx_L3:;
  5918. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
  5919. * Py_INCREF(base) # important to do this before decref below!
  5920. * baseptr = <PyObject*>base
  5921. * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
  5922. * arr.base = baseptr
  5923. *
  5924. */
  5925. Py_XDECREF(__pyx_v_arr->base);
  5926. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
  5927. * baseptr = <PyObject*>base
  5928. * Py_XDECREF(arr.base)
  5929. * arr.base = baseptr # <<<<<<<<<<<<<<
  5930. *
  5931. * cdef inline object get_array_base(ndarray arr):
  5932. */
  5933. __pyx_v_arr->base = __pyx_v_baseptr;
  5934. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5935. *
  5936. *
  5937. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5938. * cdef PyObject* baseptr
  5939. * if base is None:
  5940. */
  5941. /* function exit code */
  5942. __Pyx_RefNannyFinishContext();
  5943. }
  5944. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5945. * arr.base = baseptr
  5946. *
  5947. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5948. * if arr.base is NULL:
  5949. * return None
  5950. */
  5951. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  5952. PyObject *__pyx_r = NULL;
  5953. __Pyx_RefNannyDeclarations
  5954. int __pyx_t_1;
  5955. __Pyx_RefNannySetupContext("get_array_base", 0);
  5956. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
  5957. *
  5958. * cdef inline object get_array_base(ndarray arr):
  5959. * if arr.base is NULL: # <<<<<<<<<<<<<<
  5960. * return None
  5961. * else:
  5962. */
  5963. __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  5964. if (__pyx_t_1) {
  5965. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
  5966. * cdef inline object get_array_base(ndarray arr):
  5967. * if arr.base is NULL:
  5968. * return None # <<<<<<<<<<<<<<
  5969. * else:
  5970. * return <object>arr.base
  5971. */
  5972. __Pyx_XDECREF(__pyx_r);
  5973. __Pyx_INCREF(Py_None);
  5974. __pyx_r = Py_None;
  5975. goto __pyx_L0;
  5976. }
  5977. /*else*/ {
  5978. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
  5979. * return None
  5980. * else:
  5981. * return <object>arr.base # <<<<<<<<<<<<<<
  5982. */
  5983. __Pyx_XDECREF(__pyx_r);
  5984. __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
  5985. __pyx_r = ((PyObject *)__pyx_v_arr->base);
  5986. goto __pyx_L0;
  5987. }
  5988. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5989. * arr.base = baseptr
  5990. *
  5991. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5992. * if arr.base is NULL:
  5993. * return None
  5994. */
  5995. /* function exit code */
  5996. __pyx_L0:;
  5997. __Pyx_XGIVEREF(__pyx_r);
  5998. __Pyx_RefNannyFinishContext();
  5999. return __pyx_r;
  6000. }
  6001. /* "vector.from_py":45
  6002. *
  6003. * @cname("__pyx_convert_vector_from_py_double")
  6004. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  6005. * cdef vector[X] v
  6006. * for item in o:
  6007. */
  6008. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  6009. std::vector<double> __pyx_v_v;
  6010. PyObject *__pyx_v_item = NULL;
  6011. std::vector<double> __pyx_r;
  6012. __Pyx_RefNannyDeclarations
  6013. PyObject *__pyx_t_1 = NULL;
  6014. Py_ssize_t __pyx_t_2;
  6015. PyObject *(*__pyx_t_3)(PyObject *);
  6016. PyObject *__pyx_t_4 = NULL;
  6017. double __pyx_t_5;
  6018. int __pyx_lineno = 0;
  6019. const char *__pyx_filename = NULL;
  6020. int __pyx_clineno = 0;
  6021. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  6022. /* "vector.from_py":47
  6023. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  6024. * cdef vector[X] v
  6025. * for item in o: # <<<<<<<<<<<<<<
  6026. * v.push_back(X_from_py(item))
  6027. * return v
  6028. */
  6029. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  6030. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  6031. __pyx_t_3 = NULL;
  6032. } else {
  6033. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6034. __Pyx_GOTREF(__pyx_t_1);
  6035. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  6036. }
  6037. for (;;) {
  6038. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  6039. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  6040. #if CYTHON_COMPILING_IN_CPYTHON
  6041. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6042. #else
  6043. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6044. #endif
  6045. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  6046. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  6047. #if CYTHON_COMPILING_IN_CPYTHON
  6048. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6049. #else
  6050. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6051. #endif
  6052. } else {
  6053. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  6054. if (unlikely(!__pyx_t_4)) {
  6055. PyObject* exc_type = PyErr_Occurred();
  6056. if (exc_type) {
  6057. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6058. else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6059. }
  6060. break;
  6061. }
  6062. __Pyx_GOTREF(__pyx_t_4);
  6063. }
  6064. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  6065. __pyx_t_4 = 0;
  6066. /* "vector.from_py":48
  6067. * cdef vector[X] v
  6068. * for item in o:
  6069. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  6070. * return v
  6071. *
  6072. */
  6073. __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely(__pyx_t_5 == -1.0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6074. __pyx_v_v.push_back(__pyx_t_5);
  6075. }
  6076. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6077. /* "vector.from_py":49
  6078. * for item in o:
  6079. * v.push_back(X_from_py(item))
  6080. * return v # <<<<<<<<<<<<<<
  6081. *
  6082. *
  6083. */
  6084. __pyx_r = __pyx_v_v;
  6085. goto __pyx_L0;
  6086. /* "vector.from_py":45
  6087. *
  6088. * @cname("__pyx_convert_vector_from_py_double")
  6089. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  6090. * cdef vector[X] v
  6091. * for item in o:
  6092. */
  6093. /* function exit code */
  6094. __pyx_L1_error:;
  6095. __Pyx_XDECREF(__pyx_t_1);
  6096. __Pyx_XDECREF(__pyx_t_4);
  6097. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6098. __pyx_L0:;
  6099. __Pyx_XDECREF(__pyx_v_item);
  6100. __Pyx_RefNannyFinishContext();
  6101. return __pyx_r;
  6102. }
  6103. /* "vector.from_py":46
  6104. *
  6105. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6106. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6107. * cdef vector[X] v
  6108. * for item in o:
  6109. */
  6110. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *__pyx_v_o) {
  6111. std::vector<__pyx_t_double_complex> __pyx_v_v;
  6112. PyObject *__pyx_v_item = NULL;
  6113. std::vector<__pyx_t_double_complex> __pyx_r;
  6114. __Pyx_RefNannyDeclarations
  6115. PyObject *__pyx_t_1 = NULL;
  6116. Py_ssize_t __pyx_t_2;
  6117. PyObject *(*__pyx_t_3)(PyObject *);
  6118. PyObject *__pyx_t_4 = NULL;
  6119. __pyx_t_double_complex __pyx_t_5;
  6120. int __pyx_lineno = 0;
  6121. const char *__pyx_filename = NULL;
  6122. int __pyx_clineno = 0;
  6123. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_double_complex", 0);
  6124. /* "vector.from_py":48
  6125. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *:
  6126. * cdef vector[X] v
  6127. * for item in o: # <<<<<<<<<<<<<<
  6128. * v.push_back(X_from_py(item))
  6129. * return v
  6130. */
  6131. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  6132. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  6133. __pyx_t_3 = NULL;
  6134. } else {
  6135. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6136. __Pyx_GOTREF(__pyx_t_1);
  6137. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  6138. }
  6139. for (;;) {
  6140. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  6141. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  6142. #if CYTHON_COMPILING_IN_CPYTHON
  6143. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6144. #else
  6145. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6146. #endif
  6147. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  6148. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  6149. #if CYTHON_COMPILING_IN_CPYTHON
  6150. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6151. #else
  6152. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6153. #endif
  6154. } else {
  6155. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  6156. if (unlikely(!__pyx_t_4)) {
  6157. PyObject* exc_type = PyErr_Occurred();
  6158. if (exc_type) {
  6159. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6160. else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6161. }
  6162. break;
  6163. }
  6164. __Pyx_GOTREF(__pyx_t_4);
  6165. }
  6166. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  6167. __pyx_t_4 = 0;
  6168. /* "vector.from_py":49
  6169. * cdef vector[X] v
  6170. * for item in o:
  6171. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  6172. * return v
  6173. *
  6174. */
  6175. __pyx_t_5 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_item); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6176. __pyx_v_v.push_back(__pyx_t_5);
  6177. }
  6178. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6179. /* "vector.from_py":50
  6180. * for item in o:
  6181. * v.push_back(X_from_py(item))
  6182. * return v # <<<<<<<<<<<<<<
  6183. *
  6184. *
  6185. */
  6186. __pyx_r = __pyx_v_v;
  6187. goto __pyx_L0;
  6188. /* "vector.from_py":46
  6189. *
  6190. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6191. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6192. * cdef vector[X] v
  6193. * for item in o:
  6194. */
  6195. /* function exit code */
  6196. __pyx_L1_error:;
  6197. __Pyx_XDECREF(__pyx_t_1);
  6198. __Pyx_XDECREF(__pyx_t_4);
  6199. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_double_complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6200. __pyx_L0:;
  6201. __Pyx_XDECREF(__pyx_v_item);
  6202. __Pyx_RefNannyFinishContext();
  6203. return __pyx_r;
  6204. }
  6205. static PyMethodDef __pyx_methods[] = {
  6206. {0, 0, 0, 0}
  6207. };
  6208. #if PY_MAJOR_VERSION >= 3
  6209. static struct PyModuleDef __pyx_moduledef = {
  6210. #if PY_VERSION_HEX < 0x03020000
  6211. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  6212. #else
  6213. PyModuleDef_HEAD_INIT,
  6214. #endif
  6215. __Pyx_NAMESTR("scattnlay"),
  6216. 0, /* m_doc */
  6217. -1, /* m_size */
  6218. __pyx_methods /* m_methods */,
  6219. NULL, /* m_reload */
  6220. NULL, /* m_traverse */
  6221. NULL, /* m_clear */
  6222. NULL /* m_free */
  6223. };
  6224. #endif
  6225. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  6226. {&__pyx_n_s_Albedo, __pyx_k_Albedo, sizeof(__pyx_k_Albedo), 0, 0, 1, 1},
  6227. {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  6228. {&__pyx_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
  6229. {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
  6230. {&__pyx_n_s_Eix, __pyx_k_Eix, sizeof(__pyx_k_Eix), 0, 0, 1, 1},
  6231. {&__pyx_n_s_Eiy, __pyx_k_Eiy, sizeof(__pyx_k_Eiy), 0, 0, 1, 1},
  6232. {&__pyx_n_s_Eiz, __pyx_k_Eiz, sizeof(__pyx_k_Eiz), 0, 0, 1, 1},
  6233. {&__pyx_n_s_Erx, __pyx_k_Erx, sizeof(__pyx_k_Erx), 0, 0, 1, 1},
  6234. {&__pyx_n_s_Ery, __pyx_k_Ery, sizeof(__pyx_k_Ery), 0, 0, 1, 1},
  6235. {&__pyx_n_s_Erz, __pyx_k_Erz, sizeof(__pyx_k_Erz), 0, 0, 1, 1},
  6236. {&__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},
  6237. {&__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},
  6238. {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
  6239. {&__pyx_n_s_Hix, __pyx_k_Hix, sizeof(__pyx_k_Hix), 0, 0, 1, 1},
  6240. {&__pyx_n_s_Hiy, __pyx_k_Hiy, sizeof(__pyx_k_Hiy), 0, 0, 1, 1},
  6241. {&__pyx_n_s_Hiz, __pyx_k_Hiz, sizeof(__pyx_k_Hiz), 0, 0, 1, 1},
  6242. {&__pyx_n_s_Hrx, __pyx_k_Hrx, sizeof(__pyx_k_Hrx), 0, 0, 1, 1},
  6243. {&__pyx_n_s_Hry, __pyx_k_Hry, sizeof(__pyx_k_Hry), 0, 0, 1, 1},
  6244. {&__pyx_n_s_Hrz, __pyx_k_Hrz, sizeof(__pyx_k_Hrz), 0, 0, 1, 1},
  6245. {&__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},
  6246. {&__pyx_n_s_Qabs, __pyx_k_Qabs, sizeof(__pyx_k_Qabs), 0, 0, 1, 1},
  6247. {&__pyx_n_s_Qbk, __pyx_k_Qbk, sizeof(__pyx_k_Qbk), 0, 0, 1, 1},
  6248. {&__pyx_n_s_Qext, __pyx_k_Qext, sizeof(__pyx_k_Qext), 0, 0, 1, 1},
  6249. {&__pyx_n_s_Qpr, __pyx_k_Qpr, sizeof(__pyx_k_Qpr), 0, 0, 1, 1},
  6250. {&__pyx_n_s_Qsca, __pyx_k_Qsca, sizeof(__pyx_k_Qsca), 0, 0, 1, 1},
  6251. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  6252. {&__pyx_n_s_S1, __pyx_k_S1, sizeof(__pyx_k_S1), 0, 0, 1, 1},
  6253. {&__pyx_n_s_S1i, __pyx_k_S1i, sizeof(__pyx_k_S1i), 0, 0, 1, 1},
  6254. {&__pyx_n_s_S1r, __pyx_k_S1r, sizeof(__pyx_k_S1r), 0, 0, 1, 1},
  6255. {&__pyx_n_s_S2, __pyx_k_S2, sizeof(__pyx_k_S2), 0, 0, 1, 1},
  6256. {&__pyx_n_s_S2i, __pyx_k_S2i, sizeof(__pyx_k_S2i), 0, 0, 1, 1},
  6257. {&__pyx_n_s_S2r, __pyx_k_S2r, sizeof(__pyx_k_S2r), 0, 0, 1, 1},
  6258. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  6259. {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1},
  6260. {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  6261. {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  6262. {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  6263. {&__pyx_n_s_fieldnlay, __pyx_k_fieldnlay, sizeof(__pyx_k_fieldnlay), 0, 0, 1, 1},
  6264. {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  6265. {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  6266. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  6267. {&__pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_k_home_ovidio_scattering_scattnla, sizeof(__pyx_k_home_ovidio_scattering_scattnla), 0, 0, 1, 0},
  6268. {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  6269. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  6270. {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  6271. {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  6272. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  6273. {&__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},
  6274. {&__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},
  6275. {&__pyx_n_s_nmax, __pyx_k_nmax, sizeof(__pyx_k_nmax), 0, 0, 1, 1},
  6276. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  6277. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  6278. {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
  6279. {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  6280. {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1},
  6281. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  6282. {&__pyx_n_s_scattnlay, __pyx_k_scattnlay, sizeof(__pyx_k_scattnlay), 0, 0, 1, 1},
  6283. {&__pyx_n_s_terms, __pyx_k_terms, sizeof(__pyx_k_terms), 0, 0, 1, 1},
  6284. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  6285. {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  6286. {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1},
  6287. {&__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},
  6288. {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
  6289. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  6290. {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  6291. {0, 0, 0, 0, 0, 0, 0}
  6292. };
  6293. static int __Pyx_InitCachedBuiltins(void) {
  6294. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6295. __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;}
  6296. __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;}
  6297. return 0;
  6298. __pyx_L1_error:;
  6299. return -1;
  6300. }
  6301. static int __Pyx_InitCachedConstants(void) {
  6302. __Pyx_RefNannyDeclarations
  6303. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  6304. /* "scattnlay.pyx":47
  6305. *
  6306. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  6307. * a = a.copy('C') # <<<<<<<<<<<<<<
  6308. *
  6309. * # Return data pointer
  6310. */
  6311. __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6312. __Pyx_GOTREF(__pyx_tuple_);
  6313. __Pyx_GIVEREF(__pyx_tuple_);
  6314. /* "scattnlay.pyx":83
  6315. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  6316. *
  6317. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), nmax, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  6318. *
  6319. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  6320. */
  6321. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6322. __Pyx_GOTREF(__pyx_tuple__3);
  6323. __Pyx_GIVEREF(__pyx_tuple__3);
  6324. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6325. __Pyx_GOTREF(__pyx_tuple__4);
  6326. __Pyx_GIVEREF(__pyx_tuple__4);
  6327. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6328. __Pyx_GOTREF(__pyx_tuple__5);
  6329. __Pyx_GIVEREF(__pyx_tuple__5);
  6330. /* "scattnlay.pyx":85
  6331. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), nmax, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  6332. *
  6333. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  6334. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  6335. *
  6336. */
  6337. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6338. __Pyx_GOTREF(__pyx_tuple__6);
  6339. __Pyx_GIVEREF(__pyx_tuple__6);
  6340. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6341. __Pyx_GOTREF(__pyx_tuple__7);
  6342. __Pyx_GIVEREF(__pyx_tuple__7);
  6343. /* "scattnlay.pyx":86
  6344. *
  6345. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  6346. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  6347. *
  6348. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  6349. */
  6350. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6351. __Pyx_GOTREF(__pyx_tuple__8);
  6352. __Pyx_GIVEREF(__pyx_tuple__8);
  6353. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6354. __Pyx_GOTREF(__pyx_tuple__9);
  6355. __Pyx_GIVEREF(__pyx_tuple__9);
  6356. /* "scattnlay.pyx":126
  6357. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  6358. *
  6359. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), nmax, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Erx), npy2c(Ery), npy2c(Erz), npy2c(Eix), npy2c(Eiy), npy2c(Eiz), npy2c(Hrx), npy2c(Hry), npy2c(Hrz), npy2c(Hix), npy2c(Hiy), npy2c(Hiz)) # <<<<<<<<<<<<<<
  6360. *
  6361. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose()
  6362. */
  6363. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6364. __Pyx_GOTREF(__pyx_tuple__10);
  6365. __Pyx_GIVEREF(__pyx_tuple__10);
  6366. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6367. __Pyx_GOTREF(__pyx_tuple__11);
  6368. __Pyx_GIVEREF(__pyx_tuple__11);
  6369. __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6370. __Pyx_GOTREF(__pyx_slice__12);
  6371. __Pyx_GIVEREF(__pyx_slice__12);
  6372. __pyx_tuple__13 = PyTuple_Pack(2, __pyx_slice__12, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6373. __Pyx_GOTREF(__pyx_tuple__13);
  6374. __Pyx_GIVEREF(__pyx_tuple__13);
  6375. __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6376. __Pyx_GOTREF(__pyx_tuple__14);
  6377. __Pyx_GIVEREF(__pyx_tuple__14);
  6378. __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6379. __Pyx_GOTREF(__pyx_slice__15);
  6380. __Pyx_GIVEREF(__pyx_slice__15);
  6381. __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__15, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6382. __Pyx_GOTREF(__pyx_tuple__16);
  6383. __Pyx_GIVEREF(__pyx_tuple__16);
  6384. __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6385. __Pyx_GOTREF(__pyx_tuple__17);
  6386. __Pyx_GIVEREF(__pyx_tuple__17);
  6387. __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6388. __Pyx_GOTREF(__pyx_slice__18);
  6389. __Pyx_GIVEREF(__pyx_slice__18);
  6390. __pyx_tuple__19 = PyTuple_Pack(2, __pyx_slice__18, __pyx_int_2); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6391. __Pyx_GOTREF(__pyx_tuple__19);
  6392. __Pyx_GIVEREF(__pyx_tuple__19);
  6393. __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6394. __Pyx_GOTREF(__pyx_tuple__20);
  6395. __Pyx_GIVEREF(__pyx_tuple__20);
  6396. /* "scattnlay.pyx":128
  6397. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), nmax, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Erx), npy2c(Ery), npy2c(Erz), npy2c(Eix), npy2c(Eiy), npy2c(Eiz), npy2c(Hrx), npy2c(Hry), npy2c(Hrz), npy2c(Hix), npy2c(Hiy), npy2c(Hiz))
  6398. *
  6399. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose() # <<<<<<<<<<<<<<
  6400. * H[i] = np.vstack((Hrx.copy('C') + 1.0j*Hix.copy('C'), Hry.copy('C') + 1.0j*Hiy.copy('C'), Hrz.copy('C') + 1.0j*Hiz.copy('C'))).transpose()
  6401. *
  6402. */
  6403. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6404. __Pyx_GOTREF(__pyx_tuple__21);
  6405. __Pyx_GIVEREF(__pyx_tuple__21);
  6406. __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6407. __Pyx_GOTREF(__pyx_tuple__22);
  6408. __Pyx_GIVEREF(__pyx_tuple__22);
  6409. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6410. __Pyx_GOTREF(__pyx_tuple__23);
  6411. __Pyx_GIVEREF(__pyx_tuple__23);
  6412. __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6413. __Pyx_GOTREF(__pyx_tuple__24);
  6414. __Pyx_GIVEREF(__pyx_tuple__24);
  6415. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6416. __Pyx_GOTREF(__pyx_tuple__25);
  6417. __Pyx_GIVEREF(__pyx_tuple__25);
  6418. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6419. __Pyx_GOTREF(__pyx_tuple__26);
  6420. __Pyx_GIVEREF(__pyx_tuple__26);
  6421. /* "scattnlay.pyx":129
  6422. *
  6423. * E[i] = np.vstack((Erx.copy('C') + 1.0j*Eix.copy('C'), Ery.copy('C') + 1.0j*Eiy.copy('C'), Erz.copy('C') + 1.0j*Eiz.copy('C'))).transpose()
  6424. * H[i] = np.vstack((Hrx.copy('C') + 1.0j*Hix.copy('C'), Hry.copy('C') + 1.0j*Hiy.copy('C'), Hrz.copy('C') + 1.0j*Hiz.copy('C'))).transpose() # <<<<<<<<<<<<<<
  6425. *
  6426. * return terms, E, H
  6427. */
  6428. __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6429. __Pyx_GOTREF(__pyx_tuple__27);
  6430. __Pyx_GIVEREF(__pyx_tuple__27);
  6431. __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6432. __Pyx_GOTREF(__pyx_tuple__28);
  6433. __Pyx_GIVEREF(__pyx_tuple__28);
  6434. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6435. __Pyx_GOTREF(__pyx_tuple__29);
  6436. __Pyx_GIVEREF(__pyx_tuple__29);
  6437. __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6438. __Pyx_GOTREF(__pyx_tuple__30);
  6439. __Pyx_GIVEREF(__pyx_tuple__30);
  6440. __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6441. __Pyx_GOTREF(__pyx_tuple__31);
  6442. __Pyx_GIVEREF(__pyx_tuple__31);
  6443. __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6444. __Pyx_GOTREF(__pyx_tuple__32);
  6445. __Pyx_GIVEREF(__pyx_tuple__32);
  6446. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  6447. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  6448. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  6449. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  6450. *
  6451. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  6452. */
  6453. __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6454. __Pyx_GOTREF(__pyx_tuple__33);
  6455. __Pyx_GIVEREF(__pyx_tuple__33);
  6456. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  6457. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  6458. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  6459. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  6460. *
  6461. * info.buf = PyArray_DATA(self)
  6462. */
  6463. __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6464. __Pyx_GOTREF(__pyx_tuple__34);
  6465. __Pyx_GIVEREF(__pyx_tuple__34);
  6466. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  6467. * if ((descr.byteorder == c'>' and little_endian) or
  6468. * (descr.byteorder == c'<' and not little_endian)):
  6469. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  6470. * if t == NPY_BYTE: f = "b"
  6471. * elif t == NPY_UBYTE: f = "B"
  6472. */
  6473. __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6474. __Pyx_GOTREF(__pyx_tuple__35);
  6475. __Pyx_GIVEREF(__pyx_tuple__35);
  6476. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  6477. *
  6478. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  6479. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  6480. *
  6481. * if ((child.byteorder == c'>' and little_endian) or
  6482. */
  6483. __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6484. __Pyx_GOTREF(__pyx_tuple__36);
  6485. __Pyx_GIVEREF(__pyx_tuple__36);
  6486. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  6487. * if ((child.byteorder == c'>' and little_endian) or
  6488. * (child.byteorder == c'<' and not little_endian)):
  6489. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  6490. * # One could encode it in the format string and have Cython
  6491. * # complain instead, BUT: < and > in format strings also imply
  6492. */
  6493. __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6494. __Pyx_GOTREF(__pyx_tuple__37);
  6495. __Pyx_GIVEREF(__pyx_tuple__37);
  6496. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  6497. * t = child.type_num
  6498. * if end - f < 5:
  6499. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  6500. *
  6501. * # Until ticket #99 is fixed, use integers to avoid warnings
  6502. */
  6503. __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6504. __Pyx_GOTREF(__pyx_tuple__38);
  6505. __Pyx_GIVEREF(__pyx_tuple__38);
  6506. /* "scattnlay.pyx":56
  6507. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int nmax, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Erx[], double Ery[], double Erz[], double Eix[], double Eiy[], double Eiz[], double Hrx[], double Hry[], double Hrz[], double Hix[], double Hiy[], double Hiz[])
  6508. *
  6509. * 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), np.int_t pl = -1, np.int_t nmax = -1): # <<<<<<<<<<<<<<
  6510. * cdef Py_ssize_t i
  6511. *
  6512. */
  6513. __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6514. __Pyx_GOTREF(__pyx_tuple__39);
  6515. __Pyx_GIVEREF(__pyx_tuple__39);
  6516. __pyx_tuple__40 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_theta, __pyx_n_s_pl, __pyx_n_s_nmax, __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__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6517. __Pyx_GOTREF(__pyx_tuple__40);
  6518. __Pyx_GIVEREF(__pyx_tuple__40);
  6519. __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_scattnlay, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6520. /* "scattnlay.pyx":91
  6521. *
  6522. * #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), np.int_t pl = 0, np.int_t nmax = 0):
  6523. * 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.int_t pl = 0, np.int_t nmax = 0): # <<<<<<<<<<<<<<
  6524. * cdef Py_ssize_t i
  6525. *
  6526. */
  6527. __pyx_tuple__42 = PyTuple_Pack(21, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_coords, __pyx_n_s_pl, __pyx_n_s_nmax, __pyx_n_s_i, __pyx_n_s_terms, __pyx_n_s_E, __pyx_n_s_H, __pyx_n_s_Erx, __pyx_n_s_Ery, __pyx_n_s_Erz, __pyx_n_s_Eix, __pyx_n_s_Eiy, __pyx_n_s_Eiz, __pyx_n_s_Hrx, __pyx_n_s_Hry, __pyx_n_s_Hrz, __pyx_n_s_Hix, __pyx_n_s_Hiy, __pyx_n_s_Hiz); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6528. __Pyx_GOTREF(__pyx_tuple__42);
  6529. __Pyx_GIVEREF(__pyx_tuple__42);
  6530. __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_fieldnlay, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6531. __Pyx_RefNannyFinishContext();
  6532. return 0;
  6533. __pyx_L1_error:;
  6534. __Pyx_RefNannyFinishContext();
  6535. return -1;
  6536. }
  6537. static int __Pyx_InitGlobals(void) {
  6538. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  6539. __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;}
  6540. __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;}
  6541. __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;}
  6542. __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;}
  6543. return 0;
  6544. __pyx_L1_error:;
  6545. return -1;
  6546. }
  6547. #if PY_MAJOR_VERSION < 3
  6548. PyMODINIT_FUNC initscattnlay(void); /*proto*/
  6549. PyMODINIT_FUNC initscattnlay(void)
  6550. #else
  6551. PyMODINIT_FUNC PyInit_scattnlay(void); /*proto*/
  6552. PyMODINIT_FUNC PyInit_scattnlay(void)
  6553. #endif
  6554. {
  6555. PyObject *__pyx_t_1 = NULL;
  6556. PyObject *__pyx_t_2 = NULL;
  6557. PyObject *__pyx_t_3 = NULL;
  6558. PyObject *__pyx_t_4 = NULL;
  6559. int __pyx_lineno = 0;
  6560. const char *__pyx_filename = NULL;
  6561. int __pyx_clineno = 0;
  6562. __Pyx_RefNannyDeclarations
  6563. #if CYTHON_REFNANNY
  6564. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  6565. if (!__Pyx_RefNanny) {
  6566. PyErr_Clear();
  6567. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  6568. if (!__Pyx_RefNanny)
  6569. Py_FatalError("failed to import 'refnanny' module");
  6570. }
  6571. #endif
  6572. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scattnlay(void)", 0);
  6573. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6574. __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;}
  6575. __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;}
  6576. #ifdef __Pyx_CyFunction_USED
  6577. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6578. #endif
  6579. #ifdef __Pyx_FusedFunction_USED
  6580. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6581. #endif
  6582. #ifdef __Pyx_Generator_USED
  6583. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6584. #endif
  6585. /*--- Library function declarations ---*/
  6586. /*--- Threads initialization code ---*/
  6587. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  6588. #ifdef WITH_THREAD /* Python build with threading support? */
  6589. PyEval_InitThreads();
  6590. #endif
  6591. #endif
  6592. /*--- Module creation code ---*/
  6593. #if PY_MAJOR_VERSION < 3
  6594. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("scattnlay"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  6595. #else
  6596. __pyx_m = PyModule_Create(&__pyx_moduledef);
  6597. #endif
  6598. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6599. __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;}
  6600. Py_INCREF(__pyx_d);
  6601. __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;}
  6602. #if CYTHON_COMPILING_IN_PYPY
  6603. Py_INCREF(__pyx_b);
  6604. #endif
  6605. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  6606. /*--- Initialize various global constants etc. ---*/
  6607. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6608. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  6609. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6610. #endif
  6611. if (__pyx_module_is_main_scattnlay) {
  6612. 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;};
  6613. }
  6614. #if PY_MAJOR_VERSION >= 3
  6615. {
  6616. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6617. if (!PyDict_GetItemString(modules, "scattnlay")) {
  6618. if (unlikely(PyDict_SetItemString(modules, "scattnlay", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6619. }
  6620. }
  6621. #endif
  6622. /*--- Builtin init code ---*/
  6623. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6624. /*--- Constants init code ---*/
  6625. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6626. /*--- Global init code ---*/
  6627. /*--- Variable export code ---*/
  6628. /*--- Function export code ---*/
  6629. /*--- Type init code ---*/
  6630. /*--- Type import code ---*/
  6631. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
  6632. #if CYTHON_COMPILING_IN_PYPY
  6633. sizeof(PyTypeObject),
  6634. #else
  6635. sizeof(PyHeapTypeObject),
  6636. #endif
  6637. 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6638. __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;}
  6639. __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;}
  6640. __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;}
  6641. __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;}
  6642. __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;}
  6643. /*--- Variable import code ---*/
  6644. /*--- Function import code ---*/
  6645. /*--- Execution code ---*/
  6646. /* "scattnlay.pyx":26
  6647. *
  6648. * from __future__ import division
  6649. * import numpy as np # <<<<<<<<<<<<<<
  6650. * cimport numpy as np
  6651. *
  6652. */
  6653. __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;}
  6654. __Pyx_GOTREF(__pyx_t_1);
  6655. 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;}
  6656. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6657. /* "scattnlay.pyx":56
  6658. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int nmax, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Erx[], double Ery[], double Erz[], double Eix[], double Eiy[], double Eiz[], double Hrx[], double Hry[], double Hrz[], double Hix[], double Hiy[], double Hiz[])
  6659. *
  6660. * 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), np.int_t pl = -1, np.int_t nmax = -1): # <<<<<<<<<<<<<<
  6661. * cdef Py_ssize_t i
  6662. *
  6663. */
  6664. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6665. __Pyx_GOTREF(__pyx_t_1);
  6666. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6667. __Pyx_GOTREF(__pyx_t_2);
  6668. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6669. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6670. __Pyx_GOTREF(__pyx_t_1);
  6671. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6672. __Pyx_GOTREF(__pyx_t_3);
  6673. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6674. __Pyx_GOTREF(__pyx_t_4);
  6675. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6676. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6677. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6678. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__39, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6679. __Pyx_GOTREF(__pyx_t_4);
  6680. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6681. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6682. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6683. __pyx_k__2 = ((PyArrayObject *)__pyx_t_4);
  6684. __Pyx_GIVEREF(__pyx_t_4);
  6685. __pyx_t_4 = 0;
  6686. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6687. __Pyx_GOTREF(__pyx_t_4);
  6688. if (PyDict_SetItem(__pyx_d, __pyx_n_s_scattnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6689. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6690. /* "scattnlay.pyx":91
  6691. *
  6692. * #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), np.int_t pl = 0, np.int_t nmax = 0):
  6693. * 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.int_t pl = 0, np.int_t nmax = 0): # <<<<<<<<<<<<<<
  6694. * cdef Py_ssize_t i
  6695. *
  6696. */
  6697. __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_9scattnlay_3fieldnlay, NULL, __pyx_n_s_scattnlay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6698. __Pyx_GOTREF(__pyx_t_4);
  6699. if (PyDict_SetItem(__pyx_d, __pyx_n_s_fieldnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6700. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6701. /* "scattnlay.pyx":1
  6702. * # Copyright (C) 2009-2015 Ovidio Pena <ovidio@bytesfall.com> # <<<<<<<<<<<<<<
  6703. * #
  6704. * # This file is part of python-scattnlay
  6705. */
  6706. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6707. __Pyx_GOTREF(__pyx_t_4);
  6708. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6709. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6710. /* "vector.from_py":46
  6711. *
  6712. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6713. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6714. * cdef vector[X] v
  6715. * for item in o:
  6716. */
  6717. goto __pyx_L0;
  6718. __pyx_L1_error:;
  6719. __Pyx_XDECREF(__pyx_t_1);
  6720. __Pyx_XDECREF(__pyx_t_2);
  6721. __Pyx_XDECREF(__pyx_t_3);
  6722. __Pyx_XDECREF(__pyx_t_4);
  6723. if (__pyx_m) {
  6724. __Pyx_AddTraceback("init scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6725. Py_DECREF(__pyx_m); __pyx_m = 0;
  6726. } else if (!PyErr_Occurred()) {
  6727. PyErr_SetString(PyExc_ImportError, "init scattnlay");
  6728. }
  6729. __pyx_L0:;
  6730. __Pyx_RefNannyFinishContext();
  6731. #if PY_MAJOR_VERSION < 3
  6732. return;
  6733. #else
  6734. return __pyx_m;
  6735. #endif
  6736. }
  6737. /* Runtime support code */
  6738. #if CYTHON_REFNANNY
  6739. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  6740. PyObject *m = NULL, *p = NULL;
  6741. void *r = NULL;
  6742. m = PyImport_ImportModule((char *)modname);
  6743. if (!m) goto end;
  6744. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  6745. if (!p) goto end;
  6746. r = PyLong_AsVoidPtr(p);
  6747. end:
  6748. Py_XDECREF(p);
  6749. Py_XDECREF(m);
  6750. return (__Pyx_RefNannyAPIStruct *)r;
  6751. }
  6752. #endif /* CYTHON_REFNANNY */
  6753. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  6754. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  6755. if (unlikely(!result)) {
  6756. PyErr_Format(PyExc_NameError,
  6757. #if PY_MAJOR_VERSION >= 3
  6758. "name '%U' is not defined", name);
  6759. #else
  6760. "name '%.200s' is not defined", PyString_AS_STRING(name));
  6761. #endif
  6762. }
  6763. return result;
  6764. }
  6765. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  6766. PyObject *result;
  6767. #if CYTHON_COMPILING_IN_CPYTHON
  6768. result = PyDict_GetItem(__pyx_d, name);
  6769. if (result) {
  6770. Py_INCREF(result);
  6771. } else {
  6772. #else
  6773. result = PyObject_GetItem(__pyx_d, name);
  6774. if (!result) {
  6775. PyErr_Clear();
  6776. #endif
  6777. result = __Pyx_GetBuiltinName(name);
  6778. }
  6779. return result;
  6780. }
  6781. #if CYTHON_COMPILING_IN_CPYTHON
  6782. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  6783. PyObject *result;
  6784. ternaryfunc call = func->ob_type->tp_call;
  6785. if (unlikely(!call))
  6786. return PyObject_Call(func, arg, kw);
  6787. #if PY_VERSION_HEX >= 0x02060000
  6788. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  6789. return NULL;
  6790. #endif
  6791. result = (*call)(func, arg, kw);
  6792. #if PY_VERSION_HEX >= 0x02060000
  6793. Py_LeaveRecursiveCall();
  6794. #endif
  6795. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  6796. PyErr_SetString(
  6797. PyExc_SystemError,
  6798. "NULL result without error in PyObject_Call");
  6799. }
  6800. return result;
  6801. }
  6802. #endif
  6803. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  6804. if (unlikely(!type)) {
  6805. PyErr_SetString(PyExc_SystemError, "Missing type object");
  6806. return 0;
  6807. }
  6808. if (likely(PyObject_TypeCheck(obj, type)))
  6809. return 1;
  6810. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  6811. Py_TYPE(obj)->tp_name, type->tp_name);
  6812. return 0;
  6813. }
  6814. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  6815. #if CYTHON_COMPILING_IN_CPYTHON
  6816. PyObject *tmp_type, *tmp_value, *tmp_tb;
  6817. PyThreadState *tstate = PyThreadState_GET();
  6818. tmp_type = tstate->curexc_type;
  6819. tmp_value = tstate->curexc_value;
  6820. tmp_tb = tstate->curexc_traceback;
  6821. tstate->curexc_type = type;
  6822. tstate->curexc_value = value;
  6823. tstate->curexc_traceback = tb;
  6824. Py_XDECREF(tmp_type);
  6825. Py_XDECREF(tmp_value);
  6826. Py_XDECREF(tmp_tb);
  6827. #else
  6828. PyErr_Restore(type, value, tb);
  6829. #endif
  6830. }
  6831. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  6832. #if CYTHON_COMPILING_IN_CPYTHON
  6833. PyThreadState *tstate = PyThreadState_GET();
  6834. *type = tstate->curexc_type;
  6835. *value = tstate->curexc_value;
  6836. *tb = tstate->curexc_traceback;
  6837. tstate->curexc_type = 0;
  6838. tstate->curexc_value = 0;
  6839. tstate->curexc_traceback = 0;
  6840. #else
  6841. PyErr_Fetch(type, value, tb);
  6842. #endif
  6843. }
  6844. static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
  6845. CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
  6846. int full_traceback) {
  6847. PyObject *old_exc, *old_val, *old_tb;
  6848. PyObject *ctx;
  6849. __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
  6850. if (full_traceback) {
  6851. Py_XINCREF(old_exc);
  6852. Py_XINCREF(old_val);
  6853. Py_XINCREF(old_tb);
  6854. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6855. PyErr_PrintEx(1);
  6856. }
  6857. #if PY_MAJOR_VERSION < 3
  6858. ctx = PyString_FromString(name);
  6859. #else
  6860. ctx = PyUnicode_FromString(name);
  6861. #endif
  6862. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6863. if (!ctx) {
  6864. PyErr_WriteUnraisable(Py_None);
  6865. } else {
  6866. PyErr_WriteUnraisable(ctx);
  6867. Py_DECREF(ctx);
  6868. }
  6869. }
  6870. static void __Pyx_RaiseArgtupleInvalid(
  6871. const char* func_name,
  6872. int exact,
  6873. Py_ssize_t num_min,
  6874. Py_ssize_t num_max,
  6875. Py_ssize_t num_found)
  6876. {
  6877. Py_ssize_t num_expected;
  6878. const char *more_or_less;
  6879. if (num_found < num_min) {
  6880. num_expected = num_min;
  6881. more_or_less = "at least";
  6882. } else {
  6883. num_expected = num_max;
  6884. more_or_less = "at most";
  6885. }
  6886. if (exact) {
  6887. more_or_less = "exactly";
  6888. }
  6889. PyErr_Format(PyExc_TypeError,
  6890. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  6891. func_name, more_or_less, num_expected,
  6892. (num_expected == 1) ? "" : "s", num_found);
  6893. }
  6894. static void __Pyx_RaiseDoubleKeywordsError(
  6895. const char* func_name,
  6896. PyObject* kw_name)
  6897. {
  6898. PyErr_Format(PyExc_TypeError,
  6899. #if PY_MAJOR_VERSION >= 3
  6900. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  6901. #else
  6902. "%s() got multiple values for keyword argument '%s'", func_name,
  6903. PyString_AsString(kw_name));
  6904. #endif
  6905. }
  6906. static int __Pyx_ParseOptionalKeywords(
  6907. PyObject *kwds,
  6908. PyObject **argnames[],
  6909. PyObject *kwds2,
  6910. PyObject *values[],
  6911. Py_ssize_t num_pos_args,
  6912. const char* function_name)
  6913. {
  6914. PyObject *key = 0, *value = 0;
  6915. Py_ssize_t pos = 0;
  6916. PyObject*** name;
  6917. PyObject*** first_kw_arg = argnames + num_pos_args;
  6918. while (PyDict_Next(kwds, &pos, &key, &value)) {
  6919. name = first_kw_arg;
  6920. while (*name && (**name != key)) name++;
  6921. if (*name) {
  6922. values[name-argnames] = value;
  6923. continue;
  6924. }
  6925. name = first_kw_arg;
  6926. #if PY_MAJOR_VERSION < 3
  6927. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  6928. while (*name) {
  6929. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  6930. && _PyString_Eq(**name, key)) {
  6931. values[name-argnames] = value;
  6932. break;
  6933. }
  6934. name++;
  6935. }
  6936. if (*name) continue;
  6937. else {
  6938. PyObject*** argname = argnames;
  6939. while (argname != first_kw_arg) {
  6940. if ((**argname == key) || (
  6941. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  6942. && _PyString_Eq(**argname, key))) {
  6943. goto arg_passed_twice;
  6944. }
  6945. argname++;
  6946. }
  6947. }
  6948. } else
  6949. #endif
  6950. if (likely(PyUnicode_Check(key))) {
  6951. while (*name) {
  6952. int cmp = (**name == key) ? 0 :
  6953. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6954. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  6955. #endif
  6956. PyUnicode_Compare(**name, key);
  6957. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6958. if (cmp == 0) {
  6959. values[name-argnames] = value;
  6960. break;
  6961. }
  6962. name++;
  6963. }
  6964. if (*name) continue;
  6965. else {
  6966. PyObject*** argname = argnames;
  6967. while (argname != first_kw_arg) {
  6968. int cmp = (**argname == key) ? 0 :
  6969. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6970. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  6971. #endif
  6972. PyUnicode_Compare(**argname, key);
  6973. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6974. if (cmp == 0) goto arg_passed_twice;
  6975. argname++;
  6976. }
  6977. }
  6978. } else
  6979. goto invalid_keyword_type;
  6980. if (kwds2) {
  6981. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  6982. } else {
  6983. goto invalid_keyword;
  6984. }
  6985. }
  6986. return 0;
  6987. arg_passed_twice:
  6988. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  6989. goto bad;
  6990. invalid_keyword_type:
  6991. PyErr_Format(PyExc_TypeError,
  6992. "%.200s() keywords must be strings", function_name);
  6993. goto bad;
  6994. invalid_keyword:
  6995. PyErr_Format(PyExc_TypeError,
  6996. #if PY_MAJOR_VERSION < 3
  6997. "%.200s() got an unexpected keyword argument '%.200s'",
  6998. function_name, PyString_AsString(key));
  6999. #else
  7000. "%s() got an unexpected keyword argument '%U'",
  7001. function_name, key);
  7002. #endif
  7003. bad:
  7004. return -1;
  7005. }
  7006. static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
  7007. PyErr_Format(PyExc_TypeError,
  7008. "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
  7009. name, type->tp_name, Py_TYPE(obj)->tp_name);
  7010. }
  7011. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  7012. const char *name, int exact)
  7013. {
  7014. if (unlikely(!type)) {
  7015. PyErr_SetString(PyExc_SystemError, "Missing type object");
  7016. return 0;
  7017. }
  7018. if (none_allowed && obj == Py_None) return 1;
  7019. else if (exact) {
  7020. if (likely(Py_TYPE(obj) == type)) return 1;
  7021. #if PY_MAJOR_VERSION == 2
  7022. else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
  7023. #endif
  7024. }
  7025. else {
  7026. if (likely(PyObject_TypeCheck(obj, type))) return 1;
  7027. }
  7028. __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
  7029. return 0;
  7030. }
  7031. static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  7032. unsigned int n = 1;
  7033. return *(unsigned char*)(&n) != 0;
  7034. }
  7035. static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
  7036. __Pyx_BufFmt_StackElem* stack,
  7037. __Pyx_TypeInfo* type) {
  7038. stack[0].field = &ctx->root;
  7039. stack[0].parent_offset = 0;
  7040. ctx->root.type = type;
  7041. ctx->root.name = "buffer dtype";
  7042. ctx->root.offset = 0;
  7043. ctx->head = stack;
  7044. ctx->head->field = &ctx->root;
  7045. ctx->fmt_offset = 0;
  7046. ctx->head->parent_offset = 0;
  7047. ctx->new_packmode = '@';
  7048. ctx->enc_packmode = '@';
  7049. ctx->new_count = 1;
  7050. ctx->enc_count = 0;
  7051. ctx->enc_type = 0;
  7052. ctx->is_complex = 0;
  7053. ctx->is_valid_array = 0;
  7054. ctx->struct_alignment = 0;
  7055. while (type->typegroup == 'S') {
  7056. ++ctx->head;
  7057. ctx->head->field = type->fields;
  7058. ctx->head->parent_offset = 0;
  7059. type = type->fields->type;
  7060. }
  7061. }
  7062. static int __Pyx_BufFmt_ParseNumber(const char** ts) {
  7063. int count;
  7064. const char* t = *ts;
  7065. if (*t < '0' || *t > '9') {
  7066. return -1;
  7067. } else {
  7068. count = *t++ - '0';
  7069. while (*t >= '0' && *t < '9') {
  7070. count *= 10;
  7071. count += *t++ - '0';
  7072. }
  7073. }
  7074. *ts = t;
  7075. return count;
  7076. }
  7077. static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
  7078. int number = __Pyx_BufFmt_ParseNumber(ts);
  7079. if (number == -1) /* First char was not a digit */
  7080. PyErr_Format(PyExc_ValueError,\
  7081. "Does not understand character buffer dtype format string ('%c')", **ts);
  7082. return number;
  7083. }
  7084. static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  7085. PyErr_Format(PyExc_ValueError,
  7086. "Unexpected format string character: '%c'", ch);
  7087. }
  7088. static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  7089. switch (ch) {
  7090. case 'c': return "'char'";
  7091. case 'b': return "'signed char'";
  7092. case 'B': return "'unsigned char'";
  7093. case 'h': return "'short'";
  7094. case 'H': return "'unsigned short'";
  7095. case 'i': return "'int'";
  7096. case 'I': return "'unsigned int'";
  7097. case 'l': return "'long'";
  7098. case 'L': return "'unsigned long'";
  7099. case 'q': return "'long long'";
  7100. case 'Q': return "'unsigned long long'";
  7101. case 'f': return (is_complex ? "'complex float'" : "'float'");
  7102. case 'd': return (is_complex ? "'complex double'" : "'double'");
  7103. case 'g': return (is_complex ? "'complex long double'" : "'long double'");
  7104. case 'T': return "a struct";
  7105. case 'O': return "Python object";
  7106. case 'P': return "a pointer";
  7107. case 's': case 'p': return "a string";
  7108. case 0: return "end";
  7109. default: return "unparseable format string";
  7110. }
  7111. }
  7112. static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  7113. switch (ch) {
  7114. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7115. case 'h': case 'H': return 2;
  7116. case 'i': case 'I': case 'l': case 'L': return 4;
  7117. case 'q': case 'Q': return 8;
  7118. case 'f': return (is_complex ? 8 : 4);
  7119. case 'd': return (is_complex ? 16 : 8);
  7120. case 'g': {
  7121. PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
  7122. return 0;
  7123. }
  7124. case 'O': case 'P': return sizeof(void*);
  7125. default:
  7126. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7127. return 0;
  7128. }
  7129. }
  7130. static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  7131. switch (ch) {
  7132. case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7133. case 'h': case 'H': return sizeof(short);
  7134. case 'i': case 'I': return sizeof(int);
  7135. case 'l': case 'L': return sizeof(long);
  7136. #ifdef HAVE_LONG_LONG
  7137. case 'q': case 'Q': return sizeof(PY_LONG_LONG);
  7138. #endif
  7139. case 'f': return sizeof(float) * (is_complex ? 2 : 1);
  7140. case 'd': return sizeof(double) * (is_complex ? 2 : 1);
  7141. case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
  7142. case 'O': case 'P': return sizeof(void*);
  7143. default: {
  7144. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7145. return 0;
  7146. }
  7147. }
  7148. }
  7149. typedef struct { char c; short x; } __Pyx_st_short;
  7150. typedef struct { char c; int x; } __Pyx_st_int;
  7151. typedef struct { char c; long x; } __Pyx_st_long;
  7152. typedef struct { char c; float x; } __Pyx_st_float;
  7153. typedef struct { char c; double x; } __Pyx_st_double;
  7154. typedef struct { char c; long double x; } __Pyx_st_longdouble;
  7155. typedef struct { char c; void *x; } __Pyx_st_void_p;
  7156. #ifdef HAVE_LONG_LONG
  7157. typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
  7158. #endif
  7159. static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  7160. switch (ch) {
  7161. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7162. case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
  7163. case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
  7164. case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
  7165. #ifdef HAVE_LONG_LONG
  7166. case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
  7167. #endif
  7168. case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
  7169. case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
  7170. case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
  7171. case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
  7172. default:
  7173. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7174. return 0;
  7175. }
  7176. }
  7177. /* These are for computing the padding at the end of the struct to align
  7178. on the first member of the struct. This will probably the same as above,
  7179. but we don't have any guarantees.
  7180. */
  7181. typedef struct { short x; char c; } __Pyx_pad_short;
  7182. typedef struct { int x; char c; } __Pyx_pad_int;
  7183. typedef struct { long x; char c; } __Pyx_pad_long;
  7184. typedef struct { float x; char c; } __Pyx_pad_float;
  7185. typedef struct { double x; char c; } __Pyx_pad_double;
  7186. typedef struct { long double x; char c; } __Pyx_pad_longdouble;
  7187. typedef struct { void *x; char c; } __Pyx_pad_void_p;
  7188. #ifdef HAVE_LONG_LONG
  7189. typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
  7190. #endif
  7191. static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  7192. switch (ch) {
  7193. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7194. case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
  7195. case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
  7196. case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
  7197. #ifdef HAVE_LONG_LONG
  7198. case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
  7199. #endif
  7200. case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
  7201. case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
  7202. case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
  7203. case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
  7204. default:
  7205. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7206. return 0;
  7207. }
  7208. }
  7209. static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  7210. switch (ch) {
  7211. case 'c':
  7212. return 'H';
  7213. case 'b': case 'h': case 'i':
  7214. case 'l': case 'q': case 's': case 'p':
  7215. return 'I';
  7216. case 'B': case 'H': case 'I': case 'L': case 'Q':
  7217. return 'U';
  7218. case 'f': case 'd': case 'g':
  7219. return (is_complex ? 'C' : 'R');
  7220. case 'O':
  7221. return 'O';
  7222. case 'P':
  7223. return 'P';
  7224. default: {
  7225. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7226. return 0;
  7227. }
  7228. }
  7229. }
  7230. static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  7231. if (ctx->head == NULL || ctx->head->field == &ctx->root) {
  7232. const char* expected;
  7233. const char* quote;
  7234. if (ctx->head == NULL) {
  7235. expected = "end";
  7236. quote = "";
  7237. } else {
  7238. expected = ctx->head->field->type->name;
  7239. quote = "'";
  7240. }
  7241. PyErr_Format(PyExc_ValueError,
  7242. "Buffer dtype mismatch, expected %s%s%s but got %s",
  7243. quote, expected, quote,
  7244. __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  7245. } else {
  7246. __Pyx_StructField* field = ctx->head->field;
  7247. __Pyx_StructField* parent = (ctx->head - 1)->field;
  7248. PyErr_Format(PyExc_ValueError,
  7249. "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
  7250. field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
  7251. parent->type->name, field->name);
  7252. }
  7253. }
  7254. static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  7255. char group;
  7256. size_t size, offset, arraysize = 1;
  7257. if (ctx->enc_type == 0) return 0;
  7258. if (ctx->head->field->type->arraysize[0]) {
  7259. int i, ndim = 0;
  7260. if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
  7261. ctx->is_valid_array = ctx->head->field->type->ndim == 1;
  7262. ndim = 1;
  7263. if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
  7264. PyErr_Format(PyExc_ValueError,
  7265. "Expected a dimension of size %zu, got %zu",
  7266. ctx->head->field->type->arraysize[0], ctx->enc_count);
  7267. return -1;
  7268. }
  7269. }
  7270. if (!ctx->is_valid_array) {
  7271. PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
  7272. ctx->head->field->type->ndim, ndim);
  7273. return -1;
  7274. }
  7275. for (i = 0; i < ctx->head->field->type->ndim; i++) {
  7276. arraysize *= ctx->head->field->type->arraysize[i];
  7277. }
  7278. ctx->is_valid_array = 0;
  7279. ctx->enc_count = 1;
  7280. }
  7281. group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  7282. do {
  7283. __Pyx_StructField* field = ctx->head->field;
  7284. __Pyx_TypeInfo* type = field->type;
  7285. if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
  7286. size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
  7287. } else {
  7288. size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
  7289. }
  7290. if (ctx->enc_packmode == '@') {
  7291. size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
  7292. size_t align_mod_offset;
  7293. if (align_at == 0) return -1;
  7294. align_mod_offset = ctx->fmt_offset % align_at;
  7295. if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
  7296. if (ctx->struct_alignment == 0)
  7297. ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
  7298. ctx->is_complex);
  7299. }
  7300. if (type->size != size || type->typegroup != group) {
  7301. if (type->typegroup == 'C' && type->fields != NULL) {
  7302. size_t parent_offset = ctx->head->parent_offset + field->offset;
  7303. ++ctx->head;
  7304. ctx->head->field = type->fields;
  7305. ctx->head->parent_offset = parent_offset;
  7306. continue;
  7307. }
  7308. if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
  7309. } else {
  7310. __Pyx_BufFmt_RaiseExpected(ctx);
  7311. return -1;
  7312. }
  7313. }
  7314. offset = ctx->head->parent_offset + field->offset;
  7315. if (ctx->fmt_offset != offset) {
  7316. PyErr_Format(PyExc_ValueError,
  7317. "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
  7318. (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
  7319. return -1;
  7320. }
  7321. ctx->fmt_offset += size;
  7322. if (arraysize)
  7323. ctx->fmt_offset += (arraysize - 1) * size;
  7324. --ctx->enc_count; /* Consume from buffer string */
  7325. while (1) {
  7326. if (field == &ctx->root) {
  7327. ctx->head = NULL;
  7328. if (ctx->enc_count != 0) {
  7329. __Pyx_BufFmt_RaiseExpected(ctx);
  7330. return -1;
  7331. }
  7332. break; /* breaks both loops as ctx->enc_count == 0 */
  7333. }
  7334. ctx->head->field = ++field;
  7335. if (field->type == NULL) {
  7336. --ctx->head;
  7337. field = ctx->head->field;
  7338. continue;
  7339. } else if (field->type->typegroup == 'S') {
  7340. size_t parent_offset = ctx->head->parent_offset + field->offset;
  7341. if (field->type->fields->type == NULL) continue; /* empty struct */
  7342. field = field->type->fields;
  7343. ++ctx->head;
  7344. ctx->head->field = field;
  7345. ctx->head->parent_offset = parent_offset;
  7346. break;
  7347. } else {
  7348. break;
  7349. }
  7350. }
  7351. } while (ctx->enc_count);
  7352. ctx->enc_type = 0;
  7353. ctx->is_complex = 0;
  7354. return 0;
  7355. }
  7356. static CYTHON_INLINE PyObject *
  7357. __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
  7358. {
  7359. const char *ts = *tsp;
  7360. int i = 0, number;
  7361. int ndim = ctx->head->field->type->ndim;
  7362. ;
  7363. ++ts;
  7364. if (ctx->new_count != 1) {
  7365. PyErr_SetString(PyExc_ValueError,
  7366. "Cannot handle repeated arrays in format string");
  7367. return NULL;
  7368. }
  7369. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7370. while (*ts && *ts != ')') {
  7371. switch (*ts) {
  7372. case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
  7373. default: break; /* not a 'break' in the loop */
  7374. }
  7375. number = __Pyx_BufFmt_ExpectNumber(&ts);
  7376. if (number == -1) return NULL;
  7377. if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
  7378. return PyErr_Format(PyExc_ValueError,
  7379. "Expected a dimension of size %zu, got %d",
  7380. ctx->head->field->type->arraysize[i], number);
  7381. if (*ts != ',' && *ts != ')')
  7382. return PyErr_Format(PyExc_ValueError,
  7383. "Expected a comma in format string, got '%c'", *ts);
  7384. if (*ts == ',') ts++;
  7385. i++;
  7386. }
  7387. if (i != ndim)
  7388. return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
  7389. ctx->head->field->type->ndim, i);
  7390. if (!*ts) {
  7391. PyErr_SetString(PyExc_ValueError,
  7392. "Unexpected end of format string, expected ')'");
  7393. return NULL;
  7394. }
  7395. ctx->is_valid_array = 1;
  7396. ctx->new_count = 1;
  7397. *tsp = ++ts;
  7398. return Py_None;
  7399. }
  7400. static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  7401. int got_Z = 0;
  7402. while (1) {
  7403. switch(*ts) {
  7404. case 0:
  7405. if (ctx->enc_type != 0 && ctx->head == NULL) {
  7406. __Pyx_BufFmt_RaiseExpected(ctx);
  7407. return NULL;
  7408. }
  7409. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7410. if (ctx->head != NULL) {
  7411. __Pyx_BufFmt_RaiseExpected(ctx);
  7412. return NULL;
  7413. }
  7414. return ts;
  7415. case ' ':
  7416. case '\r':
  7417. case '\n':
  7418. ++ts;
  7419. break;
  7420. case '<':
  7421. if (!__Pyx_IsLittleEndian()) {
  7422. PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
  7423. return NULL;
  7424. }
  7425. ctx->new_packmode = '=';
  7426. ++ts;
  7427. break;
  7428. case '>':
  7429. case '!':
  7430. if (__Pyx_IsLittleEndian()) {
  7431. PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
  7432. return NULL;
  7433. }
  7434. ctx->new_packmode = '=';
  7435. ++ts;
  7436. break;
  7437. case '=':
  7438. case '@':
  7439. case '^':
  7440. ctx->new_packmode = *ts++;
  7441. break;
  7442. case 'T': /* substruct */
  7443. {
  7444. const char* ts_after_sub;
  7445. size_t i, struct_count = ctx->new_count;
  7446. size_t struct_alignment = ctx->struct_alignment;
  7447. ctx->new_count = 1;
  7448. ++ts;
  7449. if (*ts != '{') {
  7450. PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
  7451. return NULL;
  7452. }
  7453. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7454. ctx->enc_type = 0; /* Erase processed last struct element */
  7455. ctx->enc_count = 0;
  7456. ctx->struct_alignment = 0;
  7457. ++ts;
  7458. ts_after_sub = ts;
  7459. for (i = 0; i != struct_count; ++i) {
  7460. ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
  7461. if (!ts_after_sub) return NULL;
  7462. }
  7463. ts = ts_after_sub;
  7464. if (struct_alignment) ctx->struct_alignment = struct_alignment;
  7465. }
  7466. break;
  7467. case '}': /* end of substruct; either repeat or move on */
  7468. {
  7469. size_t alignment = ctx->struct_alignment;
  7470. ++ts;
  7471. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7472. ctx->enc_type = 0; /* Erase processed last struct element */
  7473. if (alignment && ctx->fmt_offset % alignment) {
  7474. ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
  7475. }
  7476. }
  7477. return ts;
  7478. case 'x':
  7479. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7480. ctx->fmt_offset += ctx->new_count;
  7481. ctx->new_count = 1;
  7482. ctx->enc_count = 0;
  7483. ctx->enc_type = 0;
  7484. ctx->enc_packmode = ctx->new_packmode;
  7485. ++ts;
  7486. break;
  7487. case 'Z':
  7488. got_Z = 1;
  7489. ++ts;
  7490. if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
  7491. __Pyx_BufFmt_RaiseUnexpectedChar('Z');
  7492. return NULL;
  7493. }
  7494. case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
  7495. case 'l': case 'L': case 'q': case 'Q':
  7496. case 'f': case 'd': case 'g':
  7497. case 'O': case 'p':
  7498. if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
  7499. ctx->enc_packmode == ctx->new_packmode) {
  7500. ctx->enc_count += ctx->new_count;
  7501. ctx->new_count = 1;
  7502. got_Z = 0;
  7503. ++ts;
  7504. break;
  7505. }
  7506. case 's':
  7507. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7508. ctx->enc_count = ctx->new_count;
  7509. ctx->enc_packmode = ctx->new_packmode;
  7510. ctx->enc_type = *ts;
  7511. ctx->is_complex = got_Z;
  7512. ++ts;
  7513. ctx->new_count = 1;
  7514. got_Z = 0;
  7515. break;
  7516. case ':':
  7517. ++ts;
  7518. while(*ts != ':') ++ts;
  7519. ++ts;
  7520. break;
  7521. case '(':
  7522. if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
  7523. break;
  7524. default:
  7525. {
  7526. int number = __Pyx_BufFmt_ExpectNumber(&ts);
  7527. if (number == -1) return NULL;
  7528. ctx->new_count = (size_t)number;
  7529. }
  7530. }
  7531. }
  7532. }
  7533. static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  7534. buf->buf = NULL;
  7535. buf->obj = NULL;
  7536. buf->strides = __Pyx_zeros;
  7537. buf->shape = __Pyx_zeros;
  7538. buf->suboffsets = __Pyx_minusones;
  7539. }
  7540. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
  7541. Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
  7542. int nd, int cast, __Pyx_BufFmt_StackElem* stack)
  7543. {
  7544. if (obj == Py_None || obj == NULL) {
  7545. __Pyx_ZeroBuffer(buf);
  7546. return 0;
  7547. }
  7548. buf->buf = NULL;
  7549. if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  7550. if (buf->ndim != nd) {
  7551. PyErr_Format(PyExc_ValueError,
  7552. "Buffer has wrong number of dimensions (expected %d, got %d)",
  7553. nd, buf->ndim);
  7554. goto fail;
  7555. }
  7556. if (!cast) {
  7557. __Pyx_BufFmt_Context ctx;
  7558. __Pyx_BufFmt_Init(&ctx, stack, dtype);
  7559. if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  7560. }
  7561. if ((unsigned)buf->itemsize != dtype->size) {
  7562. PyErr_Format(PyExc_ValueError,
  7563. "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
  7564. buf->itemsize, (buf->itemsize > 1) ? "s" : "",
  7565. dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
  7566. goto fail;
  7567. }
  7568. if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  7569. return 0;
  7570. fail:;
  7571. __Pyx_ZeroBuffer(buf);
  7572. return -1;
  7573. }
  7574. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  7575. if (info->buf == NULL) return;
  7576. if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  7577. __Pyx_ReleaseBuffer(info);
  7578. }
  7579. static void __Pyx_RaiseBufferFallbackError(void) {
  7580. PyErr_SetString(PyExc_ValueError,
  7581. "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
  7582. }
  7583. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  7584. PyObject *r;
  7585. if (!j) return NULL;
  7586. r = PyObject_GetItem(o, j);
  7587. Py_DECREF(j);
  7588. return r;
  7589. }
  7590. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  7591. int wraparound, int boundscheck) {
  7592. #if CYTHON_COMPILING_IN_CPYTHON
  7593. if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
  7594. if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
  7595. PyObject *r = PyList_GET_ITEM(o, i);
  7596. Py_INCREF(r);
  7597. return r;
  7598. }
  7599. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7600. #else
  7601. return PySequence_GetItem(o, i);
  7602. #endif
  7603. }
  7604. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  7605. int wraparound, int boundscheck) {
  7606. #if CYTHON_COMPILING_IN_CPYTHON
  7607. if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
  7608. if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
  7609. PyObject *r = PyTuple_GET_ITEM(o, i);
  7610. Py_INCREF(r);
  7611. return r;
  7612. }
  7613. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7614. #else
  7615. return PySequence_GetItem(o, i);
  7616. #endif
  7617. }
  7618. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  7619. int is_list, int wraparound, int boundscheck) {
  7620. #if CYTHON_COMPILING_IN_CPYTHON
  7621. if (is_list || PyList_CheckExact(o)) {
  7622. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  7623. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  7624. PyObject *r = PyList_GET_ITEM(o, n);
  7625. Py_INCREF(r);
  7626. return r;
  7627. }
  7628. }
  7629. else if (PyTuple_CheckExact(o)) {
  7630. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  7631. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  7632. PyObject *r = PyTuple_GET_ITEM(o, n);
  7633. Py_INCREF(r);
  7634. return r;
  7635. }
  7636. } else {
  7637. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  7638. if (likely(m && m->sq_item)) {
  7639. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  7640. Py_ssize_t l = m->sq_length(o);
  7641. if (likely(l >= 0)) {
  7642. i += l;
  7643. } else {
  7644. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  7645. PyErr_Clear();
  7646. else
  7647. return NULL;
  7648. }
  7649. }
  7650. return m->sq_item(o, i);
  7651. }
  7652. }
  7653. #else
  7654. if (is_list || PySequence_Check(o)) {
  7655. return PySequence_GetItem(o, i);
  7656. }
  7657. #endif
  7658. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7659. }
  7660. static void __Pyx_RaiseBufferIndexError(int axis) {
  7661. PyErr_Format(PyExc_IndexError,
  7662. "Out of bounds on buffer access (axis %d)", axis);
  7663. }
  7664. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
  7665. int r;
  7666. if (!j) return -1;
  7667. r = PyObject_SetItem(o, j, v);
  7668. Py_DECREF(j);
  7669. return r;
  7670. }
  7671. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  7672. int is_list, int wraparound, int boundscheck) {
  7673. #if CYTHON_COMPILING_IN_CPYTHON
  7674. if (is_list || PyList_CheckExact(o)) {
  7675. Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
  7676. if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
  7677. PyObject* old = PyList_GET_ITEM(o, n);
  7678. Py_INCREF(v);
  7679. PyList_SET_ITEM(o, n, v);
  7680. Py_DECREF(old);
  7681. return 1;
  7682. }
  7683. } else {
  7684. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  7685. if (likely(m && m->sq_ass_item)) {
  7686. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  7687. Py_ssize_t l = m->sq_length(o);
  7688. if (likely(l >= 0)) {
  7689. i += l;
  7690. } else {
  7691. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  7692. PyErr_Clear();
  7693. else
  7694. return -1;
  7695. }
  7696. }
  7697. return m->sq_ass_item(o, i, v);
  7698. }
  7699. }
  7700. #else
  7701. #if CYTHON_COMPILING_IN_PYPY
  7702. if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
  7703. #else
  7704. if (is_list || PySequence_Check(o)) {
  7705. #endif
  7706. return PySequence_SetItem(o, i, v);
  7707. }
  7708. #endif
  7709. return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
  7710. }
  7711. #if PY_MAJOR_VERSION < 3
  7712. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  7713. CYTHON_UNUSED PyObject *cause) {
  7714. Py_XINCREF(type);
  7715. if (!value || value == Py_None)
  7716. value = NULL;
  7717. else
  7718. Py_INCREF(value);
  7719. if (!tb || tb == Py_None)
  7720. tb = NULL;
  7721. else {
  7722. Py_INCREF(tb);
  7723. if (!PyTraceBack_Check(tb)) {
  7724. PyErr_SetString(PyExc_TypeError,
  7725. "raise: arg 3 must be a traceback or None");
  7726. goto raise_error;
  7727. }
  7728. }
  7729. #if PY_VERSION_HEX < 0x02050000
  7730. if (PyClass_Check(type)) {
  7731. #else
  7732. if (PyType_Check(type)) {
  7733. #endif
  7734. #if CYTHON_COMPILING_IN_PYPY
  7735. if (!value) {
  7736. Py_INCREF(Py_None);
  7737. value = Py_None;
  7738. }
  7739. #endif
  7740. PyErr_NormalizeException(&type, &value, &tb);
  7741. } else {
  7742. if (value) {
  7743. PyErr_SetString(PyExc_TypeError,
  7744. "instance exception may not have a separate value");
  7745. goto raise_error;
  7746. }
  7747. value = type;
  7748. #if PY_VERSION_HEX < 0x02050000
  7749. if (PyInstance_Check(type)) {
  7750. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  7751. Py_INCREF(type);
  7752. } else {
  7753. type = 0;
  7754. PyErr_SetString(PyExc_TypeError,
  7755. "raise: exception must be an old-style class or instance");
  7756. goto raise_error;
  7757. }
  7758. #else
  7759. type = (PyObject*) Py_TYPE(type);
  7760. Py_INCREF(type);
  7761. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  7762. PyErr_SetString(PyExc_TypeError,
  7763. "raise: exception class must be a subclass of BaseException");
  7764. goto raise_error;
  7765. }
  7766. #endif
  7767. }
  7768. __Pyx_ErrRestore(type, value, tb);
  7769. return;
  7770. raise_error:
  7771. Py_XDECREF(value);
  7772. Py_XDECREF(type);
  7773. Py_XDECREF(tb);
  7774. return;
  7775. }
  7776. #else /* Python 3+ */
  7777. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  7778. PyObject* owned_instance = NULL;
  7779. if (tb == Py_None) {
  7780. tb = 0;
  7781. } else if (tb && !PyTraceBack_Check(tb)) {
  7782. PyErr_SetString(PyExc_TypeError,
  7783. "raise: arg 3 must be a traceback or None");
  7784. goto bad;
  7785. }
  7786. if (value == Py_None)
  7787. value = 0;
  7788. if (PyExceptionInstance_Check(type)) {
  7789. if (value) {
  7790. PyErr_SetString(PyExc_TypeError,
  7791. "instance exception may not have a separate value");
  7792. goto bad;
  7793. }
  7794. value = type;
  7795. type = (PyObject*) Py_TYPE(value);
  7796. } else if (PyExceptionClass_Check(type)) {
  7797. PyObject *instance_class = NULL;
  7798. if (value && PyExceptionInstance_Check(value)) {
  7799. instance_class = (PyObject*) Py_TYPE(value);
  7800. if (instance_class != type) {
  7801. if (PyObject_IsSubclass(instance_class, type)) {
  7802. type = instance_class;
  7803. } else {
  7804. instance_class = NULL;
  7805. }
  7806. }
  7807. }
  7808. if (!instance_class) {
  7809. PyObject *args;
  7810. if (!value)
  7811. args = PyTuple_New(0);
  7812. else if (PyTuple_Check(value)) {
  7813. Py_INCREF(value);
  7814. args = value;
  7815. } else
  7816. args = PyTuple_Pack(1, value);
  7817. if (!args)
  7818. goto bad;
  7819. owned_instance = PyObject_Call(type, args, NULL);
  7820. Py_DECREF(args);
  7821. if (!owned_instance)
  7822. goto bad;
  7823. value = owned_instance;
  7824. if (!PyExceptionInstance_Check(value)) {
  7825. PyErr_Format(PyExc_TypeError,
  7826. "calling %R should have returned an instance of "
  7827. "BaseException, not %R",
  7828. type, Py_TYPE(value));
  7829. goto bad;
  7830. }
  7831. }
  7832. } else {
  7833. PyErr_SetString(PyExc_TypeError,
  7834. "raise: exception class must be a subclass of BaseException");
  7835. goto bad;
  7836. }
  7837. #if PY_VERSION_HEX >= 0x03030000
  7838. if (cause) {
  7839. #else
  7840. if (cause && cause != Py_None) {
  7841. #endif
  7842. PyObject *fixed_cause;
  7843. if (cause == Py_None) {
  7844. fixed_cause = NULL;
  7845. } else if (PyExceptionClass_Check(cause)) {
  7846. fixed_cause = PyObject_CallObject(cause, NULL);
  7847. if (fixed_cause == NULL)
  7848. goto bad;
  7849. } else if (PyExceptionInstance_Check(cause)) {
  7850. fixed_cause = cause;
  7851. Py_INCREF(fixed_cause);
  7852. } else {
  7853. PyErr_SetString(PyExc_TypeError,
  7854. "exception causes must derive from "
  7855. "BaseException");
  7856. goto bad;
  7857. }
  7858. PyException_SetCause(value, fixed_cause);
  7859. }
  7860. PyErr_SetObject(type, value);
  7861. if (tb) {
  7862. PyThreadState *tstate = PyThreadState_GET();
  7863. PyObject* tmp_tb = tstate->curexc_traceback;
  7864. if (tb != tmp_tb) {
  7865. Py_INCREF(tb);
  7866. tstate->curexc_traceback = tb;
  7867. Py_XDECREF(tmp_tb);
  7868. }
  7869. }
  7870. bad:
  7871. Py_XDECREF(owned_instance);
  7872. return;
  7873. }
  7874. #endif
  7875. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  7876. PyErr_Format(PyExc_ValueError,
  7877. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  7878. }
  7879. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  7880. PyErr_Format(PyExc_ValueError,
  7881. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  7882. index, (index == 1) ? "" : "s");
  7883. }
  7884. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  7885. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  7886. }
  7887. #if PY_MAJOR_VERSION < 3
  7888. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  7889. #if PY_VERSION_HEX >= 0x02060000
  7890. if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  7891. #endif
  7892. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
  7893. #if PY_VERSION_HEX < 0x02060000
  7894. if (obj->ob_type->tp_dict) {
  7895. PyObject *getbuffer_cobj = PyObject_GetItem(
  7896. obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer);
  7897. if (getbuffer_cobj) {
  7898. getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
  7899. Py_DECREF(getbuffer_cobj);
  7900. if (!func)
  7901. goto fail;
  7902. return func(obj, view, flags);
  7903. } else {
  7904. PyErr_Clear();
  7905. }
  7906. }
  7907. #endif
  7908. PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  7909. #if PY_VERSION_HEX < 0x02060000
  7910. fail:
  7911. #endif
  7912. return -1;
  7913. }
  7914. static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  7915. PyObject *obj = view->obj;
  7916. if (!obj) return;
  7917. #if PY_VERSION_HEX >= 0x02060000
  7918. if (PyObject_CheckBuffer(obj)) {
  7919. PyBuffer_Release(view);
  7920. return;
  7921. }
  7922. #endif
  7923. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  7924. #if PY_VERSION_HEX < 0x02060000
  7925. if (obj->ob_type->tp_dict) {
  7926. PyObject *releasebuffer_cobj = PyObject_GetItem(
  7927. obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer);
  7928. if (releasebuffer_cobj) {
  7929. releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
  7930. Py_DECREF(releasebuffer_cobj);
  7931. if (!func)
  7932. goto fail;
  7933. func(obj, view);
  7934. return;
  7935. } else {
  7936. PyErr_Clear();
  7937. }
  7938. }
  7939. #endif
  7940. goto nofail;
  7941. #if PY_VERSION_HEX < 0x02060000
  7942. fail:
  7943. #endif
  7944. PyErr_WriteUnraisable(obj);
  7945. nofail:
  7946. Py_DECREF(obj);
  7947. view->obj = NULL;
  7948. }
  7949. #endif /* PY_MAJOR_VERSION < 3 */
  7950. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  7951. PyObject *empty_list = 0;
  7952. PyObject *module = 0;
  7953. PyObject *global_dict = 0;
  7954. PyObject *empty_dict = 0;
  7955. PyObject *list;
  7956. #if PY_VERSION_HEX < 0x03030000
  7957. PyObject *py_import;
  7958. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  7959. if (!py_import)
  7960. goto bad;
  7961. #endif
  7962. if (from_list)
  7963. list = from_list;
  7964. else {
  7965. empty_list = PyList_New(0);
  7966. if (!empty_list)
  7967. goto bad;
  7968. list = empty_list;
  7969. }
  7970. global_dict = PyModule_GetDict(__pyx_m);
  7971. if (!global_dict)
  7972. goto bad;
  7973. empty_dict = PyDict_New();
  7974. if (!empty_dict)
  7975. goto bad;
  7976. #if PY_VERSION_HEX >= 0x02050000
  7977. {
  7978. #if PY_MAJOR_VERSION >= 3
  7979. if (level == -1) {
  7980. if (strchr(__Pyx_MODULE_NAME, '.')) {
  7981. #if PY_VERSION_HEX < 0x03030000
  7982. PyObject *py_level = PyInt_FromLong(1);
  7983. if (!py_level)
  7984. goto bad;
  7985. module = PyObject_CallFunctionObjArgs(py_import,
  7986. name, global_dict, empty_dict, list, py_level, NULL);
  7987. Py_DECREF(py_level);
  7988. #else
  7989. module = PyImport_ImportModuleLevelObject(
  7990. name, global_dict, empty_dict, list, 1);
  7991. #endif
  7992. if (!module) {
  7993. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  7994. goto bad;
  7995. PyErr_Clear();
  7996. }
  7997. }
  7998. level = 0; /* try absolute import on failure */
  7999. }
  8000. #endif
  8001. if (!module) {
  8002. #if PY_VERSION_HEX < 0x03030000
  8003. PyObject *py_level = PyInt_FromLong(level);
  8004. if (!py_level)
  8005. goto bad;
  8006. module = PyObject_CallFunctionObjArgs(py_import,
  8007. name, global_dict, empty_dict, list, py_level, NULL);
  8008. Py_DECREF(py_level);
  8009. #else
  8010. module = PyImport_ImportModuleLevelObject(
  8011. name, global_dict, empty_dict, list, level);
  8012. #endif
  8013. }
  8014. }
  8015. #else
  8016. if (level>0) {
  8017. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  8018. goto bad;
  8019. }
  8020. module = PyObject_CallFunctionObjArgs(py_import,
  8021. name, global_dict, empty_dict, list, NULL);
  8022. #endif
  8023. bad:
  8024. #if PY_VERSION_HEX < 0x03030000
  8025. Py_XDECREF(py_import);
  8026. #endif
  8027. Py_XDECREF(empty_list);
  8028. Py_XDECREF(empty_dict);
  8029. return module;
  8030. }
  8031. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  8032. { \
  8033. func_type value = func(x); \
  8034. if (sizeof(target_type) < sizeof(func_type)) { \
  8035. if (unlikely(value != (func_type) (target_type) value)) { \
  8036. func_type zero = 0; \
  8037. PyErr_SetString(PyExc_OverflowError, \
  8038. (is_unsigned && unlikely(value < zero)) ? \
  8039. "can't convert negative value to " #target_type : \
  8040. "value too large to convert to " #target_type); \
  8041. return (target_type) -1; \
  8042. } \
  8043. } \
  8044. return (target_type) value; \
  8045. }
  8046. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8047. #if CYTHON_USE_PYLONG_INTERNALS
  8048. #include "longintrepr.h"
  8049. #endif
  8050. #endif
  8051. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) {
  8052. const npy_long neg_one = (npy_long) -1, const_zero = 0;
  8053. const int is_unsigned = neg_one > const_zero;
  8054. #if PY_MAJOR_VERSION < 3
  8055. if (likely(PyInt_Check(x))) {
  8056. if (sizeof(npy_long) < sizeof(long)) {
  8057. __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG)
  8058. } else {
  8059. long val = PyInt_AS_LONG(x);
  8060. if (is_unsigned && unlikely(val < 0)) {
  8061. PyErr_SetString(PyExc_OverflowError,
  8062. "can't convert negative value to npy_long");
  8063. return (npy_long) -1;
  8064. }
  8065. return (npy_long) val;
  8066. }
  8067. } else
  8068. #endif
  8069. if (likely(PyLong_Check(x))) {
  8070. if (is_unsigned) {
  8071. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8072. #if CYTHON_USE_PYLONG_INTERNALS
  8073. if (sizeof(digit) <= sizeof(npy_long)) {
  8074. switch (Py_SIZE(x)) {
  8075. case 0: return 0;
  8076. case 1: return (npy_long) ((PyLongObject*)x)->ob_digit[0];
  8077. }
  8078. }
  8079. #endif
  8080. #endif
  8081. if (unlikely(Py_SIZE(x) < 0)) {
  8082. PyErr_SetString(PyExc_OverflowError,
  8083. "can't convert negative value to npy_long");
  8084. return (npy_long) -1;
  8085. }
  8086. if (sizeof(npy_long) <= sizeof(unsigned long)) {
  8087. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, PyLong_AsUnsignedLong)
  8088. } else if (sizeof(npy_long) <= sizeof(unsigned long long)) {
  8089. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long long, PyLong_AsUnsignedLongLong)
  8090. }
  8091. } else {
  8092. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8093. #if CYTHON_USE_PYLONG_INTERNALS
  8094. if (sizeof(digit) <= sizeof(npy_long)) {
  8095. switch (Py_SIZE(x)) {
  8096. case 0: return 0;
  8097. case 1: return +(npy_long) ((PyLongObject*)x)->ob_digit[0];
  8098. case -1: return -(npy_long) ((PyLongObject*)x)->ob_digit[0];
  8099. }
  8100. }
  8101. #endif
  8102. #endif
  8103. if (sizeof(npy_long) <= sizeof(long)) {
  8104. __PYX_VERIFY_RETURN_INT(npy_long, long, PyLong_AsLong)
  8105. } else if (sizeof(npy_long) <= sizeof(long long)) {
  8106. __PYX_VERIFY_RETURN_INT(npy_long, long long, PyLong_AsLongLong)
  8107. }
  8108. }
  8109. {
  8110. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8111. PyErr_SetString(PyExc_RuntimeError,
  8112. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8113. #else
  8114. npy_long val;
  8115. PyObject *v = __Pyx_PyNumber_Int(x);
  8116. #if PY_MAJOR_VERSION < 3
  8117. if (likely(v) && !PyLong_Check(v)) {
  8118. PyObject *tmp = v;
  8119. v = PyNumber_Long(tmp);
  8120. Py_DECREF(tmp);
  8121. }
  8122. #endif
  8123. if (likely(v)) {
  8124. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8125. unsigned char *bytes = (unsigned char *)&val;
  8126. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8127. bytes, sizeof(val),
  8128. is_little, !is_unsigned);
  8129. Py_DECREF(v);
  8130. if (likely(!ret))
  8131. return val;
  8132. }
  8133. #endif
  8134. return (npy_long) -1;
  8135. }
  8136. } else {
  8137. npy_long val;
  8138. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8139. if (!tmp) return (npy_long) -1;
  8140. val = __Pyx_PyInt_As_npy_long(tmp);
  8141. Py_DECREF(tmp);
  8142. return val;
  8143. }
  8144. }
  8145. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
  8146. const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
  8147. const int is_unsigned = neg_one > const_zero;
  8148. if (is_unsigned) {
  8149. if (sizeof(Py_intptr_t) < sizeof(long)) {
  8150. return PyInt_FromLong((long) value);
  8151. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
  8152. return PyLong_FromUnsignedLong((unsigned long) value);
  8153. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
  8154. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8155. }
  8156. } else {
  8157. if (sizeof(Py_intptr_t) <= sizeof(long)) {
  8158. return PyInt_FromLong((long) value);
  8159. } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
  8160. return PyLong_FromLongLong((long long) value);
  8161. }
  8162. }
  8163. {
  8164. int one = 1; int little = (int)*(unsigned char *)&one;
  8165. unsigned char *bytes = (unsigned char *)&value;
  8166. return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
  8167. little, !is_unsigned);
  8168. }
  8169. }
  8170. #if CYTHON_CCOMPLEX
  8171. #ifdef __cplusplus
  8172. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8173. return ::std::complex< double >(x, y);
  8174. }
  8175. #else
  8176. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8177. return x + y*(__pyx_t_double_complex)_Complex_I;
  8178. }
  8179. #endif
  8180. #else
  8181. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8182. __pyx_t_double_complex z;
  8183. z.real = x;
  8184. z.imag = y;
  8185. return z;
  8186. }
  8187. #endif
  8188. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
  8189. Py_complex cval;
  8190. #if CYTHON_COMPILING_IN_CPYTHON
  8191. if (PyComplex_CheckExact(o))
  8192. cval = ((PyComplexObject *)o)->cval;
  8193. else
  8194. #endif
  8195. cval = PyComplex_AsCComplex(o);
  8196. return __pyx_t_double_complex_from_parts(
  8197. (double)cval.real,
  8198. (double)cval.imag);
  8199. }
  8200. #if CYTHON_CCOMPLEX
  8201. #else
  8202. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8203. return (a.real == b.real) && (a.imag == b.imag);
  8204. }
  8205. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8206. __pyx_t_double_complex z;
  8207. z.real = a.real + b.real;
  8208. z.imag = a.imag + b.imag;
  8209. return z;
  8210. }
  8211. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8212. __pyx_t_double_complex z;
  8213. z.real = a.real - b.real;
  8214. z.imag = a.imag - b.imag;
  8215. return z;
  8216. }
  8217. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8218. __pyx_t_double_complex z;
  8219. z.real = a.real * b.real - a.imag * b.imag;
  8220. z.imag = a.real * b.imag + a.imag * b.real;
  8221. return z;
  8222. }
  8223. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8224. __pyx_t_double_complex z;
  8225. double denom = b.real * b.real + b.imag * b.imag;
  8226. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  8227. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  8228. return z;
  8229. }
  8230. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
  8231. __pyx_t_double_complex z;
  8232. z.real = -a.real;
  8233. z.imag = -a.imag;
  8234. return z;
  8235. }
  8236. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
  8237. return (a.real == 0) && (a.imag == 0);
  8238. }
  8239. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
  8240. __pyx_t_double_complex z;
  8241. z.real = a.real;
  8242. z.imag = -a.imag;
  8243. return z;
  8244. }
  8245. #if 1
  8246. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
  8247. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  8248. return sqrt(z.real*z.real + z.imag*z.imag);
  8249. #else
  8250. return hypot(z.real, z.imag);
  8251. #endif
  8252. }
  8253. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8254. __pyx_t_double_complex z;
  8255. double r, lnr, theta, z_r, z_theta;
  8256. if (b.imag == 0 && b.real == (int)b.real) {
  8257. if (b.real < 0) {
  8258. double denom = a.real * a.real + a.imag * a.imag;
  8259. a.real = a.real / denom;
  8260. a.imag = -a.imag / denom;
  8261. b.real = -b.real;
  8262. }
  8263. switch ((int)b.real) {
  8264. case 0:
  8265. z.real = 1;
  8266. z.imag = 0;
  8267. return z;
  8268. case 1:
  8269. return a;
  8270. case 2:
  8271. z = __Pyx_c_prod(a, a);
  8272. return __Pyx_c_prod(a, a);
  8273. case 3:
  8274. z = __Pyx_c_prod(a, a);
  8275. return __Pyx_c_prod(z, a);
  8276. case 4:
  8277. z = __Pyx_c_prod(a, a);
  8278. return __Pyx_c_prod(z, z);
  8279. }
  8280. }
  8281. if (a.imag == 0) {
  8282. if (a.real == 0) {
  8283. return a;
  8284. }
  8285. r = a.real;
  8286. theta = 0;
  8287. } else {
  8288. r = __Pyx_c_abs(a);
  8289. theta = atan2(a.imag, a.real);
  8290. }
  8291. lnr = log(r);
  8292. z_r = exp(lnr * b.real - theta * b.imag);
  8293. z_theta = theta * b.real + lnr * b.imag;
  8294. z.real = z_r * cos(z_theta);
  8295. z.imag = z_r * sin(z_theta);
  8296. return z;
  8297. }
  8298. #endif
  8299. #endif
  8300. #if CYTHON_CCOMPLEX
  8301. #ifdef __cplusplus
  8302. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8303. return ::std::complex< float >(x, y);
  8304. }
  8305. #else
  8306. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8307. return x + y*(__pyx_t_float_complex)_Complex_I;
  8308. }
  8309. #endif
  8310. #else
  8311. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8312. __pyx_t_float_complex z;
  8313. z.real = x;
  8314. z.imag = y;
  8315. return z;
  8316. }
  8317. #endif
  8318. #if CYTHON_CCOMPLEX
  8319. #else
  8320. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8321. return (a.real == b.real) && (a.imag == b.imag);
  8322. }
  8323. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8324. __pyx_t_float_complex z;
  8325. z.real = a.real + b.real;
  8326. z.imag = a.imag + b.imag;
  8327. return z;
  8328. }
  8329. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8330. __pyx_t_float_complex z;
  8331. z.real = a.real - b.real;
  8332. z.imag = a.imag - b.imag;
  8333. return z;
  8334. }
  8335. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8336. __pyx_t_float_complex z;
  8337. z.real = a.real * b.real - a.imag * b.imag;
  8338. z.imag = a.real * b.imag + a.imag * b.real;
  8339. return z;
  8340. }
  8341. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8342. __pyx_t_float_complex z;
  8343. float denom = b.real * b.real + b.imag * b.imag;
  8344. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  8345. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  8346. return z;
  8347. }
  8348. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
  8349. __pyx_t_float_complex z;
  8350. z.real = -a.real;
  8351. z.imag = -a.imag;
  8352. return z;
  8353. }
  8354. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
  8355. return (a.real == 0) && (a.imag == 0);
  8356. }
  8357. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
  8358. __pyx_t_float_complex z;
  8359. z.real = a.real;
  8360. z.imag = -a.imag;
  8361. return z;
  8362. }
  8363. #if 1
  8364. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
  8365. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  8366. return sqrtf(z.real*z.real + z.imag*z.imag);
  8367. #else
  8368. return hypotf(z.real, z.imag);
  8369. #endif
  8370. }
  8371. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8372. __pyx_t_float_complex z;
  8373. float r, lnr, theta, z_r, z_theta;
  8374. if (b.imag == 0 && b.real == (int)b.real) {
  8375. if (b.real < 0) {
  8376. float denom = a.real * a.real + a.imag * a.imag;
  8377. a.real = a.real / denom;
  8378. a.imag = -a.imag / denom;
  8379. b.real = -b.real;
  8380. }
  8381. switch ((int)b.real) {
  8382. case 0:
  8383. z.real = 1;
  8384. z.imag = 0;
  8385. return z;
  8386. case 1:
  8387. return a;
  8388. case 2:
  8389. z = __Pyx_c_prodf(a, a);
  8390. return __Pyx_c_prodf(a, a);
  8391. case 3:
  8392. z = __Pyx_c_prodf(a, a);
  8393. return __Pyx_c_prodf(z, a);
  8394. case 4:
  8395. z = __Pyx_c_prodf(a, a);
  8396. return __Pyx_c_prodf(z, z);
  8397. }
  8398. }
  8399. if (a.imag == 0) {
  8400. if (a.real == 0) {
  8401. return a;
  8402. }
  8403. r = a.real;
  8404. theta = 0;
  8405. } else {
  8406. r = __Pyx_c_absf(a);
  8407. theta = atan2f(a.imag, a.real);
  8408. }
  8409. lnr = logf(r);
  8410. z_r = expf(lnr * b.real - theta * b.imag);
  8411. z_theta = theta * b.real + lnr * b.imag;
  8412. z.real = z_r * cosf(z_theta);
  8413. z.imag = z_r * sinf(z_theta);
  8414. return z;
  8415. }
  8416. #endif
  8417. #endif
  8418. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  8419. const int neg_one = (int) -1, const_zero = 0;
  8420. const int is_unsigned = neg_one > const_zero;
  8421. if (is_unsigned) {
  8422. if (sizeof(int) < sizeof(long)) {
  8423. return PyInt_FromLong((long) value);
  8424. } else if (sizeof(int) <= sizeof(unsigned long)) {
  8425. return PyLong_FromUnsignedLong((unsigned long) value);
  8426. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  8427. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8428. }
  8429. } else {
  8430. if (sizeof(int) <= sizeof(long)) {
  8431. return PyInt_FromLong((long) value);
  8432. } else if (sizeof(int) <= sizeof(long long)) {
  8433. return PyLong_FromLongLong((long long) value);
  8434. }
  8435. }
  8436. {
  8437. int one = 1; int little = (int)*(unsigned char *)&one;
  8438. unsigned char *bytes = (unsigned char *)&value;
  8439. return _PyLong_FromByteArray(bytes, sizeof(int),
  8440. little, !is_unsigned);
  8441. }
  8442. }
  8443. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8444. #if CYTHON_USE_PYLONG_INTERNALS
  8445. #include "longintrepr.h"
  8446. #endif
  8447. #endif
  8448. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  8449. const int neg_one = (int) -1, const_zero = 0;
  8450. const int is_unsigned = neg_one > const_zero;
  8451. #if PY_MAJOR_VERSION < 3
  8452. if (likely(PyInt_Check(x))) {
  8453. if (sizeof(int) < sizeof(long)) {
  8454. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  8455. } else {
  8456. long val = PyInt_AS_LONG(x);
  8457. if (is_unsigned && unlikely(val < 0)) {
  8458. PyErr_SetString(PyExc_OverflowError,
  8459. "can't convert negative value to int");
  8460. return (int) -1;
  8461. }
  8462. return (int) val;
  8463. }
  8464. } else
  8465. #endif
  8466. if (likely(PyLong_Check(x))) {
  8467. if (is_unsigned) {
  8468. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8469. #if CYTHON_USE_PYLONG_INTERNALS
  8470. if (sizeof(digit) <= sizeof(int)) {
  8471. switch (Py_SIZE(x)) {
  8472. case 0: return 0;
  8473. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  8474. }
  8475. }
  8476. #endif
  8477. #endif
  8478. if (unlikely(Py_SIZE(x) < 0)) {
  8479. PyErr_SetString(PyExc_OverflowError,
  8480. "can't convert negative value to int");
  8481. return (int) -1;
  8482. }
  8483. if (sizeof(int) <= sizeof(unsigned long)) {
  8484. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  8485. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  8486. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  8487. }
  8488. } else {
  8489. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8490. #if CYTHON_USE_PYLONG_INTERNALS
  8491. if (sizeof(digit) <= sizeof(int)) {
  8492. switch (Py_SIZE(x)) {
  8493. case 0: return 0;
  8494. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  8495. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  8496. }
  8497. }
  8498. #endif
  8499. #endif
  8500. if (sizeof(int) <= sizeof(long)) {
  8501. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  8502. } else if (sizeof(int) <= sizeof(long long)) {
  8503. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  8504. }
  8505. }
  8506. {
  8507. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8508. PyErr_SetString(PyExc_RuntimeError,
  8509. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8510. #else
  8511. int val;
  8512. PyObject *v = __Pyx_PyNumber_Int(x);
  8513. #if PY_MAJOR_VERSION < 3
  8514. if (likely(v) && !PyLong_Check(v)) {
  8515. PyObject *tmp = v;
  8516. v = PyNumber_Long(tmp);
  8517. Py_DECREF(tmp);
  8518. }
  8519. #endif
  8520. if (likely(v)) {
  8521. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8522. unsigned char *bytes = (unsigned char *)&val;
  8523. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8524. bytes, sizeof(val),
  8525. is_little, !is_unsigned);
  8526. Py_DECREF(v);
  8527. if (likely(!ret))
  8528. return val;
  8529. }
  8530. #endif
  8531. return (int) -1;
  8532. }
  8533. } else {
  8534. int val;
  8535. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8536. if (!tmp) return (int) -1;
  8537. val = __Pyx_PyInt_As_int(tmp);
  8538. Py_DECREF(tmp);
  8539. return val;
  8540. }
  8541. }
  8542. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  8543. const long neg_one = (long) -1, const_zero = 0;
  8544. const int is_unsigned = neg_one > const_zero;
  8545. if (is_unsigned) {
  8546. if (sizeof(long) < sizeof(long)) {
  8547. return PyInt_FromLong((long) value);
  8548. } else if (sizeof(long) <= sizeof(unsigned long)) {
  8549. return PyLong_FromUnsignedLong((unsigned long) value);
  8550. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  8551. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8552. }
  8553. } else {
  8554. if (sizeof(long) <= sizeof(long)) {
  8555. return PyInt_FromLong((long) value);
  8556. } else if (sizeof(long) <= sizeof(long long)) {
  8557. return PyLong_FromLongLong((long long) value);
  8558. }
  8559. }
  8560. {
  8561. int one = 1; int little = (int)*(unsigned char *)&one;
  8562. unsigned char *bytes = (unsigned char *)&value;
  8563. return _PyLong_FromByteArray(bytes, sizeof(long),
  8564. little, !is_unsigned);
  8565. }
  8566. }
  8567. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8568. #if CYTHON_USE_PYLONG_INTERNALS
  8569. #include "longintrepr.h"
  8570. #endif
  8571. #endif
  8572. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  8573. const long neg_one = (long) -1, const_zero = 0;
  8574. const int is_unsigned = neg_one > const_zero;
  8575. #if PY_MAJOR_VERSION < 3
  8576. if (likely(PyInt_Check(x))) {
  8577. if (sizeof(long) < sizeof(long)) {
  8578. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  8579. } else {
  8580. long val = PyInt_AS_LONG(x);
  8581. if (is_unsigned && unlikely(val < 0)) {
  8582. PyErr_SetString(PyExc_OverflowError,
  8583. "can't convert negative value to long");
  8584. return (long) -1;
  8585. }
  8586. return (long) val;
  8587. }
  8588. } else
  8589. #endif
  8590. if (likely(PyLong_Check(x))) {
  8591. if (is_unsigned) {
  8592. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8593. #if CYTHON_USE_PYLONG_INTERNALS
  8594. if (sizeof(digit) <= sizeof(long)) {
  8595. switch (Py_SIZE(x)) {
  8596. case 0: return 0;
  8597. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  8598. }
  8599. }
  8600. #endif
  8601. #endif
  8602. if (unlikely(Py_SIZE(x) < 0)) {
  8603. PyErr_SetString(PyExc_OverflowError,
  8604. "can't convert negative value to long");
  8605. return (long) -1;
  8606. }
  8607. if (sizeof(long) <= sizeof(unsigned long)) {
  8608. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  8609. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  8610. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  8611. }
  8612. } else {
  8613. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8614. #if CYTHON_USE_PYLONG_INTERNALS
  8615. if (sizeof(digit) <= sizeof(long)) {
  8616. switch (Py_SIZE(x)) {
  8617. case 0: return 0;
  8618. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  8619. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  8620. }
  8621. }
  8622. #endif
  8623. #endif
  8624. if (sizeof(long) <= sizeof(long)) {
  8625. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  8626. } else if (sizeof(long) <= sizeof(long long)) {
  8627. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  8628. }
  8629. }
  8630. {
  8631. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8632. PyErr_SetString(PyExc_RuntimeError,
  8633. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8634. #else
  8635. long val;
  8636. PyObject *v = __Pyx_PyNumber_Int(x);
  8637. #if PY_MAJOR_VERSION < 3
  8638. if (likely(v) && !PyLong_Check(v)) {
  8639. PyObject *tmp = v;
  8640. v = PyNumber_Long(tmp);
  8641. Py_DECREF(tmp);
  8642. }
  8643. #endif
  8644. if (likely(v)) {
  8645. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8646. unsigned char *bytes = (unsigned char *)&val;
  8647. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8648. bytes, sizeof(val),
  8649. is_little, !is_unsigned);
  8650. Py_DECREF(v);
  8651. if (likely(!ret))
  8652. return val;
  8653. }
  8654. #endif
  8655. return (long) -1;
  8656. }
  8657. } else {
  8658. long val;
  8659. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8660. if (!tmp) return (long) -1;
  8661. val = __Pyx_PyInt_As_long(tmp);
  8662. Py_DECREF(tmp);
  8663. return val;
  8664. }
  8665. }
  8666. static int __Pyx_check_binary_version(void) {
  8667. char ctversion[4], rtversion[4];
  8668. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  8669. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  8670. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  8671. char message[200];
  8672. PyOS_snprintf(message, sizeof(message),
  8673. "compiletime version %s of module '%.100s' "
  8674. "does not match runtime version %s",
  8675. ctversion, __Pyx_MODULE_NAME, rtversion);
  8676. #if PY_VERSION_HEX < 0x02050000
  8677. return PyErr_Warn(NULL, message);
  8678. #else
  8679. return PyErr_WarnEx(NULL, message, 1);
  8680. #endif
  8681. }
  8682. return 0;
  8683. }
  8684. #ifndef __PYX_HAVE_RT_ImportModule
  8685. #define __PYX_HAVE_RT_ImportModule
  8686. static PyObject *__Pyx_ImportModule(const char *name) {
  8687. PyObject *py_name = 0;
  8688. PyObject *py_module = 0;
  8689. py_name = __Pyx_PyIdentifier_FromString(name);
  8690. if (!py_name)
  8691. goto bad;
  8692. py_module = PyImport_Import(py_name);
  8693. Py_DECREF(py_name);
  8694. return py_module;
  8695. bad:
  8696. Py_XDECREF(py_name);
  8697. return 0;
  8698. }
  8699. #endif
  8700. #ifndef __PYX_HAVE_RT_ImportType
  8701. #define __PYX_HAVE_RT_ImportType
  8702. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
  8703. size_t size, int strict)
  8704. {
  8705. PyObject *py_module = 0;
  8706. PyObject *result = 0;
  8707. PyObject *py_name = 0;
  8708. char warning[200];
  8709. Py_ssize_t basicsize;
  8710. #ifdef Py_LIMITED_API
  8711. PyObject *py_basicsize;
  8712. #endif
  8713. py_module = __Pyx_ImportModule(module_name);
  8714. if (!py_module)
  8715. goto bad;
  8716. py_name = __Pyx_PyIdentifier_FromString(class_name);
  8717. if (!py_name)
  8718. goto bad;
  8719. result = PyObject_GetAttr(py_module, py_name);
  8720. Py_DECREF(py_name);
  8721. py_name = 0;
  8722. Py_DECREF(py_module);
  8723. py_module = 0;
  8724. if (!result)
  8725. goto bad;
  8726. if (!PyType_Check(result)) {
  8727. PyErr_Format(PyExc_TypeError,
  8728. "%.200s.%.200s is not a type object",
  8729. module_name, class_name);
  8730. goto bad;
  8731. }
  8732. #ifndef Py_LIMITED_API
  8733. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  8734. #else
  8735. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  8736. if (!py_basicsize)
  8737. goto bad;
  8738. basicsize = PyLong_AsSsize_t(py_basicsize);
  8739. Py_DECREF(py_basicsize);
  8740. py_basicsize = 0;
  8741. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  8742. goto bad;
  8743. #endif
  8744. if (!strict && (size_t)basicsize > size) {
  8745. PyOS_snprintf(warning, sizeof(warning),
  8746. "%s.%s size changed, may indicate binary incompatibility",
  8747. module_name, class_name);
  8748. #if PY_VERSION_HEX < 0x02050000
  8749. if (PyErr_Warn(NULL, warning) < 0) goto bad;
  8750. #else
  8751. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  8752. #endif
  8753. }
  8754. else if ((size_t)basicsize != size) {
  8755. PyErr_Format(PyExc_ValueError,
  8756. "%.200s.%.200s has the wrong size, try recompiling",
  8757. module_name, class_name);
  8758. goto bad;
  8759. }
  8760. return (PyTypeObject *)result;
  8761. bad:
  8762. Py_XDECREF(py_module);
  8763. Py_XDECREF(result);
  8764. return NULL;
  8765. }
  8766. #endif
  8767. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  8768. int start = 0, mid = 0, end = count - 1;
  8769. if (end >= 0 && code_line > entries[end].code_line) {
  8770. return count;
  8771. }
  8772. while (start < end) {
  8773. mid = (start + end) / 2;
  8774. if (code_line < entries[mid].code_line) {
  8775. end = mid;
  8776. } else if (code_line > entries[mid].code_line) {
  8777. start = mid + 1;
  8778. } else {
  8779. return mid;
  8780. }
  8781. }
  8782. if (code_line <= entries[mid].code_line) {
  8783. return mid;
  8784. } else {
  8785. return mid + 1;
  8786. }
  8787. }
  8788. static PyCodeObject *__pyx_find_code_object(int code_line) {
  8789. PyCodeObject* code_object;
  8790. int pos;
  8791. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  8792. return NULL;
  8793. }
  8794. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8795. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  8796. return NULL;
  8797. }
  8798. code_object = __pyx_code_cache.entries[pos].code_object;
  8799. Py_INCREF(code_object);
  8800. return code_object;
  8801. }
  8802. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  8803. int pos, i;
  8804. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  8805. if (unlikely(!code_line)) {
  8806. return;
  8807. }
  8808. if (unlikely(!entries)) {
  8809. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  8810. if (likely(entries)) {
  8811. __pyx_code_cache.entries = entries;
  8812. __pyx_code_cache.max_count = 64;
  8813. __pyx_code_cache.count = 1;
  8814. entries[0].code_line = code_line;
  8815. entries[0].code_object = code_object;
  8816. Py_INCREF(code_object);
  8817. }
  8818. return;
  8819. }
  8820. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8821. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  8822. PyCodeObject* tmp = entries[pos].code_object;
  8823. entries[pos].code_object = code_object;
  8824. Py_DECREF(tmp);
  8825. return;
  8826. }
  8827. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  8828. int new_max = __pyx_code_cache.max_count + 64;
  8829. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  8830. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  8831. if (unlikely(!entries)) {
  8832. return;
  8833. }
  8834. __pyx_code_cache.entries = entries;
  8835. __pyx_code_cache.max_count = new_max;
  8836. }
  8837. for (i=__pyx_code_cache.count; i>pos; i--) {
  8838. entries[i] = entries[i-1];
  8839. }
  8840. entries[pos].code_line = code_line;
  8841. entries[pos].code_object = code_object;
  8842. __pyx_code_cache.count++;
  8843. Py_INCREF(code_object);
  8844. }
  8845. #include "compile.h"
  8846. #include "frameobject.h"
  8847. #include "traceback.h"
  8848. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  8849. const char *funcname, int c_line,
  8850. int py_line, const char *filename) {
  8851. PyCodeObject *py_code = 0;
  8852. PyObject *py_srcfile = 0;
  8853. PyObject *py_funcname = 0;
  8854. #if PY_MAJOR_VERSION < 3
  8855. py_srcfile = PyString_FromString(filename);
  8856. #else
  8857. py_srcfile = PyUnicode_FromString(filename);
  8858. #endif
  8859. if (!py_srcfile) goto bad;
  8860. if (c_line) {
  8861. #if PY_MAJOR_VERSION < 3
  8862. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8863. #else
  8864. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8865. #endif
  8866. }
  8867. else {
  8868. #if PY_MAJOR_VERSION < 3
  8869. py_funcname = PyString_FromString(funcname);
  8870. #else
  8871. py_funcname = PyUnicode_FromString(funcname);
  8872. #endif
  8873. }
  8874. if (!py_funcname) goto bad;
  8875. py_code = __Pyx_PyCode_New(
  8876. 0, /*int argcount,*/
  8877. 0, /*int kwonlyargcount,*/
  8878. 0, /*int nlocals,*/
  8879. 0, /*int stacksize,*/
  8880. 0, /*int flags,*/
  8881. __pyx_empty_bytes, /*PyObject *code,*/
  8882. __pyx_empty_tuple, /*PyObject *consts,*/
  8883. __pyx_empty_tuple, /*PyObject *names,*/
  8884. __pyx_empty_tuple, /*PyObject *varnames,*/
  8885. __pyx_empty_tuple, /*PyObject *freevars,*/
  8886. __pyx_empty_tuple, /*PyObject *cellvars,*/
  8887. py_srcfile, /*PyObject *filename,*/
  8888. py_funcname, /*PyObject *name,*/
  8889. py_line, /*int firstlineno,*/
  8890. __pyx_empty_bytes /*PyObject *lnotab*/
  8891. );
  8892. Py_DECREF(py_srcfile);
  8893. Py_DECREF(py_funcname);
  8894. return py_code;
  8895. bad:
  8896. Py_XDECREF(py_srcfile);
  8897. Py_XDECREF(py_funcname);
  8898. return NULL;
  8899. }
  8900. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  8901. int py_line, const char *filename) {
  8902. PyCodeObject *py_code = 0;
  8903. PyObject *py_globals = 0;
  8904. PyFrameObject *py_frame = 0;
  8905. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  8906. if (!py_code) {
  8907. py_code = __Pyx_CreateCodeObjectForTraceback(
  8908. funcname, c_line, py_line, filename);
  8909. if (!py_code) goto bad;
  8910. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  8911. }
  8912. py_globals = PyModule_GetDict(__pyx_m);
  8913. if (!py_globals) goto bad;
  8914. py_frame = PyFrame_New(
  8915. PyThreadState_GET(), /*PyThreadState *tstate,*/
  8916. py_code, /*PyCodeObject *code,*/
  8917. py_globals, /*PyObject *globals,*/
  8918. 0 /*PyObject *locals*/
  8919. );
  8920. if (!py_frame) goto bad;
  8921. py_frame->f_lineno = py_line;
  8922. PyTraceBack_Here(py_frame);
  8923. bad:
  8924. Py_XDECREF(py_code);
  8925. Py_XDECREF(py_frame);
  8926. }
  8927. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  8928. while (t->p) {
  8929. #if PY_MAJOR_VERSION < 3
  8930. if (t->is_unicode) {
  8931. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  8932. } else if (t->intern) {
  8933. *t->p = PyString_InternFromString(t->s);
  8934. } else {
  8935. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  8936. }
  8937. #else /* Python 3+ has unicode identifiers */
  8938. if (t->is_unicode | t->is_str) {
  8939. if (t->intern) {
  8940. *t->p = PyUnicode_InternFromString(t->s);
  8941. } else if (t->encoding) {
  8942. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  8943. } else {
  8944. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  8945. }
  8946. } else {
  8947. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  8948. }
  8949. #endif
  8950. if (!*t->p)
  8951. return -1;
  8952. ++t;
  8953. }
  8954. return 0;
  8955. }
  8956. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  8957. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  8958. }
  8959. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  8960. Py_ssize_t ignore;
  8961. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  8962. }
  8963. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  8964. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  8965. if (
  8966. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8967. __Pyx_sys_getdefaultencoding_not_ascii &&
  8968. #endif
  8969. PyUnicode_Check(o)) {
  8970. #if PY_VERSION_HEX < 0x03030000
  8971. char* defenc_c;
  8972. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  8973. if (!defenc) return NULL;
  8974. defenc_c = PyBytes_AS_STRING(defenc);
  8975. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8976. {
  8977. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  8978. char* c;
  8979. for (c = defenc_c; c < end; c++) {
  8980. if ((unsigned char) (*c) >= 128) {
  8981. PyUnicode_AsASCIIString(o);
  8982. return NULL;
  8983. }
  8984. }
  8985. }
  8986. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  8987. *length = PyBytes_GET_SIZE(defenc);
  8988. return defenc_c;
  8989. #else /* PY_VERSION_HEX < 0x03030000 */
  8990. if (PyUnicode_READY(o) == -1) return NULL;
  8991. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8992. if (PyUnicode_IS_ASCII(o)) {
  8993. *length = PyUnicode_GET_LENGTH(o);
  8994. return PyUnicode_AsUTF8(o);
  8995. } else {
  8996. PyUnicode_AsASCIIString(o);
  8997. return NULL;
  8998. }
  8999. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  9000. return PyUnicode_AsUTF8AndSize(o, length);
  9001. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  9002. #endif /* PY_VERSION_HEX < 0x03030000 */
  9003. } else
  9004. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  9005. #if !CYTHON_COMPILING_IN_PYPY
  9006. #if PY_VERSION_HEX >= 0x02060000
  9007. if (PyByteArray_Check(o)) {
  9008. *length = PyByteArray_GET_SIZE(o);
  9009. return PyByteArray_AS_STRING(o);
  9010. } else
  9011. #endif
  9012. #endif
  9013. {
  9014. char* result;
  9015. int r = PyBytes_AsStringAndSize(o, &result, length);
  9016. if (unlikely(r < 0)) {
  9017. return NULL;
  9018. } else {
  9019. return result;
  9020. }
  9021. }
  9022. }
  9023. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  9024. int is_true = x == Py_True;
  9025. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  9026. else return PyObject_IsTrue(x);
  9027. }
  9028. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  9029. PyNumberMethods *m;
  9030. const char *name = NULL;
  9031. PyObject *res = NULL;
  9032. #if PY_MAJOR_VERSION < 3
  9033. if (PyInt_Check(x) || PyLong_Check(x))
  9034. #else
  9035. if (PyLong_Check(x))
  9036. #endif
  9037. return Py_INCREF(x), x;
  9038. m = Py_TYPE(x)->tp_as_number;
  9039. #if PY_MAJOR_VERSION < 3
  9040. if (m && m->nb_int) {
  9041. name = "int";
  9042. res = PyNumber_Int(x);
  9043. }
  9044. else if (m && m->nb_long) {
  9045. name = "long";
  9046. res = PyNumber_Long(x);
  9047. }
  9048. #else
  9049. if (m && m->nb_int) {
  9050. name = "int";
  9051. res = PyNumber_Long(x);
  9052. }
  9053. #endif
  9054. if (res) {
  9055. #if PY_MAJOR_VERSION < 3
  9056. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  9057. #else
  9058. if (!PyLong_Check(res)) {
  9059. #endif
  9060. PyErr_Format(PyExc_TypeError,
  9061. "__%.4s__ returned non-%.4s (type %.200s)",
  9062. name, name, Py_TYPE(res)->tp_name);
  9063. Py_DECREF(res);
  9064. return NULL;
  9065. }
  9066. }
  9067. else if (!PyErr_Occurred()) {
  9068. PyErr_SetString(PyExc_TypeError,
  9069. "an integer is required");
  9070. }
  9071. return res;
  9072. }
  9073. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  9074. #if CYTHON_USE_PYLONG_INTERNALS
  9075. #include "longintrepr.h"
  9076. #endif
  9077. #endif
  9078. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  9079. Py_ssize_t ival;
  9080. PyObject *x;
  9081. #if PY_MAJOR_VERSION < 3
  9082. if (likely(PyInt_CheckExact(b)))
  9083. return PyInt_AS_LONG(b);
  9084. #endif
  9085. if (likely(PyLong_CheckExact(b))) {
  9086. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  9087. #if CYTHON_USE_PYLONG_INTERNALS
  9088. switch (Py_SIZE(b)) {
  9089. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  9090. case 0: return 0;
  9091. case 1: return ((PyLongObject*)b)->ob_digit[0];
  9092. }
  9093. #endif
  9094. #endif
  9095. #if PY_VERSION_HEX < 0x02060000
  9096. return PyInt_AsSsize_t(b);
  9097. #else
  9098. return PyLong_AsSsize_t(b);
  9099. #endif
  9100. }
  9101. x = PyNumber_Index(b);
  9102. if (!x) return -1;
  9103. ival = PyInt_AsSsize_t(x);
  9104. Py_DECREF(x);
  9105. return ival;
  9106. }
  9107. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  9108. #if PY_VERSION_HEX < 0x02050000
  9109. if (ival <= LONG_MAX)
  9110. return PyInt_FromLong((long)ival);
  9111. else {
  9112. unsigned char *bytes = (unsigned char *) &ival;
  9113. int one = 1; int little = (int)*(unsigned char*)&one;
  9114. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  9115. }
  9116. #else
  9117. return PyInt_FromSize_t(ival);
  9118. #endif
  9119. }
  9120. #endif /* Py_PYTHON_H */