scattnlay.cpp 466 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534
  1. /* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1ubuntu2) on Sat Apr 11 18:21:29 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 "ios"
  351. #include "new"
  352. #include "stdexcept"
  353. #include "typeinfo"
  354. #include "py_nmie.h"
  355. #ifdef _OPENMP
  356. #include <omp.h>
  357. #endif /* _OPENMP */
  358. #ifdef PYREX_WITHOUT_ASSERTIONS
  359. #define CYTHON_WITHOUT_ASSERTIONS
  360. #endif
  361. #ifndef CYTHON_UNUSED
  362. # if defined(__GNUC__)
  363. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  364. # define CYTHON_UNUSED __attribute__ ((__unused__))
  365. # else
  366. # define CYTHON_UNUSED
  367. # endif
  368. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  369. # define CYTHON_UNUSED __attribute__ ((__unused__))
  370. # else
  371. # define CYTHON_UNUSED
  372. # endif
  373. #endif
  374. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  375. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  376. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  377. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  378. #define __PYX_DEFAULT_STRING_ENCODING ""
  379. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  380. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  381. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  382. (sizeof(type) < sizeof(Py_ssize_t)) || \
  383. (sizeof(type) > sizeof(Py_ssize_t) && \
  384. likely(v < (type)PY_SSIZE_T_MAX || \
  385. v == (type)PY_SSIZE_T_MAX) && \
  386. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  387. v == (type)PY_SSIZE_T_MIN))) || \
  388. (sizeof(type) == sizeof(Py_ssize_t) && \
  389. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  390. v == (type)PY_SSIZE_T_MAX))) )
  391. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  392. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  393. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  394. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  395. #define __Pyx_PyBytes_FromString PyBytes_FromString
  396. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  397. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  398. #if PY_MAJOR_VERSION < 3
  399. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  400. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  401. #else
  402. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  403. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  404. #endif
  405. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  406. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  407. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
  408. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
  409. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
  410. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
  411. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
  412. #if PY_MAJOR_VERSION < 3
  413. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  414. {
  415. const Py_UNICODE *u_end = u;
  416. while (*u_end++) ;
  417. return u_end - u - 1;
  418. }
  419. #else
  420. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  421. #endif
  422. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  423. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  424. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  425. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  426. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  427. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  428. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  429. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  430. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  431. #if CYTHON_COMPILING_IN_CPYTHON
  432. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  433. #else
  434. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  435. #endif
  436. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  437. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  438. static int __Pyx_sys_getdefaultencoding_not_ascii;
  439. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  440. PyObject* sys = NULL;
  441. PyObject* default_encoding = NULL;
  442. PyObject* ascii_chars_u = NULL;
  443. PyObject* ascii_chars_b = NULL;
  444. sys = PyImport_ImportModule("sys");
  445. if (sys == NULL) goto bad;
  446. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  447. if (default_encoding == NULL) goto bad;
  448. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  449. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  450. } else {
  451. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  452. char ascii_chars[128];
  453. int c;
  454. for (c = 0; c < 128; c++) {
  455. ascii_chars[c] = c;
  456. }
  457. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  458. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  459. if (ascii_chars_u == NULL) goto bad;
  460. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  461. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  462. PyErr_Format(
  463. PyExc_ValueError,
  464. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  465. default_encoding_c);
  466. goto bad;
  467. }
  468. }
  469. Py_XDECREF(sys);
  470. Py_XDECREF(default_encoding);
  471. Py_XDECREF(ascii_chars_u);
  472. Py_XDECREF(ascii_chars_b);
  473. return 0;
  474. bad:
  475. Py_XDECREF(sys);
  476. Py_XDECREF(default_encoding);
  477. Py_XDECREF(ascii_chars_u);
  478. Py_XDECREF(ascii_chars_b);
  479. return -1;
  480. }
  481. #endif
  482. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  483. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  484. #else
  485. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  486. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  487. static char* __PYX_DEFAULT_STRING_ENCODING;
  488. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  489. PyObject* sys = NULL;
  490. PyObject* default_encoding = NULL;
  491. char* default_encoding_c;
  492. sys = PyImport_ImportModule("sys");
  493. if (sys == NULL) goto bad;
  494. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  495. if (default_encoding == NULL) goto bad;
  496. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  497. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  498. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  499. Py_DECREF(sys);
  500. Py_DECREF(default_encoding);
  501. return 0;
  502. bad:
  503. Py_XDECREF(sys);
  504. Py_XDECREF(default_encoding);
  505. return -1;
  506. }
  507. #endif
  508. #endif
  509. /* Test for GCC > 2.95 */
  510. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  511. #define likely(x) __builtin_expect(!!(x), 1)
  512. #define unlikely(x) __builtin_expect(!!(x), 0)
  513. #else /* !__GNUC__ or GCC < 2.95 */
  514. #define likely(x) (x)
  515. #define unlikely(x) (x)
  516. #endif /* __GNUC__ */
  517. static PyObject *__pyx_m;
  518. static PyObject *__pyx_d;
  519. static PyObject *__pyx_b;
  520. static PyObject *__pyx_empty_tuple;
  521. static PyObject *__pyx_empty_bytes;
  522. static int __pyx_lineno;
  523. static int __pyx_clineno = 0;
  524. static const char * __pyx_cfilenm= __FILE__;
  525. static const char *__pyx_filename;
  526. #if !defined(CYTHON_CCOMPLEX)
  527. #if defined(__cplusplus)
  528. #define CYTHON_CCOMPLEX 1
  529. #elif defined(_Complex_I)
  530. #define CYTHON_CCOMPLEX 1
  531. #else
  532. #define CYTHON_CCOMPLEX 0
  533. #endif
  534. #endif
  535. #if CYTHON_CCOMPLEX
  536. #ifdef __cplusplus
  537. #include <complex>
  538. #else
  539. #include <complex.h>
  540. #endif
  541. #endif
  542. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  543. #undef _Complex_I
  544. #define _Complex_I 1.0fj
  545. #endif
  546. static const char *__pyx_f[] = {
  547. "scattnlay.pyx",
  548. "__init__.pxd",
  549. "stringsource",
  550. "stringsource",
  551. "type.pxd",
  552. };
  553. #define IS_UNSIGNED(type) (((type) -1) > 0)
  554. struct __Pyx_StructField_;
  555. #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
  556. typedef struct {
  557. const char* name; /* for error messages only */
  558. struct __Pyx_StructField_* fields;
  559. size_t size; /* sizeof(type) */
  560. size_t arraysize[8]; /* length of array in each dimension */
  561. int ndim;
  562. char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  563. char is_unsigned;
  564. int flags;
  565. } __Pyx_TypeInfo;
  566. typedef struct __Pyx_StructField_ {
  567. __Pyx_TypeInfo* type;
  568. const char* name;
  569. size_t offset;
  570. } __Pyx_StructField;
  571. typedef struct {
  572. __Pyx_StructField* field;
  573. size_t parent_offset;
  574. } __Pyx_BufFmt_StackElem;
  575. typedef struct {
  576. __Pyx_StructField root;
  577. __Pyx_BufFmt_StackElem* head;
  578. size_t fmt_offset;
  579. size_t new_count, enc_count;
  580. size_t struct_alignment;
  581. int is_complex;
  582. char enc_type;
  583. char new_packmode;
  584. char enc_packmode;
  585. char is_valid_array;
  586. } __Pyx_BufFmt_Context;
  587. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
  588. * # in Cython to enable them only on the right systems.
  589. *
  590. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  591. * ctypedef npy_int16 int16_t
  592. * ctypedef npy_int32 int32_t
  593. */
  594. typedef npy_int8 __pyx_t_5numpy_int8_t;
  595. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
  596. *
  597. * ctypedef npy_int8 int8_t
  598. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  599. * ctypedef npy_int32 int32_t
  600. * ctypedef npy_int64 int64_t
  601. */
  602. typedef npy_int16 __pyx_t_5numpy_int16_t;
  603. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
  604. * ctypedef npy_int8 int8_t
  605. * ctypedef npy_int16 int16_t
  606. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  607. * ctypedef npy_int64 int64_t
  608. * #ctypedef npy_int96 int96_t
  609. */
  610. typedef npy_int32 __pyx_t_5numpy_int32_t;
  611. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
  612. * ctypedef npy_int16 int16_t
  613. * ctypedef npy_int32 int32_t
  614. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  615. * #ctypedef npy_int96 int96_t
  616. * #ctypedef npy_int128 int128_t
  617. */
  618. typedef npy_int64 __pyx_t_5numpy_int64_t;
  619. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
  620. * #ctypedef npy_int128 int128_t
  621. *
  622. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  623. * ctypedef npy_uint16 uint16_t
  624. * ctypedef npy_uint32 uint32_t
  625. */
  626. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  627. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
  628. *
  629. * ctypedef npy_uint8 uint8_t
  630. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  631. * ctypedef npy_uint32 uint32_t
  632. * ctypedef npy_uint64 uint64_t
  633. */
  634. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  635. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
  636. * ctypedef npy_uint8 uint8_t
  637. * ctypedef npy_uint16 uint16_t
  638. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  639. * ctypedef npy_uint64 uint64_t
  640. * #ctypedef npy_uint96 uint96_t
  641. */
  642. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  643. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
  644. * ctypedef npy_uint16 uint16_t
  645. * ctypedef npy_uint32 uint32_t
  646. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  647. * #ctypedef npy_uint96 uint96_t
  648. * #ctypedef npy_uint128 uint128_t
  649. */
  650. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  651. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
  652. * #ctypedef npy_uint128 uint128_t
  653. *
  654. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  655. * ctypedef npy_float64 float64_t
  656. * #ctypedef npy_float80 float80_t
  657. */
  658. typedef npy_float32 __pyx_t_5numpy_float32_t;
  659. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
  660. *
  661. * ctypedef npy_float32 float32_t
  662. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  663. * #ctypedef npy_float80 float80_t
  664. * #ctypedef npy_float128 float128_t
  665. */
  666. typedef npy_float64 __pyx_t_5numpy_float64_t;
  667. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
  668. * # The int types are mapped a bit surprising --
  669. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  670. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  671. * ctypedef npy_longlong long_t
  672. * ctypedef npy_longlong longlong_t
  673. */
  674. typedef npy_long __pyx_t_5numpy_int_t;
  675. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
  676. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  677. * ctypedef npy_long int_t
  678. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  679. * ctypedef npy_longlong longlong_t
  680. *
  681. */
  682. typedef npy_longlong __pyx_t_5numpy_long_t;
  683. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
  684. * ctypedef npy_long int_t
  685. * ctypedef npy_longlong long_t
  686. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  687. *
  688. * ctypedef npy_ulong uint_t
  689. */
  690. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  691. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
  692. * ctypedef npy_longlong longlong_t
  693. *
  694. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  695. * ctypedef npy_ulonglong ulong_t
  696. * ctypedef npy_ulonglong ulonglong_t
  697. */
  698. typedef npy_ulong __pyx_t_5numpy_uint_t;
  699. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
  700. *
  701. * ctypedef npy_ulong uint_t
  702. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  703. * ctypedef npy_ulonglong ulonglong_t
  704. *
  705. */
  706. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  707. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
  708. * ctypedef npy_ulong uint_t
  709. * ctypedef npy_ulonglong ulong_t
  710. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  711. *
  712. * ctypedef npy_intp intp_t
  713. */
  714. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  715. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
  716. * ctypedef npy_ulonglong ulonglong_t
  717. *
  718. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  719. * ctypedef npy_uintp uintp_t
  720. *
  721. */
  722. typedef npy_intp __pyx_t_5numpy_intp_t;
  723. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
  724. *
  725. * ctypedef npy_intp intp_t
  726. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  727. *
  728. * ctypedef npy_double float_t
  729. */
  730. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  731. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
  732. * ctypedef npy_uintp uintp_t
  733. *
  734. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  735. * ctypedef npy_double double_t
  736. * ctypedef npy_longdouble longdouble_t
  737. */
  738. typedef npy_double __pyx_t_5numpy_float_t;
  739. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
  740. *
  741. * ctypedef npy_double float_t
  742. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  743. * ctypedef npy_longdouble longdouble_t
  744. *
  745. */
  746. typedef npy_double __pyx_t_5numpy_double_t;
  747. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
  748. * ctypedef npy_double float_t
  749. * ctypedef npy_double double_t
  750. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  751. *
  752. * ctypedef npy_cfloat cfloat_t
  753. */
  754. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  755. #if CYTHON_CCOMPLEX
  756. #ifdef __cplusplus
  757. typedef ::std::complex< double > __pyx_t_double_complex;
  758. #else
  759. typedef double _Complex __pyx_t_double_complex;
  760. #endif
  761. #else
  762. typedef struct { double real, imag; } __pyx_t_double_complex;
  763. #endif
  764. #if CYTHON_CCOMPLEX
  765. #ifdef __cplusplus
  766. typedef ::std::complex< float > __pyx_t_float_complex;
  767. #else
  768. typedef float _Complex __pyx_t_float_complex;
  769. #endif
  770. #else
  771. typedef struct { float real, imag; } __pyx_t_float_complex;
  772. #endif
  773. /*--- Type declarations ---*/
  774. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
  775. * ctypedef npy_longdouble longdouble_t
  776. *
  777. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  778. * ctypedef npy_cdouble cdouble_t
  779. * ctypedef npy_clongdouble clongdouble_t
  780. */
  781. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  782. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
  783. *
  784. * ctypedef npy_cfloat cfloat_t
  785. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  786. * ctypedef npy_clongdouble clongdouble_t
  787. *
  788. */
  789. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  790. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
  791. * ctypedef npy_cfloat cfloat_t
  792. * ctypedef npy_cdouble cdouble_t
  793. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  794. *
  795. * ctypedef npy_cdouble complex_t
  796. */
  797. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  798. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
  799. * ctypedef npy_clongdouble clongdouble_t
  800. *
  801. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  802. *
  803. * cdef inline object PyArray_MultiIterNew1(a):
  804. */
  805. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  806. #ifndef CYTHON_REFNANNY
  807. #define CYTHON_REFNANNY 0
  808. #endif
  809. #if CYTHON_REFNANNY
  810. typedef struct {
  811. void (*INCREF)(void*, PyObject*, int);
  812. void (*DECREF)(void*, PyObject*, int);
  813. void (*GOTREF)(void*, PyObject*, int);
  814. void (*GIVEREF)(void*, PyObject*, int);
  815. void* (*SetupContext)(const char*, int, const char*);
  816. void (*FinishContext)(void**);
  817. } __Pyx_RefNannyAPIStruct;
  818. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  819. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  820. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  821. #ifdef WITH_THREAD
  822. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  823. if (acquire_gil) { \
  824. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  825. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  826. PyGILState_Release(__pyx_gilstate_save); \
  827. } else { \
  828. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  829. }
  830. #else
  831. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  832. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  833. #endif
  834. #define __Pyx_RefNannyFinishContext() \
  835. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  836. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  837. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  838. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  839. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  840. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  841. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  842. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  843. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  844. #else
  845. #define __Pyx_RefNannyDeclarations
  846. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  847. #define __Pyx_RefNannyFinishContext()
  848. #define __Pyx_INCREF(r) Py_INCREF(r)
  849. #define __Pyx_DECREF(r) Py_DECREF(r)
  850. #define __Pyx_GOTREF(r)
  851. #define __Pyx_GIVEREF(r)
  852. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  853. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  854. #define __Pyx_XGOTREF(r)
  855. #define __Pyx_XGIVEREF(r)
  856. #endif /* CYTHON_REFNANNY */
  857. #define __Pyx_XDECREF_SET(r, v) do { \
  858. PyObject *tmp = (PyObject *) r; \
  859. r = v; __Pyx_XDECREF(tmp); \
  860. } while (0)
  861. #define __Pyx_DECREF_SET(r, v) do { \
  862. PyObject *tmp = (PyObject *) r; \
  863. r = v; __Pyx_DECREF(tmp); \
  864. } while (0)
  865. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  866. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  867. #if CYTHON_COMPILING_IN_CPYTHON
  868. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  869. PyTypeObject* tp = Py_TYPE(obj);
  870. if (likely(tp->tp_getattro))
  871. return tp->tp_getattro(obj, attr_name);
  872. #if PY_MAJOR_VERSION < 3
  873. if (likely(tp->tp_getattr))
  874. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  875. #endif
  876. return PyObject_GetAttr(obj, attr_name);
  877. }
  878. #else
  879. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  880. #endif
  881. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  882. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  883. #if CYTHON_COMPILING_IN_CPYTHON
  884. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  885. #else
  886. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  887. #endif
  888. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
  889. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  890. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  891. static void __Pyx_WriteUnraisable(const char *name, int clineno,
  892. int lineno, const char *filename,
  893. int full_traceback); /*proto*/
  894. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  895. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  896. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  897. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  898. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  899. const char* function_name); /*proto*/
  900. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  901. const char *name, int exact); /*proto*/
  902. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  903. __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
  904. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
  905. static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
  906. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  907. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  908. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
  909. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
  910. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  911. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  912. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  913. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  914. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  915. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  916. int wraparound, int boundscheck);
  917. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  918. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  919. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  920. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  921. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  922. int wraparound, int boundscheck);
  923. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  924. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  925. int is_list, int wraparound, int boundscheck);
  926. static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
  927. #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
  928. #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  929. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  930. __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
  931. (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
  932. __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
  933. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
  934. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  935. int is_list, int wraparound, int boundscheck);
  936. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  937. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  938. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  939. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  940. typedef struct {
  941. Py_ssize_t shape, strides, suboffsets;
  942. } __Pyx_Buf_DimInfo;
  943. typedef struct {
  944. size_t refcount;
  945. Py_buffer pybuffer;
  946. } __Pyx_Buffer;
  947. typedef struct {
  948. __Pyx_Buffer *rcbuffer;
  949. char *data;
  950. __Pyx_Buf_DimInfo diminfo[8];
  951. } __Pyx_LocalBuf_ND;
  952. #if PY_MAJOR_VERSION < 3
  953. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
  954. static void __Pyx_ReleaseBuffer(Py_buffer *view);
  955. #else
  956. #define __Pyx_GetBuffer PyObject_GetBuffer
  957. #define __Pyx_ReleaseBuffer PyBuffer_Release
  958. #endif
  959. static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
  960. static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
  961. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  962. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *);
  963. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
  964. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  965. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);
  966. #if CYTHON_CCOMPLEX
  967. #ifdef __cplusplus
  968. #define __Pyx_CREAL(z) ((z).real())
  969. #define __Pyx_CIMAG(z) ((z).imag())
  970. #else
  971. #define __Pyx_CREAL(z) (__real__(z))
  972. #define __Pyx_CIMAG(z) (__imag__(z))
  973. #endif
  974. #else
  975. #define __Pyx_CREAL(z) ((z).real)
  976. #define __Pyx_CIMAG(z) ((z).imag)
  977. #endif
  978. #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
  979. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  980. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  981. #else
  982. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  983. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  984. #endif
  985. #if CYTHON_CCOMPLEX
  986. #define __Pyx_c_eq(a, b) ((a)==(b))
  987. #define __Pyx_c_sum(a, b) ((a)+(b))
  988. #define __Pyx_c_diff(a, b) ((a)-(b))
  989. #define __Pyx_c_prod(a, b) ((a)*(b))
  990. #define __Pyx_c_quot(a, b) ((a)/(b))
  991. #define __Pyx_c_neg(a) (-(a))
  992. #ifdef __cplusplus
  993. #define __Pyx_c_is_zero(z) ((z)==(double)0)
  994. #define __Pyx_c_conj(z) (::std::conj(z))
  995. #if 1
  996. #define __Pyx_c_abs(z) (::std::abs(z))
  997. #define __Pyx_c_pow(a, b) (::std::pow(a, b))
  998. #endif
  999. #else
  1000. #define __Pyx_c_is_zero(z) ((z)==0)
  1001. #define __Pyx_c_conj(z) (conj(z))
  1002. #if 1
  1003. #define __Pyx_c_abs(z) (cabs(z))
  1004. #define __Pyx_c_pow(a, b) (cpow(a, b))
  1005. #endif
  1006. #endif
  1007. #else
  1008. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
  1009. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
  1010. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
  1011. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
  1012. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
  1013. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
  1014. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
  1015. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
  1016. #if 1
  1017. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
  1018. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
  1019. #endif
  1020. #endif
  1021. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1022. #if CYTHON_CCOMPLEX
  1023. #define __Pyx_c_eqf(a, b) ((a)==(b))
  1024. #define __Pyx_c_sumf(a, b) ((a)+(b))
  1025. #define __Pyx_c_difff(a, b) ((a)-(b))
  1026. #define __Pyx_c_prodf(a, b) ((a)*(b))
  1027. #define __Pyx_c_quotf(a, b) ((a)/(b))
  1028. #define __Pyx_c_negf(a) (-(a))
  1029. #ifdef __cplusplus
  1030. #define __Pyx_c_is_zerof(z) ((z)==(float)0)
  1031. #define __Pyx_c_conjf(z) (::std::conj(z))
  1032. #if 1
  1033. #define __Pyx_c_absf(z) (::std::abs(z))
  1034. #define __Pyx_c_powf(a, b) (::std::pow(a, b))
  1035. #endif
  1036. #else
  1037. #define __Pyx_c_is_zerof(z) ((z)==0)
  1038. #define __Pyx_c_conjf(z) (conjf(z))
  1039. #if 1
  1040. #define __Pyx_c_absf(z) (cabsf(z))
  1041. #define __Pyx_c_powf(a, b) (cpowf(a, b))
  1042. #endif
  1043. #endif
  1044. #else
  1045. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
  1046. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
  1047. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
  1048. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
  1049. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
  1050. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
  1051. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
  1052. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
  1053. #if 1
  1054. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
  1055. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
  1056. #endif
  1057. #endif
  1058. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1059. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1060. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1061. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1062. static int __Pyx_check_binary_version(void);
  1063. #if !defined(__Pyx_PyIdentifier_FromString)
  1064. #if PY_MAJOR_VERSION < 3
  1065. #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
  1066. #else
  1067. #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
  1068. #endif
  1069. #endif
  1070. static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
  1071. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
  1072. typedef struct {
  1073. int code_line;
  1074. PyCodeObject* code_object;
  1075. } __Pyx_CodeObjectCacheEntry;
  1076. struct __Pyx_CodeObjectCache {
  1077. int count;
  1078. int max_count;
  1079. __Pyx_CodeObjectCacheEntry* entries;
  1080. };
  1081. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1082. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1083. static PyCodeObject *__pyx_find_code_object(int code_line);
  1084. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1085. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1086. int py_line, const char *filename); /*proto*/
  1087. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  1088. /* Module declarations from 'cpython.buffer' */
  1089. /* Module declarations from 'cpython.ref' */
  1090. /* Module declarations from 'libc.string' */
  1091. /* Module declarations from 'libc.stdio' */
  1092. /* Module declarations from 'cpython.object' */
  1093. /* Module declarations from '__builtin__' */
  1094. /* Module declarations from 'cpython.type' */
  1095. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1096. /* Module declarations from 'libc.stdlib' */
  1097. /* Module declarations from 'numpy' */
  1098. /* Module declarations from 'numpy' */
  1099. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1100. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1101. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1102. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1103. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1104. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1105. /* Module declarations from 'libcpp.vector' */
  1106. /* Module declarations from 'scattnlay' */
  1107. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *); /*proto*/
  1108. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1109. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *); /*proto*/
  1110. 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 };
  1111. static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
  1112. 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 };
  1113. #define __Pyx_MODULE_NAME "scattnlay"
  1114. int __pyx_module_is_main_scattnlay = 0;
  1115. /* Implementation of 'scattnlay' */
  1116. static PyObject *__pyx_builtin_range;
  1117. static PyObject *__pyx_builtin_ValueError;
  1118. static PyObject *__pyx_builtin_RuntimeError;
  1119. 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 */
  1120. 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 */
  1121. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  1122. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  1123. static char __pyx_k_B[] = "B";
  1124. static char __pyx_k_C[] = "C";
  1125. static char __pyx_k_E[] = "E";
  1126. static char __pyx_k_H[] = "H";
  1127. static char __pyx_k_I[] = "I";
  1128. static char __pyx_k_L[] = "L";
  1129. static char __pyx_k_O[] = "O";
  1130. static char __pyx_k_Q[] = "Q";
  1131. static char __pyx_k_b[] = "b";
  1132. static char __pyx_k_d[] = "d";
  1133. static char __pyx_k_f[] = "f";
  1134. static char __pyx_k_g[] = "g";
  1135. static char __pyx_k_h[] = "h";
  1136. static char __pyx_k_i[] = "i";
  1137. static char __pyx_k_l[] = "l";
  1138. static char __pyx_k_m[] = "m";
  1139. static char __pyx_k_q[] = "q";
  1140. static char __pyx_k_x[] = "x";
  1141. static char __pyx_k_S1[] = "S1";
  1142. static char __pyx_k_S2[] = "S2";
  1143. static char __pyx_k_Zd[] = "Zd";
  1144. static char __pyx_k_Zf[] = "Zf";
  1145. static char __pyx_k_Zg[] = "Zg";
  1146. static char __pyx_k_np[] = "np";
  1147. static char __pyx_k_pl[] = "pl";
  1148. static char __pyx_k_Eix[] = "Eix";
  1149. static char __pyx_k_Eiy[] = "Eiy";
  1150. static char __pyx_k_Eiz[] = "Eiz";
  1151. static char __pyx_k_Erx[] = "Erx";
  1152. static char __pyx_k_Ery[] = "Ery";
  1153. static char __pyx_k_Erz[] = "Erz";
  1154. static char __pyx_k_Hix[] = "Hix";
  1155. static char __pyx_k_Hiy[] = "Hiy";
  1156. static char __pyx_k_Hiz[] = "Hiz";
  1157. static char __pyx_k_Hrx[] = "Hrx";
  1158. static char __pyx_k_Hry[] = "Hry";
  1159. static char __pyx_k_Hrz[] = "Hrz";
  1160. static char __pyx_k_Qbk[] = "Qbk";
  1161. static char __pyx_k_Qpr[] = "Qpr";
  1162. static char __pyx_k_S1i[] = "S1i";
  1163. static char __pyx_k_S1r[] = "S1r";
  1164. static char __pyx_k_S2i[] = "S2i";
  1165. static char __pyx_k_S2r[] = "S2r";
  1166. static char __pyx_k_int[] = "int";
  1167. static char __pyx_k_Qabs[] = "Qabs";
  1168. static char __pyx_k_Qext[] = "Qext";
  1169. static char __pyx_k_Qsca[] = "Qsca";
  1170. static char __pyx_k_copy[] = "copy";
  1171. static char __pyx_k_main[] = "__main__";
  1172. static char __pyx_k_nmax[] = "nmax";
  1173. static char __pyx_k_test[] = "__test__";
  1174. static char __pyx_k_dtype[] = "dtype";
  1175. static char __pyx_k_flags[] = "flags";
  1176. static char __pyx_k_numpy[] = "numpy";
  1177. static char __pyx_k_range[] = "range";
  1178. static char __pyx_k_terms[] = "terms";
  1179. static char __pyx_k_theta[] = "theta";
  1180. static char __pyx_k_zeros[] = "zeros";
  1181. static char __pyx_k_Albedo[] = "Albedo";
  1182. static char __pyx_k_coords[] = "coords";
  1183. static char __pyx_k_import[] = "__import__";
  1184. static char __pyx_k_vstack[] = "vstack";
  1185. static char __pyx_k_float64[] = "float64";
  1186. static char __pyx_k_fieldnlay[] = "fieldnlay";
  1187. static char __pyx_k_scattnlay[] = "scattnlay";
  1188. static char __pyx_k_transpose[] = "transpose";
  1189. static char __pyx_k_ValueError[] = "ValueError";
  1190. static char __pyx_k_complex128[] = "complex128";
  1191. static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
  1192. static char __pyx_k_RuntimeError[] = "RuntimeError";
  1193. static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
  1194. static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer";
  1195. static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  1196. static char __pyx_k_home_ovidio_scattering_scattnla[] = "/home/ovidio/scattering/scattnlay/python-scattnlay-0.3.1/scattnlay.pyx";
  1197. static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  1198. static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  1199. static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  1200. static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  1201. static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  1202. static PyObject *__pyx_n_s_Albedo;
  1203. static PyObject *__pyx_n_s_C;
  1204. static PyObject *__pyx_n_s_C_CONTIGUOUS;
  1205. static PyObject *__pyx_n_s_E;
  1206. static PyObject *__pyx_n_s_Eix;
  1207. static PyObject *__pyx_n_s_Eiy;
  1208. static PyObject *__pyx_n_s_Eiz;
  1209. static PyObject *__pyx_n_s_Erx;
  1210. static PyObject *__pyx_n_s_Ery;
  1211. static PyObject *__pyx_n_s_Erz;
  1212. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  1213. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  1214. static PyObject *__pyx_n_s_H;
  1215. static PyObject *__pyx_n_s_Hix;
  1216. static PyObject *__pyx_n_s_Hiy;
  1217. static PyObject *__pyx_n_s_Hiz;
  1218. static PyObject *__pyx_n_s_Hrx;
  1219. static PyObject *__pyx_n_s_Hry;
  1220. static PyObject *__pyx_n_s_Hrz;
  1221. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  1222. static PyObject *__pyx_n_s_Qabs;
  1223. static PyObject *__pyx_n_s_Qbk;
  1224. static PyObject *__pyx_n_s_Qext;
  1225. static PyObject *__pyx_n_s_Qpr;
  1226. static PyObject *__pyx_n_s_Qsca;
  1227. static PyObject *__pyx_n_s_RuntimeError;
  1228. static PyObject *__pyx_n_s_S1;
  1229. static PyObject *__pyx_n_s_S1i;
  1230. static PyObject *__pyx_n_s_S1r;
  1231. static PyObject *__pyx_n_s_S2;
  1232. static PyObject *__pyx_n_s_S2i;
  1233. static PyObject *__pyx_n_s_S2r;
  1234. static PyObject *__pyx_n_s_ValueError;
  1235. static PyObject *__pyx_n_s_complex128;
  1236. static PyObject *__pyx_n_s_coords;
  1237. static PyObject *__pyx_n_s_copy;
  1238. static PyObject *__pyx_n_s_dtype;
  1239. static PyObject *__pyx_n_s_fieldnlay;
  1240. static PyObject *__pyx_n_s_flags;
  1241. static PyObject *__pyx_n_s_float64;
  1242. static PyObject *__pyx_n_s_g;
  1243. static PyObject *__pyx_kp_s_home_ovidio_scattering_scattnla;
  1244. static PyObject *__pyx_n_s_i;
  1245. static PyObject *__pyx_n_s_import;
  1246. static PyObject *__pyx_n_s_int;
  1247. static PyObject *__pyx_n_s_m;
  1248. static PyObject *__pyx_n_s_main;
  1249. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  1250. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  1251. static PyObject *__pyx_n_s_nmax;
  1252. static PyObject *__pyx_n_s_np;
  1253. static PyObject *__pyx_n_s_numpy;
  1254. static PyObject *__pyx_n_s_pl;
  1255. static PyObject *__pyx_n_s_pyx_getbuffer;
  1256. static PyObject *__pyx_n_s_pyx_releasebuffer;
  1257. static PyObject *__pyx_n_s_range;
  1258. static PyObject *__pyx_n_s_scattnlay;
  1259. static PyObject *__pyx_n_s_terms;
  1260. static PyObject *__pyx_n_s_test;
  1261. static PyObject *__pyx_n_s_theta;
  1262. static PyObject *__pyx_n_s_transpose;
  1263. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  1264. static PyObject *__pyx_n_s_vstack;
  1265. static PyObject *__pyx_n_s_x;
  1266. static PyObject *__pyx_n_s_zeros;
  1267. static PyObject *__pyx_int_0;
  1268. static PyObject *__pyx_int_1;
  1269. static PyObject *__pyx_int_2;
  1270. static PyObject *__pyx_int_3;
  1271. static PyArrayObject *__pyx_k__2;
  1272. static PyObject *__pyx_tuple_;
  1273. static PyObject *__pyx_tuple__3;
  1274. static PyObject *__pyx_tuple__4;
  1275. static PyObject *__pyx_tuple__5;
  1276. static PyObject *__pyx_tuple__6;
  1277. static PyObject *__pyx_tuple__7;
  1278. static PyObject *__pyx_tuple__8;
  1279. static PyObject *__pyx_tuple__9;
  1280. static PyObject *__pyx_slice__12;
  1281. static PyObject *__pyx_slice__15;
  1282. static PyObject *__pyx_slice__18;
  1283. static PyObject *__pyx_tuple__10;
  1284. static PyObject *__pyx_tuple__11;
  1285. static PyObject *__pyx_tuple__13;
  1286. static PyObject *__pyx_tuple__14;
  1287. static PyObject *__pyx_tuple__16;
  1288. static PyObject *__pyx_tuple__17;
  1289. static PyObject *__pyx_tuple__19;
  1290. static PyObject *__pyx_tuple__20;
  1291. static PyObject *__pyx_tuple__21;
  1292. static PyObject *__pyx_tuple__22;
  1293. static PyObject *__pyx_tuple__23;
  1294. static PyObject *__pyx_tuple__24;
  1295. static PyObject *__pyx_tuple__25;
  1296. static PyObject *__pyx_tuple__26;
  1297. static PyObject *__pyx_tuple__27;
  1298. static PyObject *__pyx_tuple__28;
  1299. static PyObject *__pyx_tuple__29;
  1300. static PyObject *__pyx_tuple__30;
  1301. static PyObject *__pyx_tuple__31;
  1302. static PyObject *__pyx_tuple__32;
  1303. static PyObject *__pyx_tuple__33;
  1304. static PyObject *__pyx_tuple__34;
  1305. static PyObject *__pyx_tuple__35;
  1306. static PyObject *__pyx_tuple__36;
  1307. static PyObject *__pyx_tuple__37;
  1308. static PyObject *__pyx_tuple__38;
  1309. static PyObject *__pyx_tuple__39;
  1310. static PyObject *__pyx_tuple__40;
  1311. static PyObject *__pyx_tuple__42;
  1312. static PyObject *__pyx_codeobj__41;
  1313. static PyObject *__pyx_codeobj__43;
  1314. /* "scattnlay.pyx":34
  1315. * from libcpp.vector cimport complex
  1316. *
  1317. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1318. * assert a.dtype == np.float64
  1319. *
  1320. */
  1321. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *__pyx_v_a) {
  1322. double *__pyx_r;
  1323. __Pyx_RefNannyDeclarations
  1324. PyObject *__pyx_t_1 = NULL;
  1325. PyObject *__pyx_t_2 = NULL;
  1326. PyObject *__pyx_t_3 = NULL;
  1327. int __pyx_t_4;
  1328. int __pyx_t_5;
  1329. int __pyx_lineno = 0;
  1330. const char *__pyx_filename = NULL;
  1331. int __pyx_clineno = 0;
  1332. __Pyx_RefNannySetupContext("npy2c", 0);
  1333. __Pyx_INCREF((PyObject *)__pyx_v_a);
  1334. /* "scattnlay.pyx":35
  1335. *
  1336. * cdef inline double *npy2c(np.ndarray a):
  1337. * assert a.dtype == np.float64 # <<<<<<<<<<<<<<
  1338. *
  1339. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1340. */
  1341. #ifndef CYTHON_WITHOUT_ASSERTIONS
  1342. if (unlikely(!Py_OptimizeFlag)) {
  1343. __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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1344. __Pyx_GOTREF(__pyx_t_1);
  1345. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1346. __Pyx_GOTREF(__pyx_t_2);
  1347. __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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1348. __Pyx_GOTREF(__pyx_t_3);
  1349. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1350. __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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1351. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1352. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1353. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1354. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1355. if (unlikely(!__pyx_t_4)) {
  1356. PyErr_SetNone(PyExc_AssertionError);
  1357. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1358. }
  1359. }
  1360. #endif
  1361. /* "scattnlay.pyx":37
  1362. * assert a.dtype == np.float64
  1363. *
  1364. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy # <<<<<<<<<<<<<<
  1365. * a = a.copy('C')
  1366. *
  1367. */
  1368. __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1369. __Pyx_GOTREF(__pyx_t_2);
  1370. __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 = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  1371. __Pyx_GOTREF(__pyx_t_3);
  1372. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1373. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1374. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1375. __pyx_t_5 = ((!__pyx_t_4) != 0);
  1376. if (__pyx_t_5) {
  1377. /* "scattnlay.pyx":38
  1378. *
  1379. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1380. * a = a.copy('C') # <<<<<<<<<<<<<<
  1381. *
  1382. * # Return data pointer
  1383. */
  1384. __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 = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1385. __Pyx_GOTREF(__pyx_t_3);
  1386. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1387. __Pyx_GOTREF(__pyx_t_2);
  1388. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1389. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1390. __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
  1391. __pyx_t_2 = 0;
  1392. goto __pyx_L3;
  1393. }
  1394. __pyx_L3:;
  1395. /* "scattnlay.pyx":41
  1396. *
  1397. * # Return data pointer
  1398. * return <double *>(a.data) # <<<<<<<<<<<<<<
  1399. *
  1400. * cdef extern from "py_nmie.h":
  1401. */
  1402. __pyx_r = ((double *)__pyx_v_a->data);
  1403. goto __pyx_L0;
  1404. /* "scattnlay.pyx":34
  1405. * from libcpp.vector cimport complex
  1406. *
  1407. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1408. * assert a.dtype == np.float64
  1409. *
  1410. */
  1411. /* function exit code */
  1412. __pyx_L1_error:;
  1413. __Pyx_XDECREF(__pyx_t_1);
  1414. __Pyx_XDECREF(__pyx_t_2);
  1415. __Pyx_XDECREF(__pyx_t_3);
  1416. __Pyx_WriteUnraisable("scattnlay.npy2c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  1417. __pyx_r = 0;
  1418. __pyx_L0:;
  1419. __Pyx_XDECREF((PyObject *)__pyx_v_a);
  1420. __Pyx_RefNannyFinishContext();
  1421. return __pyx_r;
  1422. }
  1423. /* "scattnlay.pyx":47
  1424. * 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[])
  1425. *
  1426. * 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): # <<<<<<<<<<<<<<
  1427. * cdef Py_ssize_t i
  1428. *
  1429. */
  1430. /* Python wrapper */
  1431. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1432. static PyMethodDef __pyx_mdef_9scattnlay_1scattnlay = {__Pyx_NAMESTR("scattnlay"), (PyCFunction)__pyx_pw_9scattnlay_1scattnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1433. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1434. PyArrayObject *__pyx_v_x = 0;
  1435. PyArrayObject *__pyx_v_m = 0;
  1436. PyArrayObject *__pyx_v_theta = 0;
  1437. __pyx_t_5numpy_int_t __pyx_v_pl;
  1438. __pyx_t_5numpy_int_t __pyx_v_nmax;
  1439. int __pyx_lineno = 0;
  1440. const char *__pyx_filename = NULL;
  1441. int __pyx_clineno = 0;
  1442. PyObject *__pyx_r = 0;
  1443. __Pyx_RefNannyDeclarations
  1444. __Pyx_RefNannySetupContext("scattnlay (wrapper)", 0);
  1445. {
  1446. 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};
  1447. PyObject* values[5] = {0,0,0,0,0};
  1448. values[2] = (PyObject *)__pyx_k__2;
  1449. if (unlikely(__pyx_kwds)) {
  1450. Py_ssize_t kw_args;
  1451. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1452. switch (pos_args) {
  1453. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1454. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1455. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1456. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1457. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1458. case 0: break;
  1459. default: goto __pyx_L5_argtuple_error;
  1460. }
  1461. kw_args = PyDict_Size(__pyx_kwds);
  1462. switch (pos_args) {
  1463. case 0:
  1464. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  1465. else goto __pyx_L5_argtuple_error;
  1466. case 1:
  1467. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  1468. else {
  1469. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1470. }
  1471. case 2:
  1472. if (kw_args > 0) {
  1473. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta);
  1474. if (value) { values[2] = value; kw_args--; }
  1475. }
  1476. case 3:
  1477. if (kw_args > 0) {
  1478. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  1479. if (value) { values[3] = value; kw_args--; }
  1480. }
  1481. case 4:
  1482. if (kw_args > 0) {
  1483. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nmax);
  1484. if (value) { values[4] = value; kw_args--; }
  1485. }
  1486. }
  1487. if (unlikely(kw_args > 0)) {
  1488. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scattnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1489. }
  1490. } else {
  1491. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1492. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1493. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1494. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1495. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1496. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1497. break;
  1498. default: goto __pyx_L5_argtuple_error;
  1499. }
  1500. }
  1501. __pyx_v_x = ((PyArrayObject *)values[0]);
  1502. __pyx_v_m = ((PyArrayObject *)values[1]);
  1503. __pyx_v_theta = ((PyArrayObject *)values[2]);
  1504. if (values[3]) {
  1505. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1506. } else {
  1507. __pyx_v_pl = ((__pyx_t_5numpy_int_t)-1);
  1508. }
  1509. if (values[4]) {
  1510. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1511. } else {
  1512. __pyx_v_nmax = ((__pyx_t_5numpy_int_t)-1);
  1513. }
  1514. }
  1515. goto __pyx_L4_argument_unpacking_done;
  1516. __pyx_L5_argtuple_error:;
  1517. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1518. __pyx_L3_error:;
  1519. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1520. __Pyx_RefNannyFinishContext();
  1521. return NULL;
  1522. __pyx_L4_argument_unpacking_done:;
  1523. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1524. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1525. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1526. __pyx_r = __pyx_pf_9scattnlay_scattnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_theta, __pyx_v_pl, __pyx_v_nmax);
  1527. /* function exit code */
  1528. goto __pyx_L0;
  1529. __pyx_L1_error:;
  1530. __pyx_r = NULL;
  1531. __pyx_L0:;
  1532. __Pyx_RefNannyFinishContext();
  1533. return __pyx_r;
  1534. }
  1535. 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) {
  1536. Py_ssize_t __pyx_v_i;
  1537. PyArrayObject *__pyx_v_terms = 0;
  1538. PyArrayObject *__pyx_v_Qext = 0;
  1539. PyArrayObject *__pyx_v_Qabs = 0;
  1540. PyArrayObject *__pyx_v_Qsca = 0;
  1541. PyArrayObject *__pyx_v_Qbk = 0;
  1542. PyArrayObject *__pyx_v_Qpr = 0;
  1543. PyArrayObject *__pyx_v_g = 0;
  1544. PyArrayObject *__pyx_v_Albedo = 0;
  1545. PyArrayObject *__pyx_v_S1 = 0;
  1546. PyArrayObject *__pyx_v_S2 = 0;
  1547. PyArrayObject *__pyx_v_S1r = 0;
  1548. PyArrayObject *__pyx_v_S1i = 0;
  1549. PyArrayObject *__pyx_v_S2r = 0;
  1550. PyArrayObject *__pyx_v_S2i = 0;
  1551. __Pyx_LocalBuf_ND __pyx_pybuffernd_Albedo;
  1552. __Pyx_Buffer __pyx_pybuffer_Albedo;
  1553. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qabs;
  1554. __Pyx_Buffer __pyx_pybuffer_Qabs;
  1555. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qbk;
  1556. __Pyx_Buffer __pyx_pybuffer_Qbk;
  1557. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qext;
  1558. __Pyx_Buffer __pyx_pybuffer_Qext;
  1559. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qpr;
  1560. __Pyx_Buffer __pyx_pybuffer_Qpr;
  1561. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qsca;
  1562. __Pyx_Buffer __pyx_pybuffer_Qsca;
  1563. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1;
  1564. __Pyx_Buffer __pyx_pybuffer_S1;
  1565. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1i;
  1566. __Pyx_Buffer __pyx_pybuffer_S1i;
  1567. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1r;
  1568. __Pyx_Buffer __pyx_pybuffer_S1r;
  1569. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2;
  1570. __Pyx_Buffer __pyx_pybuffer_S2;
  1571. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2i;
  1572. __Pyx_Buffer __pyx_pybuffer_S2i;
  1573. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2r;
  1574. __Pyx_Buffer __pyx_pybuffer_S2r;
  1575. __Pyx_LocalBuf_ND __pyx_pybuffernd_g;
  1576. __Pyx_Buffer __pyx_pybuffer_g;
  1577. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  1578. __Pyx_Buffer __pyx_pybuffer_m;
  1579. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  1580. __Pyx_Buffer __pyx_pybuffer_terms;
  1581. __Pyx_LocalBuf_ND __pyx_pybuffernd_theta;
  1582. __Pyx_Buffer __pyx_pybuffer_theta;
  1583. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  1584. __Pyx_Buffer __pyx_pybuffer_x;
  1585. PyObject *__pyx_r = NULL;
  1586. __Pyx_RefNannyDeclarations
  1587. PyObject *__pyx_t_1 = NULL;
  1588. PyObject *__pyx_t_2 = NULL;
  1589. PyObject *__pyx_t_3 = NULL;
  1590. PyObject *__pyx_t_4 = NULL;
  1591. PyObject *__pyx_t_5 = NULL;
  1592. PyArrayObject *__pyx_t_6 = NULL;
  1593. PyArrayObject *__pyx_t_7 = NULL;
  1594. PyArrayObject *__pyx_t_8 = NULL;
  1595. PyArrayObject *__pyx_t_9 = NULL;
  1596. PyArrayObject *__pyx_t_10 = NULL;
  1597. PyArrayObject *__pyx_t_11 = NULL;
  1598. PyArrayObject *__pyx_t_12 = NULL;
  1599. PyArrayObject *__pyx_t_13 = NULL;
  1600. PyArrayObject *__pyx_t_14 = NULL;
  1601. PyArrayObject *__pyx_t_15 = NULL;
  1602. npy_intp __pyx_t_16;
  1603. Py_ssize_t __pyx_t_17;
  1604. PyArrayObject *__pyx_t_18 = NULL;
  1605. int __pyx_t_19;
  1606. PyObject *__pyx_t_20 = NULL;
  1607. PyObject *__pyx_t_21 = NULL;
  1608. PyObject *__pyx_t_22 = NULL;
  1609. PyArrayObject *__pyx_t_23 = NULL;
  1610. PyArrayObject *__pyx_t_24 = NULL;
  1611. PyArrayObject *__pyx_t_25 = NULL;
  1612. std::vector<double> __pyx_t_26;
  1613. std::vector<__pyx_t_double_complex> __pyx_t_27;
  1614. std::vector<double> __pyx_t_28;
  1615. Py_ssize_t __pyx_t_29;
  1616. Py_ssize_t __pyx_t_30;
  1617. Py_ssize_t __pyx_t_31;
  1618. Py_ssize_t __pyx_t_32;
  1619. Py_ssize_t __pyx_t_33;
  1620. Py_ssize_t __pyx_t_34;
  1621. Py_ssize_t __pyx_t_35;
  1622. Py_ssize_t __pyx_t_36;
  1623. int __pyx_lineno = 0;
  1624. const char *__pyx_filename = NULL;
  1625. int __pyx_clineno = 0;
  1626. __Pyx_RefNannySetupContext("scattnlay", 0);
  1627. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  1628. __pyx_pybuffer_terms.refcount = 0;
  1629. __pyx_pybuffernd_terms.data = NULL;
  1630. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  1631. __pyx_pybuffer_Qext.pybuffer.buf = NULL;
  1632. __pyx_pybuffer_Qext.refcount = 0;
  1633. __pyx_pybuffernd_Qext.data = NULL;
  1634. __pyx_pybuffernd_Qext.rcbuffer = &__pyx_pybuffer_Qext;
  1635. __pyx_pybuffer_Qabs.pybuffer.buf = NULL;
  1636. __pyx_pybuffer_Qabs.refcount = 0;
  1637. __pyx_pybuffernd_Qabs.data = NULL;
  1638. __pyx_pybuffernd_Qabs.rcbuffer = &__pyx_pybuffer_Qabs;
  1639. __pyx_pybuffer_Qsca.pybuffer.buf = NULL;
  1640. __pyx_pybuffer_Qsca.refcount = 0;
  1641. __pyx_pybuffernd_Qsca.data = NULL;
  1642. __pyx_pybuffernd_Qsca.rcbuffer = &__pyx_pybuffer_Qsca;
  1643. __pyx_pybuffer_Qbk.pybuffer.buf = NULL;
  1644. __pyx_pybuffer_Qbk.refcount = 0;
  1645. __pyx_pybuffernd_Qbk.data = NULL;
  1646. __pyx_pybuffernd_Qbk.rcbuffer = &__pyx_pybuffer_Qbk;
  1647. __pyx_pybuffer_Qpr.pybuffer.buf = NULL;
  1648. __pyx_pybuffer_Qpr.refcount = 0;
  1649. __pyx_pybuffernd_Qpr.data = NULL;
  1650. __pyx_pybuffernd_Qpr.rcbuffer = &__pyx_pybuffer_Qpr;
  1651. __pyx_pybuffer_g.pybuffer.buf = NULL;
  1652. __pyx_pybuffer_g.refcount = 0;
  1653. __pyx_pybuffernd_g.data = NULL;
  1654. __pyx_pybuffernd_g.rcbuffer = &__pyx_pybuffer_g;
  1655. __pyx_pybuffer_Albedo.pybuffer.buf = NULL;
  1656. __pyx_pybuffer_Albedo.refcount = 0;
  1657. __pyx_pybuffernd_Albedo.data = NULL;
  1658. __pyx_pybuffernd_Albedo.rcbuffer = &__pyx_pybuffer_Albedo;
  1659. __pyx_pybuffer_S1.pybuffer.buf = NULL;
  1660. __pyx_pybuffer_S1.refcount = 0;
  1661. __pyx_pybuffernd_S1.data = NULL;
  1662. __pyx_pybuffernd_S1.rcbuffer = &__pyx_pybuffer_S1;
  1663. __pyx_pybuffer_S2.pybuffer.buf = NULL;
  1664. __pyx_pybuffer_S2.refcount = 0;
  1665. __pyx_pybuffernd_S2.data = NULL;
  1666. __pyx_pybuffernd_S2.rcbuffer = &__pyx_pybuffer_S2;
  1667. __pyx_pybuffer_S1r.pybuffer.buf = NULL;
  1668. __pyx_pybuffer_S1r.refcount = 0;
  1669. __pyx_pybuffernd_S1r.data = NULL;
  1670. __pyx_pybuffernd_S1r.rcbuffer = &__pyx_pybuffer_S1r;
  1671. __pyx_pybuffer_S1i.pybuffer.buf = NULL;
  1672. __pyx_pybuffer_S1i.refcount = 0;
  1673. __pyx_pybuffernd_S1i.data = NULL;
  1674. __pyx_pybuffernd_S1i.rcbuffer = &__pyx_pybuffer_S1i;
  1675. __pyx_pybuffer_S2r.pybuffer.buf = NULL;
  1676. __pyx_pybuffer_S2r.refcount = 0;
  1677. __pyx_pybuffernd_S2r.data = NULL;
  1678. __pyx_pybuffernd_S2r.rcbuffer = &__pyx_pybuffer_S2r;
  1679. __pyx_pybuffer_S2i.pybuffer.buf = NULL;
  1680. __pyx_pybuffer_S2i.refcount = 0;
  1681. __pyx_pybuffernd_S2i.data = NULL;
  1682. __pyx_pybuffernd_S2i.rcbuffer = &__pyx_pybuffer_S2i;
  1683. __pyx_pybuffer_x.pybuffer.buf = NULL;
  1684. __pyx_pybuffer_x.refcount = 0;
  1685. __pyx_pybuffernd_x.data = NULL;
  1686. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  1687. __pyx_pybuffer_m.pybuffer.buf = NULL;
  1688. __pyx_pybuffer_m.refcount = 0;
  1689. __pyx_pybuffernd_m.data = NULL;
  1690. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  1691. __pyx_pybuffer_theta.pybuffer.buf = NULL;
  1692. __pyx_pybuffer_theta.refcount = 0;
  1693. __pyx_pybuffernd_theta.data = NULL;
  1694. __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta;
  1695. {
  1696. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1697. 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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1698. }
  1699. __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];
  1700. {
  1701. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1702. 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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1703. }
  1704. __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];
  1705. {
  1706. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1707. 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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1708. }
  1709. __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];
  1710. /* "scattnlay.pyx":50
  1711. * cdef Py_ssize_t i
  1712. *
  1713. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  1714. *
  1715. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1716. */
  1717. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1718. __Pyx_GOTREF(__pyx_t_1);
  1719. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1720. __Pyx_GOTREF(__pyx_t_2);
  1721. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1722. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1723. __Pyx_GOTREF(__pyx_t_1);
  1724. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1725. __Pyx_GOTREF(__pyx_t_3);
  1726. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1727. __Pyx_GIVEREF(__pyx_t_1);
  1728. __pyx_t_1 = 0;
  1729. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1730. __Pyx_GOTREF(__pyx_t_1);
  1731. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1732. __Pyx_GOTREF(__pyx_t_4);
  1733. __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1734. __Pyx_GOTREF(__pyx_t_5);
  1735. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1736. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1737. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1738. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1739. __Pyx_GOTREF(__pyx_t_5);
  1740. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1741. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1742. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1743. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1744. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  1745. {
  1746. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1747. 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)) {
  1748. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  1749. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1750. } 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];
  1751. }
  1752. }
  1753. __pyx_t_6 = 0;
  1754. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  1755. __pyx_t_5 = 0;
  1756. /* "scattnlay.pyx":52
  1757. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  1758. *
  1759. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1760. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1761. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1762. */
  1763. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1764. __Pyx_GOTREF(__pyx_t_5);
  1765. __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1766. __Pyx_GOTREF(__pyx_t_1);
  1767. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1768. __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1769. __Pyx_GOTREF(__pyx_t_5);
  1770. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1771. __Pyx_GOTREF(__pyx_t_3);
  1772. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1773. __Pyx_GIVEREF(__pyx_t_5);
  1774. __pyx_t_5 = 0;
  1775. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1776. __Pyx_GOTREF(__pyx_t_5);
  1777. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1778. __Pyx_GOTREF(__pyx_t_2);
  1779. __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1780. __Pyx_GOTREF(__pyx_t_4);
  1781. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1782. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1783. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1784. __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1785. __Pyx_GOTREF(__pyx_t_4);
  1786. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1787. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1788. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1789. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1790. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  1791. {
  1792. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1793. 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)) {
  1794. __pyx_v_Qext = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf = NULL;
  1795. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1796. } 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];
  1797. }
  1798. }
  1799. __pyx_t_7 = 0;
  1800. __pyx_v_Qext = ((PyArrayObject *)__pyx_t_4);
  1801. __pyx_t_4 = 0;
  1802. /* "scattnlay.pyx":53
  1803. *
  1804. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1805. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1806. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1807. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1808. */
  1809. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1810. __Pyx_GOTREF(__pyx_t_4);
  1811. __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1812. __Pyx_GOTREF(__pyx_t_5);
  1813. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1814. __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1815. __Pyx_GOTREF(__pyx_t_4);
  1816. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1817. __Pyx_GOTREF(__pyx_t_3);
  1818. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1819. __Pyx_GIVEREF(__pyx_t_4);
  1820. __pyx_t_4 = 0;
  1821. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1822. __Pyx_GOTREF(__pyx_t_4);
  1823. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1824. __Pyx_GOTREF(__pyx_t_1);
  1825. __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1826. __Pyx_GOTREF(__pyx_t_2);
  1827. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1828. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1829. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1830. __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1831. __Pyx_GOTREF(__pyx_t_2);
  1832. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1833. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1834. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1835. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1836. __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  1837. {
  1838. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1839. 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)) {
  1840. __pyx_v_Qabs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf = NULL;
  1841. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1842. } 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];
  1843. }
  1844. }
  1845. __pyx_t_8 = 0;
  1846. __pyx_v_Qabs = ((PyArrayObject *)__pyx_t_2);
  1847. __pyx_t_2 = 0;
  1848. /* "scattnlay.pyx":54
  1849. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1850. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1851. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1852. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1853. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1854. */
  1855. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1856. __Pyx_GOTREF(__pyx_t_2);
  1857. __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1858. __Pyx_GOTREF(__pyx_t_4);
  1859. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1860. __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1861. __Pyx_GOTREF(__pyx_t_2);
  1862. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1863. __Pyx_GOTREF(__pyx_t_3);
  1864. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  1865. __Pyx_GIVEREF(__pyx_t_2);
  1866. __pyx_t_2 = 0;
  1867. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1868. __Pyx_GOTREF(__pyx_t_2);
  1869. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1870. __Pyx_GOTREF(__pyx_t_5);
  1871. __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1872. __Pyx_GOTREF(__pyx_t_1);
  1873. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1874. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1875. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1876. __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1877. __Pyx_GOTREF(__pyx_t_1);
  1878. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1879. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1880. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1881. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1882. __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
  1883. {
  1884. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1885. 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)) {
  1886. __pyx_v_Qsca = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf = NULL;
  1887. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1888. } 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];
  1889. }
  1890. }
  1891. __pyx_t_9 = 0;
  1892. __pyx_v_Qsca = ((PyArrayObject *)__pyx_t_1);
  1893. __pyx_t_1 = 0;
  1894. /* "scattnlay.pyx":55
  1895. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1896. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1897. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1898. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1899. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1900. */
  1901. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1902. __Pyx_GOTREF(__pyx_t_1);
  1903. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1904. __Pyx_GOTREF(__pyx_t_2);
  1905. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1906. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1907. __Pyx_GOTREF(__pyx_t_1);
  1908. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1909. __Pyx_GOTREF(__pyx_t_3);
  1910. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1911. __Pyx_GIVEREF(__pyx_t_1);
  1912. __pyx_t_1 = 0;
  1913. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1914. __Pyx_GOTREF(__pyx_t_1);
  1915. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1916. __Pyx_GOTREF(__pyx_t_4);
  1917. __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 = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1918. __Pyx_GOTREF(__pyx_t_5);
  1919. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1920. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1921. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1922. __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 = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1923. __Pyx_GOTREF(__pyx_t_5);
  1924. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1925. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1926. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1927. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1928. __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
  1929. {
  1930. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1931. 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)) {
  1932. __pyx_v_Qbk = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf = NULL;
  1933. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1934. } 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];
  1935. }
  1936. }
  1937. __pyx_t_10 = 0;
  1938. __pyx_v_Qbk = ((PyArrayObject *)__pyx_t_5);
  1939. __pyx_t_5 = 0;
  1940. /* "scattnlay.pyx":56
  1941. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1942. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1943. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1944. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1945. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1946. */
  1947. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1948. __Pyx_GOTREF(__pyx_t_5);
  1949. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1950. __Pyx_GOTREF(__pyx_t_1);
  1951. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1952. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1953. __Pyx_GOTREF(__pyx_t_5);
  1954. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1955. __Pyx_GOTREF(__pyx_t_3);
  1956. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1957. __Pyx_GIVEREF(__pyx_t_5);
  1958. __pyx_t_5 = 0;
  1959. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1960. __Pyx_GOTREF(__pyx_t_5);
  1961. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1962. __Pyx_GOTREF(__pyx_t_2);
  1963. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1964. __Pyx_GOTREF(__pyx_t_4);
  1965. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1966. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1967. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1968. __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1969. __Pyx_GOTREF(__pyx_t_4);
  1970. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1971. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1972. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1973. 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;}
  1974. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  1975. {
  1976. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1977. 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)) {
  1978. __pyx_v_Qpr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf = NULL;
  1979. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1980. } 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];
  1981. }
  1982. }
  1983. __pyx_t_11 = 0;
  1984. __pyx_v_Qpr = ((PyArrayObject *)__pyx_t_4);
  1985. __pyx_t_4 = 0;
  1986. /* "scattnlay.pyx":57
  1987. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1988. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1989. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1990. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1991. *
  1992. */
  1993. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1994. __Pyx_GOTREF(__pyx_t_4);
  1995. __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1996. __Pyx_GOTREF(__pyx_t_5);
  1997. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1998. __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1999. __Pyx_GOTREF(__pyx_t_4);
  2000. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2001. __Pyx_GOTREF(__pyx_t_3);
  2002. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2003. __Pyx_GIVEREF(__pyx_t_4);
  2004. __pyx_t_4 = 0;
  2005. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2006. __Pyx_GOTREF(__pyx_t_4);
  2007. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2008. __Pyx_GOTREF(__pyx_t_1);
  2009. __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2010. __Pyx_GOTREF(__pyx_t_2);
  2011. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2012. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2013. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2014. __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 = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2015. __Pyx_GOTREF(__pyx_t_2);
  2016. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2017. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2018. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2019. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2020. __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  2021. {
  2022. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2023. 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)) {
  2024. __pyx_v_g = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_g.rcbuffer->pybuffer.buf = NULL;
  2025. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2026. } 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];
  2027. }
  2028. }
  2029. __pyx_t_12 = 0;
  2030. __pyx_v_g = ((PyArrayObject *)__pyx_t_2);
  2031. __pyx_t_2 = 0;
  2032. /* "scattnlay.pyx":58
  2033. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  2034. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  2035. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2036. *
  2037. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2038. */
  2039. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2040. __Pyx_GOTREF(__pyx_t_2);
  2041. __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2042. __Pyx_GOTREF(__pyx_t_4);
  2043. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2044. __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2045. __Pyx_GOTREF(__pyx_t_2);
  2046. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2047. __Pyx_GOTREF(__pyx_t_3);
  2048. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2049. __Pyx_GIVEREF(__pyx_t_2);
  2050. __pyx_t_2 = 0;
  2051. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2052. __Pyx_GOTREF(__pyx_t_2);
  2053. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2054. __Pyx_GOTREF(__pyx_t_5);
  2055. __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2056. __Pyx_GOTREF(__pyx_t_1);
  2057. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2058. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2059. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2060. __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2061. __Pyx_GOTREF(__pyx_t_1);
  2062. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2063. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2064. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2065. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2066. __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
  2067. {
  2068. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2069. 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)) {
  2070. __pyx_v_Albedo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf = NULL;
  2071. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2072. } 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];
  2073. }
  2074. }
  2075. __pyx_t_13 = 0;
  2076. __pyx_v_Albedo = ((PyArrayObject *)__pyx_t_1);
  2077. __pyx_t_1 = 0;
  2078. /* "scattnlay.pyx":60
  2079. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  2080. *
  2081. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2082. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2083. *
  2084. */
  2085. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2086. __Pyx_GOTREF(__pyx_t_1);
  2087. __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2088. __Pyx_GOTREF(__pyx_t_2);
  2089. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2090. __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2091. __Pyx_GOTREF(__pyx_t_1);
  2092. __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2093. __Pyx_GOTREF(__pyx_t_3);
  2094. __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2095. __Pyx_GOTREF(__pyx_t_4);
  2096. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2097. __Pyx_GIVEREF(__pyx_t_1);
  2098. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  2099. __Pyx_GIVEREF(__pyx_t_3);
  2100. __pyx_t_1 = 0;
  2101. __pyx_t_3 = 0;
  2102. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2103. __Pyx_GOTREF(__pyx_t_3);
  2104. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2105. __Pyx_GIVEREF(__pyx_t_4);
  2106. __pyx_t_4 = 0;
  2107. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2108. __Pyx_GOTREF(__pyx_t_4);
  2109. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2110. __Pyx_GOTREF(__pyx_t_1);
  2111. __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2112. __Pyx_GOTREF(__pyx_t_5);
  2113. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2114. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2115. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2116. __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2117. __Pyx_GOTREF(__pyx_t_5);
  2118. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2119. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2120. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2121. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2122. __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
  2123. {
  2124. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2125. 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)) {
  2126. __pyx_v_S1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S1.rcbuffer->pybuffer.buf = NULL;
  2127. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2128. } 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];
  2129. }
  2130. }
  2131. __pyx_t_14 = 0;
  2132. __pyx_v_S1 = ((PyArrayObject *)__pyx_t_5);
  2133. __pyx_t_5 = 0;
  2134. /* "scattnlay.pyx":61
  2135. *
  2136. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2137. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2138. *
  2139. * cdef np.ndarray[np.float64_t, ndim = 1] S1r
  2140. */
  2141. __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;}
  2142. __Pyx_GOTREF(__pyx_t_5);
  2143. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2144. __Pyx_GOTREF(__pyx_t_4);
  2145. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2146. __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;}
  2147. __Pyx_GOTREF(__pyx_t_5);
  2148. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2149. __Pyx_GOTREF(__pyx_t_3);
  2150. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2151. __Pyx_GOTREF(__pyx_t_2);
  2152. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2153. __Pyx_GIVEREF(__pyx_t_5);
  2154. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2155. __Pyx_GIVEREF(__pyx_t_3);
  2156. __pyx_t_5 = 0;
  2157. __pyx_t_3 = 0;
  2158. __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;}
  2159. __Pyx_GOTREF(__pyx_t_3);
  2160. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2161. __Pyx_GIVEREF(__pyx_t_2);
  2162. __pyx_t_2 = 0;
  2163. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2164. __Pyx_GOTREF(__pyx_t_2);
  2165. __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;}
  2166. __Pyx_GOTREF(__pyx_t_5);
  2167. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2168. __Pyx_GOTREF(__pyx_t_1);
  2169. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2170. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2171. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2172. __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2173. __Pyx_GOTREF(__pyx_t_1);
  2174. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2175. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2176. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2177. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2178. __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
  2179. {
  2180. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2181. 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)) {
  2182. __pyx_v_S2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S2.rcbuffer->pybuffer.buf = NULL;
  2183. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2184. } 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];
  2185. }
  2186. }
  2187. __pyx_t_15 = 0;
  2188. __pyx_v_S2 = ((PyArrayObject *)__pyx_t_1);
  2189. __pyx_t_1 = 0;
  2190. /* "scattnlay.pyx":68
  2191. * cdef np.ndarray[np.float64_t, ndim = 1] S2i
  2192. *
  2193. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  2194. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2195. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2196. */
  2197. __pyx_t_16 = (__pyx_v_x->dimensions[0]);
  2198. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  2199. __pyx_v_i = __pyx_t_17;
  2200. /* "scattnlay.pyx":69
  2201. *
  2202. * for i in range(x.shape[0]):
  2203. * S1r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2204. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2205. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2206. */
  2207. __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;}
  2208. __Pyx_GOTREF(__pyx_t_1);
  2209. __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;}
  2210. __Pyx_GOTREF(__pyx_t_2);
  2211. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2212. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2213. __Pyx_GOTREF(__pyx_t_1);
  2214. __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;}
  2215. __Pyx_GOTREF(__pyx_t_3);
  2216. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2217. __Pyx_GIVEREF(__pyx_t_1);
  2218. __pyx_t_1 = 0;
  2219. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2220. __Pyx_GOTREF(__pyx_t_1);
  2221. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2222. __Pyx_GOTREF(__pyx_t_4);
  2223. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2224. __Pyx_GOTREF(__pyx_t_5);
  2225. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2226. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2227. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2228. __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2229. __Pyx_GOTREF(__pyx_t_5);
  2230. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2231. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2232. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2233. 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;}
  2234. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  2235. {
  2236. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2237. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2238. __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);
  2239. if (unlikely(__pyx_t_19 < 0)) {
  2240. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2241. 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)) {
  2242. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2243. __Pyx_RaiseBufferFallbackError();
  2244. } else {
  2245. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2246. }
  2247. }
  2248. __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];
  2249. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2250. }
  2251. __pyx_t_18 = 0;
  2252. __Pyx_XDECREF_SET(__pyx_v_S1r, ((PyArrayObject *)__pyx_t_5));
  2253. __pyx_t_5 = 0;
  2254. /* "scattnlay.pyx":70
  2255. * for i in range(x.shape[0]):
  2256. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2257. * S1i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2258. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2259. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2260. */
  2261. __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;}
  2262. __Pyx_GOTREF(__pyx_t_5);
  2263. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2264. __Pyx_GOTREF(__pyx_t_1);
  2265. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2266. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2267. __Pyx_GOTREF(__pyx_t_5);
  2268. __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;}
  2269. __Pyx_GOTREF(__pyx_t_3);
  2270. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  2271. __Pyx_GIVEREF(__pyx_t_5);
  2272. __pyx_t_5 = 0;
  2273. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2274. __Pyx_GOTREF(__pyx_t_5);
  2275. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2276. __Pyx_GOTREF(__pyx_t_2);
  2277. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2278. __Pyx_GOTREF(__pyx_t_4);
  2279. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2280. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2281. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2282. __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 = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2283. __Pyx_GOTREF(__pyx_t_4);
  2284. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2285. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2286. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2287. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2288. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  2289. {
  2290. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2291. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2292. __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);
  2293. if (unlikely(__pyx_t_19 < 0)) {
  2294. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2295. 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)) {
  2296. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2297. __Pyx_RaiseBufferFallbackError();
  2298. } else {
  2299. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2300. }
  2301. }
  2302. __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];
  2303. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2304. }
  2305. __pyx_t_23 = 0;
  2306. __Pyx_XDECREF_SET(__pyx_v_S1i, ((PyArrayObject *)__pyx_t_4));
  2307. __pyx_t_4 = 0;
  2308. /* "scattnlay.pyx":71
  2309. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2310. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2311. * S2r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2312. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2313. *
  2314. */
  2315. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2316. __Pyx_GOTREF(__pyx_t_4);
  2317. __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2318. __Pyx_GOTREF(__pyx_t_5);
  2319. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2320. __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2321. __Pyx_GOTREF(__pyx_t_4);
  2322. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2323. __Pyx_GOTREF(__pyx_t_3);
  2324. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2325. __Pyx_GIVEREF(__pyx_t_4);
  2326. __pyx_t_4 = 0;
  2327. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2328. __Pyx_GOTREF(__pyx_t_4);
  2329. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2330. __Pyx_GOTREF(__pyx_t_1);
  2331. __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2332. __Pyx_GOTREF(__pyx_t_2);
  2333. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2334. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2335. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2336. __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2337. __Pyx_GOTREF(__pyx_t_2);
  2338. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2339. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2340. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2341. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2342. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  2343. {
  2344. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2345. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2346. __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);
  2347. if (unlikely(__pyx_t_19 < 0)) {
  2348. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2349. 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)) {
  2350. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2351. __Pyx_RaiseBufferFallbackError();
  2352. } else {
  2353. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2354. }
  2355. }
  2356. __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];
  2357. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2358. }
  2359. __pyx_t_24 = 0;
  2360. __Pyx_XDECREF_SET(__pyx_v_S2r, ((PyArrayObject *)__pyx_t_2));
  2361. __pyx_t_2 = 0;
  2362. /* "scattnlay.pyx":72
  2363. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2364. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2365. * S2i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2366. *
  2367. * 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))
  2368. */
  2369. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2370. __Pyx_GOTREF(__pyx_t_2);
  2371. __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2372. __Pyx_GOTREF(__pyx_t_4);
  2373. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2374. __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2375. __Pyx_GOTREF(__pyx_t_2);
  2376. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2377. __Pyx_GOTREF(__pyx_t_3);
  2378. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2379. __Pyx_GIVEREF(__pyx_t_2);
  2380. __pyx_t_2 = 0;
  2381. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2382. __Pyx_GOTREF(__pyx_t_2);
  2383. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2384. __Pyx_GOTREF(__pyx_t_5);
  2385. __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2386. __Pyx_GOTREF(__pyx_t_1);
  2387. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2388. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2389. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2390. __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2391. __Pyx_GOTREF(__pyx_t_1);
  2392. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2393. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2394. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2395. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2396. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  2397. {
  2398. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2399. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2400. __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);
  2401. if (unlikely(__pyx_t_19 < 0)) {
  2402. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2403. 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)) {
  2404. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2405. __Pyx_RaiseBufferFallbackError();
  2406. } else {
  2407. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2408. }
  2409. }
  2410. __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];
  2411. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2412. }
  2413. __pyx_t_25 = 0;
  2414. __Pyx_XDECREF_SET(__pyx_v_S2i, ((PyArrayObject *)__pyx_t_1));
  2415. __pyx_t_1 = 0;
  2416. /* "scattnlay.pyx":74
  2417. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2418. *
  2419. * 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)) # <<<<<<<<<<<<<<
  2420. *
  2421. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2422. */
  2423. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2424. __Pyx_GOTREF(__pyx_t_1);
  2425. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2426. __Pyx_GOTREF(__pyx_t_2);
  2427. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2428. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2429. __Pyx_GOTREF(__pyx_t_1);
  2430. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2431. __pyx_t_26 = __pyx_convert_vector_from_py_double(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2432. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2433. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2434. __Pyx_GOTREF(__pyx_t_1);
  2435. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2436. __Pyx_GOTREF(__pyx_t_2);
  2437. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2438. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2439. __Pyx_GOTREF(__pyx_t_1);
  2440. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2441. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2442. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2443. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2444. __Pyx_GOTREF(__pyx_t_1);
  2445. __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2446. __Pyx_GOTREF(__pyx_t_2);
  2447. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2448. __pyx_t_28 = __pyx_convert_vector_from_py_double(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2449. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2450. __pyx_t_29 = __pyx_v_i;
  2451. __pyx_t_19 = -1;
  2452. if (__pyx_t_29 < 0) {
  2453. __pyx_t_29 += __pyx_pybuffernd_Qext.diminfo[0].shape;
  2454. if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
  2455. } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_Qext.diminfo[0].shape)) __pyx_t_19 = 0;
  2456. if (unlikely(__pyx_t_19 != -1)) {
  2457. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2458. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2459. }
  2460. __pyx_t_30 = __pyx_v_i;
  2461. __pyx_t_19 = -1;
  2462. if (__pyx_t_30 < 0) {
  2463. __pyx_t_30 += __pyx_pybuffernd_Qsca.diminfo[0].shape;
  2464. if (unlikely(__pyx_t_30 < 0)) __pyx_t_19 = 0;
  2465. } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_Qsca.diminfo[0].shape)) __pyx_t_19 = 0;
  2466. if (unlikely(__pyx_t_19 != -1)) {
  2467. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2468. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2469. }
  2470. __pyx_t_31 = __pyx_v_i;
  2471. __pyx_t_19 = -1;
  2472. if (__pyx_t_31 < 0) {
  2473. __pyx_t_31 += __pyx_pybuffernd_Qabs.diminfo[0].shape;
  2474. if (unlikely(__pyx_t_31 < 0)) __pyx_t_19 = 0;
  2475. } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_Qabs.diminfo[0].shape)) __pyx_t_19 = 0;
  2476. if (unlikely(__pyx_t_19 != -1)) {
  2477. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2478. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2479. }
  2480. __pyx_t_32 = __pyx_v_i;
  2481. __pyx_t_19 = -1;
  2482. if (__pyx_t_32 < 0) {
  2483. __pyx_t_32 += __pyx_pybuffernd_Qbk.diminfo[0].shape;
  2484. if (unlikely(__pyx_t_32 < 0)) __pyx_t_19 = 0;
  2485. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_Qbk.diminfo[0].shape)) __pyx_t_19 = 0;
  2486. if (unlikely(__pyx_t_19 != -1)) {
  2487. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2488. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2489. }
  2490. __pyx_t_33 = __pyx_v_i;
  2491. __pyx_t_19 = -1;
  2492. if (__pyx_t_33 < 0) {
  2493. __pyx_t_33 += __pyx_pybuffernd_Qpr.diminfo[0].shape;
  2494. if (unlikely(__pyx_t_33 < 0)) __pyx_t_19 = 0;
  2495. } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_Qpr.diminfo[0].shape)) __pyx_t_19 = 0;
  2496. if (unlikely(__pyx_t_19 != -1)) {
  2497. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2498. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2499. }
  2500. __pyx_t_34 = __pyx_v_i;
  2501. __pyx_t_19 = -1;
  2502. if (__pyx_t_34 < 0) {
  2503. __pyx_t_34 += __pyx_pybuffernd_g.diminfo[0].shape;
  2504. if (unlikely(__pyx_t_34 < 0)) __pyx_t_19 = 0;
  2505. } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_g.diminfo[0].shape)) __pyx_t_19 = 0;
  2506. if (unlikely(__pyx_t_19 != -1)) {
  2507. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2508. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2509. }
  2510. __pyx_t_35 = __pyx_v_i;
  2511. __pyx_t_19 = -1;
  2512. if (__pyx_t_35 < 0) {
  2513. __pyx_t_35 += __pyx_pybuffernd_Albedo.diminfo[0].shape;
  2514. if (unlikely(__pyx_t_35 < 0)) __pyx_t_19 = 0;
  2515. } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_Albedo.diminfo[0].shape)) __pyx_t_19 = 0;
  2516. if (unlikely(__pyx_t_19 != -1)) {
  2517. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2518. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2519. }
  2520. __pyx_t_36 = __pyx_v_i;
  2521. __pyx_t_19 = -1;
  2522. if (__pyx_t_36 < 0) {
  2523. __pyx_t_36 += __pyx_pybuffernd_terms.diminfo[0].shape;
  2524. if (unlikely(__pyx_t_36 < 0)) __pyx_t_19 = 0;
  2525. } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_19 = 0;
  2526. if (unlikely(__pyx_t_19 != -1)) {
  2527. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2528. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2529. }
  2530. *__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)));
  2531. /* "scattnlay.pyx":76
  2532. * 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))
  2533. *
  2534. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  2535. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2536. *
  2537. */
  2538. __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2539. __Pyx_GOTREF(__pyx_t_2);
  2540. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2541. __Pyx_GOTREF(__pyx_t_1);
  2542. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2543. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2544. __Pyx_GOTREF(__pyx_t_2);
  2545. __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2546. __Pyx_GOTREF(__pyx_t_3);
  2547. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2548. __Pyx_GOTREF(__pyx_t_4);
  2549. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2550. __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2551. __Pyx_GOTREF(__pyx_t_3);
  2552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2553. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2554. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2555. __Pyx_GOTREF(__pyx_t_4);
  2556. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2557. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2558. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2559. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2560. /* "scattnlay.pyx":77
  2561. *
  2562. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2563. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  2564. *
  2565. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2566. */
  2567. __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2568. __Pyx_GOTREF(__pyx_t_4);
  2569. __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2570. __Pyx_GOTREF(__pyx_t_3);
  2571. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2572. __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2573. __Pyx_GOTREF(__pyx_t_4);
  2574. __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2575. __Pyx_GOTREF(__pyx_t_1);
  2576. __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2577. __Pyx_GOTREF(__pyx_t_2);
  2578. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2579. __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2580. __Pyx_GOTREF(__pyx_t_1);
  2581. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2582. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2583. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2584. __Pyx_GOTREF(__pyx_t_2);
  2585. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2586. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2587. 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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2588. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2589. }
  2590. /* "scattnlay.pyx":79
  2591. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2592. *
  2593. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 # <<<<<<<<<<<<<<
  2594. *
  2595. * #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):
  2596. */
  2597. __Pyx_XDECREF(__pyx_r);
  2598. __pyx_t_2 = PyTuple_New(10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2599. __Pyx_GOTREF(__pyx_t_2);
  2600. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  2601. PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_terms));
  2602. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  2603. __Pyx_INCREF(((PyObject *)__pyx_v_Qext));
  2604. PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Qext));
  2605. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qext));
  2606. __Pyx_INCREF(((PyObject *)__pyx_v_Qsca));
  2607. PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_Qsca));
  2608. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qsca));
  2609. __Pyx_INCREF(((PyObject *)__pyx_v_Qabs));
  2610. PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_Qabs));
  2611. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qabs));
  2612. __Pyx_INCREF(((PyObject *)__pyx_v_Qbk));
  2613. PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_Qbk));
  2614. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qbk));
  2615. __Pyx_INCREF(((PyObject *)__pyx_v_Qpr));
  2616. PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_v_Qpr));
  2617. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qpr));
  2618. __Pyx_INCREF(((PyObject *)__pyx_v_g));
  2619. PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_v_g));
  2620. __Pyx_GIVEREF(((PyObject *)__pyx_v_g));
  2621. __Pyx_INCREF(((PyObject *)__pyx_v_Albedo));
  2622. PyTuple_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_v_Albedo));
  2623. __Pyx_GIVEREF(((PyObject *)__pyx_v_Albedo));
  2624. __Pyx_INCREF(((PyObject *)__pyx_v_S1));
  2625. PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_S1));
  2626. __Pyx_GIVEREF(((PyObject *)__pyx_v_S1));
  2627. __Pyx_INCREF(((PyObject *)__pyx_v_S2));
  2628. PyTuple_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_v_S2));
  2629. __Pyx_GIVEREF(((PyObject *)__pyx_v_S2));
  2630. __pyx_r = __pyx_t_2;
  2631. __pyx_t_2 = 0;
  2632. goto __pyx_L0;
  2633. /* "scattnlay.pyx":47
  2634. * 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[])
  2635. *
  2636. * 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): # <<<<<<<<<<<<<<
  2637. * cdef Py_ssize_t i
  2638. *
  2639. */
  2640. /* function exit code */
  2641. __pyx_L1_error:;
  2642. __Pyx_XDECREF(__pyx_t_1);
  2643. __Pyx_XDECREF(__pyx_t_2);
  2644. __Pyx_XDECREF(__pyx_t_3);
  2645. __Pyx_XDECREF(__pyx_t_4);
  2646. __Pyx_XDECREF(__pyx_t_5);
  2647. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  2648. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  2649. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2650. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2651. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2652. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2653. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2654. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2655. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2656. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2657. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2658. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2659. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2660. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2661. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2662. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2663. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2664. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2665. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2666. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  2667. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2668. __pyx_r = NULL;
  2669. goto __pyx_L2;
  2670. __pyx_L0:;
  2671. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2672. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2673. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2674. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2675. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2676. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2677. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2678. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2679. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2680. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2681. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2682. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2683. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2684. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2685. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2686. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2687. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2688. __pyx_L2:;
  2689. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  2690. __Pyx_XDECREF((PyObject *)__pyx_v_Qext);
  2691. __Pyx_XDECREF((PyObject *)__pyx_v_Qabs);
  2692. __Pyx_XDECREF((PyObject *)__pyx_v_Qsca);
  2693. __Pyx_XDECREF((PyObject *)__pyx_v_Qbk);
  2694. __Pyx_XDECREF((PyObject *)__pyx_v_Qpr);
  2695. __Pyx_XDECREF((PyObject *)__pyx_v_g);
  2696. __Pyx_XDECREF((PyObject *)__pyx_v_Albedo);
  2697. __Pyx_XDECREF((PyObject *)__pyx_v_S1);
  2698. __Pyx_XDECREF((PyObject *)__pyx_v_S2);
  2699. __Pyx_XDECREF((PyObject *)__pyx_v_S1r);
  2700. __Pyx_XDECREF((PyObject *)__pyx_v_S1i);
  2701. __Pyx_XDECREF((PyObject *)__pyx_v_S2r);
  2702. __Pyx_XDECREF((PyObject *)__pyx_v_S2i);
  2703. __Pyx_XGIVEREF(__pyx_r);
  2704. __Pyx_RefNannyFinishContext();
  2705. return __pyx_r;
  2706. }
  2707. /* "scattnlay.pyx":82
  2708. *
  2709. * #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):
  2710. * 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): # <<<<<<<<<<<<<<
  2711. * cdef Py_ssize_t i
  2712. *
  2713. */
  2714. /* Python wrapper */
  2715. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2716. static PyMethodDef __pyx_mdef_9scattnlay_3fieldnlay = {__Pyx_NAMESTR("fieldnlay"), (PyCFunction)__pyx_pw_9scattnlay_3fieldnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2717. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2718. PyArrayObject *__pyx_v_x = 0;
  2719. PyArrayObject *__pyx_v_m = 0;
  2720. PyArrayObject *__pyx_v_coords = 0;
  2721. __pyx_t_5numpy_int_t __pyx_v_pl;
  2722. __pyx_t_5numpy_int_t __pyx_v_nmax;
  2723. int __pyx_lineno = 0;
  2724. const char *__pyx_filename = NULL;
  2725. int __pyx_clineno = 0;
  2726. PyObject *__pyx_r = 0;
  2727. __Pyx_RefNannyDeclarations
  2728. __Pyx_RefNannySetupContext("fieldnlay (wrapper)", 0);
  2729. {
  2730. 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};
  2731. PyObject* values[5] = {0,0,0,0,0};
  2732. if (unlikely(__pyx_kwds)) {
  2733. Py_ssize_t kw_args;
  2734. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2735. switch (pos_args) {
  2736. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2737. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2738. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2739. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2740. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2741. case 0: break;
  2742. default: goto __pyx_L5_argtuple_error;
  2743. }
  2744. kw_args = PyDict_Size(__pyx_kwds);
  2745. switch (pos_args) {
  2746. case 0:
  2747. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  2748. else goto __pyx_L5_argtuple_error;
  2749. case 1:
  2750. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  2751. else {
  2752. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2753. }
  2754. case 2:
  2755. if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
  2756. else {
  2757. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2758. }
  2759. case 3:
  2760. if (kw_args > 0) {
  2761. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  2762. if (value) { values[3] = value; kw_args--; }
  2763. }
  2764. case 4:
  2765. if (kw_args > 0) {
  2766. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nmax);
  2767. if (value) { values[4] = value; kw_args--; }
  2768. }
  2769. }
  2770. if (unlikely(kw_args > 0)) {
  2771. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fieldnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2772. }
  2773. } else {
  2774. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2775. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2776. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2777. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2778. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2779. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2780. break;
  2781. default: goto __pyx_L5_argtuple_error;
  2782. }
  2783. }
  2784. __pyx_v_x = ((PyArrayObject *)values[0]);
  2785. __pyx_v_m = ((PyArrayObject *)values[1]);
  2786. __pyx_v_coords = ((PyArrayObject *)values[2]);
  2787. if (values[3]) {
  2788. __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2789. } else {
  2790. __pyx_v_pl = ((__pyx_t_5numpy_int_t)0);
  2791. }
  2792. if (values[4]) {
  2793. __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2794. } else {
  2795. __pyx_v_nmax = ((__pyx_t_5numpy_int_t)0);
  2796. }
  2797. }
  2798. goto __pyx_L4_argument_unpacking_done;
  2799. __pyx_L5_argtuple_error:;
  2800. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2801. __pyx_L3_error:;
  2802. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2803. __Pyx_RefNannyFinishContext();
  2804. return NULL;
  2805. __pyx_L4_argument_unpacking_done:;
  2806. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2807. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2808. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2809. __pyx_r = __pyx_pf_9scattnlay_2fieldnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_coords, __pyx_v_pl, __pyx_v_nmax);
  2810. /* function exit code */
  2811. goto __pyx_L0;
  2812. __pyx_L1_error:;
  2813. __pyx_r = NULL;
  2814. __pyx_L0:;
  2815. __Pyx_RefNannyFinishContext();
  2816. return __pyx_r;
  2817. }
  2818. 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) {
  2819. Py_ssize_t __pyx_v_i;
  2820. PyArrayObject *__pyx_v_terms = 0;
  2821. PyArrayObject *__pyx_v_E = 0;
  2822. PyArrayObject *__pyx_v_H = 0;
  2823. PyArrayObject *__pyx_v_Erx = 0;
  2824. PyArrayObject *__pyx_v_Ery = 0;
  2825. PyArrayObject *__pyx_v_Erz = 0;
  2826. PyArrayObject *__pyx_v_Eix = 0;
  2827. PyArrayObject *__pyx_v_Eiy = 0;
  2828. PyArrayObject *__pyx_v_Eiz = 0;
  2829. PyArrayObject *__pyx_v_Hrx = 0;
  2830. PyArrayObject *__pyx_v_Hry = 0;
  2831. PyArrayObject *__pyx_v_Hrz = 0;
  2832. PyArrayObject *__pyx_v_Hix = 0;
  2833. PyArrayObject *__pyx_v_Hiy = 0;
  2834. PyArrayObject *__pyx_v_Hiz = 0;
  2835. __Pyx_LocalBuf_ND __pyx_pybuffernd_E;
  2836. __Pyx_Buffer __pyx_pybuffer_E;
  2837. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eix;
  2838. __Pyx_Buffer __pyx_pybuffer_Eix;
  2839. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eiy;
  2840. __Pyx_Buffer __pyx_pybuffer_Eiy;
  2841. __Pyx_LocalBuf_ND __pyx_pybuffernd_Eiz;
  2842. __Pyx_Buffer __pyx_pybuffer_Eiz;
  2843. __Pyx_LocalBuf_ND __pyx_pybuffernd_Erx;
  2844. __Pyx_Buffer __pyx_pybuffer_Erx;
  2845. __Pyx_LocalBuf_ND __pyx_pybuffernd_Ery;
  2846. __Pyx_Buffer __pyx_pybuffer_Ery;
  2847. __Pyx_LocalBuf_ND __pyx_pybuffernd_Erz;
  2848. __Pyx_Buffer __pyx_pybuffer_Erz;
  2849. __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
  2850. __Pyx_Buffer __pyx_pybuffer_H;
  2851. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hix;
  2852. __Pyx_Buffer __pyx_pybuffer_Hix;
  2853. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hiy;
  2854. __Pyx_Buffer __pyx_pybuffer_Hiy;
  2855. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hiz;
  2856. __Pyx_Buffer __pyx_pybuffer_Hiz;
  2857. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hrx;
  2858. __Pyx_Buffer __pyx_pybuffer_Hrx;
  2859. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hry;
  2860. __Pyx_Buffer __pyx_pybuffer_Hry;
  2861. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hrz;
  2862. __Pyx_Buffer __pyx_pybuffer_Hrz;
  2863. __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  2864. __Pyx_Buffer __pyx_pybuffer_coords;
  2865. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  2866. __Pyx_Buffer __pyx_pybuffer_m;
  2867. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  2868. __Pyx_Buffer __pyx_pybuffer_terms;
  2869. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  2870. __Pyx_Buffer __pyx_pybuffer_x;
  2871. PyObject *__pyx_r = NULL;
  2872. __Pyx_RefNannyDeclarations
  2873. PyObject *__pyx_t_1 = NULL;
  2874. PyObject *__pyx_t_2 = NULL;
  2875. PyObject *__pyx_t_3 = NULL;
  2876. PyObject *__pyx_t_4 = NULL;
  2877. PyObject *__pyx_t_5 = NULL;
  2878. PyArrayObject *__pyx_t_6 = NULL;
  2879. PyArrayObject *__pyx_t_7 = NULL;
  2880. PyArrayObject *__pyx_t_8 = NULL;
  2881. npy_intp __pyx_t_9;
  2882. Py_ssize_t __pyx_t_10;
  2883. PyArrayObject *__pyx_t_11 = NULL;
  2884. int __pyx_t_12;
  2885. PyObject *__pyx_t_13 = NULL;
  2886. PyObject *__pyx_t_14 = NULL;
  2887. PyObject *__pyx_t_15 = NULL;
  2888. PyArrayObject *__pyx_t_16 = NULL;
  2889. PyArrayObject *__pyx_t_17 = NULL;
  2890. PyArrayObject *__pyx_t_18 = NULL;
  2891. PyArrayObject *__pyx_t_19 = NULL;
  2892. PyArrayObject *__pyx_t_20 = NULL;
  2893. PyArrayObject *__pyx_t_21 = NULL;
  2894. PyArrayObject *__pyx_t_22 = NULL;
  2895. PyArrayObject *__pyx_t_23 = NULL;
  2896. PyArrayObject *__pyx_t_24 = NULL;
  2897. PyArrayObject *__pyx_t_25 = NULL;
  2898. PyArrayObject *__pyx_t_26 = NULL;
  2899. std::vector<double> __pyx_t_27;
  2900. std::vector<__pyx_t_double_complex> __pyx_t_28;
  2901. std::vector<double> __pyx_t_29;
  2902. std::vector<double> __pyx_t_30;
  2903. std::vector<double> __pyx_t_31;
  2904. Py_ssize_t __pyx_t_32;
  2905. PyObject *__pyx_t_33 = NULL;
  2906. PyObject *__pyx_t_34 = NULL;
  2907. int __pyx_lineno = 0;
  2908. const char *__pyx_filename = NULL;
  2909. int __pyx_clineno = 0;
  2910. __Pyx_RefNannySetupContext("fieldnlay", 0);
  2911. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  2912. __pyx_pybuffer_terms.refcount = 0;
  2913. __pyx_pybuffernd_terms.data = NULL;
  2914. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  2915. __pyx_pybuffer_E.pybuffer.buf = NULL;
  2916. __pyx_pybuffer_E.refcount = 0;
  2917. __pyx_pybuffernd_E.data = NULL;
  2918. __pyx_pybuffernd_E.rcbuffer = &__pyx_pybuffer_E;
  2919. __pyx_pybuffer_H.pybuffer.buf = NULL;
  2920. __pyx_pybuffer_H.refcount = 0;
  2921. __pyx_pybuffernd_H.data = NULL;
  2922. __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
  2923. __pyx_pybuffer_Erx.pybuffer.buf = NULL;
  2924. __pyx_pybuffer_Erx.refcount = 0;
  2925. __pyx_pybuffernd_Erx.data = NULL;
  2926. __pyx_pybuffernd_Erx.rcbuffer = &__pyx_pybuffer_Erx;
  2927. __pyx_pybuffer_Ery.pybuffer.buf = NULL;
  2928. __pyx_pybuffer_Ery.refcount = 0;
  2929. __pyx_pybuffernd_Ery.data = NULL;
  2930. __pyx_pybuffernd_Ery.rcbuffer = &__pyx_pybuffer_Ery;
  2931. __pyx_pybuffer_Erz.pybuffer.buf = NULL;
  2932. __pyx_pybuffer_Erz.refcount = 0;
  2933. __pyx_pybuffernd_Erz.data = NULL;
  2934. __pyx_pybuffernd_Erz.rcbuffer = &__pyx_pybuffer_Erz;
  2935. __pyx_pybuffer_Eix.pybuffer.buf = NULL;
  2936. __pyx_pybuffer_Eix.refcount = 0;
  2937. __pyx_pybuffernd_Eix.data = NULL;
  2938. __pyx_pybuffernd_Eix.rcbuffer = &__pyx_pybuffer_Eix;
  2939. __pyx_pybuffer_Eiy.pybuffer.buf = NULL;
  2940. __pyx_pybuffer_Eiy.refcount = 0;
  2941. __pyx_pybuffernd_Eiy.data = NULL;
  2942. __pyx_pybuffernd_Eiy.rcbuffer = &__pyx_pybuffer_Eiy;
  2943. __pyx_pybuffer_Eiz.pybuffer.buf = NULL;
  2944. __pyx_pybuffer_Eiz.refcount = 0;
  2945. __pyx_pybuffernd_Eiz.data = NULL;
  2946. __pyx_pybuffernd_Eiz.rcbuffer = &__pyx_pybuffer_Eiz;
  2947. __pyx_pybuffer_Hrx.pybuffer.buf = NULL;
  2948. __pyx_pybuffer_Hrx.refcount = 0;
  2949. __pyx_pybuffernd_Hrx.data = NULL;
  2950. __pyx_pybuffernd_Hrx.rcbuffer = &__pyx_pybuffer_Hrx;
  2951. __pyx_pybuffer_Hry.pybuffer.buf = NULL;
  2952. __pyx_pybuffer_Hry.refcount = 0;
  2953. __pyx_pybuffernd_Hry.data = NULL;
  2954. __pyx_pybuffernd_Hry.rcbuffer = &__pyx_pybuffer_Hry;
  2955. __pyx_pybuffer_Hrz.pybuffer.buf = NULL;
  2956. __pyx_pybuffer_Hrz.refcount = 0;
  2957. __pyx_pybuffernd_Hrz.data = NULL;
  2958. __pyx_pybuffernd_Hrz.rcbuffer = &__pyx_pybuffer_Hrz;
  2959. __pyx_pybuffer_Hix.pybuffer.buf = NULL;
  2960. __pyx_pybuffer_Hix.refcount = 0;
  2961. __pyx_pybuffernd_Hix.data = NULL;
  2962. __pyx_pybuffernd_Hix.rcbuffer = &__pyx_pybuffer_Hix;
  2963. __pyx_pybuffer_Hiy.pybuffer.buf = NULL;
  2964. __pyx_pybuffer_Hiy.refcount = 0;
  2965. __pyx_pybuffernd_Hiy.data = NULL;
  2966. __pyx_pybuffernd_Hiy.rcbuffer = &__pyx_pybuffer_Hiy;
  2967. __pyx_pybuffer_Hiz.pybuffer.buf = NULL;
  2968. __pyx_pybuffer_Hiz.refcount = 0;
  2969. __pyx_pybuffernd_Hiz.data = NULL;
  2970. __pyx_pybuffernd_Hiz.rcbuffer = &__pyx_pybuffer_Hiz;
  2971. __pyx_pybuffer_x.pybuffer.buf = NULL;
  2972. __pyx_pybuffer_x.refcount = 0;
  2973. __pyx_pybuffernd_x.data = NULL;
  2974. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  2975. __pyx_pybuffer_m.pybuffer.buf = NULL;
  2976. __pyx_pybuffer_m.refcount = 0;
  2977. __pyx_pybuffernd_m.data = NULL;
  2978. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  2979. __pyx_pybuffer_coords.pybuffer.buf = NULL;
  2980. __pyx_pybuffer_coords.refcount = 0;
  2981. __pyx_pybuffernd_coords.data = NULL;
  2982. __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
  2983. {
  2984. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2985. 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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2986. }
  2987. __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];
  2988. {
  2989. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2990. 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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2991. }
  2992. __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];
  2993. {
  2994. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2995. 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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2996. }
  2997. __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];
  2998. /* "scattnlay.pyx":85
  2999. * cdef Py_ssize_t i
  3000. *
  3001. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  3002. *
  3003. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  3004. */
  3005. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3006. __Pyx_GOTREF(__pyx_t_1);
  3007. __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 = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3008. __Pyx_GOTREF(__pyx_t_2);
  3009. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3010. __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 = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3011. __Pyx_GOTREF(__pyx_t_1);
  3012. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3013. __Pyx_GOTREF(__pyx_t_3);
  3014. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3015. __Pyx_GIVEREF(__pyx_t_1);
  3016. __pyx_t_1 = 0;
  3017. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3018. __Pyx_GOTREF(__pyx_t_1);
  3019. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3020. __Pyx_GOTREF(__pyx_t_4);
  3021. __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 = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3022. __Pyx_GOTREF(__pyx_t_5);
  3023. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3024. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3025. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3026. __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 = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3027. __Pyx_GOTREF(__pyx_t_5);
  3028. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3029. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3030. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3031. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3032. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  3033. {
  3034. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3035. 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)) {
  3036. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  3037. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3038. } 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];
  3039. }
  3040. }
  3041. __pyx_t_6 = 0;
  3042. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  3043. __pyx_t_5 = 0;
  3044. /* "scattnlay.pyx":87
  3045. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  3046. *
  3047. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128) # <<<<<<<<<<<<<<
  3048. * cdef np.ndarray[np.complex128_t, ndim = 3] H = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  3049. *
  3050. */
  3051. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3052. __Pyx_GOTREF(__pyx_t_5);
  3053. __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3054. __Pyx_GOTREF(__pyx_t_1);
  3055. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3056. __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3057. __Pyx_GOTREF(__pyx_t_5);
  3058. __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3059. __Pyx_GOTREF(__pyx_t_3);
  3060. __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3061. __Pyx_GOTREF(__pyx_t_2);
  3062. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  3063. __Pyx_GIVEREF(__pyx_t_5);
  3064. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  3065. __Pyx_GIVEREF(__pyx_t_3);
  3066. __Pyx_INCREF(__pyx_int_3);
  3067. PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_3);
  3068. __Pyx_GIVEREF(__pyx_int_3);
  3069. __pyx_t_5 = 0;
  3070. __pyx_t_3 = 0;
  3071. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3072. __Pyx_GOTREF(__pyx_t_3);
  3073. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3074. __Pyx_GIVEREF(__pyx_t_2);
  3075. __pyx_t_2 = 0;
  3076. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3077. __Pyx_GOTREF(__pyx_t_2);
  3078. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3079. __Pyx_GOTREF(__pyx_t_5);
  3080. __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3081. __Pyx_GOTREF(__pyx_t_4);
  3082. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3083. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3084. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3085. __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 = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3086. __Pyx_GOTREF(__pyx_t_4);
  3087. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3088. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3089. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3090. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3091. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  3092. {
  3093. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3094. 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)) {
  3095. __pyx_v_E = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_E.rcbuffer->pybuffer.buf = NULL;
  3096. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3097. } 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];
  3098. }
  3099. }
  3100. __pyx_t_7 = 0;
  3101. __pyx_v_E = ((PyArrayObject *)__pyx_t_4);
  3102. __pyx_t_4 = 0;
  3103. /* "scattnlay.pyx":88
  3104. *
  3105. * cdef np.ndarray[np.complex128_t, ndim = 3] E = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128)
  3106. * cdef np.ndarray[np.complex128_t, ndim = 3] H = np.zeros((x.shape[0], coords.shape[0], 3), dtype = np.complex128) # <<<<<<<<<<<<<<
  3107. *
  3108. * cdef np.ndarray[np.float64_t, ndim = 1] Erx
  3109. */
  3110. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3111. __Pyx_GOTREF(__pyx_t_4);
  3112. __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3113. __Pyx_GOTREF(__pyx_t_2);
  3114. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3115. __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3116. __Pyx_GOTREF(__pyx_t_4);
  3117. __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3118. __Pyx_GOTREF(__pyx_t_3);
  3119. __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3120. __Pyx_GOTREF(__pyx_t_1);
  3121. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  3122. __Pyx_GIVEREF(__pyx_t_4);
  3123. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  3124. __Pyx_GIVEREF(__pyx_t_3);
  3125. __Pyx_INCREF(__pyx_int_3);
  3126. PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_3);
  3127. __Pyx_GIVEREF(__pyx_int_3);
  3128. __pyx_t_4 = 0;
  3129. __pyx_t_3 = 0;
  3130. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3131. __Pyx_GOTREF(__pyx_t_3);
  3132. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3133. __Pyx_GIVEREF(__pyx_t_1);
  3134. __pyx_t_1 = 0;
  3135. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3136. __Pyx_GOTREF(__pyx_t_1);
  3137. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3138. __Pyx_GOTREF(__pyx_t_4);
  3139. __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3140. __Pyx_GOTREF(__pyx_t_5);
  3141. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3142. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3143. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3144. __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3145. __Pyx_GOTREF(__pyx_t_5);
  3146. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3147. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3148. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3149. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3150. __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  3151. {
  3152. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3153. 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)) {
  3154. __pyx_v_H = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H.rcbuffer->pybuffer.buf = NULL;
  3155. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3156. } 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];
  3157. }
  3158. }
  3159. __pyx_t_8 = 0;
  3160. __pyx_v_H = ((PyArrayObject *)__pyx_t_5);
  3161. __pyx_t_5 = 0;
  3162. /* "scattnlay.pyx":103
  3163. * cdef np.ndarray[np.float64_t, ndim = 1] Hiz
  3164. *
  3165. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  3166. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3167. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3168. */
  3169. __pyx_t_9 = (__pyx_v_x->dimensions[0]);
  3170. for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
  3171. __pyx_v_i = __pyx_t_10;
  3172. /* "scattnlay.pyx":104
  3173. *
  3174. * for i in range(x.shape[0]):
  3175. * Erx = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3176. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3177. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3178. */
  3179. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3180. __Pyx_GOTREF(__pyx_t_5);
  3181. __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3182. __Pyx_GOTREF(__pyx_t_1);
  3183. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3184. __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3185. __Pyx_GOTREF(__pyx_t_5);
  3186. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3187. __Pyx_GOTREF(__pyx_t_3);
  3188. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3189. __Pyx_GIVEREF(__pyx_t_5);
  3190. __pyx_t_5 = 0;
  3191. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3192. __Pyx_GOTREF(__pyx_t_5);
  3193. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3194. __Pyx_GOTREF(__pyx_t_2);
  3195. __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3196. __Pyx_GOTREF(__pyx_t_4);
  3197. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3198. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3199. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3200. __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3201. __Pyx_GOTREF(__pyx_t_4);
  3202. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3203. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3204. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3205. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3206. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  3207. {
  3208. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3209. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  3210. __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);
  3211. if (unlikely(__pyx_t_12 < 0)) {
  3212. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3213. 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)) {
  3214. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3215. __Pyx_RaiseBufferFallbackError();
  3216. } else {
  3217. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3218. }
  3219. }
  3220. __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];
  3221. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3222. }
  3223. __pyx_t_11 = 0;
  3224. __Pyx_XDECREF_SET(__pyx_v_Erx, ((PyArrayObject *)__pyx_t_4));
  3225. __pyx_t_4 = 0;
  3226. /* "scattnlay.pyx":105
  3227. * for i in range(x.shape[0]):
  3228. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3229. * Ery = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3230. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3231. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3232. */
  3233. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3234. __Pyx_GOTREF(__pyx_t_4);
  3235. __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 = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3236. __Pyx_GOTREF(__pyx_t_5);
  3237. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3238. __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 = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3239. __Pyx_GOTREF(__pyx_t_4);
  3240. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3241. __Pyx_GOTREF(__pyx_t_3);
  3242. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3243. __Pyx_GIVEREF(__pyx_t_4);
  3244. __pyx_t_4 = 0;
  3245. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3246. __Pyx_GOTREF(__pyx_t_4);
  3247. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3248. __Pyx_GOTREF(__pyx_t_1);
  3249. __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 = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3250. __Pyx_GOTREF(__pyx_t_2);
  3251. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3252. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3253. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3254. __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 = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3255. __Pyx_GOTREF(__pyx_t_2);
  3256. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3257. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3258. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3259. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3260. __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  3261. {
  3262. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3263. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  3264. __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);
  3265. if (unlikely(__pyx_t_12 < 0)) {
  3266. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3267. 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)) {
  3268. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3269. __Pyx_RaiseBufferFallbackError();
  3270. } else {
  3271. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3272. }
  3273. }
  3274. __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];
  3275. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3276. }
  3277. __pyx_t_16 = 0;
  3278. __Pyx_XDECREF_SET(__pyx_v_Ery, ((PyArrayObject *)__pyx_t_2));
  3279. __pyx_t_2 = 0;
  3280. /* "scattnlay.pyx":106
  3281. * Erx = np.zeros(coords.shape[0], dtype = np.float64)
  3282. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3283. * Erz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3284. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3285. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3286. */
  3287. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3288. __Pyx_GOTREF(__pyx_t_2);
  3289. __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3290. __Pyx_GOTREF(__pyx_t_4);
  3291. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3292. __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3293. __Pyx_GOTREF(__pyx_t_2);
  3294. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3295. __Pyx_GOTREF(__pyx_t_3);
  3296. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3297. __Pyx_GIVEREF(__pyx_t_2);
  3298. __pyx_t_2 = 0;
  3299. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3300. __Pyx_GOTREF(__pyx_t_2);
  3301. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3302. __Pyx_GOTREF(__pyx_t_5);
  3303. __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3304. __Pyx_GOTREF(__pyx_t_1);
  3305. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3306. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3307. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3308. __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3309. __Pyx_GOTREF(__pyx_t_1);
  3310. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3311. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3312. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3313. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3314. __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  3315. {
  3316. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3317. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  3318. __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);
  3319. if (unlikely(__pyx_t_12 < 0)) {
  3320. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3321. 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)) {
  3322. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3323. __Pyx_RaiseBufferFallbackError();
  3324. } else {
  3325. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3326. }
  3327. }
  3328. __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];
  3329. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3330. }
  3331. __pyx_t_17 = 0;
  3332. __Pyx_XDECREF_SET(__pyx_v_Erz, ((PyArrayObject *)__pyx_t_1));
  3333. __pyx_t_1 = 0;
  3334. /* "scattnlay.pyx":107
  3335. * Ery = np.zeros(coords.shape[0], dtype = np.float64)
  3336. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3337. * Eix = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3338. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3339. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3340. */
  3341. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3342. __Pyx_GOTREF(__pyx_t_1);
  3343. __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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3344. __Pyx_GOTREF(__pyx_t_2);
  3345. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3346. __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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3347. __Pyx_GOTREF(__pyx_t_1);
  3348. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3349. __Pyx_GOTREF(__pyx_t_3);
  3350. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3351. __Pyx_GIVEREF(__pyx_t_1);
  3352. __pyx_t_1 = 0;
  3353. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3354. __Pyx_GOTREF(__pyx_t_1);
  3355. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3356. __Pyx_GOTREF(__pyx_t_4);
  3357. __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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3358. __Pyx_GOTREF(__pyx_t_5);
  3359. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3360. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3361. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3362. __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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3363. __Pyx_GOTREF(__pyx_t_5);
  3364. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3365. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3366. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3367. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3368. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  3369. {
  3370. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3371. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  3372. __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);
  3373. if (unlikely(__pyx_t_12 < 0)) {
  3374. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3375. 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)) {
  3376. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3377. __Pyx_RaiseBufferFallbackError();
  3378. } else {
  3379. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3380. }
  3381. }
  3382. __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];
  3383. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3384. }
  3385. __pyx_t_18 = 0;
  3386. __Pyx_XDECREF_SET(__pyx_v_Eix, ((PyArrayObject *)__pyx_t_5));
  3387. __pyx_t_5 = 0;
  3388. /* "scattnlay.pyx":108
  3389. * Erz = np.zeros(coords.shape[0], dtype = np.float64)
  3390. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3391. * Eiy = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3392. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3393. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3394. */
  3395. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3396. __Pyx_GOTREF(__pyx_t_5);
  3397. __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3398. __Pyx_GOTREF(__pyx_t_1);
  3399. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3400. __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3401. __Pyx_GOTREF(__pyx_t_5);
  3402. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3403. __Pyx_GOTREF(__pyx_t_3);
  3404. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3405. __Pyx_GIVEREF(__pyx_t_5);
  3406. __pyx_t_5 = 0;
  3407. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3408. __Pyx_GOTREF(__pyx_t_5);
  3409. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3410. __Pyx_GOTREF(__pyx_t_2);
  3411. __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3412. __Pyx_GOTREF(__pyx_t_4);
  3413. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3414. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3415. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3416. __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3417. __Pyx_GOTREF(__pyx_t_4);
  3418. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3419. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3420. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3421. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3422. __pyx_t_19 = ((PyArrayObject *)__pyx_t_4);
  3423. {
  3424. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3425. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  3426. __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);
  3427. if (unlikely(__pyx_t_12 < 0)) {
  3428. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3429. 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)) {
  3430. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3431. __Pyx_RaiseBufferFallbackError();
  3432. } else {
  3433. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3434. }
  3435. }
  3436. __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];
  3437. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3438. }
  3439. __pyx_t_19 = 0;
  3440. __Pyx_XDECREF_SET(__pyx_v_Eiy, ((PyArrayObject *)__pyx_t_4));
  3441. __pyx_t_4 = 0;
  3442. /* "scattnlay.pyx":109
  3443. * Eix = np.zeros(coords.shape[0], dtype = np.float64)
  3444. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3445. * Eiz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3446. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3447. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3448. */
  3449. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3450. __Pyx_GOTREF(__pyx_t_4);
  3451. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3452. __Pyx_GOTREF(__pyx_t_5);
  3453. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3454. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3455. __Pyx_GOTREF(__pyx_t_4);
  3456. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3457. __Pyx_GOTREF(__pyx_t_3);
  3458. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3459. __Pyx_GIVEREF(__pyx_t_4);
  3460. __pyx_t_4 = 0;
  3461. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3462. __Pyx_GOTREF(__pyx_t_4);
  3463. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3464. __Pyx_GOTREF(__pyx_t_1);
  3465. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3466. __Pyx_GOTREF(__pyx_t_2);
  3467. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3468. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3469. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3470. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3471. __Pyx_GOTREF(__pyx_t_2);
  3472. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3473. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3474. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3475. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3476. __pyx_t_20 = ((PyArrayObject *)__pyx_t_2);
  3477. {
  3478. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3479. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  3480. __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);
  3481. if (unlikely(__pyx_t_12 < 0)) {
  3482. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3483. 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)) {
  3484. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3485. __Pyx_RaiseBufferFallbackError();
  3486. } else {
  3487. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3488. }
  3489. }
  3490. __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];
  3491. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3492. }
  3493. __pyx_t_20 = 0;
  3494. __Pyx_XDECREF_SET(__pyx_v_Eiz, ((PyArrayObject *)__pyx_t_2));
  3495. __pyx_t_2 = 0;
  3496. /* "scattnlay.pyx":110
  3497. * Eiy = np.zeros(coords.shape[0], dtype = np.float64)
  3498. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3499. * Hrx = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3500. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3501. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3502. */
  3503. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3504. __Pyx_GOTREF(__pyx_t_2);
  3505. __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3506. __Pyx_GOTREF(__pyx_t_4);
  3507. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3508. __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3509. __Pyx_GOTREF(__pyx_t_2);
  3510. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3511. __Pyx_GOTREF(__pyx_t_3);
  3512. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3513. __Pyx_GIVEREF(__pyx_t_2);
  3514. __pyx_t_2 = 0;
  3515. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3516. __Pyx_GOTREF(__pyx_t_2);
  3517. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3518. __Pyx_GOTREF(__pyx_t_5);
  3519. __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3520. __Pyx_GOTREF(__pyx_t_1);
  3521. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3522. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3523. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3524. __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3525. __Pyx_GOTREF(__pyx_t_1);
  3526. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3527. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3528. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3529. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3530. __pyx_t_21 = ((PyArrayObject *)__pyx_t_1);
  3531. {
  3532. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3533. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  3534. __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);
  3535. if (unlikely(__pyx_t_12 < 0)) {
  3536. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3537. 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)) {
  3538. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3539. __Pyx_RaiseBufferFallbackError();
  3540. } else {
  3541. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3542. }
  3543. }
  3544. __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];
  3545. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3546. }
  3547. __pyx_t_21 = 0;
  3548. __Pyx_XDECREF_SET(__pyx_v_Hrx, ((PyArrayObject *)__pyx_t_1));
  3549. __pyx_t_1 = 0;
  3550. /* "scattnlay.pyx":111
  3551. * Eiz = np.zeros(coords.shape[0], dtype = np.float64)
  3552. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3553. * Hry = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3554. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3555. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3556. */
  3557. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3558. __Pyx_GOTREF(__pyx_t_1);
  3559. __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3560. __Pyx_GOTREF(__pyx_t_2);
  3561. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3562. __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3563. __Pyx_GOTREF(__pyx_t_1);
  3564. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3565. __Pyx_GOTREF(__pyx_t_3);
  3566. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3567. __Pyx_GIVEREF(__pyx_t_1);
  3568. __pyx_t_1 = 0;
  3569. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3570. __Pyx_GOTREF(__pyx_t_1);
  3571. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3572. __Pyx_GOTREF(__pyx_t_4);
  3573. __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3574. __Pyx_GOTREF(__pyx_t_5);
  3575. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3576. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3577. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3578. __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3579. __Pyx_GOTREF(__pyx_t_5);
  3580. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3581. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3582. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3583. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3584. __pyx_t_22 = ((PyArrayObject *)__pyx_t_5);
  3585. {
  3586. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3587. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  3588. __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);
  3589. if (unlikely(__pyx_t_12 < 0)) {
  3590. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3591. 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)) {
  3592. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3593. __Pyx_RaiseBufferFallbackError();
  3594. } else {
  3595. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3596. }
  3597. }
  3598. __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];
  3599. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3600. }
  3601. __pyx_t_22 = 0;
  3602. __Pyx_XDECREF_SET(__pyx_v_Hry, ((PyArrayObject *)__pyx_t_5));
  3603. __pyx_t_5 = 0;
  3604. /* "scattnlay.pyx":112
  3605. * Hrx = np.zeros(coords.shape[0], dtype = np.float64)
  3606. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3607. * Hrz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3608. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3609. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3610. */
  3611. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3612. __Pyx_GOTREF(__pyx_t_5);
  3613. __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3614. __Pyx_GOTREF(__pyx_t_1);
  3615. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3616. __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3617. __Pyx_GOTREF(__pyx_t_5);
  3618. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3619. __Pyx_GOTREF(__pyx_t_3);
  3620. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3621. __Pyx_GIVEREF(__pyx_t_5);
  3622. __pyx_t_5 = 0;
  3623. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3624. __Pyx_GOTREF(__pyx_t_5);
  3625. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3626. __Pyx_GOTREF(__pyx_t_2);
  3627. __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3628. __Pyx_GOTREF(__pyx_t_4);
  3629. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3630. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3631. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3632. __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3633. __Pyx_GOTREF(__pyx_t_4);
  3634. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3635. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3636. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3637. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3638. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  3639. {
  3640. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3641. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  3642. __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);
  3643. if (unlikely(__pyx_t_12 < 0)) {
  3644. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3645. 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)) {
  3646. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3647. __Pyx_RaiseBufferFallbackError();
  3648. } else {
  3649. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3650. }
  3651. }
  3652. __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];
  3653. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3654. }
  3655. __pyx_t_23 = 0;
  3656. __Pyx_XDECREF_SET(__pyx_v_Hrz, ((PyArrayObject *)__pyx_t_4));
  3657. __pyx_t_4 = 0;
  3658. /* "scattnlay.pyx":113
  3659. * Hry = np.zeros(coords.shape[0], dtype = np.float64)
  3660. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3661. * Hix = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3662. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3663. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3664. */
  3665. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3666. __Pyx_GOTREF(__pyx_t_4);
  3667. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3668. __Pyx_GOTREF(__pyx_t_5);
  3669. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3670. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3671. __Pyx_GOTREF(__pyx_t_4);
  3672. __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;}
  3673. __Pyx_GOTREF(__pyx_t_3);
  3674. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3675. __Pyx_GIVEREF(__pyx_t_4);
  3676. __pyx_t_4 = 0;
  3677. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3678. __Pyx_GOTREF(__pyx_t_4);
  3679. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3680. __Pyx_GOTREF(__pyx_t_1);
  3681. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3682. __Pyx_GOTREF(__pyx_t_2);
  3683. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3684. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3685. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3686. __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3687. __Pyx_GOTREF(__pyx_t_2);
  3688. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3689. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3690. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3691. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3692. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  3693. {
  3694. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3695. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  3696. __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);
  3697. if (unlikely(__pyx_t_12 < 0)) {
  3698. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3699. 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)) {
  3700. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3701. __Pyx_RaiseBufferFallbackError();
  3702. } else {
  3703. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3704. }
  3705. }
  3706. __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];
  3707. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3708. }
  3709. __pyx_t_24 = 0;
  3710. __Pyx_XDECREF_SET(__pyx_v_Hix, ((PyArrayObject *)__pyx_t_2));
  3711. __pyx_t_2 = 0;
  3712. /* "scattnlay.pyx":114
  3713. * Hrz = np.zeros(coords.shape[0], dtype = np.float64)
  3714. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3715. * Hiy = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3716. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3717. *
  3718. */
  3719. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3720. __Pyx_GOTREF(__pyx_t_2);
  3721. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3722. __Pyx_GOTREF(__pyx_t_4);
  3723. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3724. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3725. __Pyx_GOTREF(__pyx_t_2);
  3726. __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;}
  3727. __Pyx_GOTREF(__pyx_t_3);
  3728. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3729. __Pyx_GIVEREF(__pyx_t_2);
  3730. __pyx_t_2 = 0;
  3731. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3732. __Pyx_GOTREF(__pyx_t_2);
  3733. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3734. __Pyx_GOTREF(__pyx_t_5);
  3735. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3736. __Pyx_GOTREF(__pyx_t_1);
  3737. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3738. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3739. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3740. __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3741. __Pyx_GOTREF(__pyx_t_1);
  3742. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3743. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3744. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3745. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3746. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  3747. {
  3748. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3749. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  3750. __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);
  3751. if (unlikely(__pyx_t_12 < 0)) {
  3752. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3753. 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)) {
  3754. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3755. __Pyx_RaiseBufferFallbackError();
  3756. } else {
  3757. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3758. }
  3759. }
  3760. __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];
  3761. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3762. }
  3763. __pyx_t_25 = 0;
  3764. __Pyx_XDECREF_SET(__pyx_v_Hiy, ((PyArrayObject *)__pyx_t_1));
  3765. __pyx_t_1 = 0;
  3766. /* "scattnlay.pyx":115
  3767. * Hix = np.zeros(coords.shape[0], dtype = np.float64)
  3768. * Hiy = np.zeros(coords.shape[0], dtype = np.float64)
  3769. * Hiz = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3770. *
  3771. * 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))
  3772. */
  3773. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3774. __Pyx_GOTREF(__pyx_t_1);
  3775. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3776. __Pyx_GOTREF(__pyx_t_2);
  3777. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3778. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3779. __Pyx_GOTREF(__pyx_t_1);
  3780. __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;}
  3781. __Pyx_GOTREF(__pyx_t_3);
  3782. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3783. __Pyx_GIVEREF(__pyx_t_1);
  3784. __pyx_t_1 = 0;
  3785. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3786. __Pyx_GOTREF(__pyx_t_1);
  3787. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3788. __Pyx_GOTREF(__pyx_t_4);
  3789. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3790. __Pyx_GOTREF(__pyx_t_5);
  3791. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3792. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3793. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3794. __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3795. __Pyx_GOTREF(__pyx_t_5);
  3796. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3797. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3798. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3799. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3800. __pyx_t_26 = ((PyArrayObject *)__pyx_t_5);
  3801. {
  3802. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3803. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  3804. __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);
  3805. if (unlikely(__pyx_t_12 < 0)) {
  3806. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3807. 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)) {
  3808. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3809. __Pyx_RaiseBufferFallbackError();
  3810. } else {
  3811. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3812. }
  3813. }
  3814. __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];
  3815. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3816. }
  3817. __pyx_t_26 = 0;
  3818. __Pyx_XDECREF_SET(__pyx_v_Hiz, ((PyArrayObject *)__pyx_t_5));
  3819. __pyx_t_5 = 0;
  3820. /* "scattnlay.pyx":117
  3821. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  3822. *
  3823. * 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)) # <<<<<<<<<<<<<<
  3824. *
  3825. * 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()
  3826. */
  3827. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3828. __Pyx_GOTREF(__pyx_t_5);
  3829. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3830. __Pyx_GOTREF(__pyx_t_1);
  3831. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3832. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3833. __Pyx_GOTREF(__pyx_t_5);
  3834. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3835. __pyx_t_27 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3836. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3837. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3838. __Pyx_GOTREF(__pyx_t_5);
  3839. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3840. __Pyx_GOTREF(__pyx_t_1);
  3841. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3842. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3843. __Pyx_GOTREF(__pyx_t_5);
  3844. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3845. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3846. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3847. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3848. __Pyx_GOTREF(__pyx_t_5);
  3849. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3850. __Pyx_GOTREF(__pyx_t_1);
  3851. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3852. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3853. __Pyx_GOTREF(__pyx_t_5);
  3854. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3855. __pyx_t_29 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3856. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3857. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3858. __Pyx_GOTREF(__pyx_t_5);
  3859. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3860. __Pyx_GOTREF(__pyx_t_1);
  3861. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3862. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3863. __Pyx_GOTREF(__pyx_t_5);
  3864. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3865. __pyx_t_30 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3866. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3867. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3868. __Pyx_GOTREF(__pyx_t_5);
  3869. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3870. __Pyx_GOTREF(__pyx_t_1);
  3871. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3872. __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3873. __Pyx_GOTREF(__pyx_t_5);
  3874. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3875. __pyx_t_31 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3876. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3877. __pyx_t_32 = __pyx_v_i;
  3878. __pyx_t_12 = -1;
  3879. if (__pyx_t_32 < 0) {
  3880. __pyx_t_32 += __pyx_pybuffernd_terms.diminfo[0].shape;
  3881. if (unlikely(__pyx_t_32 < 0)) __pyx_t_12 = 0;
  3882. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_12 = 0;
  3883. if (unlikely(__pyx_t_12 != -1)) {
  3884. __Pyx_RaiseBufferIndexError(__pyx_t_12);
  3885. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3886. }
  3887. *__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)));
  3888. /* "scattnlay.pyx":119
  3889. * 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))
  3890. *
  3891. * 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() # <<<<<<<<<<<<<<
  3892. * 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()
  3893. *
  3894. */
  3895. __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;}
  3896. __Pyx_GOTREF(__pyx_t_5);
  3897. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3898. __Pyx_GOTREF(__pyx_t_1);
  3899. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3900. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3901. __Pyx_GOTREF(__pyx_t_5);
  3902. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3903. __Pyx_GOTREF(__pyx_t_3);
  3904. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3905. __pyx_t_5 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3906. __Pyx_GOTREF(__pyx_t_5);
  3907. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3908. __Pyx_GOTREF(__pyx_t_2);
  3909. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3910. __Pyx_GOTREF(__pyx_t_4);
  3911. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3912. __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3913. __Pyx_GOTREF(__pyx_t_2);
  3914. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3915. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3916. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3917. __Pyx_GOTREF(__pyx_t_4);
  3918. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3919. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3920. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3921. __Pyx_GOTREF(__pyx_t_2);
  3922. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3923. __Pyx_GOTREF(__pyx_t_3);
  3924. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3925. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3926. __Pyx_GOTREF(__pyx_t_2);
  3927. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3928. __Pyx_GOTREF(__pyx_t_5);
  3929. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3930. __Pyx_GOTREF(__pyx_t_33);
  3931. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3932. __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3933. __Pyx_GOTREF(__pyx_t_5);
  3934. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3935. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  3936. __pyx_t_33 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3937. __Pyx_GOTREF(__pyx_t_33);
  3938. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3939. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3940. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3941. __Pyx_GOTREF(__pyx_t_5);
  3942. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3943. __Pyx_GOTREF(__pyx_t_3);
  3944. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3945. __pyx_t_5 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3946. __Pyx_GOTREF(__pyx_t_5);
  3947. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3948. __Pyx_GOTREF(__pyx_t_2);
  3949. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3950. __Pyx_GOTREF(__pyx_t_34);
  3951. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3952. __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3953. __Pyx_GOTREF(__pyx_t_2);
  3954. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3955. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3956. __pyx_t_34 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3957. __Pyx_GOTREF(__pyx_t_34);
  3958. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3959. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3960. __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3961. __Pyx_GOTREF(__pyx_t_2);
  3962. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  3963. __Pyx_GIVEREF(__pyx_t_4);
  3964. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_33);
  3965. __Pyx_GIVEREF(__pyx_t_33);
  3966. PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_34);
  3967. __Pyx_GIVEREF(__pyx_t_34);
  3968. __pyx_t_4 = 0;
  3969. __pyx_t_33 = 0;
  3970. __pyx_t_34 = 0;
  3971. __pyx_t_34 = PyTuple_New(1); if (unlikely(!__pyx_t_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3972. __Pyx_GOTREF(__pyx_t_34);
  3973. PyTuple_SET_ITEM(__pyx_t_34, 0, __pyx_t_2);
  3974. __Pyx_GIVEREF(__pyx_t_2);
  3975. __pyx_t_2 = 0;
  3976. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3977. __Pyx_GOTREF(__pyx_t_2);
  3978. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3979. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3980. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3981. __Pyx_GOTREF(__pyx_t_34);
  3982. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3983. __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3984. __Pyx_GOTREF(__pyx_t_2);
  3985. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  3986. 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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3987. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3988. /* "scattnlay.pyx":120
  3989. *
  3990. * 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()
  3991. * 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() # <<<<<<<<<<<<<<
  3992. *
  3993. * return terms, E, H
  3994. */
  3995. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3996. __Pyx_GOTREF(__pyx_t_2);
  3997. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3998. __Pyx_GOTREF(__pyx_t_34);
  3999. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4000. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4001. __Pyx_GOTREF(__pyx_t_2);
  4002. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4003. __Pyx_GOTREF(__pyx_t_1);
  4004. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4005. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4006. __Pyx_GOTREF(__pyx_t_2);
  4007. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4008. __Pyx_GOTREF(__pyx_t_33);
  4009. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4010. __Pyx_GOTREF(__pyx_t_4);
  4011. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4012. __pyx_t_33 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4013. __Pyx_GOTREF(__pyx_t_33);
  4014. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4015. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4016. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_33); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4017. __Pyx_GOTREF(__pyx_t_4);
  4018. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4019. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4020. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4021. __Pyx_GOTREF(__pyx_t_33);
  4022. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4023. __Pyx_GOTREF(__pyx_t_1);
  4024. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4025. __pyx_t_33 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4026. __Pyx_GOTREF(__pyx_t_33);
  4027. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4028. __Pyx_GOTREF(__pyx_t_2);
  4029. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4030. __Pyx_GOTREF(__pyx_t_3);
  4031. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4032. __pyx_t_2 = PyNumber_Multiply(__pyx_t_33, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4033. __Pyx_GOTREF(__pyx_t_2);
  4034. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4035. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4036. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4037. __Pyx_GOTREF(__pyx_t_3);
  4038. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4039. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4040. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4041. __Pyx_GOTREF(__pyx_t_2);
  4042. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4043. __Pyx_GOTREF(__pyx_t_1);
  4044. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4045. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4046. __Pyx_GOTREF(__pyx_t_2);
  4047. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4048. __Pyx_GOTREF(__pyx_t_33);
  4049. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4050. __Pyx_GOTREF(__pyx_t_5);
  4051. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4052. __pyx_t_33 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4053. __Pyx_GOTREF(__pyx_t_33);
  4054. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4055. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4056. __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_33); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4057. __Pyx_GOTREF(__pyx_t_5);
  4058. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4059. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4060. __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4061. __Pyx_GOTREF(__pyx_t_33);
  4062. PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_4);
  4063. __Pyx_GIVEREF(__pyx_t_4);
  4064. PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_t_3);
  4065. __Pyx_GIVEREF(__pyx_t_3);
  4066. PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_t_5);
  4067. __Pyx_GIVEREF(__pyx_t_5);
  4068. __pyx_t_4 = 0;
  4069. __pyx_t_3 = 0;
  4070. __pyx_t_5 = 0;
  4071. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4072. __Pyx_GOTREF(__pyx_t_5);
  4073. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_33);
  4074. __Pyx_GIVEREF(__pyx_t_33);
  4075. __pyx_t_33 = 0;
  4076. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4077. __Pyx_GOTREF(__pyx_t_33);
  4078. __Pyx_DECREF(__pyx_t_34); __pyx_t_34 = 0;
  4079. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4080. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4081. __Pyx_GOTREF(__pyx_t_5);
  4082. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4083. __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4084. __Pyx_GOTREF(__pyx_t_33);
  4085. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4086. 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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4087. __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
  4088. }
  4089. /* "scattnlay.pyx":122
  4090. * 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()
  4091. *
  4092. * return terms, E, H # <<<<<<<<<<<<<<
  4093. *
  4094. */
  4095. __Pyx_XDECREF(__pyx_r);
  4096. __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4097. __Pyx_GOTREF(__pyx_t_33);
  4098. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  4099. PyTuple_SET_ITEM(__pyx_t_33, 0, ((PyObject *)__pyx_v_terms));
  4100. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  4101. __Pyx_INCREF(((PyObject *)__pyx_v_E));
  4102. PyTuple_SET_ITEM(__pyx_t_33, 1, ((PyObject *)__pyx_v_E));
  4103. __Pyx_GIVEREF(((PyObject *)__pyx_v_E));
  4104. __Pyx_INCREF(((PyObject *)__pyx_v_H));
  4105. PyTuple_SET_ITEM(__pyx_t_33, 2, ((PyObject *)__pyx_v_H));
  4106. __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
  4107. __pyx_r = __pyx_t_33;
  4108. __pyx_t_33 = 0;
  4109. goto __pyx_L0;
  4110. /* "scattnlay.pyx":82
  4111. *
  4112. * #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):
  4113. * 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): # <<<<<<<<<<<<<<
  4114. * cdef Py_ssize_t i
  4115. *
  4116. */
  4117. /* function exit code */
  4118. __pyx_L1_error:;
  4119. __Pyx_XDECREF(__pyx_t_1);
  4120. __Pyx_XDECREF(__pyx_t_2);
  4121. __Pyx_XDECREF(__pyx_t_3);
  4122. __Pyx_XDECREF(__pyx_t_4);
  4123. __Pyx_XDECREF(__pyx_t_5);
  4124. __Pyx_XDECREF(__pyx_t_33);
  4125. __Pyx_XDECREF(__pyx_t_34);
  4126. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  4127. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  4128. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  4129. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  4130. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  4131. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  4132. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  4133. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  4134. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  4135. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  4136. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  4137. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  4138. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  4139. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  4140. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  4141. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  4142. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  4143. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  4144. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  4145. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  4146. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  4147. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4148. __pyx_r = NULL;
  4149. goto __pyx_L2;
  4150. __pyx_L0:;
  4151. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  4152. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eix.rcbuffer->pybuffer);
  4153. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiy.rcbuffer->pybuffer);
  4154. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Eiz.rcbuffer->pybuffer);
  4155. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erx.rcbuffer->pybuffer);
  4156. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ery.rcbuffer->pybuffer);
  4157. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Erz.rcbuffer->pybuffer);
  4158. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  4159. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hix.rcbuffer->pybuffer);
  4160. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiy.rcbuffer->pybuffer);
  4161. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hiz.rcbuffer->pybuffer);
  4162. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrx.rcbuffer->pybuffer);
  4163. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hry.rcbuffer->pybuffer);
  4164. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hrz.rcbuffer->pybuffer);
  4165. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  4166. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  4167. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  4168. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  4169. __pyx_L2:;
  4170. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  4171. __Pyx_XDECREF((PyObject *)__pyx_v_E);
  4172. __Pyx_XDECREF((PyObject *)__pyx_v_H);
  4173. __Pyx_XDECREF((PyObject *)__pyx_v_Erx);
  4174. __Pyx_XDECREF((PyObject *)__pyx_v_Ery);
  4175. __Pyx_XDECREF((PyObject *)__pyx_v_Erz);
  4176. __Pyx_XDECREF((PyObject *)__pyx_v_Eix);
  4177. __Pyx_XDECREF((PyObject *)__pyx_v_Eiy);
  4178. __Pyx_XDECREF((PyObject *)__pyx_v_Eiz);
  4179. __Pyx_XDECREF((PyObject *)__pyx_v_Hrx);
  4180. __Pyx_XDECREF((PyObject *)__pyx_v_Hry);
  4181. __Pyx_XDECREF((PyObject *)__pyx_v_Hrz);
  4182. __Pyx_XDECREF((PyObject *)__pyx_v_Hix);
  4183. __Pyx_XDECREF((PyObject *)__pyx_v_Hiy);
  4184. __Pyx_XDECREF((PyObject *)__pyx_v_Hiz);
  4185. __Pyx_XGIVEREF(__pyx_r);
  4186. __Pyx_RefNannyFinishContext();
  4187. return __pyx_r;
  4188. }
  4189. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4190. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4191. * # -- the details of this may change.
  4192. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4193. * # This implementation of getbuffer is geared towards Cython
  4194. * # requirements, and does not yet fullfill the PEP.
  4195. */
  4196. /* Python wrapper */
  4197. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  4198. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  4199. int __pyx_r;
  4200. __Pyx_RefNannyDeclarations
  4201. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  4202. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  4203. /* function exit code */
  4204. __Pyx_RefNannyFinishContext();
  4205. return __pyx_r;
  4206. }
  4207. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  4208. int __pyx_v_copy_shape;
  4209. int __pyx_v_i;
  4210. int __pyx_v_ndim;
  4211. int __pyx_v_endian_detector;
  4212. int __pyx_v_little_endian;
  4213. int __pyx_v_t;
  4214. char *__pyx_v_f;
  4215. PyArray_Descr *__pyx_v_descr = 0;
  4216. int __pyx_v_offset;
  4217. int __pyx_v_hasfields;
  4218. int __pyx_r;
  4219. __Pyx_RefNannyDeclarations
  4220. int __pyx_t_1;
  4221. int __pyx_t_2;
  4222. int __pyx_t_3;
  4223. PyObject *__pyx_t_4 = NULL;
  4224. int __pyx_t_5;
  4225. int __pyx_t_6;
  4226. int __pyx_t_7;
  4227. PyObject *__pyx_t_8 = NULL;
  4228. char *__pyx_t_9;
  4229. int __pyx_lineno = 0;
  4230. const char *__pyx_filename = NULL;
  4231. int __pyx_clineno = 0;
  4232. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  4233. if (__pyx_v_info != NULL) {
  4234. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  4235. __Pyx_GIVEREF(__pyx_v_info->obj);
  4236. }
  4237. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200
  4238. * # of flags
  4239. *
  4240. * if info == NULL: return # <<<<<<<<<<<<<<
  4241. *
  4242. * cdef int copy_shape, i, ndim
  4243. */
  4244. __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  4245. if (__pyx_t_1) {
  4246. __pyx_r = 0;
  4247. goto __pyx_L0;
  4248. }
  4249. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
  4250. *
  4251. * cdef int copy_shape, i, ndim
  4252. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  4253. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4254. *
  4255. */
  4256. __pyx_v_endian_detector = 1;
  4257. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
  4258. * cdef int copy_shape, i, ndim
  4259. * cdef int endian_detector = 1
  4260. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  4261. *
  4262. * ndim = PyArray_NDIM(self)
  4263. */
  4264. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  4265. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
  4266. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4267. *
  4268. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  4269. *
  4270. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4271. */
  4272. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  4273. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
  4274. * ndim = PyArray_NDIM(self)
  4275. *
  4276. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4277. * copy_shape = 1
  4278. * else:
  4279. */
  4280. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4281. if (__pyx_t_1) {
  4282. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
  4283. *
  4284. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4285. * copy_shape = 1 # <<<<<<<<<<<<<<
  4286. * else:
  4287. * copy_shape = 0
  4288. */
  4289. __pyx_v_copy_shape = 1;
  4290. goto __pyx_L4;
  4291. }
  4292. /*else*/ {
  4293. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
  4294. * copy_shape = 1
  4295. * else:
  4296. * copy_shape = 0 # <<<<<<<<<<<<<<
  4297. *
  4298. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4299. */
  4300. __pyx_v_copy_shape = 0;
  4301. }
  4302. __pyx_L4:;
  4303. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
  4304. * copy_shape = 0
  4305. *
  4306. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  4307. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  4308. * raise ValueError(u"ndarray is not C contiguous")
  4309. */
  4310. __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  4311. if (__pyx_t_1) {
  4312. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
  4313. *
  4314. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4315. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  4316. * raise ValueError(u"ndarray is not C contiguous")
  4317. *
  4318. */
  4319. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  4320. __pyx_t_3 = __pyx_t_2;
  4321. } else {
  4322. __pyx_t_3 = __pyx_t_1;
  4323. }
  4324. if (__pyx_t_3) {
  4325. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  4326. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  4327. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  4328. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  4329. *
  4330. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4331. */
  4332. __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;}
  4333. __Pyx_GOTREF(__pyx_t_4);
  4334. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4335. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4336. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4337. }
  4338. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
  4339. * raise ValueError(u"ndarray is not C contiguous")
  4340. *
  4341. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  4342. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  4343. * raise ValueError(u"ndarray is not Fortran contiguous")
  4344. */
  4345. __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  4346. if (__pyx_t_3) {
  4347. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
  4348. *
  4349. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4350. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  4351. * raise ValueError(u"ndarray is not Fortran contiguous")
  4352. *
  4353. */
  4354. __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  4355. __pyx_t_2 = __pyx_t_1;
  4356. } else {
  4357. __pyx_t_2 = __pyx_t_3;
  4358. }
  4359. if (__pyx_t_2) {
  4360. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  4361. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  4362. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  4363. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  4364. *
  4365. * info.buf = PyArray_DATA(self)
  4366. */
  4367. __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;}
  4368. __Pyx_GOTREF(__pyx_t_4);
  4369. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4370. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4371. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4372. }
  4373. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
  4374. * raise ValueError(u"ndarray is not Fortran contiguous")
  4375. *
  4376. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  4377. * info.ndim = ndim
  4378. * if copy_shape:
  4379. */
  4380. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  4381. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
  4382. *
  4383. * info.buf = PyArray_DATA(self)
  4384. * info.ndim = ndim # <<<<<<<<<<<<<<
  4385. * if copy_shape:
  4386. * # Allocate new buffer for strides and shape info.
  4387. */
  4388. __pyx_v_info->ndim = __pyx_v_ndim;
  4389. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
  4390. * info.buf = PyArray_DATA(self)
  4391. * info.ndim = ndim
  4392. * if copy_shape: # <<<<<<<<<<<<<<
  4393. * # Allocate new buffer for strides and shape info.
  4394. * # This is allocated as one block, strides first.
  4395. */
  4396. __pyx_t_2 = (__pyx_v_copy_shape != 0);
  4397. if (__pyx_t_2) {
  4398. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
  4399. * # Allocate new buffer for strides and shape info.
  4400. * # This is allocated as one block, strides first.
  4401. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
  4402. * info.shape = info.strides + ndim
  4403. * for i in range(ndim):
  4404. */
  4405. __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
  4406. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
  4407. * # This is allocated as one block, strides first.
  4408. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  4409. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  4410. * for i in range(ndim):
  4411. * info.strides[i] = PyArray_STRIDES(self)[i]
  4412. */
  4413. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  4414. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
  4415. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  4416. * info.shape = info.strides + ndim
  4417. * for i in range(ndim): # <<<<<<<<<<<<<<
  4418. * info.strides[i] = PyArray_STRIDES(self)[i]
  4419. * info.shape[i] = PyArray_DIMS(self)[i]
  4420. */
  4421. __pyx_t_5 = __pyx_v_ndim;
  4422. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  4423. __pyx_v_i = __pyx_t_6;
  4424. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
  4425. * info.shape = info.strides + ndim
  4426. * for i in range(ndim):
  4427. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  4428. * info.shape[i] = PyArray_DIMS(self)[i]
  4429. * else:
  4430. */
  4431. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  4432. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
  4433. * for i in range(ndim):
  4434. * info.strides[i] = PyArray_STRIDES(self)[i]
  4435. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  4436. * else:
  4437. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4438. */
  4439. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  4440. }
  4441. goto __pyx_L7;
  4442. }
  4443. /*else*/ {
  4444. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
  4445. * info.shape[i] = PyArray_DIMS(self)[i]
  4446. * else:
  4447. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  4448. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4449. * info.suboffsets = NULL
  4450. */
  4451. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  4452. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
  4453. * else:
  4454. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4455. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  4456. * info.suboffsets = NULL
  4457. * info.itemsize = PyArray_ITEMSIZE(self)
  4458. */
  4459. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  4460. }
  4461. __pyx_L7:;
  4462. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
  4463. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  4464. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4465. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  4466. * info.itemsize = PyArray_ITEMSIZE(self)
  4467. * info.readonly = not PyArray_ISWRITEABLE(self)
  4468. */
  4469. __pyx_v_info->suboffsets = NULL;
  4470. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
  4471. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  4472. * info.suboffsets = NULL
  4473. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  4474. * info.readonly = not PyArray_ISWRITEABLE(self)
  4475. *
  4476. */
  4477. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  4478. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
  4479. * info.suboffsets = NULL
  4480. * info.itemsize = PyArray_ITEMSIZE(self)
  4481. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  4482. *
  4483. * cdef int t
  4484. */
  4485. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  4486. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
  4487. *
  4488. * cdef int t
  4489. * cdef char* f = NULL # <<<<<<<<<<<<<<
  4490. * cdef dtype descr = self.descr
  4491. * cdef list stack
  4492. */
  4493. __pyx_v_f = NULL;
  4494. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
  4495. * cdef int t
  4496. * cdef char* f = NULL
  4497. * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
  4498. * cdef list stack
  4499. * cdef int offset
  4500. */
  4501. __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  4502. __Pyx_INCREF(__pyx_t_4);
  4503. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  4504. __pyx_t_4 = 0;
  4505. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
  4506. * cdef int offset
  4507. *
  4508. * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
  4509. *
  4510. * if not hasfields and not copy_shape:
  4511. */
  4512. __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
  4513. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
  4514. * cdef bint hasfields = PyDataType_HASFIELDS(descr)
  4515. *
  4516. * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
  4517. * # do not call releasebuffer
  4518. * info.obj = None
  4519. */
  4520. __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  4521. if (__pyx_t_2) {
  4522. __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
  4523. __pyx_t_1 = __pyx_t_3;
  4524. } else {
  4525. __pyx_t_1 = __pyx_t_2;
  4526. }
  4527. if (__pyx_t_1) {
  4528. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
  4529. * if not hasfields and not copy_shape:
  4530. * # do not call releasebuffer
  4531. * info.obj = None # <<<<<<<<<<<<<<
  4532. * else:
  4533. * # need to call releasebuffer
  4534. */
  4535. __Pyx_INCREF(Py_None);
  4536. __Pyx_GIVEREF(Py_None);
  4537. __Pyx_GOTREF(__pyx_v_info->obj);
  4538. __Pyx_DECREF(__pyx_v_info->obj);
  4539. __pyx_v_info->obj = Py_None;
  4540. goto __pyx_L10;
  4541. }
  4542. /*else*/ {
  4543. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
  4544. * else:
  4545. * # need to call releasebuffer
  4546. * info.obj = self # <<<<<<<<<<<<<<
  4547. *
  4548. * if not hasfields:
  4549. */
  4550. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  4551. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  4552. __Pyx_GOTREF(__pyx_v_info->obj);
  4553. __Pyx_DECREF(__pyx_v_info->obj);
  4554. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  4555. }
  4556. __pyx_L10:;
  4557. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
  4558. * info.obj = self
  4559. *
  4560. * if not hasfields: # <<<<<<<<<<<<<<
  4561. * t = descr.type_num
  4562. * if ((descr.byteorder == c'>' and little_endian) or
  4563. */
  4564. __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  4565. if (__pyx_t_1) {
  4566. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
  4567. *
  4568. * if not hasfields:
  4569. * t = descr.type_num # <<<<<<<<<<<<<<
  4570. * if ((descr.byteorder == c'>' and little_endian) or
  4571. * (descr.byteorder == c'<' and not little_endian)):
  4572. */
  4573. __pyx_t_5 = __pyx_v_descr->type_num;
  4574. __pyx_v_t = __pyx_t_5;
  4575. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
  4576. * if not hasfields:
  4577. * t = descr.type_num
  4578. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  4579. * (descr.byteorder == c'<' and not little_endian)):
  4580. * raise ValueError(u"Non-native byte order not supported")
  4581. */
  4582. __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
  4583. if (__pyx_t_1) {
  4584. __pyx_t_2 = (__pyx_v_little_endian != 0);
  4585. } else {
  4586. __pyx_t_2 = __pyx_t_1;
  4587. }
  4588. if (!__pyx_t_2) {
  4589. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
  4590. * t = descr.type_num
  4591. * if ((descr.byteorder == c'>' and little_endian) or
  4592. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  4593. * raise ValueError(u"Non-native byte order not supported")
  4594. * if t == NPY_BYTE: f = "b"
  4595. */
  4596. __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
  4597. if (__pyx_t_1) {
  4598. __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
  4599. __pyx_t_7 = __pyx_t_3;
  4600. } else {
  4601. __pyx_t_7 = __pyx_t_1;
  4602. }
  4603. __pyx_t_1 = __pyx_t_7;
  4604. } else {
  4605. __pyx_t_1 = __pyx_t_2;
  4606. }
  4607. if (__pyx_t_1) {
  4608. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  4609. * if ((descr.byteorder == c'>' and little_endian) or
  4610. * (descr.byteorder == c'<' and not little_endian)):
  4611. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  4612. * if t == NPY_BYTE: f = "b"
  4613. * elif t == NPY_UBYTE: f = "B"
  4614. */
  4615. __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;}
  4616. __Pyx_GOTREF(__pyx_t_4);
  4617. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4618. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4619. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4620. }
  4621. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4622. * elif t == NPY_CDOUBLE: f = "Zd"
  4623. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4624. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4625. * else:
  4626. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4627. */
  4628. switch (__pyx_v_t) {
  4629. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
  4630. * (descr.byteorder == c'<' and not little_endian)):
  4631. * raise ValueError(u"Non-native byte order not supported")
  4632. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  4633. * elif t == NPY_UBYTE: f = "B"
  4634. * elif t == NPY_SHORT: f = "h"
  4635. */
  4636. case NPY_BYTE:
  4637. __pyx_v_f = __pyx_k_b;
  4638. break;
  4639. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
  4640. * raise ValueError(u"Non-native byte order not supported")
  4641. * if t == NPY_BYTE: f = "b"
  4642. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  4643. * elif t == NPY_SHORT: f = "h"
  4644. * elif t == NPY_USHORT: f = "H"
  4645. */
  4646. case NPY_UBYTE:
  4647. __pyx_v_f = __pyx_k_B;
  4648. break;
  4649. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
  4650. * if t == NPY_BYTE: f = "b"
  4651. * elif t == NPY_UBYTE: f = "B"
  4652. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  4653. * elif t == NPY_USHORT: f = "H"
  4654. * elif t == NPY_INT: f = "i"
  4655. */
  4656. case NPY_SHORT:
  4657. __pyx_v_f = __pyx_k_h;
  4658. break;
  4659. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
  4660. * elif t == NPY_UBYTE: f = "B"
  4661. * elif t == NPY_SHORT: f = "h"
  4662. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  4663. * elif t == NPY_INT: f = "i"
  4664. * elif t == NPY_UINT: f = "I"
  4665. */
  4666. case NPY_USHORT:
  4667. __pyx_v_f = __pyx_k_H;
  4668. break;
  4669. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
  4670. * elif t == NPY_SHORT: f = "h"
  4671. * elif t == NPY_USHORT: f = "H"
  4672. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  4673. * elif t == NPY_UINT: f = "I"
  4674. * elif t == NPY_LONG: f = "l"
  4675. */
  4676. case NPY_INT:
  4677. __pyx_v_f = __pyx_k_i;
  4678. break;
  4679. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
  4680. * elif t == NPY_USHORT: f = "H"
  4681. * elif t == NPY_INT: f = "i"
  4682. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  4683. * elif t == NPY_LONG: f = "l"
  4684. * elif t == NPY_ULONG: f = "L"
  4685. */
  4686. case NPY_UINT:
  4687. __pyx_v_f = __pyx_k_I;
  4688. break;
  4689. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
  4690. * elif t == NPY_INT: f = "i"
  4691. * elif t == NPY_UINT: f = "I"
  4692. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  4693. * elif t == NPY_ULONG: f = "L"
  4694. * elif t == NPY_LONGLONG: f = "q"
  4695. */
  4696. case NPY_LONG:
  4697. __pyx_v_f = __pyx_k_l;
  4698. break;
  4699. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
  4700. * elif t == NPY_UINT: f = "I"
  4701. * elif t == NPY_LONG: f = "l"
  4702. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  4703. * elif t == NPY_LONGLONG: f = "q"
  4704. * elif t == NPY_ULONGLONG: f = "Q"
  4705. */
  4706. case NPY_ULONG:
  4707. __pyx_v_f = __pyx_k_L;
  4708. break;
  4709. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
  4710. * elif t == NPY_LONG: f = "l"
  4711. * elif t == NPY_ULONG: f = "L"
  4712. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  4713. * elif t == NPY_ULONGLONG: f = "Q"
  4714. * elif t == NPY_FLOAT: f = "f"
  4715. */
  4716. case NPY_LONGLONG:
  4717. __pyx_v_f = __pyx_k_q;
  4718. break;
  4719. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
  4720. * elif t == NPY_ULONG: f = "L"
  4721. * elif t == NPY_LONGLONG: f = "q"
  4722. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  4723. * elif t == NPY_FLOAT: f = "f"
  4724. * elif t == NPY_DOUBLE: f = "d"
  4725. */
  4726. case NPY_ULONGLONG:
  4727. __pyx_v_f = __pyx_k_Q;
  4728. break;
  4729. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
  4730. * elif t == NPY_LONGLONG: f = "q"
  4731. * elif t == NPY_ULONGLONG: f = "Q"
  4732. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  4733. * elif t == NPY_DOUBLE: f = "d"
  4734. * elif t == NPY_LONGDOUBLE: f = "g"
  4735. */
  4736. case NPY_FLOAT:
  4737. __pyx_v_f = __pyx_k_f;
  4738. break;
  4739. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
  4740. * elif t == NPY_ULONGLONG: f = "Q"
  4741. * elif t == NPY_FLOAT: f = "f"
  4742. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  4743. * elif t == NPY_LONGDOUBLE: f = "g"
  4744. * elif t == NPY_CFLOAT: f = "Zf"
  4745. */
  4746. case NPY_DOUBLE:
  4747. __pyx_v_f = __pyx_k_d;
  4748. break;
  4749. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
  4750. * elif t == NPY_FLOAT: f = "f"
  4751. * elif t == NPY_DOUBLE: f = "d"
  4752. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  4753. * elif t == NPY_CFLOAT: f = "Zf"
  4754. * elif t == NPY_CDOUBLE: f = "Zd"
  4755. */
  4756. case NPY_LONGDOUBLE:
  4757. __pyx_v_f = __pyx_k_g;
  4758. break;
  4759. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
  4760. * elif t == NPY_DOUBLE: f = "d"
  4761. * elif t == NPY_LONGDOUBLE: f = "g"
  4762. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  4763. * elif t == NPY_CDOUBLE: f = "Zd"
  4764. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4765. */
  4766. case NPY_CFLOAT:
  4767. __pyx_v_f = __pyx_k_Zf;
  4768. break;
  4769. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
  4770. * elif t == NPY_LONGDOUBLE: f = "g"
  4771. * elif t == NPY_CFLOAT: f = "Zf"
  4772. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  4773. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4774. * elif t == NPY_OBJECT: f = "O"
  4775. */
  4776. case NPY_CDOUBLE:
  4777. __pyx_v_f = __pyx_k_Zd;
  4778. break;
  4779. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
  4780. * elif t == NPY_CFLOAT: f = "Zf"
  4781. * elif t == NPY_CDOUBLE: f = "Zd"
  4782. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  4783. * elif t == NPY_OBJECT: f = "O"
  4784. * else:
  4785. */
  4786. case NPY_CLONGDOUBLE:
  4787. __pyx_v_f = __pyx_k_Zg;
  4788. break;
  4789. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4790. * elif t == NPY_CDOUBLE: f = "Zd"
  4791. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4792. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4793. * else:
  4794. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4795. */
  4796. case NPY_OBJECT:
  4797. __pyx_v_f = __pyx_k_O;
  4798. break;
  4799. default:
  4800. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
  4801. * elif t == NPY_OBJECT: f = "O"
  4802. * else:
  4803. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  4804. * info.format = f
  4805. * return
  4806. */
  4807. __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;}
  4808. __Pyx_GOTREF(__pyx_t_4);
  4809. __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;}
  4810. __Pyx_GOTREF(__pyx_t_8);
  4811. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4812. __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;}
  4813. __Pyx_GOTREF(__pyx_t_4);
  4814. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  4815. __Pyx_GIVEREF(__pyx_t_8);
  4816. __pyx_t_8 = 0;
  4817. __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;}
  4818. __Pyx_GOTREF(__pyx_t_8);
  4819. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4820. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  4821. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4822. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4823. break;
  4824. }
  4825. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
  4826. * else:
  4827. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4828. * info.format = f # <<<<<<<<<<<<<<
  4829. * return
  4830. * else:
  4831. */
  4832. __pyx_v_info->format = __pyx_v_f;
  4833. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
  4834. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4835. * info.format = f
  4836. * return # <<<<<<<<<<<<<<
  4837. * else:
  4838. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4839. */
  4840. __pyx_r = 0;
  4841. goto __pyx_L0;
  4842. }
  4843. /*else*/ {
  4844. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
  4845. * return
  4846. * else:
  4847. * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  4848. * info.format[0] = c'^' # Native data types, manual alignment
  4849. * offset = 0
  4850. */
  4851. __pyx_v_info->format = ((char *)malloc(255));
  4852. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
  4853. * else:
  4854. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4855. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  4856. * offset = 0
  4857. * f = _util_dtypestring(descr, info.format + 1,
  4858. */
  4859. (__pyx_v_info->format[0]) = '^';
  4860. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
  4861. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4862. * info.format[0] = c'^' # Native data types, manual alignment
  4863. * offset = 0 # <<<<<<<<<<<<<<
  4864. * f = _util_dtypestring(descr, info.format + 1,
  4865. * info.format + _buffer_format_string_len,
  4866. */
  4867. __pyx_v_offset = 0;
  4868. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
  4869. * info.format[0] = c'^' # Native data types, manual alignment
  4870. * offset = 0
  4871. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  4872. * info.format + _buffer_format_string_len,
  4873. * &offset)
  4874. */
  4875. __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;}
  4876. __pyx_v_f = __pyx_t_9;
  4877. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
  4878. * info.format + _buffer_format_string_len,
  4879. * &offset)
  4880. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  4881. *
  4882. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4883. */
  4884. (__pyx_v_f[0]) = '\x00';
  4885. }
  4886. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4887. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4888. * # -- the details of this may change.
  4889. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4890. * # This implementation of getbuffer is geared towards Cython
  4891. * # requirements, and does not yet fullfill the PEP.
  4892. */
  4893. /* function exit code */
  4894. __pyx_r = 0;
  4895. goto __pyx_L0;
  4896. __pyx_L1_error:;
  4897. __Pyx_XDECREF(__pyx_t_4);
  4898. __Pyx_XDECREF(__pyx_t_8);
  4899. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4900. __pyx_r = -1;
  4901. if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
  4902. __Pyx_GOTREF(__pyx_v_info->obj);
  4903. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  4904. }
  4905. goto __pyx_L2;
  4906. __pyx_L0:;
  4907. if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
  4908. __Pyx_GOTREF(Py_None);
  4909. __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  4910. }
  4911. __pyx_L2:;
  4912. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  4913. __Pyx_RefNannyFinishContext();
  4914. return __pyx_r;
  4915. }
  4916. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4917. * f[0] = c'\0' # Terminate format string
  4918. *
  4919. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4920. * if PyArray_HASFIELDS(self):
  4921. * stdlib.free(info.format)
  4922. */
  4923. /* Python wrapper */
  4924. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  4925. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4926. __Pyx_RefNannyDeclarations
  4927. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  4928. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  4929. /* function exit code */
  4930. __Pyx_RefNannyFinishContext();
  4931. }
  4932. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4933. __Pyx_RefNannyDeclarations
  4934. int __pyx_t_1;
  4935. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  4936. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
  4937. *
  4938. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4939. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  4940. * stdlib.free(info.format)
  4941. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4942. */
  4943. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  4944. if (__pyx_t_1) {
  4945. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
  4946. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4947. * if PyArray_HASFIELDS(self):
  4948. * stdlib.free(info.format) # <<<<<<<<<<<<<<
  4949. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4950. * stdlib.free(info.strides)
  4951. */
  4952. free(__pyx_v_info->format);
  4953. goto __pyx_L3;
  4954. }
  4955. __pyx_L3:;
  4956. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
  4957. * if PyArray_HASFIELDS(self):
  4958. * stdlib.free(info.format)
  4959. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4960. * stdlib.free(info.strides)
  4961. * # info.shape was stored after info.strides in the same block
  4962. */
  4963. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4964. if (__pyx_t_1) {
  4965. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
  4966. * stdlib.free(info.format)
  4967. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4968. * stdlib.free(info.strides) # <<<<<<<<<<<<<<
  4969. * # info.shape was stored after info.strides in the same block
  4970. *
  4971. */
  4972. free(__pyx_v_info->strides);
  4973. goto __pyx_L4;
  4974. }
  4975. __pyx_L4:;
  4976. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4977. * f[0] = c'\0' # Terminate format string
  4978. *
  4979. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4980. * if PyArray_HASFIELDS(self):
  4981. * stdlib.free(info.format)
  4982. */
  4983. /* function exit code */
  4984. __Pyx_RefNannyFinishContext();
  4985. }
  4986. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4987. * ctypedef npy_cdouble complex_t
  4988. *
  4989. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4990. * return PyArray_MultiIterNew(1, <void*>a)
  4991. *
  4992. */
  4993. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  4994. PyObject *__pyx_r = NULL;
  4995. __Pyx_RefNannyDeclarations
  4996. PyObject *__pyx_t_1 = NULL;
  4997. int __pyx_lineno = 0;
  4998. const char *__pyx_filename = NULL;
  4999. int __pyx_clineno = 0;
  5000. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  5001. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
  5002. *
  5003. * cdef inline object PyArray_MultiIterNew1(a):
  5004. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  5005. *
  5006. * cdef inline object PyArray_MultiIterNew2(a, b):
  5007. */
  5008. __Pyx_XDECREF(__pyx_r);
  5009. __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;}
  5010. __Pyx_GOTREF(__pyx_t_1);
  5011. __pyx_r = __pyx_t_1;
  5012. __pyx_t_1 = 0;
  5013. goto __pyx_L0;
  5014. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  5015. * ctypedef npy_cdouble complex_t
  5016. *
  5017. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  5018. * return PyArray_MultiIterNew(1, <void*>a)
  5019. *
  5020. */
  5021. /* function exit code */
  5022. __pyx_L1_error:;
  5023. __Pyx_XDECREF(__pyx_t_1);
  5024. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5025. __pyx_r = 0;
  5026. __pyx_L0:;
  5027. __Pyx_XGIVEREF(__pyx_r);
  5028. __Pyx_RefNannyFinishContext();
  5029. return __pyx_r;
  5030. }
  5031. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  5032. * return PyArray_MultiIterNew(1, <void*>a)
  5033. *
  5034. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  5035. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5036. *
  5037. */
  5038. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  5039. PyObject *__pyx_r = NULL;
  5040. __Pyx_RefNannyDeclarations
  5041. PyObject *__pyx_t_1 = NULL;
  5042. int __pyx_lineno = 0;
  5043. const char *__pyx_filename = NULL;
  5044. int __pyx_clineno = 0;
  5045. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  5046. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
  5047. *
  5048. * cdef inline object PyArray_MultiIterNew2(a, b):
  5049. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  5050. *
  5051. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  5052. */
  5053. __Pyx_XDECREF(__pyx_r);
  5054. __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;}
  5055. __Pyx_GOTREF(__pyx_t_1);
  5056. __pyx_r = __pyx_t_1;
  5057. __pyx_t_1 = 0;
  5058. goto __pyx_L0;
  5059. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  5060. * return PyArray_MultiIterNew(1, <void*>a)
  5061. *
  5062. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  5063. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5064. *
  5065. */
  5066. /* function exit code */
  5067. __pyx_L1_error:;
  5068. __Pyx_XDECREF(__pyx_t_1);
  5069. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5070. __pyx_r = 0;
  5071. __pyx_L0:;
  5072. __Pyx_XGIVEREF(__pyx_r);
  5073. __Pyx_RefNannyFinishContext();
  5074. return __pyx_r;
  5075. }
  5076. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  5077. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5078. *
  5079. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  5080. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5081. *
  5082. */
  5083. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  5084. PyObject *__pyx_r = NULL;
  5085. __Pyx_RefNannyDeclarations
  5086. PyObject *__pyx_t_1 = NULL;
  5087. int __pyx_lineno = 0;
  5088. const char *__pyx_filename = NULL;
  5089. int __pyx_clineno = 0;
  5090. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  5091. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775
  5092. *
  5093. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  5094. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  5095. *
  5096. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  5097. */
  5098. __Pyx_XDECREF(__pyx_r);
  5099. __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;}
  5100. __Pyx_GOTREF(__pyx_t_1);
  5101. __pyx_r = __pyx_t_1;
  5102. __pyx_t_1 = 0;
  5103. goto __pyx_L0;
  5104. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  5105. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  5106. *
  5107. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  5108. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5109. *
  5110. */
  5111. /* function exit code */
  5112. __pyx_L1_error:;
  5113. __Pyx_XDECREF(__pyx_t_1);
  5114. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5115. __pyx_r = 0;
  5116. __pyx_L0:;
  5117. __Pyx_XGIVEREF(__pyx_r);
  5118. __Pyx_RefNannyFinishContext();
  5119. return __pyx_r;
  5120. }
  5121. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  5122. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5123. *
  5124. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  5125. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5126. *
  5127. */
  5128. 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) {
  5129. PyObject *__pyx_r = NULL;
  5130. __Pyx_RefNannyDeclarations
  5131. PyObject *__pyx_t_1 = NULL;
  5132. int __pyx_lineno = 0;
  5133. const char *__pyx_filename = NULL;
  5134. int __pyx_clineno = 0;
  5135. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  5136. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778
  5137. *
  5138. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  5139. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  5140. *
  5141. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  5142. */
  5143. __Pyx_XDECREF(__pyx_r);
  5144. __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;}
  5145. __Pyx_GOTREF(__pyx_t_1);
  5146. __pyx_r = __pyx_t_1;
  5147. __pyx_t_1 = 0;
  5148. goto __pyx_L0;
  5149. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  5150. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  5151. *
  5152. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  5153. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5154. *
  5155. */
  5156. /* function exit code */
  5157. __pyx_L1_error:;
  5158. __Pyx_XDECREF(__pyx_t_1);
  5159. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5160. __pyx_r = 0;
  5161. __pyx_L0:;
  5162. __Pyx_XGIVEREF(__pyx_r);
  5163. __Pyx_RefNannyFinishContext();
  5164. return __pyx_r;
  5165. }
  5166. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  5167. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5168. *
  5169. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  5170. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5171. *
  5172. */
  5173. 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) {
  5174. PyObject *__pyx_r = NULL;
  5175. __Pyx_RefNannyDeclarations
  5176. PyObject *__pyx_t_1 = NULL;
  5177. int __pyx_lineno = 0;
  5178. const char *__pyx_filename = NULL;
  5179. int __pyx_clineno = 0;
  5180. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  5181. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":781
  5182. *
  5183. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  5184. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  5185. *
  5186. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  5187. */
  5188. __Pyx_XDECREF(__pyx_r);
  5189. __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;}
  5190. __Pyx_GOTREF(__pyx_t_1);
  5191. __pyx_r = __pyx_t_1;
  5192. __pyx_t_1 = 0;
  5193. goto __pyx_L0;
  5194. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  5195. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  5196. *
  5197. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  5198. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5199. *
  5200. */
  5201. /* function exit code */
  5202. __pyx_L1_error:;
  5203. __Pyx_XDECREF(__pyx_t_1);
  5204. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5205. __pyx_r = 0;
  5206. __pyx_L0:;
  5207. __Pyx_XGIVEREF(__pyx_r);
  5208. __Pyx_RefNannyFinishContext();
  5209. return __pyx_r;
  5210. }
  5211. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5212. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5213. *
  5214. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5215. * # Recursive utility function used in __getbuffer__ to get format
  5216. * # string. The new location in the format string is returned.
  5217. */
  5218. 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) {
  5219. PyArray_Descr *__pyx_v_child = 0;
  5220. int __pyx_v_endian_detector;
  5221. int __pyx_v_little_endian;
  5222. PyObject *__pyx_v_fields = 0;
  5223. PyObject *__pyx_v_childname = NULL;
  5224. PyObject *__pyx_v_new_offset = NULL;
  5225. PyObject *__pyx_v_t = NULL;
  5226. char *__pyx_r;
  5227. __Pyx_RefNannyDeclarations
  5228. PyObject *__pyx_t_1 = NULL;
  5229. Py_ssize_t __pyx_t_2;
  5230. PyObject *__pyx_t_3 = NULL;
  5231. PyObject *__pyx_t_4 = NULL;
  5232. int __pyx_t_5;
  5233. int __pyx_t_6;
  5234. int __pyx_t_7;
  5235. int __pyx_t_8;
  5236. int __pyx_t_9;
  5237. long __pyx_t_10;
  5238. char *__pyx_t_11;
  5239. int __pyx_lineno = 0;
  5240. const char *__pyx_filename = NULL;
  5241. int __pyx_clineno = 0;
  5242. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  5243. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
  5244. * cdef int delta_offset
  5245. * cdef tuple i
  5246. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  5247. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  5248. * cdef tuple fields
  5249. */
  5250. __pyx_v_endian_detector = 1;
  5251. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
  5252. * cdef tuple i
  5253. * cdef int endian_detector = 1
  5254. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  5255. * cdef tuple fields
  5256. *
  5257. */
  5258. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  5259. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
  5260. * cdef tuple fields
  5261. *
  5262. * for childname in descr.names: # <<<<<<<<<<<<<<
  5263. * fields = descr.fields[childname]
  5264. * child, new_offset = fields
  5265. */
  5266. if (unlikely(__pyx_v_descr->names == Py_None)) {
  5267. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  5268. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5269. }
  5270. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  5271. for (;;) {
  5272. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  5273. #if CYTHON_COMPILING_IN_CPYTHON
  5274. __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;}
  5275. #else
  5276. __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;}
  5277. #endif
  5278. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  5279. __pyx_t_3 = 0;
  5280. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795
  5281. *
  5282. * for childname in descr.names:
  5283. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  5284. * child, new_offset = fields
  5285. *
  5286. */
  5287. __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;};
  5288. __Pyx_GOTREF(__pyx_t_3);
  5289. 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;}
  5290. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  5291. __pyx_t_3 = 0;
  5292. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
  5293. * for childname in descr.names:
  5294. * fields = descr.fields[childname]
  5295. * child, new_offset = fields # <<<<<<<<<<<<<<
  5296. *
  5297. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5298. */
  5299. if (likely(__pyx_v_fields != Py_None)) {
  5300. PyObject* sequence = __pyx_v_fields;
  5301. #if CYTHON_COMPILING_IN_CPYTHON
  5302. Py_ssize_t size = Py_SIZE(sequence);
  5303. #else
  5304. Py_ssize_t size = PySequence_Size(sequence);
  5305. #endif
  5306. if (unlikely(size != 2)) {
  5307. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5308. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5309. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5310. }
  5311. #if CYTHON_COMPILING_IN_CPYTHON
  5312. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  5313. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  5314. __Pyx_INCREF(__pyx_t_3);
  5315. __Pyx_INCREF(__pyx_t_4);
  5316. #else
  5317. __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;}
  5318. __Pyx_GOTREF(__pyx_t_3);
  5319. __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;}
  5320. __Pyx_GOTREF(__pyx_t_4);
  5321. #endif
  5322. } else {
  5323. __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5324. }
  5325. 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;}
  5326. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  5327. __pyx_t_3 = 0;
  5328. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  5329. __pyx_t_4 = 0;
  5330. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
  5331. * child, new_offset = fields
  5332. *
  5333. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  5334. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  5335. *
  5336. */
  5337. __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;}
  5338. __Pyx_GOTREF(__pyx_t_4);
  5339. __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;}
  5340. __Pyx_GOTREF(__pyx_t_3);
  5341. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5342. __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;}
  5343. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5344. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  5345. if (__pyx_t_6) {
  5346. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  5347. *
  5348. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5349. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  5350. *
  5351. * if ((child.byteorder == c'>' and little_endian) or
  5352. */
  5353. __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;}
  5354. __Pyx_GOTREF(__pyx_t_3);
  5355. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5356. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5357. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5358. }
  5359. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
  5360. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  5361. *
  5362. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  5363. * (child.byteorder == c'<' and not little_endian)):
  5364. * raise ValueError(u"Non-native byte order not supported")
  5365. */
  5366. __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
  5367. if (__pyx_t_6) {
  5368. __pyx_t_7 = (__pyx_v_little_endian != 0);
  5369. } else {
  5370. __pyx_t_7 = __pyx_t_6;
  5371. }
  5372. if (!__pyx_t_7) {
  5373. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
  5374. *
  5375. * if ((child.byteorder == c'>' and little_endian) or
  5376. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  5377. * raise ValueError(u"Non-native byte order not supported")
  5378. * # One could encode it in the format string and have Cython
  5379. */
  5380. __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
  5381. if (__pyx_t_6) {
  5382. __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
  5383. __pyx_t_9 = __pyx_t_8;
  5384. } else {
  5385. __pyx_t_9 = __pyx_t_6;
  5386. }
  5387. __pyx_t_6 = __pyx_t_9;
  5388. } else {
  5389. __pyx_t_6 = __pyx_t_7;
  5390. }
  5391. if (__pyx_t_6) {
  5392. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  5393. * if ((child.byteorder == c'>' and little_endian) or
  5394. * (child.byteorder == c'<' and not little_endian)):
  5395. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5396. * # One could encode it in the format string and have Cython
  5397. * # complain instead, BUT: < and > in format strings also imply
  5398. */
  5399. __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;}
  5400. __Pyx_GOTREF(__pyx_t_3);
  5401. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5402. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5403. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5404. }
  5405. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
  5406. *
  5407. * # Output padding bytes
  5408. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  5409. * f[0] = 120 # "x"; pad byte
  5410. * f += 1
  5411. */
  5412. while (1) {
  5413. __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;}
  5414. __Pyx_GOTREF(__pyx_t_3);
  5415. __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;}
  5416. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5417. __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;}
  5418. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5419. if (!__pyx_t_6) break;
  5420. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
  5421. * # Output padding bytes
  5422. * while offset[0] < new_offset:
  5423. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  5424. * f += 1
  5425. * offset[0] += 1
  5426. */
  5427. (__pyx_v_f[0]) = 120;
  5428. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
  5429. * while offset[0] < new_offset:
  5430. * f[0] = 120 # "x"; pad byte
  5431. * f += 1 # <<<<<<<<<<<<<<
  5432. * offset[0] += 1
  5433. *
  5434. */
  5435. __pyx_v_f = (__pyx_v_f + 1);
  5436. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
  5437. * f[0] = 120 # "x"; pad byte
  5438. * f += 1
  5439. * offset[0] += 1 # <<<<<<<<<<<<<<
  5440. *
  5441. * offset[0] += child.itemsize
  5442. */
  5443. __pyx_t_10 = 0;
  5444. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
  5445. }
  5446. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
  5447. * offset[0] += 1
  5448. *
  5449. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  5450. *
  5451. * if not PyDataType_HASFIELDS(child):
  5452. */
  5453. __pyx_t_10 = 0;
  5454. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
  5455. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
  5456. * offset[0] += child.itemsize
  5457. *
  5458. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  5459. * t = child.type_num
  5460. * if end - f < 5:
  5461. */
  5462. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  5463. if (__pyx_t_6) {
  5464. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821
  5465. *
  5466. * if not PyDataType_HASFIELDS(child):
  5467. * t = child.type_num # <<<<<<<<<<<<<<
  5468. * if end - f < 5:
  5469. * raise RuntimeError(u"Format string allocated too short.")
  5470. */
  5471. __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;}
  5472. __Pyx_GOTREF(__pyx_t_4);
  5473. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  5474. __pyx_t_4 = 0;
  5475. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822
  5476. * if not PyDataType_HASFIELDS(child):
  5477. * t = child.type_num
  5478. * if end - f < 5: # <<<<<<<<<<<<<<
  5479. * raise RuntimeError(u"Format string allocated too short.")
  5480. *
  5481. */
  5482. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  5483. if (__pyx_t_6) {
  5484. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  5485. * t = child.type_num
  5486. * if end - f < 5:
  5487. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  5488. *
  5489. * # Until ticket #99 is fixed, use integers to avoid warnings
  5490. */
  5491. __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;}
  5492. __Pyx_GOTREF(__pyx_t_4);
  5493. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  5494. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5495. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5496. }
  5497. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
  5498. *
  5499. * # Until ticket #99 is fixed, use integers to avoid warnings
  5500. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  5501. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5502. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5503. */
  5504. __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;}
  5505. __Pyx_GOTREF(__pyx_t_4);
  5506. __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;}
  5507. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5508. __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;}
  5509. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5510. if (__pyx_t_6) {
  5511. (__pyx_v_f[0]) = 98;
  5512. goto __pyx_L11;
  5513. }
  5514. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827
  5515. * # Until ticket #99 is fixed, use integers to avoid warnings
  5516. * if t == NPY_BYTE: f[0] = 98 #"b"
  5517. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  5518. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5519. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5520. */
  5521. __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;}
  5522. __Pyx_GOTREF(__pyx_t_3);
  5523. __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;}
  5524. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5525. __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;}
  5526. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5527. if (__pyx_t_6) {
  5528. (__pyx_v_f[0]) = 66;
  5529. goto __pyx_L11;
  5530. }
  5531. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828
  5532. * if t == NPY_BYTE: f[0] = 98 #"b"
  5533. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5534. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  5535. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5536. * elif t == NPY_INT: f[0] = 105 #"i"
  5537. */
  5538. __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;}
  5539. __Pyx_GOTREF(__pyx_t_4);
  5540. __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;}
  5541. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5542. __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;}
  5543. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5544. if (__pyx_t_6) {
  5545. (__pyx_v_f[0]) = 104;
  5546. goto __pyx_L11;
  5547. }
  5548. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
  5549. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  5550. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5551. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  5552. * elif t == NPY_INT: f[0] = 105 #"i"
  5553. * elif t == NPY_UINT: f[0] = 73 #"I"
  5554. */
  5555. __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;}
  5556. __Pyx_GOTREF(__pyx_t_3);
  5557. __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;}
  5558. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5559. __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;}
  5560. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5561. if (__pyx_t_6) {
  5562. (__pyx_v_f[0]) = 72;
  5563. goto __pyx_L11;
  5564. }
  5565. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830
  5566. * elif t == NPY_SHORT: f[0] = 104 #"h"
  5567. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5568. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  5569. * elif t == NPY_UINT: f[0] = 73 #"I"
  5570. * elif t == NPY_LONG: f[0] = 108 #"l"
  5571. */
  5572. __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;}
  5573. __Pyx_GOTREF(__pyx_t_4);
  5574. __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;}
  5575. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5576. __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;}
  5577. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5578. if (__pyx_t_6) {
  5579. (__pyx_v_f[0]) = 105;
  5580. goto __pyx_L11;
  5581. }
  5582. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
  5583. * elif t == NPY_USHORT: f[0] = 72 #"H"
  5584. * elif t == NPY_INT: f[0] = 105 #"i"
  5585. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  5586. * elif t == NPY_LONG: f[0] = 108 #"l"
  5587. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5588. */
  5589. __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;}
  5590. __Pyx_GOTREF(__pyx_t_3);
  5591. __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;}
  5592. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5593. __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;}
  5594. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5595. if (__pyx_t_6) {
  5596. (__pyx_v_f[0]) = 73;
  5597. goto __pyx_L11;
  5598. }
  5599. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832
  5600. * elif t == NPY_INT: f[0] = 105 #"i"
  5601. * elif t == NPY_UINT: f[0] = 73 #"I"
  5602. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  5603. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5604. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5605. */
  5606. __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;}
  5607. __Pyx_GOTREF(__pyx_t_4);
  5608. __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;}
  5609. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5610. __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;}
  5611. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5612. if (__pyx_t_6) {
  5613. (__pyx_v_f[0]) = 108;
  5614. goto __pyx_L11;
  5615. }
  5616. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
  5617. * elif t == NPY_UINT: f[0] = 73 #"I"
  5618. * elif t == NPY_LONG: f[0] = 108 #"l"
  5619. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  5620. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5621. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5622. */
  5623. __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;}
  5624. __Pyx_GOTREF(__pyx_t_3);
  5625. __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;}
  5626. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5627. __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;}
  5628. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5629. if (__pyx_t_6) {
  5630. (__pyx_v_f[0]) = 76;
  5631. goto __pyx_L11;
  5632. }
  5633. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834
  5634. * elif t == NPY_LONG: f[0] = 108 #"l"
  5635. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5636. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  5637. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5638. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5639. */
  5640. __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;}
  5641. __Pyx_GOTREF(__pyx_t_4);
  5642. __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;}
  5643. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5644. __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;}
  5645. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5646. if (__pyx_t_6) {
  5647. (__pyx_v_f[0]) = 113;
  5648. goto __pyx_L11;
  5649. }
  5650. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
  5651. * elif t == NPY_ULONG: f[0] = 76 #"L"
  5652. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5653. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  5654. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5655. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5656. */
  5657. __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;}
  5658. __Pyx_GOTREF(__pyx_t_3);
  5659. __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;}
  5660. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5661. __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;}
  5662. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5663. if (__pyx_t_6) {
  5664. (__pyx_v_f[0]) = 81;
  5665. goto __pyx_L11;
  5666. }
  5667. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836
  5668. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  5669. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5670. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  5671. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5672. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5673. */
  5674. __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;}
  5675. __Pyx_GOTREF(__pyx_t_4);
  5676. __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;}
  5677. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5678. __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;}
  5679. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5680. if (__pyx_t_6) {
  5681. (__pyx_v_f[0]) = 102;
  5682. goto __pyx_L11;
  5683. }
  5684. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
  5685. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  5686. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5687. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  5688. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5689. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5690. */
  5691. __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;}
  5692. __Pyx_GOTREF(__pyx_t_3);
  5693. __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;}
  5694. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5695. __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;}
  5696. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5697. if (__pyx_t_6) {
  5698. (__pyx_v_f[0]) = 100;
  5699. goto __pyx_L11;
  5700. }
  5701. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
  5702. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5703. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5704. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  5705. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5706. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5707. */
  5708. __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;}
  5709. __Pyx_GOTREF(__pyx_t_4);
  5710. __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;}
  5711. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5712. __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;}
  5713. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5714. if (__pyx_t_6) {
  5715. (__pyx_v_f[0]) = 103;
  5716. goto __pyx_L11;
  5717. }
  5718. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
  5719. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5720. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5721. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  5722. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5723. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5724. */
  5725. __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;}
  5726. __Pyx_GOTREF(__pyx_t_3);
  5727. __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;}
  5728. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5729. __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;}
  5730. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5731. if (__pyx_t_6) {
  5732. (__pyx_v_f[0]) = 90;
  5733. (__pyx_v_f[1]) = 102;
  5734. __pyx_v_f = (__pyx_v_f + 1);
  5735. goto __pyx_L11;
  5736. }
  5737. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
  5738. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5739. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5740. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  5741. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5742. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5743. */
  5744. __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;}
  5745. __Pyx_GOTREF(__pyx_t_4);
  5746. __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;}
  5747. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5748. __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;}
  5749. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5750. if (__pyx_t_6) {
  5751. (__pyx_v_f[0]) = 90;
  5752. (__pyx_v_f[1]) = 100;
  5753. __pyx_v_f = (__pyx_v_f + 1);
  5754. goto __pyx_L11;
  5755. }
  5756. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
  5757. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5758. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5759. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  5760. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5761. * else:
  5762. */
  5763. __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;}
  5764. __Pyx_GOTREF(__pyx_t_3);
  5765. __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;}
  5766. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5767. __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;}
  5768. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5769. if (__pyx_t_6) {
  5770. (__pyx_v_f[0]) = 90;
  5771. (__pyx_v_f[1]) = 103;
  5772. __pyx_v_f = (__pyx_v_f + 1);
  5773. goto __pyx_L11;
  5774. }
  5775. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
  5776. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5777. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5778. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  5779. * else:
  5780. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5781. */
  5782. __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;}
  5783. __Pyx_GOTREF(__pyx_t_4);
  5784. __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;}
  5785. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5786. __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;}
  5787. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5788. if (__pyx_t_6) {
  5789. (__pyx_v_f[0]) = 79;
  5790. goto __pyx_L11;
  5791. }
  5792. /*else*/ {
  5793. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844
  5794. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5795. * else:
  5796. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  5797. * f += 1
  5798. * else:
  5799. */
  5800. __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;}
  5801. __Pyx_GOTREF(__pyx_t_3);
  5802. __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;}
  5803. __Pyx_GOTREF(__pyx_t_4);
  5804. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  5805. __Pyx_GIVEREF(__pyx_t_3);
  5806. __pyx_t_3 = 0;
  5807. __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;}
  5808. __Pyx_GOTREF(__pyx_t_3);
  5809. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5810. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5811. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5812. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5813. }
  5814. __pyx_L11:;
  5815. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
  5816. * else:
  5817. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5818. * f += 1 # <<<<<<<<<<<<<<
  5819. * else:
  5820. * # Cython ignores struct boundary information ("T{...}"),
  5821. */
  5822. __pyx_v_f = (__pyx_v_f + 1);
  5823. goto __pyx_L9;
  5824. }
  5825. /*else*/ {
  5826. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
  5827. * # Cython ignores struct boundary information ("T{...}"),
  5828. * # so don't output it
  5829. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  5830. * return f
  5831. *
  5832. */
  5833. __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;}
  5834. __pyx_v_f = __pyx_t_11;
  5835. }
  5836. __pyx_L9:;
  5837. }
  5838. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5839. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
  5840. * # so don't output it
  5841. * f = _util_dtypestring(child, f, end, offset)
  5842. * return f # <<<<<<<<<<<<<<
  5843. *
  5844. *
  5845. */
  5846. __pyx_r = __pyx_v_f;
  5847. goto __pyx_L0;
  5848. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5849. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5850. *
  5851. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5852. * # Recursive utility function used in __getbuffer__ to get format
  5853. * # string. The new location in the format string is returned.
  5854. */
  5855. /* function exit code */
  5856. __pyx_L1_error:;
  5857. __Pyx_XDECREF(__pyx_t_1);
  5858. __Pyx_XDECREF(__pyx_t_3);
  5859. __Pyx_XDECREF(__pyx_t_4);
  5860. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5861. __pyx_r = NULL;
  5862. __pyx_L0:;
  5863. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  5864. __Pyx_XDECREF(__pyx_v_fields);
  5865. __Pyx_XDECREF(__pyx_v_childname);
  5866. __Pyx_XDECREF(__pyx_v_new_offset);
  5867. __Pyx_XDECREF(__pyx_v_t);
  5868. __Pyx_RefNannyFinishContext();
  5869. return __pyx_r;
  5870. }
  5871. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5872. *
  5873. *
  5874. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5875. * cdef PyObject* baseptr
  5876. * if base is None:
  5877. */
  5878. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  5879. PyObject *__pyx_v_baseptr;
  5880. __Pyx_RefNannyDeclarations
  5881. int __pyx_t_1;
  5882. int __pyx_t_2;
  5883. __Pyx_RefNannySetupContext("set_array_base", 0);
  5884. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
  5885. * cdef inline void set_array_base(ndarray arr, object base):
  5886. * cdef PyObject* baseptr
  5887. * if base is None: # <<<<<<<<<<<<<<
  5888. * baseptr = NULL
  5889. * else:
  5890. */
  5891. __pyx_t_1 = (__pyx_v_base == Py_None);
  5892. __pyx_t_2 = (__pyx_t_1 != 0);
  5893. if (__pyx_t_2) {
  5894. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
  5895. * cdef PyObject* baseptr
  5896. * if base is None:
  5897. * baseptr = NULL # <<<<<<<<<<<<<<
  5898. * else:
  5899. * Py_INCREF(base) # important to do this before decref below!
  5900. */
  5901. __pyx_v_baseptr = NULL;
  5902. goto __pyx_L3;
  5903. }
  5904. /*else*/ {
  5905. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
  5906. * baseptr = NULL
  5907. * else:
  5908. * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
  5909. * baseptr = <PyObject*>base
  5910. * Py_XDECREF(arr.base)
  5911. */
  5912. Py_INCREF(__pyx_v_base);
  5913. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
  5914. * else:
  5915. * Py_INCREF(base) # important to do this before decref below!
  5916. * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
  5917. * Py_XDECREF(arr.base)
  5918. * arr.base = baseptr
  5919. */
  5920. __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  5921. }
  5922. __pyx_L3:;
  5923. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
  5924. * Py_INCREF(base) # important to do this before decref below!
  5925. * baseptr = <PyObject*>base
  5926. * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
  5927. * arr.base = baseptr
  5928. *
  5929. */
  5930. Py_XDECREF(__pyx_v_arr->base);
  5931. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
  5932. * baseptr = <PyObject*>base
  5933. * Py_XDECREF(arr.base)
  5934. * arr.base = baseptr # <<<<<<<<<<<<<<
  5935. *
  5936. * cdef inline object get_array_base(ndarray arr):
  5937. */
  5938. __pyx_v_arr->base = __pyx_v_baseptr;
  5939. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5940. *
  5941. *
  5942. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5943. * cdef PyObject* baseptr
  5944. * if base is None:
  5945. */
  5946. /* function exit code */
  5947. __Pyx_RefNannyFinishContext();
  5948. }
  5949. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5950. * arr.base = baseptr
  5951. *
  5952. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5953. * if arr.base is NULL:
  5954. * return None
  5955. */
  5956. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  5957. PyObject *__pyx_r = NULL;
  5958. __Pyx_RefNannyDeclarations
  5959. int __pyx_t_1;
  5960. __Pyx_RefNannySetupContext("get_array_base", 0);
  5961. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
  5962. *
  5963. * cdef inline object get_array_base(ndarray arr):
  5964. * if arr.base is NULL: # <<<<<<<<<<<<<<
  5965. * return None
  5966. * else:
  5967. */
  5968. __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  5969. if (__pyx_t_1) {
  5970. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
  5971. * cdef inline object get_array_base(ndarray arr):
  5972. * if arr.base is NULL:
  5973. * return None # <<<<<<<<<<<<<<
  5974. * else:
  5975. * return <object>arr.base
  5976. */
  5977. __Pyx_XDECREF(__pyx_r);
  5978. __Pyx_INCREF(Py_None);
  5979. __pyx_r = Py_None;
  5980. goto __pyx_L0;
  5981. }
  5982. /*else*/ {
  5983. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
  5984. * return None
  5985. * else:
  5986. * return <object>arr.base # <<<<<<<<<<<<<<
  5987. */
  5988. __Pyx_XDECREF(__pyx_r);
  5989. __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
  5990. __pyx_r = ((PyObject *)__pyx_v_arr->base);
  5991. goto __pyx_L0;
  5992. }
  5993. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5994. * arr.base = baseptr
  5995. *
  5996. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5997. * if arr.base is NULL:
  5998. * return None
  5999. */
  6000. /* function exit code */
  6001. __pyx_L0:;
  6002. __Pyx_XGIVEREF(__pyx_r);
  6003. __Pyx_RefNannyFinishContext();
  6004. return __pyx_r;
  6005. }
  6006. /* "vector.from_py":45
  6007. *
  6008. * @cname("__pyx_convert_vector_from_py_double")
  6009. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  6010. * cdef vector[X] v
  6011. * for item in o:
  6012. */
  6013. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  6014. std::vector<double> __pyx_v_v;
  6015. PyObject *__pyx_v_item = NULL;
  6016. std::vector<double> __pyx_r;
  6017. __Pyx_RefNannyDeclarations
  6018. PyObject *__pyx_t_1 = NULL;
  6019. Py_ssize_t __pyx_t_2;
  6020. PyObject *(*__pyx_t_3)(PyObject *);
  6021. PyObject *__pyx_t_4 = NULL;
  6022. double __pyx_t_5;
  6023. int __pyx_lineno = 0;
  6024. const char *__pyx_filename = NULL;
  6025. int __pyx_clineno = 0;
  6026. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  6027. /* "vector.from_py":47
  6028. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  6029. * cdef vector[X] v
  6030. * for item in o: # <<<<<<<<<<<<<<
  6031. * v.push_back(X_from_py(item))
  6032. * return v
  6033. */
  6034. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  6035. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  6036. __pyx_t_3 = NULL;
  6037. } else {
  6038. __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;}
  6039. __Pyx_GOTREF(__pyx_t_1);
  6040. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  6041. }
  6042. for (;;) {
  6043. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  6044. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  6045. #if CYTHON_COMPILING_IN_CPYTHON
  6046. __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;}
  6047. #else
  6048. __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;}
  6049. #endif
  6050. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  6051. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  6052. #if CYTHON_COMPILING_IN_CPYTHON
  6053. __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;}
  6054. #else
  6055. __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;}
  6056. #endif
  6057. } else {
  6058. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  6059. if (unlikely(!__pyx_t_4)) {
  6060. PyObject* exc_type = PyErr_Occurred();
  6061. if (exc_type) {
  6062. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6063. else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6064. }
  6065. break;
  6066. }
  6067. __Pyx_GOTREF(__pyx_t_4);
  6068. }
  6069. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  6070. __pyx_t_4 = 0;
  6071. /* "vector.from_py":48
  6072. * cdef vector[X] v
  6073. * for item in o:
  6074. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  6075. * return v
  6076. *
  6077. */
  6078. __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;}
  6079. __pyx_v_v.push_back(__pyx_t_5);
  6080. }
  6081. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6082. /* "vector.from_py":49
  6083. * for item in o:
  6084. * v.push_back(X_from_py(item))
  6085. * return v # <<<<<<<<<<<<<<
  6086. *
  6087. *
  6088. */
  6089. __pyx_r = __pyx_v_v;
  6090. goto __pyx_L0;
  6091. /* "vector.from_py":45
  6092. *
  6093. * @cname("__pyx_convert_vector_from_py_double")
  6094. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  6095. * cdef vector[X] v
  6096. * for item in o:
  6097. */
  6098. /* function exit code */
  6099. __pyx_L1_error:;
  6100. __Pyx_XDECREF(__pyx_t_1);
  6101. __Pyx_XDECREF(__pyx_t_4);
  6102. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6103. __pyx_L0:;
  6104. __Pyx_XDECREF(__pyx_v_item);
  6105. __Pyx_RefNannyFinishContext();
  6106. return __pyx_r;
  6107. }
  6108. /* "vector.from_py":46
  6109. *
  6110. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6111. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6112. * cdef vector[X] v
  6113. * for item in o:
  6114. */
  6115. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *__pyx_v_o) {
  6116. std::vector<__pyx_t_double_complex> __pyx_v_v;
  6117. PyObject *__pyx_v_item = NULL;
  6118. std::vector<__pyx_t_double_complex> __pyx_r;
  6119. __Pyx_RefNannyDeclarations
  6120. PyObject *__pyx_t_1 = NULL;
  6121. Py_ssize_t __pyx_t_2;
  6122. PyObject *(*__pyx_t_3)(PyObject *);
  6123. PyObject *__pyx_t_4 = NULL;
  6124. __pyx_t_double_complex __pyx_t_5;
  6125. int __pyx_lineno = 0;
  6126. const char *__pyx_filename = NULL;
  6127. int __pyx_clineno = 0;
  6128. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_double_complex", 0);
  6129. /* "vector.from_py":48
  6130. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *:
  6131. * cdef vector[X] v
  6132. * for item in o: # <<<<<<<<<<<<<<
  6133. * v.push_back(X_from_py(item))
  6134. * return v
  6135. */
  6136. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  6137. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  6138. __pyx_t_3 = NULL;
  6139. } else {
  6140. __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;}
  6141. __Pyx_GOTREF(__pyx_t_1);
  6142. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  6143. }
  6144. for (;;) {
  6145. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  6146. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  6147. #if CYTHON_COMPILING_IN_CPYTHON
  6148. __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;}
  6149. #else
  6150. __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;}
  6151. #endif
  6152. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  6153. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  6154. #if CYTHON_COMPILING_IN_CPYTHON
  6155. __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;}
  6156. #else
  6157. __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;}
  6158. #endif
  6159. } else {
  6160. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  6161. if (unlikely(!__pyx_t_4)) {
  6162. PyObject* exc_type = PyErr_Occurred();
  6163. if (exc_type) {
  6164. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6165. else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6166. }
  6167. break;
  6168. }
  6169. __Pyx_GOTREF(__pyx_t_4);
  6170. }
  6171. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  6172. __pyx_t_4 = 0;
  6173. /* "vector.from_py":49
  6174. * cdef vector[X] v
  6175. * for item in o:
  6176. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  6177. * return v
  6178. *
  6179. */
  6180. __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;}
  6181. __pyx_v_v.push_back(__pyx_t_5);
  6182. }
  6183. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6184. /* "vector.from_py":50
  6185. * for item in o:
  6186. * v.push_back(X_from_py(item))
  6187. * return v # <<<<<<<<<<<<<<
  6188. *
  6189. *
  6190. */
  6191. __pyx_r = __pyx_v_v;
  6192. goto __pyx_L0;
  6193. /* "vector.from_py":46
  6194. *
  6195. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6196. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6197. * cdef vector[X] v
  6198. * for item in o:
  6199. */
  6200. /* function exit code */
  6201. __pyx_L1_error:;
  6202. __Pyx_XDECREF(__pyx_t_1);
  6203. __Pyx_XDECREF(__pyx_t_4);
  6204. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_double_complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6205. __pyx_L0:;
  6206. __Pyx_XDECREF(__pyx_v_item);
  6207. __Pyx_RefNannyFinishContext();
  6208. return __pyx_r;
  6209. }
  6210. static PyMethodDef __pyx_methods[] = {
  6211. {0, 0, 0, 0}
  6212. };
  6213. #if PY_MAJOR_VERSION >= 3
  6214. static struct PyModuleDef __pyx_moduledef = {
  6215. #if PY_VERSION_HEX < 0x03020000
  6216. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  6217. #else
  6218. PyModuleDef_HEAD_INIT,
  6219. #endif
  6220. __Pyx_NAMESTR("scattnlay"),
  6221. 0, /* m_doc */
  6222. -1, /* m_size */
  6223. __pyx_methods /* m_methods */,
  6224. NULL, /* m_reload */
  6225. NULL, /* m_traverse */
  6226. NULL, /* m_clear */
  6227. NULL /* m_free */
  6228. };
  6229. #endif
  6230. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  6231. {&__pyx_n_s_Albedo, __pyx_k_Albedo, sizeof(__pyx_k_Albedo), 0, 0, 1, 1},
  6232. {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  6233. {&__pyx_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
  6234. {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
  6235. {&__pyx_n_s_Eix, __pyx_k_Eix, sizeof(__pyx_k_Eix), 0, 0, 1, 1},
  6236. {&__pyx_n_s_Eiy, __pyx_k_Eiy, sizeof(__pyx_k_Eiy), 0, 0, 1, 1},
  6237. {&__pyx_n_s_Eiz, __pyx_k_Eiz, sizeof(__pyx_k_Eiz), 0, 0, 1, 1},
  6238. {&__pyx_n_s_Erx, __pyx_k_Erx, sizeof(__pyx_k_Erx), 0, 0, 1, 1},
  6239. {&__pyx_n_s_Ery, __pyx_k_Ery, sizeof(__pyx_k_Ery), 0, 0, 1, 1},
  6240. {&__pyx_n_s_Erz, __pyx_k_Erz, sizeof(__pyx_k_Erz), 0, 0, 1, 1},
  6241. {&__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},
  6242. {&__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},
  6243. {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
  6244. {&__pyx_n_s_Hix, __pyx_k_Hix, sizeof(__pyx_k_Hix), 0, 0, 1, 1},
  6245. {&__pyx_n_s_Hiy, __pyx_k_Hiy, sizeof(__pyx_k_Hiy), 0, 0, 1, 1},
  6246. {&__pyx_n_s_Hiz, __pyx_k_Hiz, sizeof(__pyx_k_Hiz), 0, 0, 1, 1},
  6247. {&__pyx_n_s_Hrx, __pyx_k_Hrx, sizeof(__pyx_k_Hrx), 0, 0, 1, 1},
  6248. {&__pyx_n_s_Hry, __pyx_k_Hry, sizeof(__pyx_k_Hry), 0, 0, 1, 1},
  6249. {&__pyx_n_s_Hrz, __pyx_k_Hrz, sizeof(__pyx_k_Hrz), 0, 0, 1, 1},
  6250. {&__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},
  6251. {&__pyx_n_s_Qabs, __pyx_k_Qabs, sizeof(__pyx_k_Qabs), 0, 0, 1, 1},
  6252. {&__pyx_n_s_Qbk, __pyx_k_Qbk, sizeof(__pyx_k_Qbk), 0, 0, 1, 1},
  6253. {&__pyx_n_s_Qext, __pyx_k_Qext, sizeof(__pyx_k_Qext), 0, 0, 1, 1},
  6254. {&__pyx_n_s_Qpr, __pyx_k_Qpr, sizeof(__pyx_k_Qpr), 0, 0, 1, 1},
  6255. {&__pyx_n_s_Qsca, __pyx_k_Qsca, sizeof(__pyx_k_Qsca), 0, 0, 1, 1},
  6256. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  6257. {&__pyx_n_s_S1, __pyx_k_S1, sizeof(__pyx_k_S1), 0, 0, 1, 1},
  6258. {&__pyx_n_s_S1i, __pyx_k_S1i, sizeof(__pyx_k_S1i), 0, 0, 1, 1},
  6259. {&__pyx_n_s_S1r, __pyx_k_S1r, sizeof(__pyx_k_S1r), 0, 0, 1, 1},
  6260. {&__pyx_n_s_S2, __pyx_k_S2, sizeof(__pyx_k_S2), 0, 0, 1, 1},
  6261. {&__pyx_n_s_S2i, __pyx_k_S2i, sizeof(__pyx_k_S2i), 0, 0, 1, 1},
  6262. {&__pyx_n_s_S2r, __pyx_k_S2r, sizeof(__pyx_k_S2r), 0, 0, 1, 1},
  6263. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  6264. {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1},
  6265. {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  6266. {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  6267. {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  6268. {&__pyx_n_s_fieldnlay, __pyx_k_fieldnlay, sizeof(__pyx_k_fieldnlay), 0, 0, 1, 1},
  6269. {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  6270. {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  6271. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  6272. {&__pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_k_home_ovidio_scattering_scattnla, sizeof(__pyx_k_home_ovidio_scattering_scattnla), 0, 0, 1, 0},
  6273. {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  6274. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  6275. {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  6276. {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  6277. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  6278. {&__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},
  6279. {&__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},
  6280. {&__pyx_n_s_nmax, __pyx_k_nmax, sizeof(__pyx_k_nmax), 0, 0, 1, 1},
  6281. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  6282. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  6283. {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
  6284. {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  6285. {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1},
  6286. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  6287. {&__pyx_n_s_scattnlay, __pyx_k_scattnlay, sizeof(__pyx_k_scattnlay), 0, 0, 1, 1},
  6288. {&__pyx_n_s_terms, __pyx_k_terms, sizeof(__pyx_k_terms), 0, 0, 1, 1},
  6289. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  6290. {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  6291. {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1},
  6292. {&__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},
  6293. {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
  6294. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  6295. {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  6296. {0, 0, 0, 0, 0, 0, 0}
  6297. };
  6298. static int __Pyx_InitCachedBuiltins(void) {
  6299. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6300. __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;}
  6301. __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;}
  6302. return 0;
  6303. __pyx_L1_error:;
  6304. return -1;
  6305. }
  6306. static int __Pyx_InitCachedConstants(void) {
  6307. __Pyx_RefNannyDeclarations
  6308. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  6309. /* "scattnlay.pyx":38
  6310. *
  6311. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  6312. * a = a.copy('C') # <<<<<<<<<<<<<<
  6313. *
  6314. * # Return data pointer
  6315. */
  6316. __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6317. __Pyx_GOTREF(__pyx_tuple_);
  6318. __Pyx_GIVEREF(__pyx_tuple_);
  6319. /* "scattnlay.pyx":74
  6320. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  6321. *
  6322. * 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)) # <<<<<<<<<<<<<<
  6323. *
  6324. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  6325. */
  6326. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6327. __Pyx_GOTREF(__pyx_tuple__3);
  6328. __Pyx_GIVEREF(__pyx_tuple__3);
  6329. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6330. __Pyx_GOTREF(__pyx_tuple__4);
  6331. __Pyx_GIVEREF(__pyx_tuple__4);
  6332. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6333. __Pyx_GOTREF(__pyx_tuple__5);
  6334. __Pyx_GIVEREF(__pyx_tuple__5);
  6335. /* "scattnlay.pyx":76
  6336. * 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))
  6337. *
  6338. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  6339. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  6340. *
  6341. */
  6342. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6343. __Pyx_GOTREF(__pyx_tuple__6);
  6344. __Pyx_GIVEREF(__pyx_tuple__6);
  6345. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6346. __Pyx_GOTREF(__pyx_tuple__7);
  6347. __Pyx_GIVEREF(__pyx_tuple__7);
  6348. /* "scattnlay.pyx":77
  6349. *
  6350. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  6351. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  6352. *
  6353. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  6354. */
  6355. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6356. __Pyx_GOTREF(__pyx_tuple__8);
  6357. __Pyx_GIVEREF(__pyx_tuple__8);
  6358. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6359. __Pyx_GOTREF(__pyx_tuple__9);
  6360. __Pyx_GIVEREF(__pyx_tuple__9);
  6361. /* "scattnlay.pyx":117
  6362. * Hiz = np.zeros(coords.shape[0], dtype = np.float64)
  6363. *
  6364. * 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)) # <<<<<<<<<<<<<<
  6365. *
  6366. * 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()
  6367. */
  6368. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6369. __Pyx_GOTREF(__pyx_tuple__10);
  6370. __Pyx_GIVEREF(__pyx_tuple__10);
  6371. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6372. __Pyx_GOTREF(__pyx_tuple__11);
  6373. __Pyx_GIVEREF(__pyx_tuple__11);
  6374. __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6375. __Pyx_GOTREF(__pyx_slice__12);
  6376. __Pyx_GIVEREF(__pyx_slice__12);
  6377. __pyx_tuple__13 = PyTuple_Pack(2, __pyx_slice__12, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6378. __Pyx_GOTREF(__pyx_tuple__13);
  6379. __Pyx_GIVEREF(__pyx_tuple__13);
  6380. __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6381. __Pyx_GOTREF(__pyx_tuple__14);
  6382. __Pyx_GIVEREF(__pyx_tuple__14);
  6383. __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6384. __Pyx_GOTREF(__pyx_slice__15);
  6385. __Pyx_GIVEREF(__pyx_slice__15);
  6386. __pyx_tuple__16 = PyTuple_Pack(2, __pyx_slice__15, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6387. __Pyx_GOTREF(__pyx_tuple__16);
  6388. __Pyx_GIVEREF(__pyx_tuple__16);
  6389. __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6390. __Pyx_GOTREF(__pyx_tuple__17);
  6391. __Pyx_GIVEREF(__pyx_tuple__17);
  6392. __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6393. __Pyx_GOTREF(__pyx_slice__18);
  6394. __Pyx_GIVEREF(__pyx_slice__18);
  6395. __pyx_tuple__19 = PyTuple_Pack(2, __pyx_slice__18, __pyx_int_2); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6396. __Pyx_GOTREF(__pyx_tuple__19);
  6397. __Pyx_GIVEREF(__pyx_tuple__19);
  6398. __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6399. __Pyx_GOTREF(__pyx_tuple__20);
  6400. __Pyx_GIVEREF(__pyx_tuple__20);
  6401. /* "scattnlay.pyx":119
  6402. * 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))
  6403. *
  6404. * 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() # <<<<<<<<<<<<<<
  6405. * 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()
  6406. *
  6407. */
  6408. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6409. __Pyx_GOTREF(__pyx_tuple__21);
  6410. __Pyx_GIVEREF(__pyx_tuple__21);
  6411. __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6412. __Pyx_GOTREF(__pyx_tuple__22);
  6413. __Pyx_GIVEREF(__pyx_tuple__22);
  6414. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6415. __Pyx_GOTREF(__pyx_tuple__23);
  6416. __Pyx_GIVEREF(__pyx_tuple__23);
  6417. __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6418. __Pyx_GOTREF(__pyx_tuple__24);
  6419. __Pyx_GIVEREF(__pyx_tuple__24);
  6420. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6421. __Pyx_GOTREF(__pyx_tuple__25);
  6422. __Pyx_GIVEREF(__pyx_tuple__25);
  6423. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6424. __Pyx_GOTREF(__pyx_tuple__26);
  6425. __Pyx_GIVEREF(__pyx_tuple__26);
  6426. /* "scattnlay.pyx":120
  6427. *
  6428. * 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()
  6429. * 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() # <<<<<<<<<<<<<<
  6430. *
  6431. * return terms, E, H
  6432. */
  6433. __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6434. __Pyx_GOTREF(__pyx_tuple__27);
  6435. __Pyx_GIVEREF(__pyx_tuple__27);
  6436. __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6437. __Pyx_GOTREF(__pyx_tuple__28);
  6438. __Pyx_GIVEREF(__pyx_tuple__28);
  6439. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6440. __Pyx_GOTREF(__pyx_tuple__29);
  6441. __Pyx_GIVEREF(__pyx_tuple__29);
  6442. __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6443. __Pyx_GOTREF(__pyx_tuple__30);
  6444. __Pyx_GIVEREF(__pyx_tuple__30);
  6445. __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6446. __Pyx_GOTREF(__pyx_tuple__31);
  6447. __Pyx_GIVEREF(__pyx_tuple__31);
  6448. __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6449. __Pyx_GOTREF(__pyx_tuple__32);
  6450. __Pyx_GIVEREF(__pyx_tuple__32);
  6451. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  6452. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  6453. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  6454. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  6455. *
  6456. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  6457. */
  6458. __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;}
  6459. __Pyx_GOTREF(__pyx_tuple__33);
  6460. __Pyx_GIVEREF(__pyx_tuple__33);
  6461. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  6462. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  6463. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  6464. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  6465. *
  6466. * info.buf = PyArray_DATA(self)
  6467. */
  6468. __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;}
  6469. __Pyx_GOTREF(__pyx_tuple__34);
  6470. __Pyx_GIVEREF(__pyx_tuple__34);
  6471. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  6472. * if ((descr.byteorder == c'>' and little_endian) or
  6473. * (descr.byteorder == c'<' and not little_endian)):
  6474. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  6475. * if t == NPY_BYTE: f = "b"
  6476. * elif t == NPY_UBYTE: f = "B"
  6477. */
  6478. __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;}
  6479. __Pyx_GOTREF(__pyx_tuple__35);
  6480. __Pyx_GIVEREF(__pyx_tuple__35);
  6481. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  6482. *
  6483. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  6484. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  6485. *
  6486. * if ((child.byteorder == c'>' and little_endian) or
  6487. */
  6488. __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;}
  6489. __Pyx_GOTREF(__pyx_tuple__36);
  6490. __Pyx_GIVEREF(__pyx_tuple__36);
  6491. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  6492. * if ((child.byteorder == c'>' and little_endian) or
  6493. * (child.byteorder == c'<' and not little_endian)):
  6494. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  6495. * # One could encode it in the format string and have Cython
  6496. * # complain instead, BUT: < and > in format strings also imply
  6497. */
  6498. __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;}
  6499. __Pyx_GOTREF(__pyx_tuple__37);
  6500. __Pyx_GIVEREF(__pyx_tuple__37);
  6501. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  6502. * t = child.type_num
  6503. * if end - f < 5:
  6504. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  6505. *
  6506. * # Until ticket #99 is fixed, use integers to avoid warnings
  6507. */
  6508. __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;}
  6509. __Pyx_GOTREF(__pyx_tuple__38);
  6510. __Pyx_GIVEREF(__pyx_tuple__38);
  6511. /* "scattnlay.pyx":47
  6512. * 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[])
  6513. *
  6514. * 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): # <<<<<<<<<<<<<<
  6515. * cdef Py_ssize_t i
  6516. *
  6517. */
  6518. __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6519. __Pyx_GOTREF(__pyx_tuple__39);
  6520. __Pyx_GIVEREF(__pyx_tuple__39);
  6521. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6522. __Pyx_GOTREF(__pyx_tuple__40);
  6523. __Pyx_GIVEREF(__pyx_tuple__40);
  6524. __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, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6525. /* "scattnlay.pyx":82
  6526. *
  6527. * #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):
  6528. * 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): # <<<<<<<<<<<<<<
  6529. * cdef Py_ssize_t i
  6530. *
  6531. */
  6532. __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6533. __Pyx_GOTREF(__pyx_tuple__42);
  6534. __Pyx_GIVEREF(__pyx_tuple__42);
  6535. __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, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6536. __Pyx_RefNannyFinishContext();
  6537. return 0;
  6538. __pyx_L1_error:;
  6539. __Pyx_RefNannyFinishContext();
  6540. return -1;
  6541. }
  6542. static int __Pyx_InitGlobals(void) {
  6543. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  6544. __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;}
  6545. __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;}
  6546. __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;}
  6547. __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;}
  6548. return 0;
  6549. __pyx_L1_error:;
  6550. return -1;
  6551. }
  6552. #if PY_MAJOR_VERSION < 3
  6553. PyMODINIT_FUNC initscattnlay(void); /*proto*/
  6554. PyMODINIT_FUNC initscattnlay(void)
  6555. #else
  6556. PyMODINIT_FUNC PyInit_scattnlay(void); /*proto*/
  6557. PyMODINIT_FUNC PyInit_scattnlay(void)
  6558. #endif
  6559. {
  6560. PyObject *__pyx_t_1 = NULL;
  6561. PyObject *__pyx_t_2 = NULL;
  6562. PyObject *__pyx_t_3 = NULL;
  6563. PyObject *__pyx_t_4 = NULL;
  6564. int __pyx_lineno = 0;
  6565. const char *__pyx_filename = NULL;
  6566. int __pyx_clineno = 0;
  6567. __Pyx_RefNannyDeclarations
  6568. #if CYTHON_REFNANNY
  6569. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  6570. if (!__Pyx_RefNanny) {
  6571. PyErr_Clear();
  6572. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  6573. if (!__Pyx_RefNanny)
  6574. Py_FatalError("failed to import 'refnanny' module");
  6575. }
  6576. #endif
  6577. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scattnlay(void)", 0);
  6578. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6579. __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;}
  6580. __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;}
  6581. #ifdef __Pyx_CyFunction_USED
  6582. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6583. #endif
  6584. #ifdef __Pyx_FusedFunction_USED
  6585. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6586. #endif
  6587. #ifdef __Pyx_Generator_USED
  6588. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6589. #endif
  6590. /*--- Library function declarations ---*/
  6591. /*--- Threads initialization code ---*/
  6592. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  6593. #ifdef WITH_THREAD /* Python build with threading support? */
  6594. PyEval_InitThreads();
  6595. #endif
  6596. #endif
  6597. /*--- Module creation code ---*/
  6598. #if PY_MAJOR_VERSION < 3
  6599. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("scattnlay"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  6600. #else
  6601. __pyx_m = PyModule_Create(&__pyx_moduledef);
  6602. #endif
  6603. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6604. __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;}
  6605. Py_INCREF(__pyx_d);
  6606. __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;}
  6607. #if CYTHON_COMPILING_IN_PYPY
  6608. Py_INCREF(__pyx_b);
  6609. #endif
  6610. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  6611. /*--- Initialize various global constants etc. ---*/
  6612. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6613. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  6614. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6615. #endif
  6616. if (__pyx_module_is_main_scattnlay) {
  6617. 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;};
  6618. }
  6619. #if PY_MAJOR_VERSION >= 3
  6620. {
  6621. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6622. if (!PyDict_GetItemString(modules, "scattnlay")) {
  6623. if (unlikely(PyDict_SetItemString(modules, "scattnlay", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6624. }
  6625. }
  6626. #endif
  6627. /*--- Builtin init code ---*/
  6628. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6629. /*--- Constants init code ---*/
  6630. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6631. /*--- Global init code ---*/
  6632. /*--- Variable export code ---*/
  6633. /*--- Function export code ---*/
  6634. /*--- Type init code ---*/
  6635. /*--- Type import code ---*/
  6636. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
  6637. #if CYTHON_COMPILING_IN_PYPY
  6638. sizeof(PyTypeObject),
  6639. #else
  6640. sizeof(PyHeapTypeObject),
  6641. #endif
  6642. 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6643. __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;}
  6644. __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;}
  6645. __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;}
  6646. __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;}
  6647. __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;}
  6648. /*--- Variable import code ---*/
  6649. /*--- Function import code ---*/
  6650. /*--- Execution code ---*/
  6651. /* "scattnlay.pyx":29
  6652. *
  6653. * from __future__ import division
  6654. * import numpy as np # <<<<<<<<<<<<<<
  6655. * cimport numpy as np
  6656. * from libcpp.vector cimport vector
  6657. */
  6658. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6659. __Pyx_GOTREF(__pyx_t_1);
  6660. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6661. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6662. /* "scattnlay.pyx":47
  6663. * 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[])
  6664. *
  6665. * 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): # <<<<<<<<<<<<<<
  6666. * cdef Py_ssize_t i
  6667. *
  6668. */
  6669. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6670. __Pyx_GOTREF(__pyx_t_1);
  6671. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6672. __Pyx_GOTREF(__pyx_t_2);
  6673. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6674. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6675. __Pyx_GOTREF(__pyx_t_1);
  6676. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6677. __Pyx_GOTREF(__pyx_t_3);
  6678. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6679. __Pyx_GOTREF(__pyx_t_4);
  6680. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6681. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6682. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6683. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6684. __Pyx_GOTREF(__pyx_t_4);
  6685. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6686. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6687. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6688. __pyx_k__2 = ((PyArrayObject *)__pyx_t_4);
  6689. __Pyx_GIVEREF(__pyx_t_4);
  6690. __pyx_t_4 = 0;
  6691. __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6692. __Pyx_GOTREF(__pyx_t_4);
  6693. if (PyDict_SetItem(__pyx_d, __pyx_n_s_scattnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6694. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6695. /* "scattnlay.pyx":82
  6696. *
  6697. * #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):
  6698. * 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): # <<<<<<<<<<<<<<
  6699. * cdef Py_ssize_t i
  6700. *
  6701. */
  6702. __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 = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6703. __Pyx_GOTREF(__pyx_t_4);
  6704. if (PyDict_SetItem(__pyx_d, __pyx_n_s_fieldnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6705. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6706. /* "scattnlay.pyx":1
  6707. * # Copyright (C) 2009-2015 Ovidio Pena <ovidio@bytesfall.com> # <<<<<<<<<<<<<<
  6708. * #
  6709. * # This file is part of python-scattnlay
  6710. */
  6711. __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;}
  6712. __Pyx_GOTREF(__pyx_t_4);
  6713. 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;}
  6714. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6715. /* "vector.from_py":46
  6716. *
  6717. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6718. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6719. * cdef vector[X] v
  6720. * for item in o:
  6721. */
  6722. goto __pyx_L0;
  6723. __pyx_L1_error:;
  6724. __Pyx_XDECREF(__pyx_t_1);
  6725. __Pyx_XDECREF(__pyx_t_2);
  6726. __Pyx_XDECREF(__pyx_t_3);
  6727. __Pyx_XDECREF(__pyx_t_4);
  6728. if (__pyx_m) {
  6729. __Pyx_AddTraceback("init scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6730. Py_DECREF(__pyx_m); __pyx_m = 0;
  6731. } else if (!PyErr_Occurred()) {
  6732. PyErr_SetString(PyExc_ImportError, "init scattnlay");
  6733. }
  6734. __pyx_L0:;
  6735. __Pyx_RefNannyFinishContext();
  6736. #if PY_MAJOR_VERSION < 3
  6737. return;
  6738. #else
  6739. return __pyx_m;
  6740. #endif
  6741. }
  6742. /* Runtime support code */
  6743. #if CYTHON_REFNANNY
  6744. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  6745. PyObject *m = NULL, *p = NULL;
  6746. void *r = NULL;
  6747. m = PyImport_ImportModule((char *)modname);
  6748. if (!m) goto end;
  6749. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  6750. if (!p) goto end;
  6751. r = PyLong_AsVoidPtr(p);
  6752. end:
  6753. Py_XDECREF(p);
  6754. Py_XDECREF(m);
  6755. return (__Pyx_RefNannyAPIStruct *)r;
  6756. }
  6757. #endif /* CYTHON_REFNANNY */
  6758. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  6759. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  6760. if (unlikely(!result)) {
  6761. PyErr_Format(PyExc_NameError,
  6762. #if PY_MAJOR_VERSION >= 3
  6763. "name '%U' is not defined", name);
  6764. #else
  6765. "name '%.200s' is not defined", PyString_AS_STRING(name));
  6766. #endif
  6767. }
  6768. return result;
  6769. }
  6770. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  6771. PyObject *result;
  6772. #if CYTHON_COMPILING_IN_CPYTHON
  6773. result = PyDict_GetItem(__pyx_d, name);
  6774. if (result) {
  6775. Py_INCREF(result);
  6776. } else {
  6777. #else
  6778. result = PyObject_GetItem(__pyx_d, name);
  6779. if (!result) {
  6780. PyErr_Clear();
  6781. #endif
  6782. result = __Pyx_GetBuiltinName(name);
  6783. }
  6784. return result;
  6785. }
  6786. #if CYTHON_COMPILING_IN_CPYTHON
  6787. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  6788. PyObject *result;
  6789. ternaryfunc call = func->ob_type->tp_call;
  6790. if (unlikely(!call))
  6791. return PyObject_Call(func, arg, kw);
  6792. #if PY_VERSION_HEX >= 0x02060000
  6793. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  6794. return NULL;
  6795. #endif
  6796. result = (*call)(func, arg, kw);
  6797. #if PY_VERSION_HEX >= 0x02060000
  6798. Py_LeaveRecursiveCall();
  6799. #endif
  6800. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  6801. PyErr_SetString(
  6802. PyExc_SystemError,
  6803. "NULL result without error in PyObject_Call");
  6804. }
  6805. return result;
  6806. }
  6807. #endif
  6808. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  6809. if (unlikely(!type)) {
  6810. PyErr_SetString(PyExc_SystemError, "Missing type object");
  6811. return 0;
  6812. }
  6813. if (likely(PyObject_TypeCheck(obj, type)))
  6814. return 1;
  6815. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  6816. Py_TYPE(obj)->tp_name, type->tp_name);
  6817. return 0;
  6818. }
  6819. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  6820. #if CYTHON_COMPILING_IN_CPYTHON
  6821. PyObject *tmp_type, *tmp_value, *tmp_tb;
  6822. PyThreadState *tstate = PyThreadState_GET();
  6823. tmp_type = tstate->curexc_type;
  6824. tmp_value = tstate->curexc_value;
  6825. tmp_tb = tstate->curexc_traceback;
  6826. tstate->curexc_type = type;
  6827. tstate->curexc_value = value;
  6828. tstate->curexc_traceback = tb;
  6829. Py_XDECREF(tmp_type);
  6830. Py_XDECREF(tmp_value);
  6831. Py_XDECREF(tmp_tb);
  6832. #else
  6833. PyErr_Restore(type, value, tb);
  6834. #endif
  6835. }
  6836. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  6837. #if CYTHON_COMPILING_IN_CPYTHON
  6838. PyThreadState *tstate = PyThreadState_GET();
  6839. *type = tstate->curexc_type;
  6840. *value = tstate->curexc_value;
  6841. *tb = tstate->curexc_traceback;
  6842. tstate->curexc_type = 0;
  6843. tstate->curexc_value = 0;
  6844. tstate->curexc_traceback = 0;
  6845. #else
  6846. PyErr_Fetch(type, value, tb);
  6847. #endif
  6848. }
  6849. static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
  6850. CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
  6851. int full_traceback) {
  6852. PyObject *old_exc, *old_val, *old_tb;
  6853. PyObject *ctx;
  6854. __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
  6855. if (full_traceback) {
  6856. Py_XINCREF(old_exc);
  6857. Py_XINCREF(old_val);
  6858. Py_XINCREF(old_tb);
  6859. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6860. PyErr_PrintEx(1);
  6861. }
  6862. #if PY_MAJOR_VERSION < 3
  6863. ctx = PyString_FromString(name);
  6864. #else
  6865. ctx = PyUnicode_FromString(name);
  6866. #endif
  6867. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6868. if (!ctx) {
  6869. PyErr_WriteUnraisable(Py_None);
  6870. } else {
  6871. PyErr_WriteUnraisable(ctx);
  6872. Py_DECREF(ctx);
  6873. }
  6874. }
  6875. static void __Pyx_RaiseArgtupleInvalid(
  6876. const char* func_name,
  6877. int exact,
  6878. Py_ssize_t num_min,
  6879. Py_ssize_t num_max,
  6880. Py_ssize_t num_found)
  6881. {
  6882. Py_ssize_t num_expected;
  6883. const char *more_or_less;
  6884. if (num_found < num_min) {
  6885. num_expected = num_min;
  6886. more_or_less = "at least";
  6887. } else {
  6888. num_expected = num_max;
  6889. more_or_less = "at most";
  6890. }
  6891. if (exact) {
  6892. more_or_less = "exactly";
  6893. }
  6894. PyErr_Format(PyExc_TypeError,
  6895. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  6896. func_name, more_or_less, num_expected,
  6897. (num_expected == 1) ? "" : "s", num_found);
  6898. }
  6899. static void __Pyx_RaiseDoubleKeywordsError(
  6900. const char* func_name,
  6901. PyObject* kw_name)
  6902. {
  6903. PyErr_Format(PyExc_TypeError,
  6904. #if PY_MAJOR_VERSION >= 3
  6905. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  6906. #else
  6907. "%s() got multiple values for keyword argument '%s'", func_name,
  6908. PyString_AsString(kw_name));
  6909. #endif
  6910. }
  6911. static int __Pyx_ParseOptionalKeywords(
  6912. PyObject *kwds,
  6913. PyObject **argnames[],
  6914. PyObject *kwds2,
  6915. PyObject *values[],
  6916. Py_ssize_t num_pos_args,
  6917. const char* function_name)
  6918. {
  6919. PyObject *key = 0, *value = 0;
  6920. Py_ssize_t pos = 0;
  6921. PyObject*** name;
  6922. PyObject*** first_kw_arg = argnames + num_pos_args;
  6923. while (PyDict_Next(kwds, &pos, &key, &value)) {
  6924. name = first_kw_arg;
  6925. while (*name && (**name != key)) name++;
  6926. if (*name) {
  6927. values[name-argnames] = value;
  6928. continue;
  6929. }
  6930. name = first_kw_arg;
  6931. #if PY_MAJOR_VERSION < 3
  6932. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  6933. while (*name) {
  6934. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  6935. && _PyString_Eq(**name, key)) {
  6936. values[name-argnames] = value;
  6937. break;
  6938. }
  6939. name++;
  6940. }
  6941. if (*name) continue;
  6942. else {
  6943. PyObject*** argname = argnames;
  6944. while (argname != first_kw_arg) {
  6945. if ((**argname == key) || (
  6946. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  6947. && _PyString_Eq(**argname, key))) {
  6948. goto arg_passed_twice;
  6949. }
  6950. argname++;
  6951. }
  6952. }
  6953. } else
  6954. #endif
  6955. if (likely(PyUnicode_Check(key))) {
  6956. while (*name) {
  6957. int cmp = (**name == key) ? 0 :
  6958. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6959. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  6960. #endif
  6961. PyUnicode_Compare(**name, key);
  6962. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6963. if (cmp == 0) {
  6964. values[name-argnames] = value;
  6965. break;
  6966. }
  6967. name++;
  6968. }
  6969. if (*name) continue;
  6970. else {
  6971. PyObject*** argname = argnames;
  6972. while (argname != first_kw_arg) {
  6973. int cmp = (**argname == key) ? 0 :
  6974. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6975. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  6976. #endif
  6977. PyUnicode_Compare(**argname, key);
  6978. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6979. if (cmp == 0) goto arg_passed_twice;
  6980. argname++;
  6981. }
  6982. }
  6983. } else
  6984. goto invalid_keyword_type;
  6985. if (kwds2) {
  6986. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  6987. } else {
  6988. goto invalid_keyword;
  6989. }
  6990. }
  6991. return 0;
  6992. arg_passed_twice:
  6993. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  6994. goto bad;
  6995. invalid_keyword_type:
  6996. PyErr_Format(PyExc_TypeError,
  6997. "%.200s() keywords must be strings", function_name);
  6998. goto bad;
  6999. invalid_keyword:
  7000. PyErr_Format(PyExc_TypeError,
  7001. #if PY_MAJOR_VERSION < 3
  7002. "%.200s() got an unexpected keyword argument '%.200s'",
  7003. function_name, PyString_AsString(key));
  7004. #else
  7005. "%s() got an unexpected keyword argument '%U'",
  7006. function_name, key);
  7007. #endif
  7008. bad:
  7009. return -1;
  7010. }
  7011. static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
  7012. PyErr_Format(PyExc_TypeError,
  7013. "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
  7014. name, type->tp_name, Py_TYPE(obj)->tp_name);
  7015. }
  7016. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  7017. const char *name, int exact)
  7018. {
  7019. if (unlikely(!type)) {
  7020. PyErr_SetString(PyExc_SystemError, "Missing type object");
  7021. return 0;
  7022. }
  7023. if (none_allowed && obj == Py_None) return 1;
  7024. else if (exact) {
  7025. if (likely(Py_TYPE(obj) == type)) return 1;
  7026. #if PY_MAJOR_VERSION == 2
  7027. else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
  7028. #endif
  7029. }
  7030. else {
  7031. if (likely(PyObject_TypeCheck(obj, type))) return 1;
  7032. }
  7033. __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
  7034. return 0;
  7035. }
  7036. static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  7037. unsigned int n = 1;
  7038. return *(unsigned char*)(&n) != 0;
  7039. }
  7040. static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
  7041. __Pyx_BufFmt_StackElem* stack,
  7042. __Pyx_TypeInfo* type) {
  7043. stack[0].field = &ctx->root;
  7044. stack[0].parent_offset = 0;
  7045. ctx->root.type = type;
  7046. ctx->root.name = "buffer dtype";
  7047. ctx->root.offset = 0;
  7048. ctx->head = stack;
  7049. ctx->head->field = &ctx->root;
  7050. ctx->fmt_offset = 0;
  7051. ctx->head->parent_offset = 0;
  7052. ctx->new_packmode = '@';
  7053. ctx->enc_packmode = '@';
  7054. ctx->new_count = 1;
  7055. ctx->enc_count = 0;
  7056. ctx->enc_type = 0;
  7057. ctx->is_complex = 0;
  7058. ctx->is_valid_array = 0;
  7059. ctx->struct_alignment = 0;
  7060. while (type->typegroup == 'S') {
  7061. ++ctx->head;
  7062. ctx->head->field = type->fields;
  7063. ctx->head->parent_offset = 0;
  7064. type = type->fields->type;
  7065. }
  7066. }
  7067. static int __Pyx_BufFmt_ParseNumber(const char** ts) {
  7068. int count;
  7069. const char* t = *ts;
  7070. if (*t < '0' || *t > '9') {
  7071. return -1;
  7072. } else {
  7073. count = *t++ - '0';
  7074. while (*t >= '0' && *t < '9') {
  7075. count *= 10;
  7076. count += *t++ - '0';
  7077. }
  7078. }
  7079. *ts = t;
  7080. return count;
  7081. }
  7082. static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
  7083. int number = __Pyx_BufFmt_ParseNumber(ts);
  7084. if (number == -1) /* First char was not a digit */
  7085. PyErr_Format(PyExc_ValueError,\
  7086. "Does not understand character buffer dtype format string ('%c')", **ts);
  7087. return number;
  7088. }
  7089. static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  7090. PyErr_Format(PyExc_ValueError,
  7091. "Unexpected format string character: '%c'", ch);
  7092. }
  7093. static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  7094. switch (ch) {
  7095. case 'c': return "'char'";
  7096. case 'b': return "'signed char'";
  7097. case 'B': return "'unsigned char'";
  7098. case 'h': return "'short'";
  7099. case 'H': return "'unsigned short'";
  7100. case 'i': return "'int'";
  7101. case 'I': return "'unsigned int'";
  7102. case 'l': return "'long'";
  7103. case 'L': return "'unsigned long'";
  7104. case 'q': return "'long long'";
  7105. case 'Q': return "'unsigned long long'";
  7106. case 'f': return (is_complex ? "'complex float'" : "'float'");
  7107. case 'd': return (is_complex ? "'complex double'" : "'double'");
  7108. case 'g': return (is_complex ? "'complex long double'" : "'long double'");
  7109. case 'T': return "a struct";
  7110. case 'O': return "Python object";
  7111. case 'P': return "a pointer";
  7112. case 's': case 'p': return "a string";
  7113. case 0: return "end";
  7114. default: return "unparseable format string";
  7115. }
  7116. }
  7117. static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  7118. switch (ch) {
  7119. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7120. case 'h': case 'H': return 2;
  7121. case 'i': case 'I': case 'l': case 'L': return 4;
  7122. case 'q': case 'Q': return 8;
  7123. case 'f': return (is_complex ? 8 : 4);
  7124. case 'd': return (is_complex ? 16 : 8);
  7125. case 'g': {
  7126. PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
  7127. return 0;
  7128. }
  7129. case 'O': case 'P': return sizeof(void*);
  7130. default:
  7131. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7132. return 0;
  7133. }
  7134. }
  7135. static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  7136. switch (ch) {
  7137. case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7138. case 'h': case 'H': return sizeof(short);
  7139. case 'i': case 'I': return sizeof(int);
  7140. case 'l': case 'L': return sizeof(long);
  7141. #ifdef HAVE_LONG_LONG
  7142. case 'q': case 'Q': return sizeof(PY_LONG_LONG);
  7143. #endif
  7144. case 'f': return sizeof(float) * (is_complex ? 2 : 1);
  7145. case 'd': return sizeof(double) * (is_complex ? 2 : 1);
  7146. case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
  7147. case 'O': case 'P': return sizeof(void*);
  7148. default: {
  7149. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7150. return 0;
  7151. }
  7152. }
  7153. }
  7154. typedef struct { char c; short x; } __Pyx_st_short;
  7155. typedef struct { char c; int x; } __Pyx_st_int;
  7156. typedef struct { char c; long x; } __Pyx_st_long;
  7157. typedef struct { char c; float x; } __Pyx_st_float;
  7158. typedef struct { char c; double x; } __Pyx_st_double;
  7159. typedef struct { char c; long double x; } __Pyx_st_longdouble;
  7160. typedef struct { char c; void *x; } __Pyx_st_void_p;
  7161. #ifdef HAVE_LONG_LONG
  7162. typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
  7163. #endif
  7164. static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  7165. switch (ch) {
  7166. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7167. case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
  7168. case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
  7169. case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
  7170. #ifdef HAVE_LONG_LONG
  7171. case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
  7172. #endif
  7173. case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
  7174. case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
  7175. case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
  7176. case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
  7177. default:
  7178. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7179. return 0;
  7180. }
  7181. }
  7182. /* These are for computing the padding at the end of the struct to align
  7183. on the first member of the struct. This will probably the same as above,
  7184. but we don't have any guarantees.
  7185. */
  7186. typedef struct { short x; char c; } __Pyx_pad_short;
  7187. typedef struct { int x; char c; } __Pyx_pad_int;
  7188. typedef struct { long x; char c; } __Pyx_pad_long;
  7189. typedef struct { float x; char c; } __Pyx_pad_float;
  7190. typedef struct { double x; char c; } __Pyx_pad_double;
  7191. typedef struct { long double x; char c; } __Pyx_pad_longdouble;
  7192. typedef struct { void *x; char c; } __Pyx_pad_void_p;
  7193. #ifdef HAVE_LONG_LONG
  7194. typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
  7195. #endif
  7196. static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  7197. switch (ch) {
  7198. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  7199. case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
  7200. case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
  7201. case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
  7202. #ifdef HAVE_LONG_LONG
  7203. case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
  7204. #endif
  7205. case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
  7206. case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
  7207. case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
  7208. case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
  7209. default:
  7210. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7211. return 0;
  7212. }
  7213. }
  7214. static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  7215. switch (ch) {
  7216. case 'c':
  7217. return 'H';
  7218. case 'b': case 'h': case 'i':
  7219. case 'l': case 'q': case 's': case 'p':
  7220. return 'I';
  7221. case 'B': case 'H': case 'I': case 'L': case 'Q':
  7222. return 'U';
  7223. case 'f': case 'd': case 'g':
  7224. return (is_complex ? 'C' : 'R');
  7225. case 'O':
  7226. return 'O';
  7227. case 'P':
  7228. return 'P';
  7229. default: {
  7230. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  7231. return 0;
  7232. }
  7233. }
  7234. }
  7235. static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  7236. if (ctx->head == NULL || ctx->head->field == &ctx->root) {
  7237. const char* expected;
  7238. const char* quote;
  7239. if (ctx->head == NULL) {
  7240. expected = "end";
  7241. quote = "";
  7242. } else {
  7243. expected = ctx->head->field->type->name;
  7244. quote = "'";
  7245. }
  7246. PyErr_Format(PyExc_ValueError,
  7247. "Buffer dtype mismatch, expected %s%s%s but got %s",
  7248. quote, expected, quote,
  7249. __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  7250. } else {
  7251. __Pyx_StructField* field = ctx->head->field;
  7252. __Pyx_StructField* parent = (ctx->head - 1)->field;
  7253. PyErr_Format(PyExc_ValueError,
  7254. "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
  7255. field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
  7256. parent->type->name, field->name);
  7257. }
  7258. }
  7259. static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  7260. char group;
  7261. size_t size, offset, arraysize = 1;
  7262. if (ctx->enc_type == 0) return 0;
  7263. if (ctx->head->field->type->arraysize[0]) {
  7264. int i, ndim = 0;
  7265. if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
  7266. ctx->is_valid_array = ctx->head->field->type->ndim == 1;
  7267. ndim = 1;
  7268. if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
  7269. PyErr_Format(PyExc_ValueError,
  7270. "Expected a dimension of size %zu, got %zu",
  7271. ctx->head->field->type->arraysize[0], ctx->enc_count);
  7272. return -1;
  7273. }
  7274. }
  7275. if (!ctx->is_valid_array) {
  7276. PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
  7277. ctx->head->field->type->ndim, ndim);
  7278. return -1;
  7279. }
  7280. for (i = 0; i < ctx->head->field->type->ndim; i++) {
  7281. arraysize *= ctx->head->field->type->arraysize[i];
  7282. }
  7283. ctx->is_valid_array = 0;
  7284. ctx->enc_count = 1;
  7285. }
  7286. group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  7287. do {
  7288. __Pyx_StructField* field = ctx->head->field;
  7289. __Pyx_TypeInfo* type = field->type;
  7290. if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
  7291. size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
  7292. } else {
  7293. size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
  7294. }
  7295. if (ctx->enc_packmode == '@') {
  7296. size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
  7297. size_t align_mod_offset;
  7298. if (align_at == 0) return -1;
  7299. align_mod_offset = ctx->fmt_offset % align_at;
  7300. if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
  7301. if (ctx->struct_alignment == 0)
  7302. ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
  7303. ctx->is_complex);
  7304. }
  7305. if (type->size != size || type->typegroup != group) {
  7306. if (type->typegroup == 'C' && type->fields != NULL) {
  7307. size_t parent_offset = ctx->head->parent_offset + field->offset;
  7308. ++ctx->head;
  7309. ctx->head->field = type->fields;
  7310. ctx->head->parent_offset = parent_offset;
  7311. continue;
  7312. }
  7313. if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
  7314. } else {
  7315. __Pyx_BufFmt_RaiseExpected(ctx);
  7316. return -1;
  7317. }
  7318. }
  7319. offset = ctx->head->parent_offset + field->offset;
  7320. if (ctx->fmt_offset != offset) {
  7321. PyErr_Format(PyExc_ValueError,
  7322. "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
  7323. (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
  7324. return -1;
  7325. }
  7326. ctx->fmt_offset += size;
  7327. if (arraysize)
  7328. ctx->fmt_offset += (arraysize - 1) * size;
  7329. --ctx->enc_count; /* Consume from buffer string */
  7330. while (1) {
  7331. if (field == &ctx->root) {
  7332. ctx->head = NULL;
  7333. if (ctx->enc_count != 0) {
  7334. __Pyx_BufFmt_RaiseExpected(ctx);
  7335. return -1;
  7336. }
  7337. break; /* breaks both loops as ctx->enc_count == 0 */
  7338. }
  7339. ctx->head->field = ++field;
  7340. if (field->type == NULL) {
  7341. --ctx->head;
  7342. field = ctx->head->field;
  7343. continue;
  7344. } else if (field->type->typegroup == 'S') {
  7345. size_t parent_offset = ctx->head->parent_offset + field->offset;
  7346. if (field->type->fields->type == NULL) continue; /* empty struct */
  7347. field = field->type->fields;
  7348. ++ctx->head;
  7349. ctx->head->field = field;
  7350. ctx->head->parent_offset = parent_offset;
  7351. break;
  7352. } else {
  7353. break;
  7354. }
  7355. }
  7356. } while (ctx->enc_count);
  7357. ctx->enc_type = 0;
  7358. ctx->is_complex = 0;
  7359. return 0;
  7360. }
  7361. static CYTHON_INLINE PyObject *
  7362. __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
  7363. {
  7364. const char *ts = *tsp;
  7365. int i = 0, number;
  7366. int ndim = ctx->head->field->type->ndim;
  7367. ;
  7368. ++ts;
  7369. if (ctx->new_count != 1) {
  7370. PyErr_SetString(PyExc_ValueError,
  7371. "Cannot handle repeated arrays in format string");
  7372. return NULL;
  7373. }
  7374. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7375. while (*ts && *ts != ')') {
  7376. switch (*ts) {
  7377. case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
  7378. default: break; /* not a 'break' in the loop */
  7379. }
  7380. number = __Pyx_BufFmt_ExpectNumber(&ts);
  7381. if (number == -1) return NULL;
  7382. if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
  7383. return PyErr_Format(PyExc_ValueError,
  7384. "Expected a dimension of size %zu, got %d",
  7385. ctx->head->field->type->arraysize[i], number);
  7386. if (*ts != ',' && *ts != ')')
  7387. return PyErr_Format(PyExc_ValueError,
  7388. "Expected a comma in format string, got '%c'", *ts);
  7389. if (*ts == ',') ts++;
  7390. i++;
  7391. }
  7392. if (i != ndim)
  7393. return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
  7394. ctx->head->field->type->ndim, i);
  7395. if (!*ts) {
  7396. PyErr_SetString(PyExc_ValueError,
  7397. "Unexpected end of format string, expected ')'");
  7398. return NULL;
  7399. }
  7400. ctx->is_valid_array = 1;
  7401. ctx->new_count = 1;
  7402. *tsp = ++ts;
  7403. return Py_None;
  7404. }
  7405. static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  7406. int got_Z = 0;
  7407. while (1) {
  7408. switch(*ts) {
  7409. case 0:
  7410. if (ctx->enc_type != 0 && ctx->head == NULL) {
  7411. __Pyx_BufFmt_RaiseExpected(ctx);
  7412. return NULL;
  7413. }
  7414. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7415. if (ctx->head != NULL) {
  7416. __Pyx_BufFmt_RaiseExpected(ctx);
  7417. return NULL;
  7418. }
  7419. return ts;
  7420. case ' ':
  7421. case '\r':
  7422. case '\n':
  7423. ++ts;
  7424. break;
  7425. case '<':
  7426. if (!__Pyx_IsLittleEndian()) {
  7427. PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
  7428. return NULL;
  7429. }
  7430. ctx->new_packmode = '=';
  7431. ++ts;
  7432. break;
  7433. case '>':
  7434. case '!':
  7435. if (__Pyx_IsLittleEndian()) {
  7436. PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
  7437. return NULL;
  7438. }
  7439. ctx->new_packmode = '=';
  7440. ++ts;
  7441. break;
  7442. case '=':
  7443. case '@':
  7444. case '^':
  7445. ctx->new_packmode = *ts++;
  7446. break;
  7447. case 'T': /* substruct */
  7448. {
  7449. const char* ts_after_sub;
  7450. size_t i, struct_count = ctx->new_count;
  7451. size_t struct_alignment = ctx->struct_alignment;
  7452. ctx->new_count = 1;
  7453. ++ts;
  7454. if (*ts != '{') {
  7455. PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
  7456. return NULL;
  7457. }
  7458. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7459. ctx->enc_type = 0; /* Erase processed last struct element */
  7460. ctx->enc_count = 0;
  7461. ctx->struct_alignment = 0;
  7462. ++ts;
  7463. ts_after_sub = ts;
  7464. for (i = 0; i != struct_count; ++i) {
  7465. ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
  7466. if (!ts_after_sub) return NULL;
  7467. }
  7468. ts = ts_after_sub;
  7469. if (struct_alignment) ctx->struct_alignment = struct_alignment;
  7470. }
  7471. break;
  7472. case '}': /* end of substruct; either repeat or move on */
  7473. {
  7474. size_t alignment = ctx->struct_alignment;
  7475. ++ts;
  7476. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7477. ctx->enc_type = 0; /* Erase processed last struct element */
  7478. if (alignment && ctx->fmt_offset % alignment) {
  7479. ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
  7480. }
  7481. }
  7482. return ts;
  7483. case 'x':
  7484. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7485. ctx->fmt_offset += ctx->new_count;
  7486. ctx->new_count = 1;
  7487. ctx->enc_count = 0;
  7488. ctx->enc_type = 0;
  7489. ctx->enc_packmode = ctx->new_packmode;
  7490. ++ts;
  7491. break;
  7492. case 'Z':
  7493. got_Z = 1;
  7494. ++ts;
  7495. if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
  7496. __Pyx_BufFmt_RaiseUnexpectedChar('Z');
  7497. return NULL;
  7498. }
  7499. case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
  7500. case 'l': case 'L': case 'q': case 'Q':
  7501. case 'f': case 'd': case 'g':
  7502. case 'O': case 'p':
  7503. if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
  7504. ctx->enc_packmode == ctx->new_packmode) {
  7505. ctx->enc_count += ctx->new_count;
  7506. ctx->new_count = 1;
  7507. got_Z = 0;
  7508. ++ts;
  7509. break;
  7510. }
  7511. case 's':
  7512. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  7513. ctx->enc_count = ctx->new_count;
  7514. ctx->enc_packmode = ctx->new_packmode;
  7515. ctx->enc_type = *ts;
  7516. ctx->is_complex = got_Z;
  7517. ++ts;
  7518. ctx->new_count = 1;
  7519. got_Z = 0;
  7520. break;
  7521. case ':':
  7522. ++ts;
  7523. while(*ts != ':') ++ts;
  7524. ++ts;
  7525. break;
  7526. case '(':
  7527. if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
  7528. break;
  7529. default:
  7530. {
  7531. int number = __Pyx_BufFmt_ExpectNumber(&ts);
  7532. if (number == -1) return NULL;
  7533. ctx->new_count = (size_t)number;
  7534. }
  7535. }
  7536. }
  7537. }
  7538. static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  7539. buf->buf = NULL;
  7540. buf->obj = NULL;
  7541. buf->strides = __Pyx_zeros;
  7542. buf->shape = __Pyx_zeros;
  7543. buf->suboffsets = __Pyx_minusones;
  7544. }
  7545. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
  7546. Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
  7547. int nd, int cast, __Pyx_BufFmt_StackElem* stack)
  7548. {
  7549. if (obj == Py_None || obj == NULL) {
  7550. __Pyx_ZeroBuffer(buf);
  7551. return 0;
  7552. }
  7553. buf->buf = NULL;
  7554. if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  7555. if (buf->ndim != nd) {
  7556. PyErr_Format(PyExc_ValueError,
  7557. "Buffer has wrong number of dimensions (expected %d, got %d)",
  7558. nd, buf->ndim);
  7559. goto fail;
  7560. }
  7561. if (!cast) {
  7562. __Pyx_BufFmt_Context ctx;
  7563. __Pyx_BufFmt_Init(&ctx, stack, dtype);
  7564. if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  7565. }
  7566. if ((unsigned)buf->itemsize != dtype->size) {
  7567. PyErr_Format(PyExc_ValueError,
  7568. "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
  7569. buf->itemsize, (buf->itemsize > 1) ? "s" : "",
  7570. dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
  7571. goto fail;
  7572. }
  7573. if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  7574. return 0;
  7575. fail:;
  7576. __Pyx_ZeroBuffer(buf);
  7577. return -1;
  7578. }
  7579. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  7580. if (info->buf == NULL) return;
  7581. if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  7582. __Pyx_ReleaseBuffer(info);
  7583. }
  7584. static void __Pyx_RaiseBufferFallbackError(void) {
  7585. PyErr_SetString(PyExc_ValueError,
  7586. "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
  7587. }
  7588. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  7589. PyObject *r;
  7590. if (!j) return NULL;
  7591. r = PyObject_GetItem(o, j);
  7592. Py_DECREF(j);
  7593. return r;
  7594. }
  7595. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  7596. int wraparound, int boundscheck) {
  7597. #if CYTHON_COMPILING_IN_CPYTHON
  7598. if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
  7599. if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
  7600. PyObject *r = PyList_GET_ITEM(o, i);
  7601. Py_INCREF(r);
  7602. return r;
  7603. }
  7604. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7605. #else
  7606. return PySequence_GetItem(o, i);
  7607. #endif
  7608. }
  7609. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  7610. int wraparound, int boundscheck) {
  7611. #if CYTHON_COMPILING_IN_CPYTHON
  7612. if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
  7613. if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
  7614. PyObject *r = PyTuple_GET_ITEM(o, i);
  7615. Py_INCREF(r);
  7616. return r;
  7617. }
  7618. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7619. #else
  7620. return PySequence_GetItem(o, i);
  7621. #endif
  7622. }
  7623. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  7624. int is_list, int wraparound, int boundscheck) {
  7625. #if CYTHON_COMPILING_IN_CPYTHON
  7626. if (is_list || PyList_CheckExact(o)) {
  7627. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  7628. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  7629. PyObject *r = PyList_GET_ITEM(o, n);
  7630. Py_INCREF(r);
  7631. return r;
  7632. }
  7633. }
  7634. else if (PyTuple_CheckExact(o)) {
  7635. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  7636. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  7637. PyObject *r = PyTuple_GET_ITEM(o, n);
  7638. Py_INCREF(r);
  7639. return r;
  7640. }
  7641. } else {
  7642. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  7643. if (likely(m && m->sq_item)) {
  7644. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  7645. Py_ssize_t l = m->sq_length(o);
  7646. if (likely(l >= 0)) {
  7647. i += l;
  7648. } else {
  7649. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  7650. PyErr_Clear();
  7651. else
  7652. return NULL;
  7653. }
  7654. }
  7655. return m->sq_item(o, i);
  7656. }
  7657. }
  7658. #else
  7659. if (is_list || PySequence_Check(o)) {
  7660. return PySequence_GetItem(o, i);
  7661. }
  7662. #endif
  7663. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  7664. }
  7665. static void __Pyx_RaiseBufferIndexError(int axis) {
  7666. PyErr_Format(PyExc_IndexError,
  7667. "Out of bounds on buffer access (axis %d)", axis);
  7668. }
  7669. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
  7670. int r;
  7671. if (!j) return -1;
  7672. r = PyObject_SetItem(o, j, v);
  7673. Py_DECREF(j);
  7674. return r;
  7675. }
  7676. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  7677. int is_list, int wraparound, int boundscheck) {
  7678. #if CYTHON_COMPILING_IN_CPYTHON
  7679. if (is_list || PyList_CheckExact(o)) {
  7680. Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
  7681. if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
  7682. PyObject* old = PyList_GET_ITEM(o, n);
  7683. Py_INCREF(v);
  7684. PyList_SET_ITEM(o, n, v);
  7685. Py_DECREF(old);
  7686. return 1;
  7687. }
  7688. } else {
  7689. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  7690. if (likely(m && m->sq_ass_item)) {
  7691. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  7692. Py_ssize_t l = m->sq_length(o);
  7693. if (likely(l >= 0)) {
  7694. i += l;
  7695. } else {
  7696. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  7697. PyErr_Clear();
  7698. else
  7699. return -1;
  7700. }
  7701. }
  7702. return m->sq_ass_item(o, i, v);
  7703. }
  7704. }
  7705. #else
  7706. #if CYTHON_COMPILING_IN_PYPY
  7707. if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
  7708. #else
  7709. if (is_list || PySequence_Check(o)) {
  7710. #endif
  7711. return PySequence_SetItem(o, i, v);
  7712. }
  7713. #endif
  7714. return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
  7715. }
  7716. #if PY_MAJOR_VERSION < 3
  7717. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  7718. CYTHON_UNUSED PyObject *cause) {
  7719. Py_XINCREF(type);
  7720. if (!value || value == Py_None)
  7721. value = NULL;
  7722. else
  7723. Py_INCREF(value);
  7724. if (!tb || tb == Py_None)
  7725. tb = NULL;
  7726. else {
  7727. Py_INCREF(tb);
  7728. if (!PyTraceBack_Check(tb)) {
  7729. PyErr_SetString(PyExc_TypeError,
  7730. "raise: arg 3 must be a traceback or None");
  7731. goto raise_error;
  7732. }
  7733. }
  7734. #if PY_VERSION_HEX < 0x02050000
  7735. if (PyClass_Check(type)) {
  7736. #else
  7737. if (PyType_Check(type)) {
  7738. #endif
  7739. #if CYTHON_COMPILING_IN_PYPY
  7740. if (!value) {
  7741. Py_INCREF(Py_None);
  7742. value = Py_None;
  7743. }
  7744. #endif
  7745. PyErr_NormalizeException(&type, &value, &tb);
  7746. } else {
  7747. if (value) {
  7748. PyErr_SetString(PyExc_TypeError,
  7749. "instance exception may not have a separate value");
  7750. goto raise_error;
  7751. }
  7752. value = type;
  7753. #if PY_VERSION_HEX < 0x02050000
  7754. if (PyInstance_Check(type)) {
  7755. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  7756. Py_INCREF(type);
  7757. } else {
  7758. type = 0;
  7759. PyErr_SetString(PyExc_TypeError,
  7760. "raise: exception must be an old-style class or instance");
  7761. goto raise_error;
  7762. }
  7763. #else
  7764. type = (PyObject*) Py_TYPE(type);
  7765. Py_INCREF(type);
  7766. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  7767. PyErr_SetString(PyExc_TypeError,
  7768. "raise: exception class must be a subclass of BaseException");
  7769. goto raise_error;
  7770. }
  7771. #endif
  7772. }
  7773. __Pyx_ErrRestore(type, value, tb);
  7774. return;
  7775. raise_error:
  7776. Py_XDECREF(value);
  7777. Py_XDECREF(type);
  7778. Py_XDECREF(tb);
  7779. return;
  7780. }
  7781. #else /* Python 3+ */
  7782. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  7783. PyObject* owned_instance = NULL;
  7784. if (tb == Py_None) {
  7785. tb = 0;
  7786. } else if (tb && !PyTraceBack_Check(tb)) {
  7787. PyErr_SetString(PyExc_TypeError,
  7788. "raise: arg 3 must be a traceback or None");
  7789. goto bad;
  7790. }
  7791. if (value == Py_None)
  7792. value = 0;
  7793. if (PyExceptionInstance_Check(type)) {
  7794. if (value) {
  7795. PyErr_SetString(PyExc_TypeError,
  7796. "instance exception may not have a separate value");
  7797. goto bad;
  7798. }
  7799. value = type;
  7800. type = (PyObject*) Py_TYPE(value);
  7801. } else if (PyExceptionClass_Check(type)) {
  7802. PyObject *instance_class = NULL;
  7803. if (value && PyExceptionInstance_Check(value)) {
  7804. instance_class = (PyObject*) Py_TYPE(value);
  7805. if (instance_class != type) {
  7806. if (PyObject_IsSubclass(instance_class, type)) {
  7807. type = instance_class;
  7808. } else {
  7809. instance_class = NULL;
  7810. }
  7811. }
  7812. }
  7813. if (!instance_class) {
  7814. PyObject *args;
  7815. if (!value)
  7816. args = PyTuple_New(0);
  7817. else if (PyTuple_Check(value)) {
  7818. Py_INCREF(value);
  7819. args = value;
  7820. } else
  7821. args = PyTuple_Pack(1, value);
  7822. if (!args)
  7823. goto bad;
  7824. owned_instance = PyObject_Call(type, args, NULL);
  7825. Py_DECREF(args);
  7826. if (!owned_instance)
  7827. goto bad;
  7828. value = owned_instance;
  7829. if (!PyExceptionInstance_Check(value)) {
  7830. PyErr_Format(PyExc_TypeError,
  7831. "calling %R should have returned an instance of "
  7832. "BaseException, not %R",
  7833. type, Py_TYPE(value));
  7834. goto bad;
  7835. }
  7836. }
  7837. } else {
  7838. PyErr_SetString(PyExc_TypeError,
  7839. "raise: exception class must be a subclass of BaseException");
  7840. goto bad;
  7841. }
  7842. #if PY_VERSION_HEX >= 0x03030000
  7843. if (cause) {
  7844. #else
  7845. if (cause && cause != Py_None) {
  7846. #endif
  7847. PyObject *fixed_cause;
  7848. if (cause == Py_None) {
  7849. fixed_cause = NULL;
  7850. } else if (PyExceptionClass_Check(cause)) {
  7851. fixed_cause = PyObject_CallObject(cause, NULL);
  7852. if (fixed_cause == NULL)
  7853. goto bad;
  7854. } else if (PyExceptionInstance_Check(cause)) {
  7855. fixed_cause = cause;
  7856. Py_INCREF(fixed_cause);
  7857. } else {
  7858. PyErr_SetString(PyExc_TypeError,
  7859. "exception causes must derive from "
  7860. "BaseException");
  7861. goto bad;
  7862. }
  7863. PyException_SetCause(value, fixed_cause);
  7864. }
  7865. PyErr_SetObject(type, value);
  7866. if (tb) {
  7867. PyThreadState *tstate = PyThreadState_GET();
  7868. PyObject* tmp_tb = tstate->curexc_traceback;
  7869. if (tb != tmp_tb) {
  7870. Py_INCREF(tb);
  7871. tstate->curexc_traceback = tb;
  7872. Py_XDECREF(tmp_tb);
  7873. }
  7874. }
  7875. bad:
  7876. Py_XDECREF(owned_instance);
  7877. return;
  7878. }
  7879. #endif
  7880. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  7881. PyErr_Format(PyExc_ValueError,
  7882. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  7883. }
  7884. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  7885. PyErr_Format(PyExc_ValueError,
  7886. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  7887. index, (index == 1) ? "" : "s");
  7888. }
  7889. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  7890. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  7891. }
  7892. #if PY_MAJOR_VERSION < 3
  7893. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  7894. #if PY_VERSION_HEX >= 0x02060000
  7895. if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  7896. #endif
  7897. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
  7898. #if PY_VERSION_HEX < 0x02060000
  7899. if (obj->ob_type->tp_dict) {
  7900. PyObject *getbuffer_cobj = PyObject_GetItem(
  7901. obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer);
  7902. if (getbuffer_cobj) {
  7903. getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
  7904. Py_DECREF(getbuffer_cobj);
  7905. if (!func)
  7906. goto fail;
  7907. return func(obj, view, flags);
  7908. } else {
  7909. PyErr_Clear();
  7910. }
  7911. }
  7912. #endif
  7913. PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  7914. #if PY_VERSION_HEX < 0x02060000
  7915. fail:
  7916. #endif
  7917. return -1;
  7918. }
  7919. static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  7920. PyObject *obj = view->obj;
  7921. if (!obj) return;
  7922. #if PY_VERSION_HEX >= 0x02060000
  7923. if (PyObject_CheckBuffer(obj)) {
  7924. PyBuffer_Release(view);
  7925. return;
  7926. }
  7927. #endif
  7928. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  7929. #if PY_VERSION_HEX < 0x02060000
  7930. if (obj->ob_type->tp_dict) {
  7931. PyObject *releasebuffer_cobj = PyObject_GetItem(
  7932. obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer);
  7933. if (releasebuffer_cobj) {
  7934. releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
  7935. Py_DECREF(releasebuffer_cobj);
  7936. if (!func)
  7937. goto fail;
  7938. func(obj, view);
  7939. return;
  7940. } else {
  7941. PyErr_Clear();
  7942. }
  7943. }
  7944. #endif
  7945. goto nofail;
  7946. #if PY_VERSION_HEX < 0x02060000
  7947. fail:
  7948. #endif
  7949. PyErr_WriteUnraisable(obj);
  7950. nofail:
  7951. Py_DECREF(obj);
  7952. view->obj = NULL;
  7953. }
  7954. #endif /* PY_MAJOR_VERSION < 3 */
  7955. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  7956. PyObject *empty_list = 0;
  7957. PyObject *module = 0;
  7958. PyObject *global_dict = 0;
  7959. PyObject *empty_dict = 0;
  7960. PyObject *list;
  7961. #if PY_VERSION_HEX < 0x03030000
  7962. PyObject *py_import;
  7963. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  7964. if (!py_import)
  7965. goto bad;
  7966. #endif
  7967. if (from_list)
  7968. list = from_list;
  7969. else {
  7970. empty_list = PyList_New(0);
  7971. if (!empty_list)
  7972. goto bad;
  7973. list = empty_list;
  7974. }
  7975. global_dict = PyModule_GetDict(__pyx_m);
  7976. if (!global_dict)
  7977. goto bad;
  7978. empty_dict = PyDict_New();
  7979. if (!empty_dict)
  7980. goto bad;
  7981. #if PY_VERSION_HEX >= 0x02050000
  7982. {
  7983. #if PY_MAJOR_VERSION >= 3
  7984. if (level == -1) {
  7985. if (strchr(__Pyx_MODULE_NAME, '.')) {
  7986. #if PY_VERSION_HEX < 0x03030000
  7987. PyObject *py_level = PyInt_FromLong(1);
  7988. if (!py_level)
  7989. goto bad;
  7990. module = PyObject_CallFunctionObjArgs(py_import,
  7991. name, global_dict, empty_dict, list, py_level, NULL);
  7992. Py_DECREF(py_level);
  7993. #else
  7994. module = PyImport_ImportModuleLevelObject(
  7995. name, global_dict, empty_dict, list, 1);
  7996. #endif
  7997. if (!module) {
  7998. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  7999. goto bad;
  8000. PyErr_Clear();
  8001. }
  8002. }
  8003. level = 0; /* try absolute import on failure */
  8004. }
  8005. #endif
  8006. if (!module) {
  8007. #if PY_VERSION_HEX < 0x03030000
  8008. PyObject *py_level = PyInt_FromLong(level);
  8009. if (!py_level)
  8010. goto bad;
  8011. module = PyObject_CallFunctionObjArgs(py_import,
  8012. name, global_dict, empty_dict, list, py_level, NULL);
  8013. Py_DECREF(py_level);
  8014. #else
  8015. module = PyImport_ImportModuleLevelObject(
  8016. name, global_dict, empty_dict, list, level);
  8017. #endif
  8018. }
  8019. }
  8020. #else
  8021. if (level>0) {
  8022. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  8023. goto bad;
  8024. }
  8025. module = PyObject_CallFunctionObjArgs(py_import,
  8026. name, global_dict, empty_dict, list, NULL);
  8027. #endif
  8028. bad:
  8029. #if PY_VERSION_HEX < 0x03030000
  8030. Py_XDECREF(py_import);
  8031. #endif
  8032. Py_XDECREF(empty_list);
  8033. Py_XDECREF(empty_dict);
  8034. return module;
  8035. }
  8036. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  8037. { \
  8038. func_type value = func(x); \
  8039. if (sizeof(target_type) < sizeof(func_type)) { \
  8040. if (unlikely(value != (func_type) (target_type) value)) { \
  8041. func_type zero = 0; \
  8042. PyErr_SetString(PyExc_OverflowError, \
  8043. (is_unsigned && unlikely(value < zero)) ? \
  8044. "can't convert negative value to " #target_type : \
  8045. "value too large to convert to " #target_type); \
  8046. return (target_type) -1; \
  8047. } \
  8048. } \
  8049. return (target_type) value; \
  8050. }
  8051. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8052. #if CYTHON_USE_PYLONG_INTERNALS
  8053. #include "longintrepr.h"
  8054. #endif
  8055. #endif
  8056. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) {
  8057. const npy_long neg_one = (npy_long) -1, const_zero = 0;
  8058. const int is_unsigned = neg_one > const_zero;
  8059. #if PY_MAJOR_VERSION < 3
  8060. if (likely(PyInt_Check(x))) {
  8061. if (sizeof(npy_long) < sizeof(long)) {
  8062. __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG)
  8063. } else {
  8064. long val = PyInt_AS_LONG(x);
  8065. if (is_unsigned && unlikely(val < 0)) {
  8066. PyErr_SetString(PyExc_OverflowError,
  8067. "can't convert negative value to npy_long");
  8068. return (npy_long) -1;
  8069. }
  8070. return (npy_long) val;
  8071. }
  8072. } else
  8073. #endif
  8074. if (likely(PyLong_Check(x))) {
  8075. if (is_unsigned) {
  8076. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8077. #if CYTHON_USE_PYLONG_INTERNALS
  8078. if (sizeof(digit) <= sizeof(npy_long)) {
  8079. switch (Py_SIZE(x)) {
  8080. case 0: return 0;
  8081. case 1: return (npy_long) ((PyLongObject*)x)->ob_digit[0];
  8082. }
  8083. }
  8084. #endif
  8085. #endif
  8086. if (unlikely(Py_SIZE(x) < 0)) {
  8087. PyErr_SetString(PyExc_OverflowError,
  8088. "can't convert negative value to npy_long");
  8089. return (npy_long) -1;
  8090. }
  8091. if (sizeof(npy_long) <= sizeof(unsigned long)) {
  8092. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, PyLong_AsUnsignedLong)
  8093. } else if (sizeof(npy_long) <= sizeof(unsigned long long)) {
  8094. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long long, PyLong_AsUnsignedLongLong)
  8095. }
  8096. } else {
  8097. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8098. #if CYTHON_USE_PYLONG_INTERNALS
  8099. if (sizeof(digit) <= sizeof(npy_long)) {
  8100. switch (Py_SIZE(x)) {
  8101. case 0: return 0;
  8102. case 1: return +(npy_long) ((PyLongObject*)x)->ob_digit[0];
  8103. case -1: return -(npy_long) ((PyLongObject*)x)->ob_digit[0];
  8104. }
  8105. }
  8106. #endif
  8107. #endif
  8108. if (sizeof(npy_long) <= sizeof(long)) {
  8109. __PYX_VERIFY_RETURN_INT(npy_long, long, PyLong_AsLong)
  8110. } else if (sizeof(npy_long) <= sizeof(long long)) {
  8111. __PYX_VERIFY_RETURN_INT(npy_long, long long, PyLong_AsLongLong)
  8112. }
  8113. }
  8114. {
  8115. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8116. PyErr_SetString(PyExc_RuntimeError,
  8117. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8118. #else
  8119. npy_long val;
  8120. PyObject *v = __Pyx_PyNumber_Int(x);
  8121. #if PY_MAJOR_VERSION < 3
  8122. if (likely(v) && !PyLong_Check(v)) {
  8123. PyObject *tmp = v;
  8124. v = PyNumber_Long(tmp);
  8125. Py_DECREF(tmp);
  8126. }
  8127. #endif
  8128. if (likely(v)) {
  8129. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8130. unsigned char *bytes = (unsigned char *)&val;
  8131. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8132. bytes, sizeof(val),
  8133. is_little, !is_unsigned);
  8134. Py_DECREF(v);
  8135. if (likely(!ret))
  8136. return val;
  8137. }
  8138. #endif
  8139. return (npy_long) -1;
  8140. }
  8141. } else {
  8142. npy_long val;
  8143. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8144. if (!tmp) return (npy_long) -1;
  8145. val = __Pyx_PyInt_As_npy_long(tmp);
  8146. Py_DECREF(tmp);
  8147. return val;
  8148. }
  8149. }
  8150. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
  8151. const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
  8152. const int is_unsigned = neg_one > const_zero;
  8153. if (is_unsigned) {
  8154. if (sizeof(Py_intptr_t) < sizeof(long)) {
  8155. return PyInt_FromLong((long) value);
  8156. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
  8157. return PyLong_FromUnsignedLong((unsigned long) value);
  8158. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
  8159. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8160. }
  8161. } else {
  8162. if (sizeof(Py_intptr_t) <= sizeof(long)) {
  8163. return PyInt_FromLong((long) value);
  8164. } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
  8165. return PyLong_FromLongLong((long long) value);
  8166. }
  8167. }
  8168. {
  8169. int one = 1; int little = (int)*(unsigned char *)&one;
  8170. unsigned char *bytes = (unsigned char *)&value;
  8171. return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
  8172. little, !is_unsigned);
  8173. }
  8174. }
  8175. #if CYTHON_CCOMPLEX
  8176. #ifdef __cplusplus
  8177. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8178. return ::std::complex< double >(x, y);
  8179. }
  8180. #else
  8181. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8182. return x + y*(__pyx_t_double_complex)_Complex_I;
  8183. }
  8184. #endif
  8185. #else
  8186. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  8187. __pyx_t_double_complex z;
  8188. z.real = x;
  8189. z.imag = y;
  8190. return z;
  8191. }
  8192. #endif
  8193. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
  8194. Py_complex cval;
  8195. #if CYTHON_COMPILING_IN_CPYTHON
  8196. if (PyComplex_CheckExact(o))
  8197. cval = ((PyComplexObject *)o)->cval;
  8198. else
  8199. #endif
  8200. cval = PyComplex_AsCComplex(o);
  8201. return __pyx_t_double_complex_from_parts(
  8202. (double)cval.real,
  8203. (double)cval.imag);
  8204. }
  8205. #if CYTHON_CCOMPLEX
  8206. #else
  8207. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8208. return (a.real == b.real) && (a.imag == b.imag);
  8209. }
  8210. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8211. __pyx_t_double_complex z;
  8212. z.real = a.real + b.real;
  8213. z.imag = a.imag + b.imag;
  8214. return z;
  8215. }
  8216. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8217. __pyx_t_double_complex z;
  8218. z.real = a.real - b.real;
  8219. z.imag = a.imag - b.imag;
  8220. return z;
  8221. }
  8222. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8223. __pyx_t_double_complex z;
  8224. z.real = a.real * b.real - a.imag * b.imag;
  8225. z.imag = a.real * b.imag + a.imag * b.real;
  8226. return z;
  8227. }
  8228. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8229. __pyx_t_double_complex z;
  8230. double denom = b.real * b.real + b.imag * b.imag;
  8231. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  8232. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  8233. return z;
  8234. }
  8235. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
  8236. __pyx_t_double_complex z;
  8237. z.real = -a.real;
  8238. z.imag = -a.imag;
  8239. return z;
  8240. }
  8241. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
  8242. return (a.real == 0) && (a.imag == 0);
  8243. }
  8244. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
  8245. __pyx_t_double_complex z;
  8246. z.real = a.real;
  8247. z.imag = -a.imag;
  8248. return z;
  8249. }
  8250. #if 1
  8251. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
  8252. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  8253. return sqrt(z.real*z.real + z.imag*z.imag);
  8254. #else
  8255. return hypot(z.real, z.imag);
  8256. #endif
  8257. }
  8258. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  8259. __pyx_t_double_complex z;
  8260. double r, lnr, theta, z_r, z_theta;
  8261. if (b.imag == 0 && b.real == (int)b.real) {
  8262. if (b.real < 0) {
  8263. double denom = a.real * a.real + a.imag * a.imag;
  8264. a.real = a.real / denom;
  8265. a.imag = -a.imag / denom;
  8266. b.real = -b.real;
  8267. }
  8268. switch ((int)b.real) {
  8269. case 0:
  8270. z.real = 1;
  8271. z.imag = 0;
  8272. return z;
  8273. case 1:
  8274. return a;
  8275. case 2:
  8276. z = __Pyx_c_prod(a, a);
  8277. return __Pyx_c_prod(a, a);
  8278. case 3:
  8279. z = __Pyx_c_prod(a, a);
  8280. return __Pyx_c_prod(z, a);
  8281. case 4:
  8282. z = __Pyx_c_prod(a, a);
  8283. return __Pyx_c_prod(z, z);
  8284. }
  8285. }
  8286. if (a.imag == 0) {
  8287. if (a.real == 0) {
  8288. return a;
  8289. }
  8290. r = a.real;
  8291. theta = 0;
  8292. } else {
  8293. r = __Pyx_c_abs(a);
  8294. theta = atan2(a.imag, a.real);
  8295. }
  8296. lnr = log(r);
  8297. z_r = exp(lnr * b.real - theta * b.imag);
  8298. z_theta = theta * b.real + lnr * b.imag;
  8299. z.real = z_r * cos(z_theta);
  8300. z.imag = z_r * sin(z_theta);
  8301. return z;
  8302. }
  8303. #endif
  8304. #endif
  8305. #if CYTHON_CCOMPLEX
  8306. #ifdef __cplusplus
  8307. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8308. return ::std::complex< float >(x, y);
  8309. }
  8310. #else
  8311. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8312. return x + y*(__pyx_t_float_complex)_Complex_I;
  8313. }
  8314. #endif
  8315. #else
  8316. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  8317. __pyx_t_float_complex z;
  8318. z.real = x;
  8319. z.imag = y;
  8320. return z;
  8321. }
  8322. #endif
  8323. #if CYTHON_CCOMPLEX
  8324. #else
  8325. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8326. return (a.real == b.real) && (a.imag == b.imag);
  8327. }
  8328. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8329. __pyx_t_float_complex z;
  8330. z.real = a.real + b.real;
  8331. z.imag = a.imag + b.imag;
  8332. return z;
  8333. }
  8334. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8335. __pyx_t_float_complex z;
  8336. z.real = a.real - b.real;
  8337. z.imag = a.imag - b.imag;
  8338. return z;
  8339. }
  8340. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8341. __pyx_t_float_complex z;
  8342. z.real = a.real * b.real - a.imag * b.imag;
  8343. z.imag = a.real * b.imag + a.imag * b.real;
  8344. return z;
  8345. }
  8346. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8347. __pyx_t_float_complex z;
  8348. float denom = b.real * b.real + b.imag * b.imag;
  8349. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  8350. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  8351. return z;
  8352. }
  8353. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
  8354. __pyx_t_float_complex z;
  8355. z.real = -a.real;
  8356. z.imag = -a.imag;
  8357. return z;
  8358. }
  8359. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
  8360. return (a.real == 0) && (a.imag == 0);
  8361. }
  8362. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
  8363. __pyx_t_float_complex z;
  8364. z.real = a.real;
  8365. z.imag = -a.imag;
  8366. return z;
  8367. }
  8368. #if 1
  8369. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
  8370. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  8371. return sqrtf(z.real*z.real + z.imag*z.imag);
  8372. #else
  8373. return hypotf(z.real, z.imag);
  8374. #endif
  8375. }
  8376. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  8377. __pyx_t_float_complex z;
  8378. float r, lnr, theta, z_r, z_theta;
  8379. if (b.imag == 0 && b.real == (int)b.real) {
  8380. if (b.real < 0) {
  8381. float denom = a.real * a.real + a.imag * a.imag;
  8382. a.real = a.real / denom;
  8383. a.imag = -a.imag / denom;
  8384. b.real = -b.real;
  8385. }
  8386. switch ((int)b.real) {
  8387. case 0:
  8388. z.real = 1;
  8389. z.imag = 0;
  8390. return z;
  8391. case 1:
  8392. return a;
  8393. case 2:
  8394. z = __Pyx_c_prodf(a, a);
  8395. return __Pyx_c_prodf(a, a);
  8396. case 3:
  8397. z = __Pyx_c_prodf(a, a);
  8398. return __Pyx_c_prodf(z, a);
  8399. case 4:
  8400. z = __Pyx_c_prodf(a, a);
  8401. return __Pyx_c_prodf(z, z);
  8402. }
  8403. }
  8404. if (a.imag == 0) {
  8405. if (a.real == 0) {
  8406. return a;
  8407. }
  8408. r = a.real;
  8409. theta = 0;
  8410. } else {
  8411. r = __Pyx_c_absf(a);
  8412. theta = atan2f(a.imag, a.real);
  8413. }
  8414. lnr = logf(r);
  8415. z_r = expf(lnr * b.real - theta * b.imag);
  8416. z_theta = theta * b.real + lnr * b.imag;
  8417. z.real = z_r * cosf(z_theta);
  8418. z.imag = z_r * sinf(z_theta);
  8419. return z;
  8420. }
  8421. #endif
  8422. #endif
  8423. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  8424. const int neg_one = (int) -1, const_zero = 0;
  8425. const int is_unsigned = neg_one > const_zero;
  8426. if (is_unsigned) {
  8427. if (sizeof(int) < sizeof(long)) {
  8428. return PyInt_FromLong((long) value);
  8429. } else if (sizeof(int) <= sizeof(unsigned long)) {
  8430. return PyLong_FromUnsignedLong((unsigned long) value);
  8431. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  8432. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8433. }
  8434. } else {
  8435. if (sizeof(int) <= sizeof(long)) {
  8436. return PyInt_FromLong((long) value);
  8437. } else if (sizeof(int) <= sizeof(long long)) {
  8438. return PyLong_FromLongLong((long long) value);
  8439. }
  8440. }
  8441. {
  8442. int one = 1; int little = (int)*(unsigned char *)&one;
  8443. unsigned char *bytes = (unsigned char *)&value;
  8444. return _PyLong_FromByteArray(bytes, sizeof(int),
  8445. little, !is_unsigned);
  8446. }
  8447. }
  8448. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8449. #if CYTHON_USE_PYLONG_INTERNALS
  8450. #include "longintrepr.h"
  8451. #endif
  8452. #endif
  8453. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  8454. const int neg_one = (int) -1, const_zero = 0;
  8455. const int is_unsigned = neg_one > const_zero;
  8456. #if PY_MAJOR_VERSION < 3
  8457. if (likely(PyInt_Check(x))) {
  8458. if (sizeof(int) < sizeof(long)) {
  8459. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  8460. } else {
  8461. long val = PyInt_AS_LONG(x);
  8462. if (is_unsigned && unlikely(val < 0)) {
  8463. PyErr_SetString(PyExc_OverflowError,
  8464. "can't convert negative value to int");
  8465. return (int) -1;
  8466. }
  8467. return (int) val;
  8468. }
  8469. } else
  8470. #endif
  8471. if (likely(PyLong_Check(x))) {
  8472. if (is_unsigned) {
  8473. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8474. #if CYTHON_USE_PYLONG_INTERNALS
  8475. if (sizeof(digit) <= sizeof(int)) {
  8476. switch (Py_SIZE(x)) {
  8477. case 0: return 0;
  8478. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  8479. }
  8480. }
  8481. #endif
  8482. #endif
  8483. if (unlikely(Py_SIZE(x) < 0)) {
  8484. PyErr_SetString(PyExc_OverflowError,
  8485. "can't convert negative value to int");
  8486. return (int) -1;
  8487. }
  8488. if (sizeof(int) <= sizeof(unsigned long)) {
  8489. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  8490. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  8491. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  8492. }
  8493. } else {
  8494. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8495. #if CYTHON_USE_PYLONG_INTERNALS
  8496. if (sizeof(digit) <= sizeof(int)) {
  8497. switch (Py_SIZE(x)) {
  8498. case 0: return 0;
  8499. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  8500. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  8501. }
  8502. }
  8503. #endif
  8504. #endif
  8505. if (sizeof(int) <= sizeof(long)) {
  8506. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  8507. } else if (sizeof(int) <= sizeof(long long)) {
  8508. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  8509. }
  8510. }
  8511. {
  8512. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8513. PyErr_SetString(PyExc_RuntimeError,
  8514. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8515. #else
  8516. int val;
  8517. PyObject *v = __Pyx_PyNumber_Int(x);
  8518. #if PY_MAJOR_VERSION < 3
  8519. if (likely(v) && !PyLong_Check(v)) {
  8520. PyObject *tmp = v;
  8521. v = PyNumber_Long(tmp);
  8522. Py_DECREF(tmp);
  8523. }
  8524. #endif
  8525. if (likely(v)) {
  8526. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8527. unsigned char *bytes = (unsigned char *)&val;
  8528. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8529. bytes, sizeof(val),
  8530. is_little, !is_unsigned);
  8531. Py_DECREF(v);
  8532. if (likely(!ret))
  8533. return val;
  8534. }
  8535. #endif
  8536. return (int) -1;
  8537. }
  8538. } else {
  8539. int val;
  8540. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8541. if (!tmp) return (int) -1;
  8542. val = __Pyx_PyInt_As_int(tmp);
  8543. Py_DECREF(tmp);
  8544. return val;
  8545. }
  8546. }
  8547. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  8548. const long neg_one = (long) -1, const_zero = 0;
  8549. const int is_unsigned = neg_one > const_zero;
  8550. if (is_unsigned) {
  8551. if (sizeof(long) < sizeof(long)) {
  8552. return PyInt_FromLong((long) value);
  8553. } else if (sizeof(long) <= sizeof(unsigned long)) {
  8554. return PyLong_FromUnsignedLong((unsigned long) value);
  8555. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  8556. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  8557. }
  8558. } else {
  8559. if (sizeof(long) <= sizeof(long)) {
  8560. return PyInt_FromLong((long) value);
  8561. } else if (sizeof(long) <= sizeof(long long)) {
  8562. return PyLong_FromLongLong((long long) value);
  8563. }
  8564. }
  8565. {
  8566. int one = 1; int little = (int)*(unsigned char *)&one;
  8567. unsigned char *bytes = (unsigned char *)&value;
  8568. return _PyLong_FromByteArray(bytes, sizeof(long),
  8569. little, !is_unsigned);
  8570. }
  8571. }
  8572. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8573. #if CYTHON_USE_PYLONG_INTERNALS
  8574. #include "longintrepr.h"
  8575. #endif
  8576. #endif
  8577. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  8578. const long neg_one = (long) -1, const_zero = 0;
  8579. const int is_unsigned = neg_one > const_zero;
  8580. #if PY_MAJOR_VERSION < 3
  8581. if (likely(PyInt_Check(x))) {
  8582. if (sizeof(long) < sizeof(long)) {
  8583. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  8584. } else {
  8585. long val = PyInt_AS_LONG(x);
  8586. if (is_unsigned && unlikely(val < 0)) {
  8587. PyErr_SetString(PyExc_OverflowError,
  8588. "can't convert negative value to long");
  8589. return (long) -1;
  8590. }
  8591. return (long) val;
  8592. }
  8593. } else
  8594. #endif
  8595. if (likely(PyLong_Check(x))) {
  8596. if (is_unsigned) {
  8597. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8598. #if CYTHON_USE_PYLONG_INTERNALS
  8599. if (sizeof(digit) <= sizeof(long)) {
  8600. switch (Py_SIZE(x)) {
  8601. case 0: return 0;
  8602. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  8603. }
  8604. }
  8605. #endif
  8606. #endif
  8607. if (unlikely(Py_SIZE(x) < 0)) {
  8608. PyErr_SetString(PyExc_OverflowError,
  8609. "can't convert negative value to long");
  8610. return (long) -1;
  8611. }
  8612. if (sizeof(long) <= sizeof(unsigned long)) {
  8613. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  8614. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  8615. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  8616. }
  8617. } else {
  8618. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8619. #if CYTHON_USE_PYLONG_INTERNALS
  8620. if (sizeof(digit) <= sizeof(long)) {
  8621. switch (Py_SIZE(x)) {
  8622. case 0: return 0;
  8623. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  8624. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  8625. }
  8626. }
  8627. #endif
  8628. #endif
  8629. if (sizeof(long) <= sizeof(long)) {
  8630. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  8631. } else if (sizeof(long) <= sizeof(long long)) {
  8632. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  8633. }
  8634. }
  8635. {
  8636. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  8637. PyErr_SetString(PyExc_RuntimeError,
  8638. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  8639. #else
  8640. long val;
  8641. PyObject *v = __Pyx_PyNumber_Int(x);
  8642. #if PY_MAJOR_VERSION < 3
  8643. if (likely(v) && !PyLong_Check(v)) {
  8644. PyObject *tmp = v;
  8645. v = PyNumber_Long(tmp);
  8646. Py_DECREF(tmp);
  8647. }
  8648. #endif
  8649. if (likely(v)) {
  8650. int one = 1; int is_little = (int)*(unsigned char *)&one;
  8651. unsigned char *bytes = (unsigned char *)&val;
  8652. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  8653. bytes, sizeof(val),
  8654. is_little, !is_unsigned);
  8655. Py_DECREF(v);
  8656. if (likely(!ret))
  8657. return val;
  8658. }
  8659. #endif
  8660. return (long) -1;
  8661. }
  8662. } else {
  8663. long val;
  8664. PyObject *tmp = __Pyx_PyNumber_Int(x);
  8665. if (!tmp) return (long) -1;
  8666. val = __Pyx_PyInt_As_long(tmp);
  8667. Py_DECREF(tmp);
  8668. return val;
  8669. }
  8670. }
  8671. static int __Pyx_check_binary_version(void) {
  8672. char ctversion[4], rtversion[4];
  8673. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  8674. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  8675. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  8676. char message[200];
  8677. PyOS_snprintf(message, sizeof(message),
  8678. "compiletime version %s of module '%.100s' "
  8679. "does not match runtime version %s",
  8680. ctversion, __Pyx_MODULE_NAME, rtversion);
  8681. #if PY_VERSION_HEX < 0x02050000
  8682. return PyErr_Warn(NULL, message);
  8683. #else
  8684. return PyErr_WarnEx(NULL, message, 1);
  8685. #endif
  8686. }
  8687. return 0;
  8688. }
  8689. #ifndef __PYX_HAVE_RT_ImportModule
  8690. #define __PYX_HAVE_RT_ImportModule
  8691. static PyObject *__Pyx_ImportModule(const char *name) {
  8692. PyObject *py_name = 0;
  8693. PyObject *py_module = 0;
  8694. py_name = __Pyx_PyIdentifier_FromString(name);
  8695. if (!py_name)
  8696. goto bad;
  8697. py_module = PyImport_Import(py_name);
  8698. Py_DECREF(py_name);
  8699. return py_module;
  8700. bad:
  8701. Py_XDECREF(py_name);
  8702. return 0;
  8703. }
  8704. #endif
  8705. #ifndef __PYX_HAVE_RT_ImportType
  8706. #define __PYX_HAVE_RT_ImportType
  8707. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
  8708. size_t size, int strict)
  8709. {
  8710. PyObject *py_module = 0;
  8711. PyObject *result = 0;
  8712. PyObject *py_name = 0;
  8713. char warning[200];
  8714. Py_ssize_t basicsize;
  8715. #ifdef Py_LIMITED_API
  8716. PyObject *py_basicsize;
  8717. #endif
  8718. py_module = __Pyx_ImportModule(module_name);
  8719. if (!py_module)
  8720. goto bad;
  8721. py_name = __Pyx_PyIdentifier_FromString(class_name);
  8722. if (!py_name)
  8723. goto bad;
  8724. result = PyObject_GetAttr(py_module, py_name);
  8725. Py_DECREF(py_name);
  8726. py_name = 0;
  8727. Py_DECREF(py_module);
  8728. py_module = 0;
  8729. if (!result)
  8730. goto bad;
  8731. if (!PyType_Check(result)) {
  8732. PyErr_Format(PyExc_TypeError,
  8733. "%.200s.%.200s is not a type object",
  8734. module_name, class_name);
  8735. goto bad;
  8736. }
  8737. #ifndef Py_LIMITED_API
  8738. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  8739. #else
  8740. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  8741. if (!py_basicsize)
  8742. goto bad;
  8743. basicsize = PyLong_AsSsize_t(py_basicsize);
  8744. Py_DECREF(py_basicsize);
  8745. py_basicsize = 0;
  8746. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  8747. goto bad;
  8748. #endif
  8749. if (!strict && (size_t)basicsize > size) {
  8750. PyOS_snprintf(warning, sizeof(warning),
  8751. "%s.%s size changed, may indicate binary incompatibility",
  8752. module_name, class_name);
  8753. #if PY_VERSION_HEX < 0x02050000
  8754. if (PyErr_Warn(NULL, warning) < 0) goto bad;
  8755. #else
  8756. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  8757. #endif
  8758. }
  8759. else if ((size_t)basicsize != size) {
  8760. PyErr_Format(PyExc_ValueError,
  8761. "%.200s.%.200s has the wrong size, try recompiling",
  8762. module_name, class_name);
  8763. goto bad;
  8764. }
  8765. return (PyTypeObject *)result;
  8766. bad:
  8767. Py_XDECREF(py_module);
  8768. Py_XDECREF(result);
  8769. return NULL;
  8770. }
  8771. #endif
  8772. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  8773. int start = 0, mid = 0, end = count - 1;
  8774. if (end >= 0 && code_line > entries[end].code_line) {
  8775. return count;
  8776. }
  8777. while (start < end) {
  8778. mid = (start + end) / 2;
  8779. if (code_line < entries[mid].code_line) {
  8780. end = mid;
  8781. } else if (code_line > entries[mid].code_line) {
  8782. start = mid + 1;
  8783. } else {
  8784. return mid;
  8785. }
  8786. }
  8787. if (code_line <= entries[mid].code_line) {
  8788. return mid;
  8789. } else {
  8790. return mid + 1;
  8791. }
  8792. }
  8793. static PyCodeObject *__pyx_find_code_object(int code_line) {
  8794. PyCodeObject* code_object;
  8795. int pos;
  8796. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  8797. return NULL;
  8798. }
  8799. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8800. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  8801. return NULL;
  8802. }
  8803. code_object = __pyx_code_cache.entries[pos].code_object;
  8804. Py_INCREF(code_object);
  8805. return code_object;
  8806. }
  8807. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  8808. int pos, i;
  8809. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  8810. if (unlikely(!code_line)) {
  8811. return;
  8812. }
  8813. if (unlikely(!entries)) {
  8814. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  8815. if (likely(entries)) {
  8816. __pyx_code_cache.entries = entries;
  8817. __pyx_code_cache.max_count = 64;
  8818. __pyx_code_cache.count = 1;
  8819. entries[0].code_line = code_line;
  8820. entries[0].code_object = code_object;
  8821. Py_INCREF(code_object);
  8822. }
  8823. return;
  8824. }
  8825. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8826. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  8827. PyCodeObject* tmp = entries[pos].code_object;
  8828. entries[pos].code_object = code_object;
  8829. Py_DECREF(tmp);
  8830. return;
  8831. }
  8832. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  8833. int new_max = __pyx_code_cache.max_count + 64;
  8834. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  8835. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  8836. if (unlikely(!entries)) {
  8837. return;
  8838. }
  8839. __pyx_code_cache.entries = entries;
  8840. __pyx_code_cache.max_count = new_max;
  8841. }
  8842. for (i=__pyx_code_cache.count; i>pos; i--) {
  8843. entries[i] = entries[i-1];
  8844. }
  8845. entries[pos].code_line = code_line;
  8846. entries[pos].code_object = code_object;
  8847. __pyx_code_cache.count++;
  8848. Py_INCREF(code_object);
  8849. }
  8850. #include "compile.h"
  8851. #include "frameobject.h"
  8852. #include "traceback.h"
  8853. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  8854. const char *funcname, int c_line,
  8855. int py_line, const char *filename) {
  8856. PyCodeObject *py_code = 0;
  8857. PyObject *py_srcfile = 0;
  8858. PyObject *py_funcname = 0;
  8859. #if PY_MAJOR_VERSION < 3
  8860. py_srcfile = PyString_FromString(filename);
  8861. #else
  8862. py_srcfile = PyUnicode_FromString(filename);
  8863. #endif
  8864. if (!py_srcfile) goto bad;
  8865. if (c_line) {
  8866. #if PY_MAJOR_VERSION < 3
  8867. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8868. #else
  8869. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8870. #endif
  8871. }
  8872. else {
  8873. #if PY_MAJOR_VERSION < 3
  8874. py_funcname = PyString_FromString(funcname);
  8875. #else
  8876. py_funcname = PyUnicode_FromString(funcname);
  8877. #endif
  8878. }
  8879. if (!py_funcname) goto bad;
  8880. py_code = __Pyx_PyCode_New(
  8881. 0, /*int argcount,*/
  8882. 0, /*int kwonlyargcount,*/
  8883. 0, /*int nlocals,*/
  8884. 0, /*int stacksize,*/
  8885. 0, /*int flags,*/
  8886. __pyx_empty_bytes, /*PyObject *code,*/
  8887. __pyx_empty_tuple, /*PyObject *consts,*/
  8888. __pyx_empty_tuple, /*PyObject *names,*/
  8889. __pyx_empty_tuple, /*PyObject *varnames,*/
  8890. __pyx_empty_tuple, /*PyObject *freevars,*/
  8891. __pyx_empty_tuple, /*PyObject *cellvars,*/
  8892. py_srcfile, /*PyObject *filename,*/
  8893. py_funcname, /*PyObject *name,*/
  8894. py_line, /*int firstlineno,*/
  8895. __pyx_empty_bytes /*PyObject *lnotab*/
  8896. );
  8897. Py_DECREF(py_srcfile);
  8898. Py_DECREF(py_funcname);
  8899. return py_code;
  8900. bad:
  8901. Py_XDECREF(py_srcfile);
  8902. Py_XDECREF(py_funcname);
  8903. return NULL;
  8904. }
  8905. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  8906. int py_line, const char *filename) {
  8907. PyCodeObject *py_code = 0;
  8908. PyObject *py_globals = 0;
  8909. PyFrameObject *py_frame = 0;
  8910. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  8911. if (!py_code) {
  8912. py_code = __Pyx_CreateCodeObjectForTraceback(
  8913. funcname, c_line, py_line, filename);
  8914. if (!py_code) goto bad;
  8915. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  8916. }
  8917. py_globals = PyModule_GetDict(__pyx_m);
  8918. if (!py_globals) goto bad;
  8919. py_frame = PyFrame_New(
  8920. PyThreadState_GET(), /*PyThreadState *tstate,*/
  8921. py_code, /*PyCodeObject *code,*/
  8922. py_globals, /*PyObject *globals,*/
  8923. 0 /*PyObject *locals*/
  8924. );
  8925. if (!py_frame) goto bad;
  8926. py_frame->f_lineno = py_line;
  8927. PyTraceBack_Here(py_frame);
  8928. bad:
  8929. Py_XDECREF(py_code);
  8930. Py_XDECREF(py_frame);
  8931. }
  8932. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  8933. while (t->p) {
  8934. #if PY_MAJOR_VERSION < 3
  8935. if (t->is_unicode) {
  8936. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  8937. } else if (t->intern) {
  8938. *t->p = PyString_InternFromString(t->s);
  8939. } else {
  8940. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  8941. }
  8942. #else /* Python 3+ has unicode identifiers */
  8943. if (t->is_unicode | t->is_str) {
  8944. if (t->intern) {
  8945. *t->p = PyUnicode_InternFromString(t->s);
  8946. } else if (t->encoding) {
  8947. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  8948. } else {
  8949. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  8950. }
  8951. } else {
  8952. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  8953. }
  8954. #endif
  8955. if (!*t->p)
  8956. return -1;
  8957. ++t;
  8958. }
  8959. return 0;
  8960. }
  8961. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  8962. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  8963. }
  8964. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  8965. Py_ssize_t ignore;
  8966. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  8967. }
  8968. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  8969. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  8970. if (
  8971. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8972. __Pyx_sys_getdefaultencoding_not_ascii &&
  8973. #endif
  8974. PyUnicode_Check(o)) {
  8975. #if PY_VERSION_HEX < 0x03030000
  8976. char* defenc_c;
  8977. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  8978. if (!defenc) return NULL;
  8979. defenc_c = PyBytes_AS_STRING(defenc);
  8980. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8981. {
  8982. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  8983. char* c;
  8984. for (c = defenc_c; c < end; c++) {
  8985. if ((unsigned char) (*c) >= 128) {
  8986. PyUnicode_AsASCIIString(o);
  8987. return NULL;
  8988. }
  8989. }
  8990. }
  8991. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  8992. *length = PyBytes_GET_SIZE(defenc);
  8993. return defenc_c;
  8994. #else /* PY_VERSION_HEX < 0x03030000 */
  8995. if (PyUnicode_READY(o) == -1) return NULL;
  8996. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8997. if (PyUnicode_IS_ASCII(o)) {
  8998. *length = PyUnicode_GET_LENGTH(o);
  8999. return PyUnicode_AsUTF8(o);
  9000. } else {
  9001. PyUnicode_AsASCIIString(o);
  9002. return NULL;
  9003. }
  9004. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  9005. return PyUnicode_AsUTF8AndSize(o, length);
  9006. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  9007. #endif /* PY_VERSION_HEX < 0x03030000 */
  9008. } else
  9009. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  9010. #if !CYTHON_COMPILING_IN_PYPY
  9011. #if PY_VERSION_HEX >= 0x02060000
  9012. if (PyByteArray_Check(o)) {
  9013. *length = PyByteArray_GET_SIZE(o);
  9014. return PyByteArray_AS_STRING(o);
  9015. } else
  9016. #endif
  9017. #endif
  9018. {
  9019. char* result;
  9020. int r = PyBytes_AsStringAndSize(o, &result, length);
  9021. if (unlikely(r < 0)) {
  9022. return NULL;
  9023. } else {
  9024. return result;
  9025. }
  9026. }
  9027. }
  9028. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  9029. int is_true = x == Py_True;
  9030. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  9031. else return PyObject_IsTrue(x);
  9032. }
  9033. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  9034. PyNumberMethods *m;
  9035. const char *name = NULL;
  9036. PyObject *res = NULL;
  9037. #if PY_MAJOR_VERSION < 3
  9038. if (PyInt_Check(x) || PyLong_Check(x))
  9039. #else
  9040. if (PyLong_Check(x))
  9041. #endif
  9042. return Py_INCREF(x), x;
  9043. m = Py_TYPE(x)->tp_as_number;
  9044. #if PY_MAJOR_VERSION < 3
  9045. if (m && m->nb_int) {
  9046. name = "int";
  9047. res = PyNumber_Int(x);
  9048. }
  9049. else if (m && m->nb_long) {
  9050. name = "long";
  9051. res = PyNumber_Long(x);
  9052. }
  9053. #else
  9054. if (m && m->nb_int) {
  9055. name = "int";
  9056. res = PyNumber_Long(x);
  9057. }
  9058. #endif
  9059. if (res) {
  9060. #if PY_MAJOR_VERSION < 3
  9061. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  9062. #else
  9063. if (!PyLong_Check(res)) {
  9064. #endif
  9065. PyErr_Format(PyExc_TypeError,
  9066. "__%.4s__ returned non-%.4s (type %.200s)",
  9067. name, name, Py_TYPE(res)->tp_name);
  9068. Py_DECREF(res);
  9069. return NULL;
  9070. }
  9071. }
  9072. else if (!PyErr_Occurred()) {
  9073. PyErr_SetString(PyExc_TypeError,
  9074. "an integer is required");
  9075. }
  9076. return res;
  9077. }
  9078. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  9079. #if CYTHON_USE_PYLONG_INTERNALS
  9080. #include "longintrepr.h"
  9081. #endif
  9082. #endif
  9083. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  9084. Py_ssize_t ival;
  9085. PyObject *x;
  9086. #if PY_MAJOR_VERSION < 3
  9087. if (likely(PyInt_CheckExact(b)))
  9088. return PyInt_AS_LONG(b);
  9089. #endif
  9090. if (likely(PyLong_CheckExact(b))) {
  9091. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  9092. #if CYTHON_USE_PYLONG_INTERNALS
  9093. switch (Py_SIZE(b)) {
  9094. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  9095. case 0: return 0;
  9096. case 1: return ((PyLongObject*)b)->ob_digit[0];
  9097. }
  9098. #endif
  9099. #endif
  9100. #if PY_VERSION_HEX < 0x02060000
  9101. return PyInt_AsSsize_t(b);
  9102. #else
  9103. return PyLong_AsSsize_t(b);
  9104. #endif
  9105. }
  9106. x = PyNumber_Index(b);
  9107. if (!x) return -1;
  9108. ival = PyInt_AsSsize_t(x);
  9109. Py_DECREF(x);
  9110. return ival;
  9111. }
  9112. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  9113. #if PY_VERSION_HEX < 0x02050000
  9114. if (ival <= LONG_MAX)
  9115. return PyInt_FromLong((long)ival);
  9116. else {
  9117. unsigned char *bytes = (unsigned char *) &ival;
  9118. int one = 1; int little = (int)*(unsigned char*)&one;
  9119. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  9120. }
  9121. #else
  9122. return PyInt_FromSize_t(ival);
  9123. #endif
  9124. }
  9125. #endif /* Py_PYTHON_H */