scattnlay.cc 413 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818
  1. /* Generated by Cython 0.20.1post0 (Debian 0.20.1+git90-g0e6e38e-1ubuntu2) on Thu Dec 11 08:44:47 2014 */
  2. #define PY_SSIZE_T_CLEAN
  3. #ifndef CYTHON_USE_PYLONG_INTERNALS
  4. #ifdef PYLONG_BITS_IN_DIGIT
  5. #define CYTHON_USE_PYLONG_INTERNALS 0
  6. #else
  7. #include "pyconfig.h"
  8. #ifdef PYLONG_BITS_IN_DIGIT
  9. #define CYTHON_USE_PYLONG_INTERNALS 1
  10. #else
  11. #define CYTHON_USE_PYLONG_INTERNALS 0
  12. #endif
  13. #endif
  14. #endif
  15. #include "Python.h"
  16. #ifndef Py_PYTHON_H
  17. #error Python headers needed to compile C extensions, please install development version of Python.
  18. #elif PY_VERSION_HEX < 0x02040000
  19. #error Cython requires Python 2.4+.
  20. #else
  21. #define CYTHON_ABI "0_20_1post0"
  22. #include <stddef.h> /* For offsetof */
  23. #ifndef offsetof
  24. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  25. #endif
  26. #if !defined(WIN32) && !defined(MS_WINDOWS)
  27. #ifndef __stdcall
  28. #define __stdcall
  29. #endif
  30. #ifndef __cdecl
  31. #define __cdecl
  32. #endif
  33. #ifndef __fastcall
  34. #define __fastcall
  35. #endif
  36. #endif
  37. #ifndef DL_IMPORT
  38. #define DL_IMPORT(t) t
  39. #endif
  40. #ifndef DL_EXPORT
  41. #define DL_EXPORT(t) t
  42. #endif
  43. #ifndef PY_LONG_LONG
  44. #define PY_LONG_LONG LONG_LONG
  45. #endif
  46. #ifndef Py_HUGE_VAL
  47. #define Py_HUGE_VAL HUGE_VAL
  48. #endif
  49. #ifdef PYPY_VERSION
  50. #define CYTHON_COMPILING_IN_PYPY 1
  51. #define CYTHON_COMPILING_IN_CPYTHON 0
  52. #else
  53. #define CYTHON_COMPILING_IN_PYPY 0
  54. #define CYTHON_COMPILING_IN_CPYTHON 1
  55. #endif
  56. #if CYTHON_COMPILING_IN_PYPY
  57. #define Py_OptimizeFlag 0
  58. #endif
  59. #if PY_VERSION_HEX < 0x02050000
  60. typedef int Py_ssize_t;
  61. #define PY_SSIZE_T_MAX INT_MAX
  62. #define PY_SSIZE_T_MIN INT_MIN
  63. #define PY_FORMAT_SIZE_T ""
  64. #define CYTHON_FORMAT_SSIZE_T ""
  65. #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  66. #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
  67. #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
  68. (PyErr_Format(PyExc_TypeError, \
  69. "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
  70. (PyObject*)0))
  71. #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
  72. !PyComplex_Check(o))
  73. #define PyIndex_Check __Pyx_PyIndex_Check
  74. #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  75. #define __PYX_BUILD_PY_SSIZE_T "i"
  76. #else
  77. #define __PYX_BUILD_PY_SSIZE_T "n"
  78. #define CYTHON_FORMAT_SSIZE_T "z"
  79. #define __Pyx_PyIndex_Check PyIndex_Check
  80. #endif
  81. #if PY_VERSION_HEX < 0x02060000
  82. #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  83. #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
  84. #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
  85. #define PyVarObject_HEAD_INIT(type, size) \
  86. PyObject_HEAD_INIT(type) size,
  87. #define PyType_Modified(t)
  88. typedef struct {
  89. void *buf;
  90. PyObject *obj;
  91. Py_ssize_t len;
  92. Py_ssize_t itemsize;
  93. int readonly;
  94. int ndim;
  95. char *format;
  96. Py_ssize_t *shape;
  97. Py_ssize_t *strides;
  98. Py_ssize_t *suboffsets;
  99. void *internal;
  100. } Py_buffer;
  101. #define PyBUF_SIMPLE 0
  102. #define PyBUF_WRITABLE 0x0001
  103. #define PyBUF_FORMAT 0x0004
  104. #define PyBUF_ND 0x0008
  105. #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  106. #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  107. #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  108. #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  109. #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  110. #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  111. #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  112. typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  113. typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
  114. #endif
  115. #if PY_MAJOR_VERSION < 3
  116. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  117. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  118. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  119. #define __Pyx_DefaultClassType PyClass_Type
  120. #else
  121. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  122. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  123. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  124. #define __Pyx_DefaultClassType PyType_Type
  125. #endif
  126. #if PY_VERSION_HEX < 0x02060000
  127. #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
  128. #endif
  129. #if PY_MAJOR_VERSION >= 3
  130. #define Py_TPFLAGS_CHECKTYPES 0
  131. #define Py_TPFLAGS_HAVE_INDEX 0
  132. #endif
  133. #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  134. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  135. #endif
  136. #if PY_VERSION_HEX < 0x02060000
  137. #define Py_TPFLAGS_HAVE_VERSION_TAG 0
  138. #endif
  139. #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  140. #define Py_TPFLAGS_IS_ABSTRACT 0
  141. #endif
  142. #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  143. #define Py_TPFLAGS_HAVE_FINALIZE 0
  144. #endif
  145. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  146. #define CYTHON_PEP393_ENABLED 1
  147. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
  148. 0 : _PyUnicode_Ready((PyObject *)(op)))
  149. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  150. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  151. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  152. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  153. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  154. #else
  155. #define CYTHON_PEP393_ENABLED 0
  156. #define __Pyx_PyUnicode_READY(op) (0)
  157. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  158. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  159. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  160. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  161. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  162. #endif
  163. #if CYTHON_COMPILING_IN_PYPY
  164. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  165. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  166. #else
  167. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  168. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
  169. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  170. #endif
  171. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  172. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  173. #if PY_MAJOR_VERSION >= 3
  174. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  175. #else
  176. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  177. #endif
  178. #if PY_MAJOR_VERSION >= 3
  179. #define PyBaseString_Type PyUnicode_Type
  180. #define PyStringObject PyUnicodeObject
  181. #define PyString_Type PyUnicode_Type
  182. #define PyString_Check PyUnicode_Check
  183. #define PyString_CheckExact PyUnicode_CheckExact
  184. #endif
  185. #if PY_VERSION_HEX < 0x02060000
  186. #define PyBytesObject PyStringObject
  187. #define PyBytes_Type PyString_Type
  188. #define PyBytes_Check PyString_Check
  189. #define PyBytes_CheckExact PyString_CheckExact
  190. #define PyBytes_FromString PyString_FromString
  191. #define PyBytes_FromStringAndSize PyString_FromStringAndSize
  192. #define PyBytes_FromFormat PyString_FromFormat
  193. #define PyBytes_DecodeEscape PyString_DecodeEscape
  194. #define PyBytes_AsString PyString_AsString
  195. #define PyBytes_AsStringAndSize PyString_AsStringAndSize
  196. #define PyBytes_Size PyString_Size
  197. #define PyBytes_AS_STRING PyString_AS_STRING
  198. #define PyBytes_GET_SIZE PyString_GET_SIZE
  199. #define PyBytes_Repr PyString_Repr
  200. #define PyBytes_Concat PyString_Concat
  201. #define PyBytes_ConcatAndDel PyString_ConcatAndDel
  202. #endif
  203. #if PY_MAJOR_VERSION >= 3
  204. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  205. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  206. #else
  207. #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
  208. PyString_Check(obj) || PyUnicode_Check(obj))
  209. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  210. #endif
  211. #if PY_VERSION_HEX < 0x02060000
  212. #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
  213. #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
  214. #endif
  215. #ifndef PySet_CheckExact
  216. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  217. #endif
  218. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  219. #if PY_MAJOR_VERSION >= 3
  220. #define PyIntObject PyLongObject
  221. #define PyInt_Type PyLong_Type
  222. #define PyInt_Check(op) PyLong_Check(op)
  223. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  224. #define PyInt_FromString PyLong_FromString
  225. #define PyInt_FromUnicode PyLong_FromUnicode
  226. #define PyInt_FromLong PyLong_FromLong
  227. #define PyInt_FromSize_t PyLong_FromSize_t
  228. #define PyInt_FromSsize_t PyLong_FromSsize_t
  229. #define PyInt_AsLong PyLong_AsLong
  230. #define PyInt_AS_LONG PyLong_AS_LONG
  231. #define PyInt_AsSsize_t PyLong_AsSsize_t
  232. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  233. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  234. #define PyNumber_Int PyNumber_Long
  235. #endif
  236. #if PY_MAJOR_VERSION >= 3
  237. #define PyBoolObject PyLongObject
  238. #endif
  239. #if PY_VERSION_HEX < 0x030200A4
  240. typedef long Py_hash_t;
  241. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  242. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  243. #else
  244. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  245. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  246. #endif
  247. #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  248. #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  249. #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  250. #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
  251. #else
  252. #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
  253. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
  254. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
  255. (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  256. #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
  257. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  258. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
  259. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  260. #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
  261. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  262. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
  263. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
  264. #endif
  265. #if PY_MAJOR_VERSION >= 3
  266. #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  267. #endif
  268. #if PY_VERSION_HEX < 0x02050000
  269. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
  270. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  271. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
  272. #else
  273. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
  274. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  275. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
  276. #endif
  277. #if PY_VERSION_HEX < 0x02050000
  278. #define __Pyx_NAMESTR(n) ((char *)(n))
  279. #define __Pyx_DOCSTR(n) ((char *)(n))
  280. #else
  281. #define __Pyx_NAMESTR(n) (n)
  282. #define __Pyx_DOCSTR(n) (n)
  283. #endif
  284. #ifndef CYTHON_INLINE
  285. #if defined(__GNUC__)
  286. #define CYTHON_INLINE __inline__
  287. #elif defined(_MSC_VER)
  288. #define CYTHON_INLINE __inline
  289. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  290. #define CYTHON_INLINE inline
  291. #else
  292. #define CYTHON_INLINE
  293. #endif
  294. #endif
  295. #ifndef CYTHON_RESTRICT
  296. #if defined(__GNUC__)
  297. #define CYTHON_RESTRICT __restrict__
  298. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  299. #define CYTHON_RESTRICT __restrict
  300. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  301. #define CYTHON_RESTRICT restrict
  302. #else
  303. #define CYTHON_RESTRICT
  304. #endif
  305. #endif
  306. #ifdef NAN
  307. #define __PYX_NAN() ((float) NAN)
  308. #else
  309. static CYTHON_INLINE float __PYX_NAN() {
  310. /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
  311. a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
  312. a quiet NaN. */
  313. float value;
  314. memset(&value, 0xFF, sizeof(value));
  315. return value;
  316. }
  317. #endif
  318. #ifdef __cplusplus
  319. template<typename T>
  320. void __Pyx_call_destructor(T* x) {
  321. x->~T();
  322. }
  323. #endif
  324. #if PY_MAJOR_VERSION >= 3
  325. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  326. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  327. #else
  328. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  329. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  330. #endif
  331. #ifndef __PYX_EXTERN_C
  332. #ifdef __cplusplus
  333. #define __PYX_EXTERN_C extern "C"
  334. #else
  335. #define __PYX_EXTERN_C extern
  336. #endif
  337. #endif
  338. #if defined(WIN32) || defined(MS_WINDOWS)
  339. #define _USE_MATH_DEFINES
  340. #endif
  341. #include <math.h>
  342. #define __PYX_HAVE__scattnlay
  343. #define __PYX_HAVE_API__scattnlay
  344. #include "string.h"
  345. #include "stdio.h"
  346. #include "stdlib.h"
  347. #include "numpy/arrayobject.h"
  348. #include "numpy/ufuncobject.h"
  349. #include <vector>
  350. #include "py_nmie.h"
  351. #ifdef _OPENMP
  352. #include <omp.h>
  353. #endif /* _OPENMP */
  354. #ifdef PYREX_WITHOUT_ASSERTIONS
  355. #define CYTHON_WITHOUT_ASSERTIONS
  356. #endif
  357. #ifndef CYTHON_UNUSED
  358. # if defined(__GNUC__)
  359. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  360. # define CYTHON_UNUSED __attribute__ ((__unused__))
  361. # else
  362. # define CYTHON_UNUSED
  363. # endif
  364. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  365. # define CYTHON_UNUSED __attribute__ ((__unused__))
  366. # else
  367. # define CYTHON_UNUSED
  368. # endif
  369. #endif
  370. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  371. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  372. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  373. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  374. #define __PYX_DEFAULT_STRING_ENCODING ""
  375. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  376. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  377. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  378. (sizeof(type) < sizeof(Py_ssize_t)) || \
  379. (sizeof(type) > sizeof(Py_ssize_t) && \
  380. likely(v < (type)PY_SSIZE_T_MAX || \
  381. v == (type)PY_SSIZE_T_MAX) && \
  382. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  383. v == (type)PY_SSIZE_T_MIN))) || \
  384. (sizeof(type) == sizeof(Py_ssize_t) && \
  385. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  386. v == (type)PY_SSIZE_T_MAX))) )
  387. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  388. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  389. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  390. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  391. #define __Pyx_PyBytes_FromString PyBytes_FromString
  392. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  393. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  394. #if PY_MAJOR_VERSION < 3
  395. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  396. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  397. #else
  398. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  399. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  400. #endif
  401. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  402. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  403. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
  404. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
  405. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
  406. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
  407. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
  408. #if PY_MAJOR_VERSION < 3
  409. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  410. {
  411. const Py_UNICODE *u_end = u;
  412. while (*u_end++) ;
  413. return u_end - u - 1;
  414. }
  415. #else
  416. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  417. #endif
  418. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  419. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  420. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  421. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  422. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  423. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  424. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  425. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  426. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  427. #if CYTHON_COMPILING_IN_CPYTHON
  428. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  429. #else
  430. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  431. #endif
  432. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  433. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  434. static int __Pyx_sys_getdefaultencoding_not_ascii;
  435. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  436. PyObject* sys = NULL;
  437. PyObject* default_encoding = NULL;
  438. PyObject* ascii_chars_u = NULL;
  439. PyObject* ascii_chars_b = NULL;
  440. sys = PyImport_ImportModule("sys");
  441. if (sys == NULL) goto bad;
  442. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  443. if (default_encoding == NULL) goto bad;
  444. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  445. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  446. } else {
  447. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  448. char ascii_chars[128];
  449. int c;
  450. for (c = 0; c < 128; c++) {
  451. ascii_chars[c] = c;
  452. }
  453. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  454. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  455. if (ascii_chars_u == NULL) goto bad;
  456. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  457. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  458. PyErr_Format(
  459. PyExc_ValueError,
  460. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  461. default_encoding_c);
  462. goto bad;
  463. }
  464. }
  465. Py_XDECREF(sys);
  466. Py_XDECREF(default_encoding);
  467. Py_XDECREF(ascii_chars_u);
  468. Py_XDECREF(ascii_chars_b);
  469. return 0;
  470. bad:
  471. Py_XDECREF(sys);
  472. Py_XDECREF(default_encoding);
  473. Py_XDECREF(ascii_chars_u);
  474. Py_XDECREF(ascii_chars_b);
  475. return -1;
  476. }
  477. #endif
  478. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  479. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  480. #else
  481. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  482. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  483. static char* __PYX_DEFAULT_STRING_ENCODING;
  484. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  485. PyObject* sys = NULL;
  486. PyObject* default_encoding = NULL;
  487. char* default_encoding_c;
  488. sys = PyImport_ImportModule("sys");
  489. if (sys == NULL) goto bad;
  490. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  491. if (default_encoding == NULL) goto bad;
  492. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  493. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  494. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  495. Py_DECREF(sys);
  496. Py_DECREF(default_encoding);
  497. return 0;
  498. bad:
  499. Py_XDECREF(sys);
  500. Py_XDECREF(default_encoding);
  501. return -1;
  502. }
  503. #endif
  504. #endif
  505. /* Test for GCC > 2.95 */
  506. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  507. #define likely(x) __builtin_expect(!!(x), 1)
  508. #define unlikely(x) __builtin_expect(!!(x), 0)
  509. #else /* !__GNUC__ or GCC < 2.95 */
  510. #define likely(x) (x)
  511. #define unlikely(x) (x)
  512. #endif /* __GNUC__ */
  513. static PyObject *__pyx_m;
  514. static PyObject *__pyx_d;
  515. static PyObject *__pyx_b;
  516. static PyObject *__pyx_empty_tuple;
  517. static PyObject *__pyx_empty_bytes;
  518. static int __pyx_lineno;
  519. static int __pyx_clineno = 0;
  520. static const char * __pyx_cfilenm= __FILE__;
  521. static const char *__pyx_filename;
  522. #if !defined(CYTHON_CCOMPLEX)
  523. #if defined(__cplusplus)
  524. #define CYTHON_CCOMPLEX 1
  525. #elif defined(_Complex_I)
  526. #define CYTHON_CCOMPLEX 1
  527. #else
  528. #define CYTHON_CCOMPLEX 0
  529. #endif
  530. #endif
  531. #if CYTHON_CCOMPLEX
  532. #ifdef __cplusplus
  533. #include <complex>
  534. #else
  535. #include <complex.h>
  536. #endif
  537. #endif
  538. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  539. #undef _Complex_I
  540. #define _Complex_I 1.0fj
  541. #endif
  542. static const char *__pyx_f[] = {
  543. "scattnlay.pyx",
  544. "__init__.pxd",
  545. "stringsource",
  546. "stringsource",
  547. "type.pxd",
  548. };
  549. #define IS_UNSIGNED(type) (((type) -1) > 0)
  550. struct __Pyx_StructField_;
  551. #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
  552. typedef struct {
  553. const char* name; /* for error messages only */
  554. struct __Pyx_StructField_* fields;
  555. size_t size; /* sizeof(type) */
  556. size_t arraysize[8]; /* length of array in each dimension */
  557. int ndim;
  558. char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
  559. char is_unsigned;
  560. int flags;
  561. } __Pyx_TypeInfo;
  562. typedef struct __Pyx_StructField_ {
  563. __Pyx_TypeInfo* type;
  564. const char* name;
  565. size_t offset;
  566. } __Pyx_StructField;
  567. typedef struct {
  568. __Pyx_StructField* field;
  569. size_t parent_offset;
  570. } __Pyx_BufFmt_StackElem;
  571. typedef struct {
  572. __Pyx_StructField root;
  573. __Pyx_BufFmt_StackElem* head;
  574. size_t fmt_offset;
  575. size_t new_count, enc_count;
  576. size_t struct_alignment;
  577. int is_complex;
  578. char enc_type;
  579. char new_packmode;
  580. char enc_packmode;
  581. char is_valid_array;
  582. } __Pyx_BufFmt_Context;
  583. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
  584. * # in Cython to enable them only on the right systems.
  585. *
  586. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  587. * ctypedef npy_int16 int16_t
  588. * ctypedef npy_int32 int32_t
  589. */
  590. typedef npy_int8 __pyx_t_5numpy_int8_t;
  591. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
  592. *
  593. * ctypedef npy_int8 int8_t
  594. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  595. * ctypedef npy_int32 int32_t
  596. * ctypedef npy_int64 int64_t
  597. */
  598. typedef npy_int16 __pyx_t_5numpy_int16_t;
  599. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
  600. * ctypedef npy_int8 int8_t
  601. * ctypedef npy_int16 int16_t
  602. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  603. * ctypedef npy_int64 int64_t
  604. * #ctypedef npy_int96 int96_t
  605. */
  606. typedef npy_int32 __pyx_t_5numpy_int32_t;
  607. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
  608. * ctypedef npy_int16 int16_t
  609. * ctypedef npy_int32 int32_t
  610. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  611. * #ctypedef npy_int96 int96_t
  612. * #ctypedef npy_int128 int128_t
  613. */
  614. typedef npy_int64 __pyx_t_5numpy_int64_t;
  615. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
  616. * #ctypedef npy_int128 int128_t
  617. *
  618. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  619. * ctypedef npy_uint16 uint16_t
  620. * ctypedef npy_uint32 uint32_t
  621. */
  622. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  623. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
  624. *
  625. * ctypedef npy_uint8 uint8_t
  626. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  627. * ctypedef npy_uint32 uint32_t
  628. * ctypedef npy_uint64 uint64_t
  629. */
  630. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  631. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
  632. * ctypedef npy_uint8 uint8_t
  633. * ctypedef npy_uint16 uint16_t
  634. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  635. * ctypedef npy_uint64 uint64_t
  636. * #ctypedef npy_uint96 uint96_t
  637. */
  638. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  639. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
  640. * ctypedef npy_uint16 uint16_t
  641. * ctypedef npy_uint32 uint32_t
  642. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  643. * #ctypedef npy_uint96 uint96_t
  644. * #ctypedef npy_uint128 uint128_t
  645. */
  646. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  647. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
  648. * #ctypedef npy_uint128 uint128_t
  649. *
  650. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  651. * ctypedef npy_float64 float64_t
  652. * #ctypedef npy_float80 float80_t
  653. */
  654. typedef npy_float32 __pyx_t_5numpy_float32_t;
  655. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
  656. *
  657. * ctypedef npy_float32 float32_t
  658. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  659. * #ctypedef npy_float80 float80_t
  660. * #ctypedef npy_float128 float128_t
  661. */
  662. typedef npy_float64 __pyx_t_5numpy_float64_t;
  663. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
  664. * # The int types are mapped a bit surprising --
  665. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  666. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  667. * ctypedef npy_longlong long_t
  668. * ctypedef npy_longlong longlong_t
  669. */
  670. typedef npy_long __pyx_t_5numpy_int_t;
  671. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
  672. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  673. * ctypedef npy_long int_t
  674. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  675. * ctypedef npy_longlong longlong_t
  676. *
  677. */
  678. typedef npy_longlong __pyx_t_5numpy_long_t;
  679. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
  680. * ctypedef npy_long int_t
  681. * ctypedef npy_longlong long_t
  682. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  683. *
  684. * ctypedef npy_ulong uint_t
  685. */
  686. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  687. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
  688. * ctypedef npy_longlong longlong_t
  689. *
  690. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  691. * ctypedef npy_ulonglong ulong_t
  692. * ctypedef npy_ulonglong ulonglong_t
  693. */
  694. typedef npy_ulong __pyx_t_5numpy_uint_t;
  695. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
  696. *
  697. * ctypedef npy_ulong uint_t
  698. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  699. * ctypedef npy_ulonglong ulonglong_t
  700. *
  701. */
  702. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  703. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
  704. * ctypedef npy_ulong uint_t
  705. * ctypedef npy_ulonglong ulong_t
  706. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  707. *
  708. * ctypedef npy_intp intp_t
  709. */
  710. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  711. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
  712. * ctypedef npy_ulonglong ulonglong_t
  713. *
  714. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  715. * ctypedef npy_uintp uintp_t
  716. *
  717. */
  718. typedef npy_intp __pyx_t_5numpy_intp_t;
  719. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
  720. *
  721. * ctypedef npy_intp intp_t
  722. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  723. *
  724. * ctypedef npy_double float_t
  725. */
  726. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  727. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
  728. * ctypedef npy_uintp uintp_t
  729. *
  730. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  731. * ctypedef npy_double double_t
  732. * ctypedef npy_longdouble longdouble_t
  733. */
  734. typedef npy_double __pyx_t_5numpy_float_t;
  735. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
  736. *
  737. * ctypedef npy_double float_t
  738. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  739. * ctypedef npy_longdouble longdouble_t
  740. *
  741. */
  742. typedef npy_double __pyx_t_5numpy_double_t;
  743. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
  744. * ctypedef npy_double float_t
  745. * ctypedef npy_double double_t
  746. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  747. *
  748. * ctypedef npy_cfloat cfloat_t
  749. */
  750. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  751. #if CYTHON_CCOMPLEX
  752. #ifdef __cplusplus
  753. typedef ::std::complex< double > __pyx_t_double_complex;
  754. #else
  755. typedef double _Complex __pyx_t_double_complex;
  756. #endif
  757. #else
  758. typedef struct { double real, imag; } __pyx_t_double_complex;
  759. #endif
  760. #if CYTHON_CCOMPLEX
  761. #ifdef __cplusplus
  762. typedef ::std::complex< float > __pyx_t_float_complex;
  763. #else
  764. typedef float _Complex __pyx_t_float_complex;
  765. #endif
  766. #else
  767. typedef struct { float real, imag; } __pyx_t_float_complex;
  768. #endif
  769. /*--- Type declarations ---*/
  770. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
  771. * ctypedef npy_longdouble longdouble_t
  772. *
  773. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  774. * ctypedef npy_cdouble cdouble_t
  775. * ctypedef npy_clongdouble clongdouble_t
  776. */
  777. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  778. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
  779. *
  780. * ctypedef npy_cfloat cfloat_t
  781. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  782. * ctypedef npy_clongdouble clongdouble_t
  783. *
  784. */
  785. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  786. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
  787. * ctypedef npy_cfloat cfloat_t
  788. * ctypedef npy_cdouble cdouble_t
  789. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  790. *
  791. * ctypedef npy_cdouble complex_t
  792. */
  793. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  794. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
  795. * ctypedef npy_clongdouble clongdouble_t
  796. *
  797. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  798. *
  799. * cdef inline object PyArray_MultiIterNew1(a):
  800. */
  801. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  802. #ifndef CYTHON_REFNANNY
  803. #define CYTHON_REFNANNY 0
  804. #endif
  805. #if CYTHON_REFNANNY
  806. typedef struct {
  807. void (*INCREF)(void*, PyObject*, int);
  808. void (*DECREF)(void*, PyObject*, int);
  809. void (*GOTREF)(void*, PyObject*, int);
  810. void (*GIVEREF)(void*, PyObject*, int);
  811. void* (*SetupContext)(const char*, int, const char*);
  812. void (*FinishContext)(void**);
  813. } __Pyx_RefNannyAPIStruct;
  814. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  815. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  816. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  817. #ifdef WITH_THREAD
  818. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  819. if (acquire_gil) { \
  820. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  821. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  822. PyGILState_Release(__pyx_gilstate_save); \
  823. } else { \
  824. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  825. }
  826. #else
  827. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  828. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  829. #endif
  830. #define __Pyx_RefNannyFinishContext() \
  831. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  832. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  833. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  834. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  835. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  836. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  837. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  838. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  839. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  840. #else
  841. #define __Pyx_RefNannyDeclarations
  842. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  843. #define __Pyx_RefNannyFinishContext()
  844. #define __Pyx_INCREF(r) Py_INCREF(r)
  845. #define __Pyx_DECREF(r) Py_DECREF(r)
  846. #define __Pyx_GOTREF(r)
  847. #define __Pyx_GIVEREF(r)
  848. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  849. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  850. #define __Pyx_XGOTREF(r)
  851. #define __Pyx_XGIVEREF(r)
  852. #endif /* CYTHON_REFNANNY */
  853. #define __Pyx_XDECREF_SET(r, v) do { \
  854. PyObject *tmp = (PyObject *) r; \
  855. r = v; __Pyx_XDECREF(tmp); \
  856. } while (0)
  857. #define __Pyx_DECREF_SET(r, v) do { \
  858. PyObject *tmp = (PyObject *) r; \
  859. r = v; __Pyx_DECREF(tmp); \
  860. } while (0)
  861. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  862. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  863. #if CYTHON_COMPILING_IN_CPYTHON
  864. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  865. PyTypeObject* tp = Py_TYPE(obj);
  866. if (likely(tp->tp_getattro))
  867. return tp->tp_getattro(obj, attr_name);
  868. #if PY_MAJOR_VERSION < 3
  869. if (likely(tp->tp_getattr))
  870. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  871. #endif
  872. return PyObject_GetAttr(obj, attr_name);
  873. }
  874. #else
  875. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  876. #endif
  877. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  878. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  879. #if CYTHON_COMPILING_IN_CPYTHON
  880. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  881. #else
  882. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  883. #endif
  884. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
  885. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  886. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  887. static void __Pyx_WriteUnraisable(const char *name, int clineno,
  888. int lineno, const char *filename,
  889. int full_traceback); /*proto*/
  890. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  891. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  892. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  893. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  894. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  895. const char* function_name); /*proto*/
  896. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  897. const char *name, int exact); /*proto*/
  898. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
  899. __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
  900. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
  901. static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
  902. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  903. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  904. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
  905. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
  906. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  907. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  908. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  909. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  910. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  911. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  912. int wraparound, int boundscheck);
  913. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  914. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  915. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
  916. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  917. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  918. int wraparound, int boundscheck);
  919. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  920. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  921. int is_list, int wraparound, int boundscheck);
  922. static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
  923. #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
  924. #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
  925. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
  926. __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
  927. (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
  928. __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
  929. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
  930. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  931. int is_list, int wraparound, int boundscheck);
  932. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
  933. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  934. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  935. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  936. typedef struct {
  937. Py_ssize_t shape, strides, suboffsets;
  938. } __Pyx_Buf_DimInfo;
  939. typedef struct {
  940. size_t refcount;
  941. Py_buffer pybuffer;
  942. } __Pyx_Buffer;
  943. typedef struct {
  944. __Pyx_Buffer *rcbuffer;
  945. char *data;
  946. __Pyx_Buf_DimInfo diminfo[8];
  947. } __Pyx_LocalBuf_ND;
  948. #if PY_MAJOR_VERSION < 3
  949. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
  950. static void __Pyx_ReleaseBuffer(Py_buffer *view);
  951. #else
  952. #define __Pyx_GetBuffer PyObject_GetBuffer
  953. #define __Pyx_ReleaseBuffer PyBuffer_Release
  954. #endif
  955. static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
  956. static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
  957. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  958. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *);
  959. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
  960. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  961. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);
  962. #if CYTHON_CCOMPLEX
  963. #ifdef __cplusplus
  964. #define __Pyx_CREAL(z) ((z).real())
  965. #define __Pyx_CIMAG(z) ((z).imag())
  966. #else
  967. #define __Pyx_CREAL(z) (__real__(z))
  968. #define __Pyx_CIMAG(z) (__imag__(z))
  969. #endif
  970. #else
  971. #define __Pyx_CREAL(z) ((z).real)
  972. #define __Pyx_CIMAG(z) ((z).imag)
  973. #endif
  974. #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
  975. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  976. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  977. #else
  978. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  979. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  980. #endif
  981. #if CYTHON_CCOMPLEX
  982. #define __Pyx_c_eq(a, b) ((a)==(b))
  983. #define __Pyx_c_sum(a, b) ((a)+(b))
  984. #define __Pyx_c_diff(a, b) ((a)-(b))
  985. #define __Pyx_c_prod(a, b) ((a)*(b))
  986. #define __Pyx_c_quot(a, b) ((a)/(b))
  987. #define __Pyx_c_neg(a) (-(a))
  988. #ifdef __cplusplus
  989. #define __Pyx_c_is_zero(z) ((z)==(double)0)
  990. #define __Pyx_c_conj(z) (::std::conj(z))
  991. #if 1
  992. #define __Pyx_c_abs(z) (::std::abs(z))
  993. #define __Pyx_c_pow(a, b) (::std::pow(a, b))
  994. #endif
  995. #else
  996. #define __Pyx_c_is_zero(z) ((z)==0)
  997. #define __Pyx_c_conj(z) (conj(z))
  998. #if 1
  999. #define __Pyx_c_abs(z) (cabs(z))
  1000. #define __Pyx_c_pow(a, b) (cpow(a, b))
  1001. #endif
  1002. #endif
  1003. #else
  1004. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
  1005. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
  1006. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
  1007. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
  1008. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
  1009. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
  1010. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
  1011. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
  1012. #if 1
  1013. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
  1014. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
  1015. #endif
  1016. #endif
  1017. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1018. #if CYTHON_CCOMPLEX
  1019. #define __Pyx_c_eqf(a, b) ((a)==(b))
  1020. #define __Pyx_c_sumf(a, b) ((a)+(b))
  1021. #define __Pyx_c_difff(a, b) ((a)-(b))
  1022. #define __Pyx_c_prodf(a, b) ((a)*(b))
  1023. #define __Pyx_c_quotf(a, b) ((a)/(b))
  1024. #define __Pyx_c_negf(a) (-(a))
  1025. #ifdef __cplusplus
  1026. #define __Pyx_c_is_zerof(z) ((z)==(float)0)
  1027. #define __Pyx_c_conjf(z) (::std::conj(z))
  1028. #if 1
  1029. #define __Pyx_c_absf(z) (::std::abs(z))
  1030. #define __Pyx_c_powf(a, b) (::std::pow(a, b))
  1031. #endif
  1032. #else
  1033. #define __Pyx_c_is_zerof(z) ((z)==0)
  1034. #define __Pyx_c_conjf(z) (conjf(z))
  1035. #if 1
  1036. #define __Pyx_c_absf(z) (cabsf(z))
  1037. #define __Pyx_c_powf(a, b) (cpowf(a, b))
  1038. #endif
  1039. #endif
  1040. #else
  1041. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
  1042. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
  1043. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
  1044. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
  1045. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
  1046. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
  1047. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
  1048. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
  1049. #if 1
  1050. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
  1051. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
  1052. #endif
  1053. #endif
  1054. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1055. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1056. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1057. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1058. static int __Pyx_check_binary_version(void);
  1059. #if !defined(__Pyx_PyIdentifier_FromString)
  1060. #if PY_MAJOR_VERSION < 3
  1061. #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
  1062. #else
  1063. #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
  1064. #endif
  1065. #endif
  1066. static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
  1067. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
  1068. typedef struct {
  1069. int code_line;
  1070. PyCodeObject* code_object;
  1071. } __Pyx_CodeObjectCacheEntry;
  1072. struct __Pyx_CodeObjectCache {
  1073. int count;
  1074. int max_count;
  1075. __Pyx_CodeObjectCacheEntry* entries;
  1076. };
  1077. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1078. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1079. static PyCodeObject *__pyx_find_code_object(int code_line);
  1080. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1081. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1082. int py_line, const char *filename); /*proto*/
  1083. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  1084. /* Module declarations from 'cpython.buffer' */
  1085. /* Module declarations from 'cpython.ref' */
  1086. /* Module declarations from 'libc.string' */
  1087. /* Module declarations from 'libc.stdio' */
  1088. /* Module declarations from 'cpython.object' */
  1089. /* Module declarations from '__builtin__' */
  1090. /* Module declarations from 'cpython.type' */
  1091. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1092. /* Module declarations from 'libc.stdlib' */
  1093. /* Module declarations from 'numpy' */
  1094. /* Module declarations from 'numpy' */
  1095. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1096. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1097. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1098. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1099. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1100. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1101. /* Module declarations from 'scattnlay' */
  1102. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *); /*proto*/
  1103. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1104. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *); /*proto*/
  1105. static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
  1106. static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), { 0 }, 0, 'C', 0, 0 };
  1107. static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
  1108. #define __Pyx_MODULE_NAME "scattnlay"
  1109. int __pyx_module_is_main_scattnlay = 0;
  1110. /* Implementation of 'scattnlay' */
  1111. static PyObject *__pyx_builtin_range;
  1112. static PyObject *__pyx_builtin_ValueError;
  1113. static PyObject *__pyx_builtin_RuntimeError;
  1114. static PyObject *__pyx_pf_9scattnlay_scattnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_theta, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_n_max); /* proto */
  1115. static PyObject *__pyx_pf_9scattnlay_2fieldnlay(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_coords, __pyx_t_5numpy_int_t __pyx_v_pl, __pyx_t_5numpy_int_t __pyx_v_n_max); /* proto */
  1116. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  1117. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  1118. static char __pyx_k_B[] = "B";
  1119. static char __pyx_k_C[] = "C";
  1120. static char __pyx_k_E[] = "E";
  1121. static char __pyx_k_H[] = "H";
  1122. static char __pyx_k_I[] = "I";
  1123. static char __pyx_k_L[] = "L";
  1124. static char __pyx_k_O[] = "O";
  1125. static char __pyx_k_Q[] = "Q";
  1126. static char __pyx_k_b[] = "b";
  1127. static char __pyx_k_d[] = "d";
  1128. static char __pyx_k_f[] = "f";
  1129. static char __pyx_k_g[] = "g";
  1130. static char __pyx_k_h[] = "h";
  1131. static char __pyx_k_i[] = "i";
  1132. static char __pyx_k_l[] = "l";
  1133. static char __pyx_k_m[] = "m";
  1134. static char __pyx_k_q[] = "q";
  1135. static char __pyx_k_x[] = "x";
  1136. static char __pyx_k_Ei[] = "Ei";
  1137. static char __pyx_k_Er[] = "Er";
  1138. static char __pyx_k_Hi[] = "Hi";
  1139. static char __pyx_k_Hr[] = "Hr";
  1140. static char __pyx_k_S1[] = "S1";
  1141. static char __pyx_k_S2[] = "S2";
  1142. static char __pyx_k_Zd[] = "Zd";
  1143. static char __pyx_k_Zf[] = "Zf";
  1144. static char __pyx_k_Zg[] = "Zg";
  1145. static char __pyx_k_np[] = "np";
  1146. static char __pyx_k_pl[] = "pl";
  1147. static char __pyx_k_Qbk[] = "Qbk";
  1148. static char __pyx_k_Qpr[] = "Qpr";
  1149. static char __pyx_k_S1i[] = "S1i";
  1150. static char __pyx_k_S1r[] = "S1r";
  1151. static char __pyx_k_S2i[] = "S2i";
  1152. static char __pyx_k_S2r[] = "S2r";
  1153. static char __pyx_k_int[] = "int";
  1154. static char __pyx_k_Qabs[] = "Qabs";
  1155. static char __pyx_k_Qext[] = "Qext";
  1156. static char __pyx_k_Qsca[] = "Qsca";
  1157. static char __pyx_k_copy[] = "copy";
  1158. static char __pyx_k_main[] = "__main__";
  1159. static char __pyx_k_test[] = "__test__";
  1160. static char __pyx_k_dtype[] = "dtype";
  1161. static char __pyx_k_flags[] = "flags";
  1162. static char __pyx_k_n_max[] = "n_max";
  1163. static char __pyx_k_numpy[] = "numpy";
  1164. static char __pyx_k_range[] = "range";
  1165. static char __pyx_k_terms[] = "terms";
  1166. static char __pyx_k_theta[] = "theta";
  1167. static char __pyx_k_zeros[] = "zeros";
  1168. static char __pyx_k_Albedo[] = "Albedo";
  1169. static char __pyx_k_coords[] = "coords";
  1170. static char __pyx_k_import[] = "__import__";
  1171. static char __pyx_k_float64[] = "float64";
  1172. static char __pyx_k_fieldnlay[] = "fieldnlay";
  1173. static char __pyx_k_scattnlay[] = "scattnlay";
  1174. static char __pyx_k_ValueError[] = "ValueError";
  1175. static char __pyx_k_complex128[] = "complex128";
  1176. static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
  1177. static char __pyx_k_RuntimeError[] = "RuntimeError";
  1178. static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
  1179. static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer";
  1180. static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  1181. static char __pyx_k_home_ovidio_scattering_scattnla[] = "/home/ovidio/scattering/scattnlay/python-scattnlay-0.3.1/scattnlay.pyx";
  1182. static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  1183. static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  1184. static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  1185. static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  1186. static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  1187. static PyObject *__pyx_n_s_Albedo;
  1188. static PyObject *__pyx_n_s_C;
  1189. static PyObject *__pyx_n_s_C_CONTIGUOUS;
  1190. static PyObject *__pyx_n_s_E;
  1191. static PyObject *__pyx_n_s_Ei;
  1192. static PyObject *__pyx_n_s_Er;
  1193. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  1194. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  1195. static PyObject *__pyx_n_s_H;
  1196. static PyObject *__pyx_n_s_Hi;
  1197. static PyObject *__pyx_n_s_Hr;
  1198. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  1199. static PyObject *__pyx_n_s_Qabs;
  1200. static PyObject *__pyx_n_s_Qbk;
  1201. static PyObject *__pyx_n_s_Qext;
  1202. static PyObject *__pyx_n_s_Qpr;
  1203. static PyObject *__pyx_n_s_Qsca;
  1204. static PyObject *__pyx_n_s_RuntimeError;
  1205. static PyObject *__pyx_n_s_S1;
  1206. static PyObject *__pyx_n_s_S1i;
  1207. static PyObject *__pyx_n_s_S1r;
  1208. static PyObject *__pyx_n_s_S2;
  1209. static PyObject *__pyx_n_s_S2i;
  1210. static PyObject *__pyx_n_s_S2r;
  1211. static PyObject *__pyx_n_s_ValueError;
  1212. static PyObject *__pyx_n_s_complex128;
  1213. static PyObject *__pyx_n_s_coords;
  1214. static PyObject *__pyx_n_s_copy;
  1215. static PyObject *__pyx_n_s_dtype;
  1216. static PyObject *__pyx_n_s_fieldnlay;
  1217. static PyObject *__pyx_n_s_flags;
  1218. static PyObject *__pyx_n_s_float64;
  1219. static PyObject *__pyx_n_s_g;
  1220. static PyObject *__pyx_kp_s_home_ovidio_scattering_scattnla;
  1221. static PyObject *__pyx_n_s_i;
  1222. static PyObject *__pyx_n_s_import;
  1223. static PyObject *__pyx_n_s_int;
  1224. static PyObject *__pyx_n_s_m;
  1225. static PyObject *__pyx_n_s_main;
  1226. static PyObject *__pyx_n_s_n_max;
  1227. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  1228. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  1229. static PyObject *__pyx_n_s_np;
  1230. static PyObject *__pyx_n_s_numpy;
  1231. static PyObject *__pyx_n_s_pl;
  1232. static PyObject *__pyx_n_s_pyx_getbuffer;
  1233. static PyObject *__pyx_n_s_pyx_releasebuffer;
  1234. static PyObject *__pyx_n_s_range;
  1235. static PyObject *__pyx_n_s_scattnlay;
  1236. static PyObject *__pyx_n_s_terms;
  1237. static PyObject *__pyx_n_s_test;
  1238. static PyObject *__pyx_n_s_theta;
  1239. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  1240. static PyObject *__pyx_n_s_x;
  1241. static PyObject *__pyx_n_s_zeros;
  1242. static PyObject *__pyx_int_0;
  1243. static PyObject *__pyx_int_1;
  1244. static PyObject *__pyx_int_2;
  1245. static PyObject *__pyx_int_3;
  1246. static PyArrayObject *__pyx_k__2;
  1247. static PyArrayObject *__pyx_k__10;
  1248. static PyObject *__pyx_tuple_;
  1249. static PyObject *__pyx_tuple__3;
  1250. static PyObject *__pyx_tuple__4;
  1251. static PyObject *__pyx_tuple__5;
  1252. static PyObject *__pyx_tuple__6;
  1253. static PyObject *__pyx_tuple__7;
  1254. static PyObject *__pyx_tuple__8;
  1255. static PyObject *__pyx_tuple__9;
  1256. static PyObject *__pyx_slice__13;
  1257. static PyObject *__pyx_slice__16;
  1258. static PyObject *__pyx_slice__19;
  1259. static PyObject *__pyx_tuple__11;
  1260. static PyObject *__pyx_tuple__12;
  1261. static PyObject *__pyx_tuple__14;
  1262. static PyObject *__pyx_tuple__15;
  1263. static PyObject *__pyx_tuple__17;
  1264. static PyObject *__pyx_tuple__18;
  1265. static PyObject *__pyx_tuple__20;
  1266. static PyObject *__pyx_tuple__21;
  1267. static PyObject *__pyx_tuple__22;
  1268. static PyObject *__pyx_tuple__23;
  1269. static PyObject *__pyx_tuple__24;
  1270. static PyObject *__pyx_tuple__25;
  1271. static PyObject *__pyx_tuple__26;
  1272. static PyObject *__pyx_tuple__27;
  1273. static PyObject *__pyx_tuple__28;
  1274. static PyObject *__pyx_tuple__29;
  1275. static PyObject *__pyx_tuple__30;
  1276. static PyObject *__pyx_tuple__31;
  1277. static PyObject *__pyx_tuple__32;
  1278. static PyObject *__pyx_tuple__33;
  1279. static PyObject *__pyx_tuple__35;
  1280. static PyObject *__pyx_tuple__36;
  1281. static PyObject *__pyx_tuple__37;
  1282. static PyObject *__pyx_codeobj__34;
  1283. static PyObject *__pyx_codeobj__38;
  1284. /* "scattnlay.pyx":43
  1285. * iterator end()
  1286. *
  1287. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1288. * assert a.dtype == np.float64
  1289. *
  1290. */
  1291. static CYTHON_INLINE double *__pyx_f_9scattnlay_npy2c(PyArrayObject *__pyx_v_a) {
  1292. double *__pyx_r;
  1293. __Pyx_RefNannyDeclarations
  1294. PyObject *__pyx_t_1 = NULL;
  1295. PyObject *__pyx_t_2 = NULL;
  1296. PyObject *__pyx_t_3 = NULL;
  1297. int __pyx_t_4;
  1298. int __pyx_t_5;
  1299. int __pyx_lineno = 0;
  1300. const char *__pyx_filename = NULL;
  1301. int __pyx_clineno = 0;
  1302. __Pyx_RefNannySetupContext("npy2c", 0);
  1303. __Pyx_INCREF((PyObject *)__pyx_v_a);
  1304. /* "scattnlay.pyx":44
  1305. *
  1306. * cdef inline double *npy2c(np.ndarray a):
  1307. * assert a.dtype == np.float64 # <<<<<<<<<<<<<<
  1308. *
  1309. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1310. */
  1311. #ifndef CYTHON_WITHOUT_ASSERTIONS
  1312. if (unlikely(!Py_OptimizeFlag)) {
  1313. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1314. __Pyx_GOTREF(__pyx_t_1);
  1315. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1316. __Pyx_GOTREF(__pyx_t_2);
  1317. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1318. __Pyx_GOTREF(__pyx_t_3);
  1319. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1320. __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1321. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1322. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1323. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1324. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1325. if (unlikely(!__pyx_t_4)) {
  1326. PyErr_SetNone(PyExc_AssertionError);
  1327. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1328. }
  1329. }
  1330. #endif
  1331. /* "scattnlay.pyx":46
  1332. * assert a.dtype == np.float64
  1333. *
  1334. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy # <<<<<<<<<<<<<<
  1335. * a = a.copy('C')
  1336. *
  1337. */
  1338. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1339. __Pyx_GOTREF(__pyx_t_2);
  1340. __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  1341. __Pyx_GOTREF(__pyx_t_3);
  1342. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1343. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1344. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1345. __pyx_t_5 = ((!__pyx_t_4) != 0);
  1346. if (__pyx_t_5) {
  1347. /* "scattnlay.pyx":47
  1348. *
  1349. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  1350. * a = a.copy('C') # <<<<<<<<<<<<<<
  1351. *
  1352. * # Return data pointer
  1353. */
  1354. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_a), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1355. __Pyx_GOTREF(__pyx_t_3);
  1356. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1357. __Pyx_GOTREF(__pyx_t_2);
  1358. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1359. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1360. __Pyx_DECREF_SET(__pyx_v_a, ((PyArrayObject *)__pyx_t_2));
  1361. __pyx_t_2 = 0;
  1362. goto __pyx_L3;
  1363. }
  1364. __pyx_L3:;
  1365. /* "scattnlay.pyx":50
  1366. *
  1367. * # Return data pointer
  1368. * return <double *>(a.data) # <<<<<<<<<<<<<<
  1369. *
  1370. * cdef extern from "py_nmie.h":
  1371. */
  1372. __pyx_r = ((double *)__pyx_v_a->data);
  1373. goto __pyx_L0;
  1374. /* "scattnlay.pyx":43
  1375. * iterator end()
  1376. *
  1377. * cdef inline double *npy2c(np.ndarray a): # <<<<<<<<<<<<<<
  1378. * assert a.dtype == np.float64
  1379. *
  1380. */
  1381. /* function exit code */
  1382. __pyx_L1_error:;
  1383. __Pyx_XDECREF(__pyx_t_1);
  1384. __Pyx_XDECREF(__pyx_t_2);
  1385. __Pyx_XDECREF(__pyx_t_3);
  1386. __Pyx_WriteUnraisable("scattnlay.npy2c", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  1387. __pyx_r = 0;
  1388. __pyx_L0:;
  1389. __Pyx_XDECREF((PyObject *)__pyx_v_a);
  1390. __Pyx_RefNannyFinishContext();
  1391. return __pyx_r;
  1392. }
  1393. /* "scattnlay.pyx":56
  1394. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int n_max, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Er[], double Ei[], double Hr[], double Hi[])
  1395. *
  1396. * 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 n_max = -1): # <<<<<<<<<<<<<<
  1397. * cdef Py_ssize_t i
  1398. *
  1399. */
  1400. /* Python wrapper */
  1401. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1402. static PyMethodDef __pyx_mdef_9scattnlay_1scattnlay = {__Pyx_NAMESTR("scattnlay"), (PyCFunction)__pyx_pw_9scattnlay_1scattnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1403. static PyObject *__pyx_pw_9scattnlay_1scattnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1404. PyArrayObject *__pyx_v_x = 0;
  1405. PyArrayObject *__pyx_v_m = 0;
  1406. PyArrayObject *__pyx_v_theta = 0;
  1407. __pyx_t_5numpy_int_t __pyx_v_pl;
  1408. __pyx_t_5numpy_int_t __pyx_v_n_max;
  1409. int __pyx_lineno = 0;
  1410. const char *__pyx_filename = NULL;
  1411. int __pyx_clineno = 0;
  1412. PyObject *__pyx_r = 0;
  1413. __Pyx_RefNannyDeclarations
  1414. __Pyx_RefNannySetupContext("scattnlay (wrapper)", 0);
  1415. {
  1416. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_theta,&__pyx_n_s_pl,&__pyx_n_s_n_max,0};
  1417. PyObject* values[5] = {0,0,0,0,0};
  1418. values[2] = (PyObject *)__pyx_k__2;
  1419. if (unlikely(__pyx_kwds)) {
  1420. Py_ssize_t kw_args;
  1421. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1422. switch (pos_args) {
  1423. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1424. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1425. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1426. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1427. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1428. case 0: break;
  1429. default: goto __pyx_L5_argtuple_error;
  1430. }
  1431. kw_args = PyDict_Size(__pyx_kwds);
  1432. switch (pos_args) {
  1433. case 0:
  1434. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  1435. else goto __pyx_L5_argtuple_error;
  1436. case 1:
  1437. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  1438. else {
  1439. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1440. }
  1441. case 2:
  1442. if (kw_args > 0) {
  1443. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_theta);
  1444. if (value) { values[2] = value; kw_args--; }
  1445. }
  1446. case 3:
  1447. if (kw_args > 0) {
  1448. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  1449. if (value) { values[3] = value; kw_args--; }
  1450. }
  1451. case 4:
  1452. if (kw_args > 0) {
  1453. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_max);
  1454. if (value) { values[4] = value; kw_args--; }
  1455. }
  1456. }
  1457. if (unlikely(kw_args > 0)) {
  1458. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scattnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1459. }
  1460. } else {
  1461. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1462. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  1463. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  1464. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  1465. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1466. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1467. break;
  1468. default: goto __pyx_L5_argtuple_error;
  1469. }
  1470. }
  1471. __pyx_v_x = ((PyArrayObject *)values[0]);
  1472. __pyx_v_m = ((PyArrayObject *)values[1]);
  1473. __pyx_v_theta = ((PyArrayObject *)values[2]);
  1474. if (values[3]) {
  1475. __pyx_v_pl = __Pyx_PyInt_As_npy_long(values[3]); if (unlikely((__pyx_v_pl == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1476. } else {
  1477. __pyx_v_pl = ((__pyx_t_5numpy_int_t)-1);
  1478. }
  1479. if (values[4]) {
  1480. __pyx_v_n_max = __Pyx_PyInt_As_npy_long(values[4]); if (unlikely((__pyx_v_n_max == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1481. } else {
  1482. __pyx_v_n_max = ((__pyx_t_5numpy_int_t)-1);
  1483. }
  1484. }
  1485. goto __pyx_L4_argument_unpacking_done;
  1486. __pyx_L5_argtuple_error:;
  1487. __Pyx_RaiseArgtupleInvalid("scattnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1488. __pyx_L3_error:;
  1489. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1490. __Pyx_RefNannyFinishContext();
  1491. return NULL;
  1492. __pyx_L4_argument_unpacking_done:;
  1493. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1494. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1495. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_theta), __pyx_ptype_5numpy_ndarray, 1, "theta", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1496. __pyx_r = __pyx_pf_9scattnlay_scattnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_theta, __pyx_v_pl, __pyx_v_n_max);
  1497. /* function exit code */
  1498. goto __pyx_L0;
  1499. __pyx_L1_error:;
  1500. __pyx_r = NULL;
  1501. __pyx_L0:;
  1502. __Pyx_RefNannyFinishContext();
  1503. return __pyx_r;
  1504. }
  1505. 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_n_max) {
  1506. Py_ssize_t __pyx_v_i;
  1507. PyArrayObject *__pyx_v_terms = 0;
  1508. PyArrayObject *__pyx_v_Qext = 0;
  1509. PyArrayObject *__pyx_v_Qabs = 0;
  1510. PyArrayObject *__pyx_v_Qsca = 0;
  1511. PyArrayObject *__pyx_v_Qbk = 0;
  1512. PyArrayObject *__pyx_v_Qpr = 0;
  1513. PyArrayObject *__pyx_v_g = 0;
  1514. PyArrayObject *__pyx_v_Albedo = 0;
  1515. PyArrayObject *__pyx_v_S1 = 0;
  1516. PyArrayObject *__pyx_v_S2 = 0;
  1517. PyArrayObject *__pyx_v_S1r = 0;
  1518. PyArrayObject *__pyx_v_S1i = 0;
  1519. PyArrayObject *__pyx_v_S2r = 0;
  1520. PyArrayObject *__pyx_v_S2i = 0;
  1521. __Pyx_LocalBuf_ND __pyx_pybuffernd_Albedo;
  1522. __Pyx_Buffer __pyx_pybuffer_Albedo;
  1523. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qabs;
  1524. __Pyx_Buffer __pyx_pybuffer_Qabs;
  1525. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qbk;
  1526. __Pyx_Buffer __pyx_pybuffer_Qbk;
  1527. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qext;
  1528. __Pyx_Buffer __pyx_pybuffer_Qext;
  1529. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qpr;
  1530. __Pyx_Buffer __pyx_pybuffer_Qpr;
  1531. __Pyx_LocalBuf_ND __pyx_pybuffernd_Qsca;
  1532. __Pyx_Buffer __pyx_pybuffer_Qsca;
  1533. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1;
  1534. __Pyx_Buffer __pyx_pybuffer_S1;
  1535. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1i;
  1536. __Pyx_Buffer __pyx_pybuffer_S1i;
  1537. __Pyx_LocalBuf_ND __pyx_pybuffernd_S1r;
  1538. __Pyx_Buffer __pyx_pybuffer_S1r;
  1539. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2;
  1540. __Pyx_Buffer __pyx_pybuffer_S2;
  1541. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2i;
  1542. __Pyx_Buffer __pyx_pybuffer_S2i;
  1543. __Pyx_LocalBuf_ND __pyx_pybuffernd_S2r;
  1544. __Pyx_Buffer __pyx_pybuffer_S2r;
  1545. __Pyx_LocalBuf_ND __pyx_pybuffernd_g;
  1546. __Pyx_Buffer __pyx_pybuffer_g;
  1547. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  1548. __Pyx_Buffer __pyx_pybuffer_m;
  1549. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  1550. __Pyx_Buffer __pyx_pybuffer_terms;
  1551. __Pyx_LocalBuf_ND __pyx_pybuffernd_theta;
  1552. __Pyx_Buffer __pyx_pybuffer_theta;
  1553. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  1554. __Pyx_Buffer __pyx_pybuffer_x;
  1555. PyObject *__pyx_r = NULL;
  1556. __Pyx_RefNannyDeclarations
  1557. PyObject *__pyx_t_1 = NULL;
  1558. PyObject *__pyx_t_2 = NULL;
  1559. PyObject *__pyx_t_3 = NULL;
  1560. PyObject *__pyx_t_4 = NULL;
  1561. PyObject *__pyx_t_5 = NULL;
  1562. PyArrayObject *__pyx_t_6 = NULL;
  1563. PyArrayObject *__pyx_t_7 = NULL;
  1564. PyArrayObject *__pyx_t_8 = NULL;
  1565. PyArrayObject *__pyx_t_9 = NULL;
  1566. PyArrayObject *__pyx_t_10 = NULL;
  1567. PyArrayObject *__pyx_t_11 = NULL;
  1568. PyArrayObject *__pyx_t_12 = NULL;
  1569. PyArrayObject *__pyx_t_13 = NULL;
  1570. PyArrayObject *__pyx_t_14 = NULL;
  1571. PyArrayObject *__pyx_t_15 = NULL;
  1572. npy_intp __pyx_t_16;
  1573. Py_ssize_t __pyx_t_17;
  1574. PyArrayObject *__pyx_t_18 = NULL;
  1575. int __pyx_t_19;
  1576. PyObject *__pyx_t_20 = NULL;
  1577. PyObject *__pyx_t_21 = NULL;
  1578. PyObject *__pyx_t_22 = NULL;
  1579. PyArrayObject *__pyx_t_23 = NULL;
  1580. PyArrayObject *__pyx_t_24 = NULL;
  1581. PyArrayObject *__pyx_t_25 = NULL;
  1582. std::vector<double> __pyx_t_26;
  1583. std::vector<__pyx_t_double_complex> __pyx_t_27;
  1584. std::vector<double> __pyx_t_28;
  1585. Py_ssize_t __pyx_t_29;
  1586. Py_ssize_t __pyx_t_30;
  1587. Py_ssize_t __pyx_t_31;
  1588. Py_ssize_t __pyx_t_32;
  1589. Py_ssize_t __pyx_t_33;
  1590. Py_ssize_t __pyx_t_34;
  1591. Py_ssize_t __pyx_t_35;
  1592. Py_ssize_t __pyx_t_36;
  1593. int __pyx_lineno = 0;
  1594. const char *__pyx_filename = NULL;
  1595. int __pyx_clineno = 0;
  1596. __Pyx_RefNannySetupContext("scattnlay", 0);
  1597. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  1598. __pyx_pybuffer_terms.refcount = 0;
  1599. __pyx_pybuffernd_terms.data = NULL;
  1600. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  1601. __pyx_pybuffer_Qext.pybuffer.buf = NULL;
  1602. __pyx_pybuffer_Qext.refcount = 0;
  1603. __pyx_pybuffernd_Qext.data = NULL;
  1604. __pyx_pybuffernd_Qext.rcbuffer = &__pyx_pybuffer_Qext;
  1605. __pyx_pybuffer_Qabs.pybuffer.buf = NULL;
  1606. __pyx_pybuffer_Qabs.refcount = 0;
  1607. __pyx_pybuffernd_Qabs.data = NULL;
  1608. __pyx_pybuffernd_Qabs.rcbuffer = &__pyx_pybuffer_Qabs;
  1609. __pyx_pybuffer_Qsca.pybuffer.buf = NULL;
  1610. __pyx_pybuffer_Qsca.refcount = 0;
  1611. __pyx_pybuffernd_Qsca.data = NULL;
  1612. __pyx_pybuffernd_Qsca.rcbuffer = &__pyx_pybuffer_Qsca;
  1613. __pyx_pybuffer_Qbk.pybuffer.buf = NULL;
  1614. __pyx_pybuffer_Qbk.refcount = 0;
  1615. __pyx_pybuffernd_Qbk.data = NULL;
  1616. __pyx_pybuffernd_Qbk.rcbuffer = &__pyx_pybuffer_Qbk;
  1617. __pyx_pybuffer_Qpr.pybuffer.buf = NULL;
  1618. __pyx_pybuffer_Qpr.refcount = 0;
  1619. __pyx_pybuffernd_Qpr.data = NULL;
  1620. __pyx_pybuffernd_Qpr.rcbuffer = &__pyx_pybuffer_Qpr;
  1621. __pyx_pybuffer_g.pybuffer.buf = NULL;
  1622. __pyx_pybuffer_g.refcount = 0;
  1623. __pyx_pybuffernd_g.data = NULL;
  1624. __pyx_pybuffernd_g.rcbuffer = &__pyx_pybuffer_g;
  1625. __pyx_pybuffer_Albedo.pybuffer.buf = NULL;
  1626. __pyx_pybuffer_Albedo.refcount = 0;
  1627. __pyx_pybuffernd_Albedo.data = NULL;
  1628. __pyx_pybuffernd_Albedo.rcbuffer = &__pyx_pybuffer_Albedo;
  1629. __pyx_pybuffer_S1.pybuffer.buf = NULL;
  1630. __pyx_pybuffer_S1.refcount = 0;
  1631. __pyx_pybuffernd_S1.data = NULL;
  1632. __pyx_pybuffernd_S1.rcbuffer = &__pyx_pybuffer_S1;
  1633. __pyx_pybuffer_S2.pybuffer.buf = NULL;
  1634. __pyx_pybuffer_S2.refcount = 0;
  1635. __pyx_pybuffernd_S2.data = NULL;
  1636. __pyx_pybuffernd_S2.rcbuffer = &__pyx_pybuffer_S2;
  1637. __pyx_pybuffer_S1r.pybuffer.buf = NULL;
  1638. __pyx_pybuffer_S1r.refcount = 0;
  1639. __pyx_pybuffernd_S1r.data = NULL;
  1640. __pyx_pybuffernd_S1r.rcbuffer = &__pyx_pybuffer_S1r;
  1641. __pyx_pybuffer_S1i.pybuffer.buf = NULL;
  1642. __pyx_pybuffer_S1i.refcount = 0;
  1643. __pyx_pybuffernd_S1i.data = NULL;
  1644. __pyx_pybuffernd_S1i.rcbuffer = &__pyx_pybuffer_S1i;
  1645. __pyx_pybuffer_S2r.pybuffer.buf = NULL;
  1646. __pyx_pybuffer_S2r.refcount = 0;
  1647. __pyx_pybuffernd_S2r.data = NULL;
  1648. __pyx_pybuffernd_S2r.rcbuffer = &__pyx_pybuffer_S2r;
  1649. __pyx_pybuffer_S2i.pybuffer.buf = NULL;
  1650. __pyx_pybuffer_S2i.refcount = 0;
  1651. __pyx_pybuffernd_S2i.data = NULL;
  1652. __pyx_pybuffernd_S2i.rcbuffer = &__pyx_pybuffer_S2i;
  1653. __pyx_pybuffer_x.pybuffer.buf = NULL;
  1654. __pyx_pybuffer_x.refcount = 0;
  1655. __pyx_pybuffernd_x.data = NULL;
  1656. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  1657. __pyx_pybuffer_m.pybuffer.buf = NULL;
  1658. __pyx_pybuffer_m.refcount = 0;
  1659. __pyx_pybuffernd_m.data = NULL;
  1660. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  1661. __pyx_pybuffer_theta.pybuffer.buf = NULL;
  1662. __pyx_pybuffer_theta.refcount = 0;
  1663. __pyx_pybuffernd_theta.data = NULL;
  1664. __pyx_pybuffernd_theta.rcbuffer = &__pyx_pybuffer_theta;
  1665. {
  1666. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1667. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1668. }
  1669. __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];
  1670. {
  1671. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1672. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1673. }
  1674. __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];
  1675. {
  1676. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1677. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_theta.rcbuffer->pybuffer, (PyObject*)__pyx_v_theta, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1678. }
  1679. __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];
  1680. /* "scattnlay.pyx":59
  1681. * cdef Py_ssize_t i
  1682. *
  1683. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  1684. *
  1685. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1686. */
  1687. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1688. __Pyx_GOTREF(__pyx_t_1);
  1689. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1690. __Pyx_GOTREF(__pyx_t_2);
  1691. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1692. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1693. __Pyx_GOTREF(__pyx_t_1);
  1694. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1695. __Pyx_GOTREF(__pyx_t_3);
  1696. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1697. __Pyx_GIVEREF(__pyx_t_1);
  1698. __pyx_t_1 = 0;
  1699. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1700. __Pyx_GOTREF(__pyx_t_1);
  1701. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1702. __Pyx_GOTREF(__pyx_t_4);
  1703. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1704. __Pyx_GOTREF(__pyx_t_5);
  1705. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1706. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1707. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1708. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1709. __Pyx_GOTREF(__pyx_t_5);
  1710. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1711. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1712. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1713. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1714. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  1715. {
  1716. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1717. 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)) {
  1718. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  1719. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1720. } 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];
  1721. }
  1722. }
  1723. __pyx_t_6 = 0;
  1724. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  1725. __pyx_t_5 = 0;
  1726. /* "scattnlay.pyx":61
  1727. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  1728. *
  1729. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1730. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1731. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1732. */
  1733. __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;}
  1734. __Pyx_GOTREF(__pyx_t_5);
  1735. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1736. __Pyx_GOTREF(__pyx_t_1);
  1737. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1738. __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;}
  1739. __Pyx_GOTREF(__pyx_t_5);
  1740. __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;}
  1741. __Pyx_GOTREF(__pyx_t_3);
  1742. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1743. __Pyx_GIVEREF(__pyx_t_5);
  1744. __pyx_t_5 = 0;
  1745. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1746. __Pyx_GOTREF(__pyx_t_5);
  1747. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1748. __Pyx_GOTREF(__pyx_t_2);
  1749. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1750. __Pyx_GOTREF(__pyx_t_4);
  1751. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1752. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1753. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1754. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1755. __Pyx_GOTREF(__pyx_t_4);
  1756. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1757. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1758. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1759. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1760. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  1761. {
  1762. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1763. 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)) {
  1764. __pyx_v_Qext = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qext.rcbuffer->pybuffer.buf = NULL;
  1765. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1766. } 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];
  1767. }
  1768. }
  1769. __pyx_t_7 = 0;
  1770. __pyx_v_Qext = ((PyArrayObject *)__pyx_t_4);
  1771. __pyx_t_4 = 0;
  1772. /* "scattnlay.pyx":62
  1773. *
  1774. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1775. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1776. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1777. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1778. */
  1779. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1780. __Pyx_GOTREF(__pyx_t_4);
  1781. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1782. __Pyx_GOTREF(__pyx_t_5);
  1783. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1784. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1785. __Pyx_GOTREF(__pyx_t_4);
  1786. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1787. __Pyx_GOTREF(__pyx_t_3);
  1788. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1789. __Pyx_GIVEREF(__pyx_t_4);
  1790. __pyx_t_4 = 0;
  1791. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1792. __Pyx_GOTREF(__pyx_t_4);
  1793. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1794. __Pyx_GOTREF(__pyx_t_1);
  1795. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1796. __Pyx_GOTREF(__pyx_t_2);
  1797. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1798. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1799. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1800. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1801. __Pyx_GOTREF(__pyx_t_2);
  1802. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1803. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1804. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1805. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1806. __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  1807. {
  1808. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1809. 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)) {
  1810. __pyx_v_Qabs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qabs.rcbuffer->pybuffer.buf = NULL;
  1811. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1812. } 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];
  1813. }
  1814. }
  1815. __pyx_t_8 = 0;
  1816. __pyx_v_Qabs = ((PyArrayObject *)__pyx_t_2);
  1817. __pyx_t_2 = 0;
  1818. /* "scattnlay.pyx":63
  1819. * cdef np.ndarray[np.float64_t, ndim = 1] Qext = np.zeros(x.shape[0], dtype = np.float64)
  1820. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1821. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1822. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1823. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1824. */
  1825. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1826. __Pyx_GOTREF(__pyx_t_2);
  1827. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1828. __Pyx_GOTREF(__pyx_t_4);
  1829. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1830. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1831. __Pyx_GOTREF(__pyx_t_2);
  1832. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1833. __Pyx_GOTREF(__pyx_t_3);
  1834. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  1835. __Pyx_GIVEREF(__pyx_t_2);
  1836. __pyx_t_2 = 0;
  1837. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1838. __Pyx_GOTREF(__pyx_t_2);
  1839. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1840. __Pyx_GOTREF(__pyx_t_5);
  1841. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1842. __Pyx_GOTREF(__pyx_t_1);
  1843. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1844. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1845. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1846. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1847. __Pyx_GOTREF(__pyx_t_1);
  1848. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1849. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1850. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1851. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1852. __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
  1853. {
  1854. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1855. 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)) {
  1856. __pyx_v_Qsca = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qsca.rcbuffer->pybuffer.buf = NULL;
  1857. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1858. } 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];
  1859. }
  1860. }
  1861. __pyx_t_9 = 0;
  1862. __pyx_v_Qsca = ((PyArrayObject *)__pyx_t_1);
  1863. __pyx_t_1 = 0;
  1864. /* "scattnlay.pyx":64
  1865. * cdef np.ndarray[np.float64_t, ndim = 1] Qabs = np.zeros(x.shape[0], dtype = np.float64)
  1866. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1867. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1868. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1869. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1870. */
  1871. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1872. __Pyx_GOTREF(__pyx_t_1);
  1873. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1874. __Pyx_GOTREF(__pyx_t_2);
  1875. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1876. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1877. __Pyx_GOTREF(__pyx_t_1);
  1878. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1879. __Pyx_GOTREF(__pyx_t_3);
  1880. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  1881. __Pyx_GIVEREF(__pyx_t_1);
  1882. __pyx_t_1 = 0;
  1883. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1884. __Pyx_GOTREF(__pyx_t_1);
  1885. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1886. __Pyx_GOTREF(__pyx_t_4);
  1887. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1888. __Pyx_GOTREF(__pyx_t_5);
  1889. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1890. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1891. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1892. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1893. __Pyx_GOTREF(__pyx_t_5);
  1894. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1895. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1896. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1897. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1898. __pyx_t_10 = ((PyArrayObject *)__pyx_t_5);
  1899. {
  1900. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1901. 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)) {
  1902. __pyx_v_Qbk = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qbk.rcbuffer->pybuffer.buf = NULL;
  1903. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1904. } 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];
  1905. }
  1906. }
  1907. __pyx_t_10 = 0;
  1908. __pyx_v_Qbk = ((PyArrayObject *)__pyx_t_5);
  1909. __pyx_t_5 = 0;
  1910. /* "scattnlay.pyx":65
  1911. * cdef np.ndarray[np.float64_t, ndim = 1] Qsca = np.zeros(x.shape[0], dtype = np.float64)
  1912. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1913. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1914. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  1915. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1916. */
  1917. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1918. __Pyx_GOTREF(__pyx_t_5);
  1919. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1920. __Pyx_GOTREF(__pyx_t_1);
  1921. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1922. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1923. __Pyx_GOTREF(__pyx_t_5);
  1924. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1925. __Pyx_GOTREF(__pyx_t_3);
  1926. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  1927. __Pyx_GIVEREF(__pyx_t_5);
  1928. __pyx_t_5 = 0;
  1929. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1930. __Pyx_GOTREF(__pyx_t_5);
  1931. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1932. __Pyx_GOTREF(__pyx_t_2);
  1933. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1934. __Pyx_GOTREF(__pyx_t_4);
  1935. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1936. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1937. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1938. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1939. __Pyx_GOTREF(__pyx_t_4);
  1940. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1941. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1942. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1943. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1944. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  1945. {
  1946. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1947. 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)) {
  1948. __pyx_v_Qpr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Qpr.rcbuffer->pybuffer.buf = NULL;
  1949. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1950. } 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];
  1951. }
  1952. }
  1953. __pyx_t_11 = 0;
  1954. __pyx_v_Qpr = ((PyArrayObject *)__pyx_t_4);
  1955. __pyx_t_4 = 0;
  1956. /* "scattnlay.pyx":66
  1957. * cdef np.ndarray[np.float64_t, ndim = 1] Qbk = np.zeros(x.shape[0], dtype = np.float64)
  1958. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  1959. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  1960. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  1961. *
  1962. */
  1963. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1964. __Pyx_GOTREF(__pyx_t_4);
  1965. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1966. __Pyx_GOTREF(__pyx_t_5);
  1967. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1968. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1969. __Pyx_GOTREF(__pyx_t_4);
  1970. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1971. __Pyx_GOTREF(__pyx_t_3);
  1972. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  1973. __Pyx_GIVEREF(__pyx_t_4);
  1974. __pyx_t_4 = 0;
  1975. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1976. __Pyx_GOTREF(__pyx_t_4);
  1977. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1978. __Pyx_GOTREF(__pyx_t_1);
  1979. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1980. __Pyx_GOTREF(__pyx_t_2);
  1981. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1982. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1983. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1984. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1985. __Pyx_GOTREF(__pyx_t_2);
  1986. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1987. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1988. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1989. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1990. __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  1991. {
  1992. __Pyx_BufFmt_StackElem __pyx_stack[1];
  1993. 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)) {
  1994. __pyx_v_g = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_g.rcbuffer->pybuffer.buf = NULL;
  1995. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1996. } 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];
  1997. }
  1998. }
  1999. __pyx_t_12 = 0;
  2000. __pyx_v_g = ((PyArrayObject *)__pyx_t_2);
  2001. __pyx_t_2 = 0;
  2002. /* "scattnlay.pyx":67
  2003. * cdef np.ndarray[np.float64_t, ndim = 1] Qpr = np.zeros(x.shape[0], dtype = np.float64)
  2004. * cdef np.ndarray[np.float64_t, ndim = 1] g = np.zeros(x.shape[0], dtype = np.float64)
  2005. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2006. *
  2007. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2008. */
  2009. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2010. __Pyx_GOTREF(__pyx_t_2);
  2011. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2012. __Pyx_GOTREF(__pyx_t_4);
  2013. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2014. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2015. __Pyx_GOTREF(__pyx_t_2);
  2016. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2017. __Pyx_GOTREF(__pyx_t_3);
  2018. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2019. __Pyx_GIVEREF(__pyx_t_2);
  2020. __pyx_t_2 = 0;
  2021. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2022. __Pyx_GOTREF(__pyx_t_2);
  2023. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2024. __Pyx_GOTREF(__pyx_t_5);
  2025. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2026. __Pyx_GOTREF(__pyx_t_1);
  2027. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2028. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2029. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2030. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2031. __Pyx_GOTREF(__pyx_t_1);
  2032. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2033. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2034. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2035. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2036. __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
  2037. {
  2038. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2039. 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)) {
  2040. __pyx_v_Albedo = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Albedo.rcbuffer->pybuffer.buf = NULL;
  2041. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2042. } 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];
  2043. }
  2044. }
  2045. __pyx_t_13 = 0;
  2046. __pyx_v_Albedo = ((PyArrayObject *)__pyx_t_1);
  2047. __pyx_t_1 = 0;
  2048. /* "scattnlay.pyx":69
  2049. * cdef np.ndarray[np.float64_t, ndim = 1] Albedo = np.zeros(x.shape[0], dtype = np.float64)
  2050. *
  2051. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2052. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2053. *
  2054. */
  2055. __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;}
  2056. __Pyx_GOTREF(__pyx_t_1);
  2057. __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;}
  2058. __Pyx_GOTREF(__pyx_t_2);
  2059. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2060. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2061. __Pyx_GOTREF(__pyx_t_1);
  2062. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2063. __Pyx_GOTREF(__pyx_t_3);
  2064. __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2065. __Pyx_GOTREF(__pyx_t_4);
  2066. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2067. __Pyx_GIVEREF(__pyx_t_1);
  2068. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  2069. __Pyx_GIVEREF(__pyx_t_3);
  2070. __pyx_t_1 = 0;
  2071. __pyx_t_3 = 0;
  2072. __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;}
  2073. __Pyx_GOTREF(__pyx_t_3);
  2074. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2075. __Pyx_GIVEREF(__pyx_t_4);
  2076. __pyx_t_4 = 0;
  2077. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2078. __Pyx_GOTREF(__pyx_t_4);
  2079. __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;}
  2080. __Pyx_GOTREF(__pyx_t_1);
  2081. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_complex128); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2082. __Pyx_GOTREF(__pyx_t_5);
  2083. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2084. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2085. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2086. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2087. __Pyx_GOTREF(__pyx_t_5);
  2088. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2089. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2090. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2091. 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;}
  2092. __pyx_t_14 = ((PyArrayObject *)__pyx_t_5);
  2093. {
  2094. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2095. 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)) {
  2096. __pyx_v_S1 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S1.rcbuffer->pybuffer.buf = NULL;
  2097. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2098. } 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];
  2099. }
  2100. }
  2101. __pyx_t_14 = 0;
  2102. __pyx_v_S1 = ((PyArrayObject *)__pyx_t_5);
  2103. __pyx_t_5 = 0;
  2104. /* "scattnlay.pyx":70
  2105. *
  2106. * cdef np.ndarray[np.complex128_t, ndim = 2] S1 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128)
  2107. * cdef np.ndarray[np.complex128_t, ndim = 2] S2 = np.zeros((x.shape[0], theta.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2108. *
  2109. * cdef np.ndarray[np.float64_t, ndim = 1] S1r
  2110. */
  2111. __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;}
  2112. __Pyx_GOTREF(__pyx_t_5);
  2113. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2114. __Pyx_GOTREF(__pyx_t_4);
  2115. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2116. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_x->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2117. __Pyx_GOTREF(__pyx_t_5);
  2118. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2119. __Pyx_GOTREF(__pyx_t_3);
  2120. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2121. __Pyx_GOTREF(__pyx_t_2);
  2122. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2123. __Pyx_GIVEREF(__pyx_t_5);
  2124. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2125. __Pyx_GIVEREF(__pyx_t_3);
  2126. __pyx_t_5 = 0;
  2127. __pyx_t_3 = 0;
  2128. __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;}
  2129. __Pyx_GOTREF(__pyx_t_3);
  2130. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2131. __Pyx_GIVEREF(__pyx_t_2);
  2132. __pyx_t_2 = 0;
  2133. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2134. __Pyx_GOTREF(__pyx_t_2);
  2135. __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;}
  2136. __Pyx_GOTREF(__pyx_t_5);
  2137. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_complex128); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2138. __Pyx_GOTREF(__pyx_t_1);
  2139. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2140. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2141. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2142. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2143. __Pyx_GOTREF(__pyx_t_1);
  2144. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2145. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2146. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2147. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2148. __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
  2149. {
  2150. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2151. 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)) {
  2152. __pyx_v_S2 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S2.rcbuffer->pybuffer.buf = NULL;
  2153. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2154. } 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];
  2155. }
  2156. }
  2157. __pyx_t_15 = 0;
  2158. __pyx_v_S2 = ((PyArrayObject *)__pyx_t_1);
  2159. __pyx_t_1 = 0;
  2160. /* "scattnlay.pyx":77
  2161. * cdef np.ndarray[np.float64_t, ndim = 1] S2i
  2162. *
  2163. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  2164. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2165. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2166. */
  2167. __pyx_t_16 = (__pyx_v_x->dimensions[0]);
  2168. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  2169. __pyx_v_i = __pyx_t_17;
  2170. /* "scattnlay.pyx":78
  2171. *
  2172. * for i in range(x.shape[0]):
  2173. * S1r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2174. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2175. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2176. */
  2177. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2178. __Pyx_GOTREF(__pyx_t_1);
  2179. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2180. __Pyx_GOTREF(__pyx_t_2);
  2181. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2182. __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2183. __Pyx_GOTREF(__pyx_t_1);
  2184. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2185. __Pyx_GOTREF(__pyx_t_3);
  2186. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2187. __Pyx_GIVEREF(__pyx_t_1);
  2188. __pyx_t_1 = 0;
  2189. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2190. __Pyx_GOTREF(__pyx_t_1);
  2191. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2192. __Pyx_GOTREF(__pyx_t_4);
  2193. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2194. __Pyx_GOTREF(__pyx_t_5);
  2195. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2196. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2197. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2198. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2199. __Pyx_GOTREF(__pyx_t_5);
  2200. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2201. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2202. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2203. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2204. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  2205. {
  2206. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2207. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2208. __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);
  2209. if (unlikely(__pyx_t_19 < 0)) {
  2210. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2211. 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)) {
  2212. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2213. __Pyx_RaiseBufferFallbackError();
  2214. } else {
  2215. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2216. }
  2217. }
  2218. __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];
  2219. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2220. }
  2221. __pyx_t_18 = 0;
  2222. __Pyx_XDECREF_SET(__pyx_v_S1r, ((PyArrayObject *)__pyx_t_5));
  2223. __pyx_t_5 = 0;
  2224. /* "scattnlay.pyx":79
  2225. * for i in range(x.shape[0]):
  2226. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2227. * S1i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2228. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2229. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2230. */
  2231. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2232. __Pyx_GOTREF(__pyx_t_5);
  2233. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2234. __Pyx_GOTREF(__pyx_t_1);
  2235. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2236. __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2237. __Pyx_GOTREF(__pyx_t_5);
  2238. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2239. __Pyx_GOTREF(__pyx_t_3);
  2240. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  2241. __Pyx_GIVEREF(__pyx_t_5);
  2242. __pyx_t_5 = 0;
  2243. __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2244. __Pyx_GOTREF(__pyx_t_5);
  2245. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2246. __Pyx_GOTREF(__pyx_t_2);
  2247. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2248. __Pyx_GOTREF(__pyx_t_4);
  2249. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2250. if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2251. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2252. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2253. __Pyx_GOTREF(__pyx_t_4);
  2254. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2255. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2256. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2257. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2258. __pyx_t_23 = ((PyArrayObject *)__pyx_t_4);
  2259. {
  2260. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2261. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2262. __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);
  2263. if (unlikely(__pyx_t_19 < 0)) {
  2264. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2265. 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)) {
  2266. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2267. __Pyx_RaiseBufferFallbackError();
  2268. } else {
  2269. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2270. }
  2271. }
  2272. __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];
  2273. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2274. }
  2275. __pyx_t_23 = 0;
  2276. __Pyx_XDECREF_SET(__pyx_v_S1i, ((PyArrayObject *)__pyx_t_4));
  2277. __pyx_t_4 = 0;
  2278. /* "scattnlay.pyx":80
  2279. * S1r = np.zeros(theta.shape[0], dtype = np.float64)
  2280. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2281. * S2r = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2282. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2283. *
  2284. */
  2285. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2286. __Pyx_GOTREF(__pyx_t_4);
  2287. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2288. __Pyx_GOTREF(__pyx_t_5);
  2289. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2290. __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2291. __Pyx_GOTREF(__pyx_t_4);
  2292. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2293. __Pyx_GOTREF(__pyx_t_3);
  2294. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  2295. __Pyx_GIVEREF(__pyx_t_4);
  2296. __pyx_t_4 = 0;
  2297. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2298. __Pyx_GOTREF(__pyx_t_4);
  2299. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2300. __Pyx_GOTREF(__pyx_t_1);
  2301. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2302. __Pyx_GOTREF(__pyx_t_2);
  2303. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2304. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2305. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2306. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2307. __Pyx_GOTREF(__pyx_t_2);
  2308. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2309. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2310. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2311. if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2312. __pyx_t_24 = ((PyArrayObject *)__pyx_t_2);
  2313. {
  2314. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2315. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2316. __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);
  2317. if (unlikely(__pyx_t_19 < 0)) {
  2318. PyErr_Fetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
  2319. 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)) {
  2320. Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_22);
  2321. __Pyx_RaiseBufferFallbackError();
  2322. } else {
  2323. PyErr_Restore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
  2324. }
  2325. }
  2326. __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];
  2327. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2328. }
  2329. __pyx_t_24 = 0;
  2330. __Pyx_XDECREF_SET(__pyx_v_S2r, ((PyArrayObject *)__pyx_t_2));
  2331. __pyx_t_2 = 0;
  2332. /* "scattnlay.pyx":81
  2333. * S1i = np.zeros(theta.shape[0], dtype = np.float64)
  2334. * S2r = np.zeros(theta.shape[0], dtype = np.float64)
  2335. * S2i = np.zeros(theta.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  2336. *
  2337. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2338. */
  2339. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2340. __Pyx_GOTREF(__pyx_t_2);
  2341. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2342. __Pyx_GOTREF(__pyx_t_4);
  2343. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2344. __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_theta->dimensions[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2345. __Pyx_GOTREF(__pyx_t_2);
  2346. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2347. __Pyx_GOTREF(__pyx_t_3);
  2348. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2349. __Pyx_GIVEREF(__pyx_t_2);
  2350. __pyx_t_2 = 0;
  2351. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2352. __Pyx_GOTREF(__pyx_t_2);
  2353. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2354. __Pyx_GOTREF(__pyx_t_5);
  2355. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2356. __Pyx_GOTREF(__pyx_t_1);
  2357. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2358. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2359. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2360. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2361. __Pyx_GOTREF(__pyx_t_1);
  2362. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2363. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2364. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2365. if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2366. __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
  2367. {
  2368. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2369. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2370. __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);
  2371. if (unlikely(__pyx_t_19 < 0)) {
  2372. PyErr_Fetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
  2373. 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)) {
  2374. Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20);
  2375. __Pyx_RaiseBufferFallbackError();
  2376. } else {
  2377. PyErr_Restore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
  2378. }
  2379. }
  2380. __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];
  2381. if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2382. }
  2383. __pyx_t_25 = 0;
  2384. __Pyx_XDECREF_SET(__pyx_v_S2i, ((PyArrayObject *)__pyx_t_1));
  2385. __pyx_t_1 = 0;
  2386. /* "scattnlay.pyx":83
  2387. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  2388. *
  2389. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  2390. *
  2391. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2392. */
  2393. __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_x), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2394. __Pyx_GOTREF(__pyx_t_1);
  2395. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2396. __Pyx_GOTREF(__pyx_t_2);
  2397. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2398. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2399. __Pyx_GOTREF(__pyx_t_1);
  2400. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2401. __pyx_t_26 = __pyx_convert_vector_from_py_double(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2402. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2403. __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_m), __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  2404. __Pyx_GOTREF(__pyx_t_1);
  2405. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2406. __Pyx_GOTREF(__pyx_t_2);
  2407. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2408. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2409. __Pyx_GOTREF(__pyx_t_1);
  2410. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2411. __pyx_t_27 = __pyx_convert_vector_from_py___pyx_t_double_complex(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2412. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2413. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_theta), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2414. __Pyx_GOTREF(__pyx_t_1);
  2415. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2416. __Pyx_GOTREF(__pyx_t_2);
  2417. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2418. __pyx_t_28 = __pyx_convert_vector_from_py_double(__pyx_t_2); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2419. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2420. __pyx_t_29 = __pyx_v_i;
  2421. __pyx_t_19 = -1;
  2422. if (__pyx_t_29 < 0) {
  2423. __pyx_t_29 += __pyx_pybuffernd_Qext.diminfo[0].shape;
  2424. if (unlikely(__pyx_t_29 < 0)) __pyx_t_19 = 0;
  2425. } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_Qext.diminfo[0].shape)) __pyx_t_19 = 0;
  2426. if (unlikely(__pyx_t_19 != -1)) {
  2427. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2428. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2429. }
  2430. __pyx_t_30 = __pyx_v_i;
  2431. __pyx_t_19 = -1;
  2432. if (__pyx_t_30 < 0) {
  2433. __pyx_t_30 += __pyx_pybuffernd_Qsca.diminfo[0].shape;
  2434. if (unlikely(__pyx_t_30 < 0)) __pyx_t_19 = 0;
  2435. } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_Qsca.diminfo[0].shape)) __pyx_t_19 = 0;
  2436. if (unlikely(__pyx_t_19 != -1)) {
  2437. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2438. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2439. }
  2440. __pyx_t_31 = __pyx_v_i;
  2441. __pyx_t_19 = -1;
  2442. if (__pyx_t_31 < 0) {
  2443. __pyx_t_31 += __pyx_pybuffernd_Qabs.diminfo[0].shape;
  2444. if (unlikely(__pyx_t_31 < 0)) __pyx_t_19 = 0;
  2445. } else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_Qabs.diminfo[0].shape)) __pyx_t_19 = 0;
  2446. if (unlikely(__pyx_t_19 != -1)) {
  2447. __Pyx_RaiseBufferIndexError(__pyx_t_19);
  2448. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2449. }
  2450. __pyx_t_32 = __pyx_v_i;
  2451. __pyx_t_19 = -1;
  2452. if (__pyx_t_32 < 0) {
  2453. __pyx_t_32 += __pyx_pybuffernd_Qbk.diminfo[0].shape;
  2454. if (unlikely(__pyx_t_32 < 0)) __pyx_t_19 = 0;
  2455. } else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_Qbk.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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2459. }
  2460. __pyx_t_33 = __pyx_v_i;
  2461. __pyx_t_19 = -1;
  2462. if (__pyx_t_33 < 0) {
  2463. __pyx_t_33 += __pyx_pybuffernd_Qpr.diminfo[0].shape;
  2464. if (unlikely(__pyx_t_33 < 0)) __pyx_t_19 = 0;
  2465. } else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_Qpr.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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2469. }
  2470. __pyx_t_34 = __pyx_v_i;
  2471. __pyx_t_19 = -1;
  2472. if (__pyx_t_34 < 0) {
  2473. __pyx_t_34 += __pyx_pybuffernd_g.diminfo[0].shape;
  2474. if (unlikely(__pyx_t_34 < 0)) __pyx_t_19 = 0;
  2475. } else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_g.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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2479. }
  2480. __pyx_t_35 = __pyx_v_i;
  2481. __pyx_t_19 = -1;
  2482. if (__pyx_t_35 < 0) {
  2483. __pyx_t_35 += __pyx_pybuffernd_Albedo.diminfo[0].shape;
  2484. if (unlikely(__pyx_t_35 < 0)) __pyx_t_19 = 0;
  2485. } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_Albedo.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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2489. }
  2490. __pyx_t_36 = __pyx_v_i;
  2491. __pyx_t_19 = -1;
  2492. if (__pyx_t_36 < 0) {
  2493. __pyx_t_36 += __pyx_pybuffernd_terms.diminfo[0].shape;
  2494. if (unlikely(__pyx_t_36 < 0)) __pyx_t_19 = 0;
  2495. } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_terms.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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2499. }
  2500. *__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_n_max, (&(*__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)));
  2501. /* "scattnlay.pyx":85
  2502. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  2503. *
  2504. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  2505. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2506. *
  2507. */
  2508. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1r), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2509. __Pyx_GOTREF(__pyx_t_2);
  2510. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2511. __Pyx_GOTREF(__pyx_t_1);
  2512. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2513. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2514. __Pyx_GOTREF(__pyx_t_2);
  2515. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S1i), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2516. __Pyx_GOTREF(__pyx_t_3);
  2517. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2518. __Pyx_GOTREF(__pyx_t_4);
  2519. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2520. __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2521. __Pyx_GOTREF(__pyx_t_3);
  2522. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2523. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2524. __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2525. __Pyx_GOTREF(__pyx_t_4);
  2526. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2527. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2528. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S1), __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2529. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2530. /* "scattnlay.pyx":86
  2531. *
  2532. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  2533. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  2534. *
  2535. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2536. */
  2537. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2r), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2538. __Pyx_GOTREF(__pyx_t_4);
  2539. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2540. __Pyx_GOTREF(__pyx_t_3);
  2541. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2542. __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2543. __Pyx_GOTREF(__pyx_t_4);
  2544. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_S2i), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2545. __Pyx_GOTREF(__pyx_t_1);
  2546. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2547. __Pyx_GOTREF(__pyx_t_2);
  2548. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2549. __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2550. __Pyx_GOTREF(__pyx_t_1);
  2551. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2553. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2554. __Pyx_GOTREF(__pyx_t_2);
  2555. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2556. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2557. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_S2), __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2558. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2559. }
  2560. /* "scattnlay.pyx":88
  2561. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  2562. *
  2563. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2 # <<<<<<<<<<<<<<
  2564. *
  2565. * 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 n_max = 0):
  2566. */
  2567. __Pyx_XDECREF(__pyx_r);
  2568. __pyx_t_2 = PyTuple_New(10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2569. __Pyx_GOTREF(__pyx_t_2);
  2570. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  2571. PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_terms));
  2572. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  2573. __Pyx_INCREF(((PyObject *)__pyx_v_Qext));
  2574. PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Qext));
  2575. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qext));
  2576. __Pyx_INCREF(((PyObject *)__pyx_v_Qsca));
  2577. PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_Qsca));
  2578. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qsca));
  2579. __Pyx_INCREF(((PyObject *)__pyx_v_Qabs));
  2580. PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_Qabs));
  2581. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qabs));
  2582. __Pyx_INCREF(((PyObject *)__pyx_v_Qbk));
  2583. PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_v_Qbk));
  2584. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qbk));
  2585. __Pyx_INCREF(((PyObject *)__pyx_v_Qpr));
  2586. PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_v_Qpr));
  2587. __Pyx_GIVEREF(((PyObject *)__pyx_v_Qpr));
  2588. __Pyx_INCREF(((PyObject *)__pyx_v_g));
  2589. PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_v_g));
  2590. __Pyx_GIVEREF(((PyObject *)__pyx_v_g));
  2591. __Pyx_INCREF(((PyObject *)__pyx_v_Albedo));
  2592. PyTuple_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_v_Albedo));
  2593. __Pyx_GIVEREF(((PyObject *)__pyx_v_Albedo));
  2594. __Pyx_INCREF(((PyObject *)__pyx_v_S1));
  2595. PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_v_S1));
  2596. __Pyx_GIVEREF(((PyObject *)__pyx_v_S1));
  2597. __Pyx_INCREF(((PyObject *)__pyx_v_S2));
  2598. PyTuple_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_v_S2));
  2599. __Pyx_GIVEREF(((PyObject *)__pyx_v_S2));
  2600. __pyx_r = __pyx_t_2;
  2601. __pyx_t_2 = 0;
  2602. goto __pyx_L0;
  2603. /* "scattnlay.pyx":56
  2604. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int n_max, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Er[], double Ei[], double Hr[], double Hi[])
  2605. *
  2606. * 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 n_max = -1): # <<<<<<<<<<<<<<
  2607. * cdef Py_ssize_t i
  2608. *
  2609. */
  2610. /* function exit code */
  2611. __pyx_L1_error:;
  2612. __Pyx_XDECREF(__pyx_t_1);
  2613. __Pyx_XDECREF(__pyx_t_2);
  2614. __Pyx_XDECREF(__pyx_t_3);
  2615. __Pyx_XDECREF(__pyx_t_4);
  2616. __Pyx_XDECREF(__pyx_t_5);
  2617. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  2618. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  2619. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2620. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2621. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2622. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2623. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2624. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2625. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2626. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2627. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2628. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2629. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2630. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2631. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2632. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2633. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2634. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2635. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2636. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  2637. __Pyx_AddTraceback("scattnlay.scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2638. __pyx_r = NULL;
  2639. goto __pyx_L2;
  2640. __pyx_L0:;
  2641. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Albedo.rcbuffer->pybuffer);
  2642. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qabs.rcbuffer->pybuffer);
  2643. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qbk.rcbuffer->pybuffer);
  2644. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qext.rcbuffer->pybuffer);
  2645. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qpr.rcbuffer->pybuffer);
  2646. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qsca.rcbuffer->pybuffer);
  2647. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1.rcbuffer->pybuffer);
  2648. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1i.rcbuffer->pybuffer);
  2649. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S1r.rcbuffer->pybuffer);
  2650. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2.rcbuffer->pybuffer);
  2651. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2i.rcbuffer->pybuffer);
  2652. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S2r.rcbuffer->pybuffer);
  2653. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_g.rcbuffer->pybuffer);
  2654. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  2655. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  2656. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_theta.rcbuffer->pybuffer);
  2657. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  2658. __pyx_L2:;
  2659. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  2660. __Pyx_XDECREF((PyObject *)__pyx_v_Qext);
  2661. __Pyx_XDECREF((PyObject *)__pyx_v_Qabs);
  2662. __Pyx_XDECREF((PyObject *)__pyx_v_Qsca);
  2663. __Pyx_XDECREF((PyObject *)__pyx_v_Qbk);
  2664. __Pyx_XDECREF((PyObject *)__pyx_v_Qpr);
  2665. __Pyx_XDECREF((PyObject *)__pyx_v_g);
  2666. __Pyx_XDECREF((PyObject *)__pyx_v_Albedo);
  2667. __Pyx_XDECREF((PyObject *)__pyx_v_S1);
  2668. __Pyx_XDECREF((PyObject *)__pyx_v_S2);
  2669. __Pyx_XDECREF((PyObject *)__pyx_v_S1r);
  2670. __Pyx_XDECREF((PyObject *)__pyx_v_S1i);
  2671. __Pyx_XDECREF((PyObject *)__pyx_v_S2r);
  2672. __Pyx_XDECREF((PyObject *)__pyx_v_S2i);
  2673. __Pyx_XGIVEREF(__pyx_r);
  2674. __Pyx_RefNannyFinishContext();
  2675. return __pyx_r;
  2676. }
  2677. /* "scattnlay.pyx":90
  2678. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  2679. *
  2680. * 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 n_max = 0): # <<<<<<<<<<<<<<
  2681. * cdef Py_ssize_t i
  2682. *
  2683. */
  2684. /* Python wrapper */
  2685. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2686. static PyMethodDef __pyx_mdef_9scattnlay_3fieldnlay = {__Pyx_NAMESTR("fieldnlay"), (PyCFunction)__pyx_pw_9scattnlay_3fieldnlay, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2687. static PyObject *__pyx_pw_9scattnlay_3fieldnlay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2688. PyArrayObject *__pyx_v_x = 0;
  2689. PyArrayObject *__pyx_v_m = 0;
  2690. PyArrayObject *__pyx_v_coords = 0;
  2691. __pyx_t_5numpy_int_t __pyx_v_pl;
  2692. __pyx_t_5numpy_int_t __pyx_v_n_max;
  2693. int __pyx_lineno = 0;
  2694. const char *__pyx_filename = NULL;
  2695. int __pyx_clineno = 0;
  2696. PyObject *__pyx_r = 0;
  2697. __Pyx_RefNannyDeclarations
  2698. __Pyx_RefNannySetupContext("fieldnlay (wrapper)", 0);
  2699. {
  2700. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_m,&__pyx_n_s_coords,&__pyx_n_s_pl,&__pyx_n_s_n_max,0};
  2701. PyObject* values[5] = {0,0,0,0,0};
  2702. values[2] = (PyObject *)__pyx_k__10;
  2703. if (unlikely(__pyx_kwds)) {
  2704. Py_ssize_t kw_args;
  2705. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2706. switch (pos_args) {
  2707. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2708. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2709. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2710. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2711. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2712. case 0: break;
  2713. default: goto __pyx_L5_argtuple_error;
  2714. }
  2715. kw_args = PyDict_Size(__pyx_kwds);
  2716. switch (pos_args) {
  2717. case 0:
  2718. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
  2719. else goto __pyx_L5_argtuple_error;
  2720. case 1:
  2721. if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
  2722. else {
  2723. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2724. }
  2725. case 2:
  2726. if (kw_args > 0) {
  2727. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coords);
  2728. if (value) { values[2] = value; kw_args--; }
  2729. }
  2730. case 3:
  2731. if (kw_args > 0) {
  2732. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pl);
  2733. if (value) { values[3] = value; kw_args--; }
  2734. }
  2735. case 4:
  2736. if (kw_args > 0) {
  2737. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_max);
  2738. if (value) { values[4] = value; kw_args--; }
  2739. }
  2740. }
  2741. if (unlikely(kw_args > 0)) {
  2742. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fieldnlay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2743. }
  2744. } else {
  2745. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2746. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  2747. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  2748. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  2749. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2750. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2751. break;
  2752. default: goto __pyx_L5_argtuple_error;
  2753. }
  2754. }
  2755. __pyx_v_x = ((PyArrayObject *)values[0]);
  2756. __pyx_v_m = ((PyArrayObject *)values[1]);
  2757. __pyx_v_coords = ((PyArrayObject *)values[2]);
  2758. if (values[3]) {
  2759. __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 = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2760. } else {
  2761. __pyx_v_pl = ((__pyx_t_5numpy_int_t)0);
  2762. }
  2763. if (values[4]) {
  2764. __pyx_v_n_max = __Pyx_PyInt_As_npy_long(values[4]); if (unlikely((__pyx_v_n_max == (npy_long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2765. } else {
  2766. __pyx_v_n_max = ((__pyx_t_5numpy_int_t)0);
  2767. }
  2768. }
  2769. goto __pyx_L4_argument_unpacking_done;
  2770. __pyx_L5_argtuple_error:;
  2771. __Pyx_RaiseArgtupleInvalid("fieldnlay", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2772. __pyx_L3_error:;
  2773. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2774. __Pyx_RefNannyFinishContext();
  2775. return NULL;
  2776. __pyx_L4_argument_unpacking_done:;
  2777. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2778. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2779. if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_5numpy_ndarray, 1, "coords", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2780. __pyx_r = __pyx_pf_9scattnlay_2fieldnlay(__pyx_self, __pyx_v_x, __pyx_v_m, __pyx_v_coords, __pyx_v_pl, __pyx_v_n_max);
  2781. /* function exit code */
  2782. goto __pyx_L0;
  2783. __pyx_L1_error:;
  2784. __pyx_r = NULL;
  2785. __pyx_L0:;
  2786. __Pyx_RefNannyFinishContext();
  2787. return __pyx_r;
  2788. }
  2789. 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_n_max) {
  2790. Py_ssize_t __pyx_v_i;
  2791. PyArrayObject *__pyx_v_terms = 0;
  2792. PyArrayObject *__pyx_v_E = 0;
  2793. PyArrayObject *__pyx_v_H = 0;
  2794. PyArrayObject *__pyx_v_Er = 0;
  2795. PyArrayObject *__pyx_v_Ei = 0;
  2796. PyArrayObject *__pyx_v_Hr = 0;
  2797. PyArrayObject *__pyx_v_Hi = 0;
  2798. __Pyx_LocalBuf_ND __pyx_pybuffernd_E;
  2799. __Pyx_Buffer __pyx_pybuffer_E;
  2800. __Pyx_LocalBuf_ND __pyx_pybuffernd_Ei;
  2801. __Pyx_Buffer __pyx_pybuffer_Ei;
  2802. __Pyx_LocalBuf_ND __pyx_pybuffernd_Er;
  2803. __Pyx_Buffer __pyx_pybuffer_Er;
  2804. __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
  2805. __Pyx_Buffer __pyx_pybuffer_H;
  2806. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hi;
  2807. __Pyx_Buffer __pyx_pybuffer_Hi;
  2808. __Pyx_LocalBuf_ND __pyx_pybuffernd_Hr;
  2809. __Pyx_Buffer __pyx_pybuffer_Hr;
  2810. __Pyx_LocalBuf_ND __pyx_pybuffernd_coords;
  2811. __Pyx_Buffer __pyx_pybuffer_coords;
  2812. __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
  2813. __Pyx_Buffer __pyx_pybuffer_m;
  2814. __Pyx_LocalBuf_ND __pyx_pybuffernd_terms;
  2815. __Pyx_Buffer __pyx_pybuffer_terms;
  2816. __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
  2817. __Pyx_Buffer __pyx_pybuffer_x;
  2818. PyObject *__pyx_r = NULL;
  2819. __Pyx_RefNannyDeclarations
  2820. PyObject *__pyx_t_1 = NULL;
  2821. PyObject *__pyx_t_2 = NULL;
  2822. PyObject *__pyx_t_3 = NULL;
  2823. PyObject *__pyx_t_4 = NULL;
  2824. PyObject *__pyx_t_5 = NULL;
  2825. PyArrayObject *__pyx_t_6 = NULL;
  2826. PyArrayObject *__pyx_t_7 = NULL;
  2827. PyArrayObject *__pyx_t_8 = NULL;
  2828. npy_intp __pyx_t_9;
  2829. Py_ssize_t __pyx_t_10;
  2830. PyArrayObject *__pyx_t_11 = NULL;
  2831. int __pyx_t_12;
  2832. PyObject *__pyx_t_13 = NULL;
  2833. PyObject *__pyx_t_14 = NULL;
  2834. PyObject *__pyx_t_15 = NULL;
  2835. PyArrayObject *__pyx_t_16 = NULL;
  2836. PyArrayObject *__pyx_t_17 = NULL;
  2837. PyArrayObject *__pyx_t_18 = NULL;
  2838. std::vector<double> __pyx_t_19;
  2839. std::vector<__pyx_t_double_complex> __pyx_t_20;
  2840. std::vector<double> __pyx_t_21;
  2841. std::vector<double> __pyx_t_22;
  2842. std::vector<double> __pyx_t_23;
  2843. Py_ssize_t __pyx_t_24;
  2844. int __pyx_lineno = 0;
  2845. const char *__pyx_filename = NULL;
  2846. int __pyx_clineno = 0;
  2847. __Pyx_RefNannySetupContext("fieldnlay", 0);
  2848. __pyx_pybuffer_terms.pybuffer.buf = NULL;
  2849. __pyx_pybuffer_terms.refcount = 0;
  2850. __pyx_pybuffernd_terms.data = NULL;
  2851. __pyx_pybuffernd_terms.rcbuffer = &__pyx_pybuffer_terms;
  2852. __pyx_pybuffer_E.pybuffer.buf = NULL;
  2853. __pyx_pybuffer_E.refcount = 0;
  2854. __pyx_pybuffernd_E.data = NULL;
  2855. __pyx_pybuffernd_E.rcbuffer = &__pyx_pybuffer_E;
  2856. __pyx_pybuffer_H.pybuffer.buf = NULL;
  2857. __pyx_pybuffer_H.refcount = 0;
  2858. __pyx_pybuffernd_H.data = NULL;
  2859. __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
  2860. __pyx_pybuffer_Er.pybuffer.buf = NULL;
  2861. __pyx_pybuffer_Er.refcount = 0;
  2862. __pyx_pybuffernd_Er.data = NULL;
  2863. __pyx_pybuffernd_Er.rcbuffer = &__pyx_pybuffer_Er;
  2864. __pyx_pybuffer_Ei.pybuffer.buf = NULL;
  2865. __pyx_pybuffer_Ei.refcount = 0;
  2866. __pyx_pybuffernd_Ei.data = NULL;
  2867. __pyx_pybuffernd_Ei.rcbuffer = &__pyx_pybuffer_Ei;
  2868. __pyx_pybuffer_Hr.pybuffer.buf = NULL;
  2869. __pyx_pybuffer_Hr.refcount = 0;
  2870. __pyx_pybuffernd_Hr.data = NULL;
  2871. __pyx_pybuffernd_Hr.rcbuffer = &__pyx_pybuffer_Hr;
  2872. __pyx_pybuffer_Hi.pybuffer.buf = NULL;
  2873. __pyx_pybuffer_Hi.refcount = 0;
  2874. __pyx_pybuffernd_Hi.data = NULL;
  2875. __pyx_pybuffernd_Hi.rcbuffer = &__pyx_pybuffer_Hi;
  2876. __pyx_pybuffer_x.pybuffer.buf = NULL;
  2877. __pyx_pybuffer_x.refcount = 0;
  2878. __pyx_pybuffernd_x.data = NULL;
  2879. __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
  2880. __pyx_pybuffer_m.pybuffer.buf = NULL;
  2881. __pyx_pybuffer_m.refcount = 0;
  2882. __pyx_pybuffernd_m.data = NULL;
  2883. __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
  2884. __pyx_pybuffer_coords.pybuffer.buf = NULL;
  2885. __pyx_pybuffer_coords.refcount = 0;
  2886. __pyx_pybuffernd_coords.data = NULL;
  2887. __pyx_pybuffernd_coords.rcbuffer = &__pyx_pybuffer_coords;
  2888. {
  2889. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2890. 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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2891. }
  2892. __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];
  2893. {
  2894. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2895. 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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2896. }
  2897. __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];
  2898. {
  2899. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2900. 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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2901. }
  2902. __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];
  2903. /* "scattnlay.pyx":93
  2904. * cdef Py_ssize_t i
  2905. *
  2906. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int) # <<<<<<<<<<<<<<
  2907. *
  2908. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  2909. */
  2910. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2911. __Pyx_GOTREF(__pyx_t_1);
  2912. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2913. __Pyx_GOTREF(__pyx_t_2);
  2914. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2915. __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 = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2916. __Pyx_GOTREF(__pyx_t_1);
  2917. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2918. __Pyx_GOTREF(__pyx_t_3);
  2919. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2920. __Pyx_GIVEREF(__pyx_t_1);
  2921. __pyx_t_1 = 0;
  2922. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2923. __Pyx_GOTREF(__pyx_t_1);
  2924. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2925. __Pyx_GOTREF(__pyx_t_4);
  2926. __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 = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2927. __Pyx_GOTREF(__pyx_t_5);
  2928. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2929. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2930. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2931. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2932. __Pyx_GOTREF(__pyx_t_5);
  2933. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2934. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2935. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2936. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2937. __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  2938. {
  2939. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2940. 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)) {
  2941. __pyx_v_terms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf = NULL;
  2942. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2943. } 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];
  2944. }
  2945. }
  2946. __pyx_t_6 = 0;
  2947. __pyx_v_terms = ((PyArrayObject *)__pyx_t_5);
  2948. __pyx_t_5 = 0;
  2949. /* "scattnlay.pyx":95
  2950. * cdef np.ndarray[np.int_t, ndim = 1] terms = np.zeros(x.shape[0], dtype = np.int)
  2951. *
  2952. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  2953. * cdef np.ndarray[np.complex128_t, ndim = 2] H = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  2954. *
  2955. */
  2956. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2957. __Pyx_GOTREF(__pyx_t_5);
  2958. __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2959. __Pyx_GOTREF(__pyx_t_1);
  2960. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2961. __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2962. __Pyx_GOTREF(__pyx_t_5);
  2963. __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2964. __Pyx_GOTREF(__pyx_t_3);
  2965. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2966. __Pyx_GOTREF(__pyx_t_2);
  2967. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  2968. __Pyx_GIVEREF(__pyx_t_5);
  2969. PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  2970. __Pyx_GIVEREF(__pyx_t_3);
  2971. __pyx_t_5 = 0;
  2972. __pyx_t_3 = 0;
  2973. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2974. __Pyx_GOTREF(__pyx_t_3);
  2975. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  2976. __Pyx_GIVEREF(__pyx_t_2);
  2977. __pyx_t_2 = 0;
  2978. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2979. __Pyx_GOTREF(__pyx_t_2);
  2980. __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2981. __Pyx_GOTREF(__pyx_t_5);
  2982. __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2983. __Pyx_GOTREF(__pyx_t_4);
  2984. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  2985. if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2986. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2987. __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 = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2988. __Pyx_GOTREF(__pyx_t_4);
  2989. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2990. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2991. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2992. if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2993. __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
  2994. {
  2995. __Pyx_BufFmt_StackElem __pyx_stack[1];
  2996. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_E.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  2997. __pyx_v_E = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_E.rcbuffer->pybuffer.buf = NULL;
  2998. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2999. } 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];
  3000. }
  3001. }
  3002. __pyx_t_7 = 0;
  3003. __pyx_v_E = ((PyArrayObject *)__pyx_t_4);
  3004. __pyx_t_4 = 0;
  3005. /* "scattnlay.pyx":96
  3006. *
  3007. * cdef np.ndarray[np.complex128_t, ndim = 2] E = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128)
  3008. * cdef np.ndarray[np.complex128_t, ndim = 2] H = np.zeros((x.shape[0], coords.shape[0]), dtype = np.complex128) # <<<<<<<<<<<<<<
  3009. *
  3010. * cdef np.ndarray[np.float64_t, ndim = 1] Er
  3011. */
  3012. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3013. __Pyx_GOTREF(__pyx_t_4);
  3014. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3015. __Pyx_GOTREF(__pyx_t_2);
  3016. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3017. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3018. __Pyx_GOTREF(__pyx_t_4);
  3019. __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_coords->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3020. __Pyx_GOTREF(__pyx_t_3);
  3021. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3022. __Pyx_GOTREF(__pyx_t_1);
  3023. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  3024. __Pyx_GIVEREF(__pyx_t_4);
  3025. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  3026. __Pyx_GIVEREF(__pyx_t_3);
  3027. __pyx_t_4 = 0;
  3028. __pyx_t_3 = 0;
  3029. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3030. __Pyx_GOTREF(__pyx_t_3);
  3031. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3032. __Pyx_GIVEREF(__pyx_t_1);
  3033. __pyx_t_1 = 0;
  3034. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3035. __Pyx_GOTREF(__pyx_t_1);
  3036. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3037. __Pyx_GOTREF(__pyx_t_4);
  3038. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3039. __Pyx_GOTREF(__pyx_t_5);
  3040. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3041. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3042. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3043. __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 = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3044. __Pyx_GOTREF(__pyx_t_5);
  3045. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3046. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3047. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3048. if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3049. __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  3050. {
  3051. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3052. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
  3053. __pyx_v_H = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H.rcbuffer->pybuffer.buf = NULL;
  3054. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3055. } 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];
  3056. }
  3057. }
  3058. __pyx_t_8 = 0;
  3059. __pyx_v_H = ((PyArrayObject *)__pyx_t_5);
  3060. __pyx_t_5 = 0;
  3061. /* "scattnlay.pyx":103
  3062. * cdef np.ndarray[np.float64_t, ndim = 1] Hi
  3063. *
  3064. * for i in range(x.shape[0]): # <<<<<<<<<<<<<<
  3065. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3066. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3067. */
  3068. __pyx_t_9 = (__pyx_v_x->dimensions[0]);
  3069. for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
  3070. __pyx_v_i = __pyx_t_10;
  3071. /* "scattnlay.pyx":104
  3072. *
  3073. * for i in range(x.shape[0]):
  3074. * Er = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3075. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3076. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3077. */
  3078. __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;}
  3079. __Pyx_GOTREF(__pyx_t_5);
  3080. __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;}
  3081. __Pyx_GOTREF(__pyx_t_1);
  3082. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3083. __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;}
  3084. __Pyx_GOTREF(__pyx_t_5);
  3085. __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;}
  3086. __Pyx_GOTREF(__pyx_t_3);
  3087. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  3088. __Pyx_GIVEREF(__pyx_t_5);
  3089. __pyx_t_5 = 0;
  3090. __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;}
  3091. __Pyx_GOTREF(__pyx_t_5);
  3092. __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;}
  3093. __Pyx_GOTREF(__pyx_t_2);
  3094. __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;}
  3095. __Pyx_GOTREF(__pyx_t_4);
  3096. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3097. 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;}
  3098. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3099. __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;}
  3100. __Pyx_GOTREF(__pyx_t_4);
  3101. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3102. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3103. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3104. 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;}
  3105. __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  3106. {
  3107. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3108. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3109. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Er.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3110. if (unlikely(__pyx_t_12 < 0)) {
  3111. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3112. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Er.rcbuffer->pybuffer, (PyObject*)__pyx_v_Er, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3113. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3114. __Pyx_RaiseBufferFallbackError();
  3115. } else {
  3116. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3117. }
  3118. }
  3119. __pyx_pybuffernd_Er.diminfo[0].strides = __pyx_pybuffernd_Er.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Er.diminfo[0].shape = __pyx_pybuffernd_Er.rcbuffer->pybuffer.shape[0];
  3120. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3121. }
  3122. __pyx_t_11 = 0;
  3123. __Pyx_XDECREF_SET(__pyx_v_Er, ((PyArrayObject *)__pyx_t_4));
  3124. __pyx_t_4 = 0;
  3125. /* "scattnlay.pyx":105
  3126. * for i in range(x.shape[0]):
  3127. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3128. * Ei = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3129. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3130. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3131. */
  3132. __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;}
  3133. __Pyx_GOTREF(__pyx_t_4);
  3134. __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;}
  3135. __Pyx_GOTREF(__pyx_t_5);
  3136. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3137. __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;}
  3138. __Pyx_GOTREF(__pyx_t_4);
  3139. __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;}
  3140. __Pyx_GOTREF(__pyx_t_3);
  3141. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  3142. __Pyx_GIVEREF(__pyx_t_4);
  3143. __pyx_t_4 = 0;
  3144. __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;}
  3145. __Pyx_GOTREF(__pyx_t_4);
  3146. __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;}
  3147. __Pyx_GOTREF(__pyx_t_1);
  3148. __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;}
  3149. __Pyx_GOTREF(__pyx_t_2);
  3150. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3151. 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;}
  3152. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3153. __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;}
  3154. __Pyx_GOTREF(__pyx_t_2);
  3155. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3156. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3157. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3158. 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;}
  3159. __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  3160. {
  3161. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3162. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3163. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3164. if (unlikely(__pyx_t_12 < 0)) {
  3165. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3166. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer, (PyObject*)__pyx_v_Ei, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3167. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3168. __Pyx_RaiseBufferFallbackError();
  3169. } else {
  3170. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3171. }
  3172. }
  3173. __pyx_pybuffernd_Ei.diminfo[0].strides = __pyx_pybuffernd_Ei.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Ei.diminfo[0].shape = __pyx_pybuffernd_Ei.rcbuffer->pybuffer.shape[0];
  3174. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3175. }
  3176. __pyx_t_16 = 0;
  3177. __Pyx_XDECREF_SET(__pyx_v_Ei, ((PyArrayObject *)__pyx_t_2));
  3178. __pyx_t_2 = 0;
  3179. /* "scattnlay.pyx":106
  3180. * Er = np.zeros(coords.shape[0], dtype = np.float64)
  3181. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3182. * Hr = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3183. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3184. *
  3185. */
  3186. __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;}
  3187. __Pyx_GOTREF(__pyx_t_2);
  3188. __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;}
  3189. __Pyx_GOTREF(__pyx_t_4);
  3190. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3191. __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;}
  3192. __Pyx_GOTREF(__pyx_t_2);
  3193. __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;}
  3194. __Pyx_GOTREF(__pyx_t_3);
  3195. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  3196. __Pyx_GIVEREF(__pyx_t_2);
  3197. __pyx_t_2 = 0;
  3198. __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;}
  3199. __Pyx_GOTREF(__pyx_t_2);
  3200. __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;}
  3201. __Pyx_GOTREF(__pyx_t_5);
  3202. __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;}
  3203. __Pyx_GOTREF(__pyx_t_1);
  3204. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3205. 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;}
  3206. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3207. __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;}
  3208. __Pyx_GOTREF(__pyx_t_1);
  3209. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3210. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3211. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3212. 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;}
  3213. __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  3214. {
  3215. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3216. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3217. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3218. if (unlikely(__pyx_t_12 < 0)) {
  3219. PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
  3220. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3221. Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
  3222. __Pyx_RaiseBufferFallbackError();
  3223. } else {
  3224. PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
  3225. }
  3226. }
  3227. __pyx_pybuffernd_Hr.diminfo[0].strides = __pyx_pybuffernd_Hr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hr.diminfo[0].shape = __pyx_pybuffernd_Hr.rcbuffer->pybuffer.shape[0];
  3228. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3229. }
  3230. __pyx_t_17 = 0;
  3231. __Pyx_XDECREF_SET(__pyx_v_Hr, ((PyArrayObject *)__pyx_t_1));
  3232. __pyx_t_1 = 0;
  3233. /* "scattnlay.pyx":107
  3234. * Ei = np.zeros(coords.shape[0], dtype = np.float64)
  3235. * Hr = np.zeros(coords.shape[0], dtype = np.float64)
  3236. * Hi = np.zeros(coords.shape[0], dtype = np.float64) # <<<<<<<<<<<<<<
  3237. *
  3238. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), n_max, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  3239. */
  3240. __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;}
  3241. __Pyx_GOTREF(__pyx_t_1);
  3242. __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;}
  3243. __Pyx_GOTREF(__pyx_t_2);
  3244. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3245. __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;}
  3246. __Pyx_GOTREF(__pyx_t_1);
  3247. __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;}
  3248. __Pyx_GOTREF(__pyx_t_3);
  3249. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  3250. __Pyx_GIVEREF(__pyx_t_1);
  3251. __pyx_t_1 = 0;
  3252. __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;}
  3253. __Pyx_GOTREF(__pyx_t_1);
  3254. __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;}
  3255. __Pyx_GOTREF(__pyx_t_4);
  3256. __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;}
  3257. __Pyx_GOTREF(__pyx_t_5);
  3258. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3259. 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;}
  3260. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3261. __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;}
  3262. __Pyx_GOTREF(__pyx_t_5);
  3263. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3264. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3265. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3266. 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;}
  3267. __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
  3268. {
  3269. __Pyx_BufFmt_StackElem __pyx_stack[1];
  3270. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3271. __pyx_t_12 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
  3272. if (unlikely(__pyx_t_12 < 0)) {
  3273. PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
  3274. if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
  3275. Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
  3276. __Pyx_RaiseBufferFallbackError();
  3277. } else {
  3278. PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
  3279. }
  3280. }
  3281. __pyx_pybuffernd_Hi.diminfo[0].strides = __pyx_pybuffernd_Hi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hi.diminfo[0].shape = __pyx_pybuffernd_Hi.rcbuffer->pybuffer.shape[0];
  3282. if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3283. }
  3284. __pyx_t_18 = 0;
  3285. __Pyx_XDECREF_SET(__pyx_v_Hi, ((PyArrayObject *)__pyx_t_5));
  3286. __pyx_t_5 = 0;
  3287. /* "scattnlay.pyx":109
  3288. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  3289. *
  3290. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), n_max, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi)) # <<<<<<<<<<<<<<
  3291. *
  3292. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  3293. */
  3294. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3295. __Pyx_GOTREF(__pyx_t_5);
  3296. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3297. __Pyx_GOTREF(__pyx_t_1);
  3298. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3299. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3300. __Pyx_GOTREF(__pyx_t_5);
  3301. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3302. __pyx_t_19 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3303. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3304. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3305. __Pyx_GOTREF(__pyx_t_5);
  3306. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3307. __Pyx_GOTREF(__pyx_t_1);
  3308. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3309. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3310. __Pyx_GOTREF(__pyx_t_5);
  3311. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3312. __pyx_t_20 = __pyx_convert_vector_from_py___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3313. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3314. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__14); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3315. __Pyx_GOTREF(__pyx_t_5);
  3316. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3317. __Pyx_GOTREF(__pyx_t_1);
  3318. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3319. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3320. __Pyx_GOTREF(__pyx_t_5);
  3321. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3322. __pyx_t_21 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3323. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3324. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__17); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3325. __Pyx_GOTREF(__pyx_t_5);
  3326. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3327. __Pyx_GOTREF(__pyx_t_1);
  3328. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3329. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3330. __Pyx_GOTREF(__pyx_t_5);
  3331. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3332. __pyx_t_22 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3333. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3334. __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_coords), __pyx_tuple__20); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  3335. __Pyx_GOTREF(__pyx_t_5);
  3336. __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3337. __Pyx_GOTREF(__pyx_t_1);
  3338. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3339. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3340. __Pyx_GOTREF(__pyx_t_5);
  3341. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3342. __pyx_t_23 = __pyx_convert_vector_from_py_double(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3343. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3344. __pyx_t_24 = __pyx_v_i;
  3345. __pyx_t_12 = -1;
  3346. if (__pyx_t_24 < 0) {
  3347. __pyx_t_24 += __pyx_pybuffernd_terms.diminfo[0].shape;
  3348. if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 0;
  3349. } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_terms.diminfo[0].shape)) __pyx_t_12 = 0;
  3350. if (unlikely(__pyx_t_12 != -1)) {
  3351. __Pyx_RaiseBufferIndexError(__pyx_t_12);
  3352. {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3353. }
  3354. *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_terms.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_terms.diminfo[0].strides) = nField((__pyx_v_x->dimensions[1]), __pyx_v_pl, __pyx_t_19, __pyx_t_20, __pyx_v_n_max, (__pyx_v_coords->dimensions[0]), __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Er)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Ei)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hr)), __pyx_f_9scattnlay_npy2c(((PyArrayObject *)__pyx_v_Hi)));
  3355. /* "scattnlay.pyx":111
  3356. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), n_max, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  3357. *
  3358. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C') # <<<<<<<<<<<<<<
  3359. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  3360. *
  3361. */
  3362. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Er), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3363. __Pyx_GOTREF(__pyx_t_5);
  3364. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3365. __Pyx_GOTREF(__pyx_t_1);
  3366. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3367. __pyx_t_5 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3368. __Pyx_GOTREF(__pyx_t_5);
  3369. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Ei), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3370. __Pyx_GOTREF(__pyx_t_3);
  3371. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3372. __Pyx_GOTREF(__pyx_t_2);
  3373. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3374. __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3375. __Pyx_GOTREF(__pyx_t_3);
  3376. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3377. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3378. __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3379. __Pyx_GOTREF(__pyx_t_2);
  3380. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3381. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3382. 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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3383. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3384. /* "scattnlay.pyx":112
  3385. *
  3386. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  3387. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C') # <<<<<<<<<<<<<<
  3388. *
  3389. * return terms, E, H
  3390. */
  3391. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hr), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3392. __Pyx_GOTREF(__pyx_t_2);
  3393. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3394. __Pyx_GOTREF(__pyx_t_3);
  3395. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3396. __pyx_t_2 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3397. __Pyx_GOTREF(__pyx_t_2);
  3398. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Hi), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3399. __Pyx_GOTREF(__pyx_t_1);
  3400. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3401. __Pyx_GOTREF(__pyx_t_5);
  3402. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3403. __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3404. __Pyx_GOTREF(__pyx_t_1);
  3405. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3406. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3407. __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3408. __Pyx_GOTREF(__pyx_t_5);
  3409. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3410. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3411. if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_H), __pyx_v_i, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3412. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3413. }
  3414. /* "scattnlay.pyx":114
  3415. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  3416. *
  3417. * return terms, E, H # <<<<<<<<<<<<<<
  3418. *
  3419. */
  3420. __Pyx_XDECREF(__pyx_r);
  3421. __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3422. __Pyx_GOTREF(__pyx_t_5);
  3423. __Pyx_INCREF(((PyObject *)__pyx_v_terms));
  3424. PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_terms));
  3425. __Pyx_GIVEREF(((PyObject *)__pyx_v_terms));
  3426. __Pyx_INCREF(((PyObject *)__pyx_v_E));
  3427. PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_E));
  3428. __Pyx_GIVEREF(((PyObject *)__pyx_v_E));
  3429. __Pyx_INCREF(((PyObject *)__pyx_v_H));
  3430. PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_H));
  3431. __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
  3432. __pyx_r = __pyx_t_5;
  3433. __pyx_t_5 = 0;
  3434. goto __pyx_L0;
  3435. /* "scattnlay.pyx":90
  3436. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  3437. *
  3438. * 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 n_max = 0): # <<<<<<<<<<<<<<
  3439. * cdef Py_ssize_t i
  3440. *
  3441. */
  3442. /* function exit code */
  3443. __pyx_L1_error:;
  3444. __Pyx_XDECREF(__pyx_t_1);
  3445. __Pyx_XDECREF(__pyx_t_2);
  3446. __Pyx_XDECREF(__pyx_t_3);
  3447. __Pyx_XDECREF(__pyx_t_4);
  3448. __Pyx_XDECREF(__pyx_t_5);
  3449. { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
  3450. __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
  3451. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  3452. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3453. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3454. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  3455. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3456. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3457. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  3458. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  3459. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  3460. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  3461. __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  3462. __Pyx_AddTraceback("scattnlay.fieldnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3463. __pyx_r = NULL;
  3464. goto __pyx_L2;
  3465. __pyx_L0:;
  3466. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_E.rcbuffer->pybuffer);
  3467. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Ei.rcbuffer->pybuffer);
  3468. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Er.rcbuffer->pybuffer);
  3469. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
  3470. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hi.rcbuffer->pybuffer);
  3471. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hr.rcbuffer->pybuffer);
  3472. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_coords.rcbuffer->pybuffer);
  3473. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
  3474. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_terms.rcbuffer->pybuffer);
  3475. __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
  3476. __pyx_L2:;
  3477. __Pyx_XDECREF((PyObject *)__pyx_v_terms);
  3478. __Pyx_XDECREF((PyObject *)__pyx_v_E);
  3479. __Pyx_XDECREF((PyObject *)__pyx_v_H);
  3480. __Pyx_XDECREF((PyObject *)__pyx_v_Er);
  3481. __Pyx_XDECREF((PyObject *)__pyx_v_Ei);
  3482. __Pyx_XDECREF((PyObject *)__pyx_v_Hr);
  3483. __Pyx_XDECREF((PyObject *)__pyx_v_Hi);
  3484. __Pyx_XGIVEREF(__pyx_r);
  3485. __Pyx_RefNannyFinishContext();
  3486. return __pyx_r;
  3487. }
  3488. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  3489. * # experimental exception made for __getbuffer__ and __releasebuffer__
  3490. * # -- the details of this may change.
  3491. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  3492. * # This implementation of getbuffer is geared towards Cython
  3493. * # requirements, and does not yet fullfill the PEP.
  3494. */
  3495. /* Python wrapper */
  3496. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  3497. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  3498. int __pyx_r;
  3499. __Pyx_RefNannyDeclarations
  3500. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  3501. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  3502. /* function exit code */
  3503. __Pyx_RefNannyFinishContext();
  3504. return __pyx_r;
  3505. }
  3506. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  3507. int __pyx_v_copy_shape;
  3508. int __pyx_v_i;
  3509. int __pyx_v_ndim;
  3510. int __pyx_v_endian_detector;
  3511. int __pyx_v_little_endian;
  3512. int __pyx_v_t;
  3513. char *__pyx_v_f;
  3514. PyArray_Descr *__pyx_v_descr = 0;
  3515. int __pyx_v_offset;
  3516. int __pyx_v_hasfields;
  3517. int __pyx_r;
  3518. __Pyx_RefNannyDeclarations
  3519. int __pyx_t_1;
  3520. int __pyx_t_2;
  3521. int __pyx_t_3;
  3522. PyObject *__pyx_t_4 = NULL;
  3523. int __pyx_t_5;
  3524. int __pyx_t_6;
  3525. int __pyx_t_7;
  3526. PyObject *__pyx_t_8 = NULL;
  3527. char *__pyx_t_9;
  3528. int __pyx_lineno = 0;
  3529. const char *__pyx_filename = NULL;
  3530. int __pyx_clineno = 0;
  3531. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  3532. if (__pyx_v_info != NULL) {
  3533. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  3534. __Pyx_GIVEREF(__pyx_v_info->obj);
  3535. }
  3536. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200
  3537. * # of flags
  3538. *
  3539. * if info == NULL: return # <<<<<<<<<<<<<<
  3540. *
  3541. * cdef int copy_shape, i, ndim
  3542. */
  3543. __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  3544. if (__pyx_t_1) {
  3545. __pyx_r = 0;
  3546. goto __pyx_L0;
  3547. }
  3548. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
  3549. *
  3550. * cdef int copy_shape, i, ndim
  3551. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  3552. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  3553. *
  3554. */
  3555. __pyx_v_endian_detector = 1;
  3556. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
  3557. * cdef int copy_shape, i, ndim
  3558. * cdef int endian_detector = 1
  3559. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  3560. *
  3561. * ndim = PyArray_NDIM(self)
  3562. */
  3563. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  3564. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
  3565. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  3566. *
  3567. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  3568. *
  3569. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  3570. */
  3571. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  3572. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
  3573. * ndim = PyArray_NDIM(self)
  3574. *
  3575. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  3576. * copy_shape = 1
  3577. * else:
  3578. */
  3579. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  3580. if (__pyx_t_1) {
  3581. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
  3582. *
  3583. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  3584. * copy_shape = 1 # <<<<<<<<<<<<<<
  3585. * else:
  3586. * copy_shape = 0
  3587. */
  3588. __pyx_v_copy_shape = 1;
  3589. goto __pyx_L4;
  3590. }
  3591. /*else*/ {
  3592. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
  3593. * copy_shape = 1
  3594. * else:
  3595. * copy_shape = 0 # <<<<<<<<<<<<<<
  3596. *
  3597. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3598. */
  3599. __pyx_v_copy_shape = 0;
  3600. }
  3601. __pyx_L4:;
  3602. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
  3603. * copy_shape = 0
  3604. *
  3605. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  3606. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  3607. * raise ValueError(u"ndarray is not C contiguous")
  3608. */
  3609. __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  3610. if (__pyx_t_1) {
  3611. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
  3612. *
  3613. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3614. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  3615. * raise ValueError(u"ndarray is not C contiguous")
  3616. *
  3617. */
  3618. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  3619. __pyx_t_3 = __pyx_t_2;
  3620. } else {
  3621. __pyx_t_3 = __pyx_t_1;
  3622. }
  3623. if (__pyx_t_3) {
  3624. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  3625. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  3626. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  3627. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  3628. *
  3629. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3630. */
  3631. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3632. __Pyx_GOTREF(__pyx_t_4);
  3633. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3634. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3635. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3636. }
  3637. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
  3638. * raise ValueError(u"ndarray is not C contiguous")
  3639. *
  3640. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  3641. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  3642. * raise ValueError(u"ndarray is not Fortran contiguous")
  3643. */
  3644. __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  3645. if (__pyx_t_3) {
  3646. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
  3647. *
  3648. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3649. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  3650. * raise ValueError(u"ndarray is not Fortran contiguous")
  3651. *
  3652. */
  3653. __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  3654. __pyx_t_2 = __pyx_t_1;
  3655. } else {
  3656. __pyx_t_2 = __pyx_t_3;
  3657. }
  3658. if (__pyx_t_2) {
  3659. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  3660. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  3661. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  3662. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  3663. *
  3664. * info.buf = PyArray_DATA(self)
  3665. */
  3666. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3667. __Pyx_GOTREF(__pyx_t_4);
  3668. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3669. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3670. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3671. }
  3672. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
  3673. * raise ValueError(u"ndarray is not Fortran contiguous")
  3674. *
  3675. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  3676. * info.ndim = ndim
  3677. * if copy_shape:
  3678. */
  3679. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  3680. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
  3681. *
  3682. * info.buf = PyArray_DATA(self)
  3683. * info.ndim = ndim # <<<<<<<<<<<<<<
  3684. * if copy_shape:
  3685. * # Allocate new buffer for strides and shape info.
  3686. */
  3687. __pyx_v_info->ndim = __pyx_v_ndim;
  3688. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
  3689. * info.buf = PyArray_DATA(self)
  3690. * info.ndim = ndim
  3691. * if copy_shape: # <<<<<<<<<<<<<<
  3692. * # Allocate new buffer for strides and shape info.
  3693. * # This is allocated as one block, strides first.
  3694. */
  3695. __pyx_t_2 = (__pyx_v_copy_shape != 0);
  3696. if (__pyx_t_2) {
  3697. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
  3698. * # Allocate new buffer for strides and shape info.
  3699. * # This is allocated as one block, strides first.
  3700. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
  3701. * info.shape = info.strides + ndim
  3702. * for i in range(ndim):
  3703. */
  3704. __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
  3705. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
  3706. * # This is allocated as one block, strides first.
  3707. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  3708. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  3709. * for i in range(ndim):
  3710. * info.strides[i] = PyArray_STRIDES(self)[i]
  3711. */
  3712. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  3713. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
  3714. * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
  3715. * info.shape = info.strides + ndim
  3716. * for i in range(ndim): # <<<<<<<<<<<<<<
  3717. * info.strides[i] = PyArray_STRIDES(self)[i]
  3718. * info.shape[i] = PyArray_DIMS(self)[i]
  3719. */
  3720. __pyx_t_5 = __pyx_v_ndim;
  3721. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  3722. __pyx_v_i = __pyx_t_6;
  3723. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
  3724. * info.shape = info.strides + ndim
  3725. * for i in range(ndim):
  3726. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  3727. * info.shape[i] = PyArray_DIMS(self)[i]
  3728. * else:
  3729. */
  3730. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  3731. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
  3732. * for i in range(ndim):
  3733. * info.strides[i] = PyArray_STRIDES(self)[i]
  3734. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  3735. * else:
  3736. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3737. */
  3738. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  3739. }
  3740. goto __pyx_L7;
  3741. }
  3742. /*else*/ {
  3743. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
  3744. * info.shape[i] = PyArray_DIMS(self)[i]
  3745. * else:
  3746. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  3747. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3748. * info.suboffsets = NULL
  3749. */
  3750. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  3751. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
  3752. * else:
  3753. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3754. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  3755. * info.suboffsets = NULL
  3756. * info.itemsize = PyArray_ITEMSIZE(self)
  3757. */
  3758. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  3759. }
  3760. __pyx_L7:;
  3761. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
  3762. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  3763. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3764. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  3765. * info.itemsize = PyArray_ITEMSIZE(self)
  3766. * info.readonly = not PyArray_ISWRITEABLE(self)
  3767. */
  3768. __pyx_v_info->suboffsets = NULL;
  3769. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
  3770. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  3771. * info.suboffsets = NULL
  3772. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  3773. * info.readonly = not PyArray_ISWRITEABLE(self)
  3774. *
  3775. */
  3776. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  3777. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
  3778. * info.suboffsets = NULL
  3779. * info.itemsize = PyArray_ITEMSIZE(self)
  3780. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  3781. *
  3782. * cdef int t
  3783. */
  3784. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  3785. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
  3786. *
  3787. * cdef int t
  3788. * cdef char* f = NULL # <<<<<<<<<<<<<<
  3789. * cdef dtype descr = self.descr
  3790. * cdef list stack
  3791. */
  3792. __pyx_v_f = NULL;
  3793. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
  3794. * cdef int t
  3795. * cdef char* f = NULL
  3796. * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
  3797. * cdef list stack
  3798. * cdef int offset
  3799. */
  3800. __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
  3801. __Pyx_INCREF(__pyx_t_4);
  3802. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
  3803. __pyx_t_4 = 0;
  3804. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244
  3805. * cdef int offset
  3806. *
  3807. * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
  3808. *
  3809. * if not hasfields and not copy_shape:
  3810. */
  3811. __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
  3812. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
  3813. * cdef bint hasfields = PyDataType_HASFIELDS(descr)
  3814. *
  3815. * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
  3816. * # do not call releasebuffer
  3817. * info.obj = None
  3818. */
  3819. __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  3820. if (__pyx_t_2) {
  3821. __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
  3822. __pyx_t_1 = __pyx_t_3;
  3823. } else {
  3824. __pyx_t_1 = __pyx_t_2;
  3825. }
  3826. if (__pyx_t_1) {
  3827. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
  3828. * if not hasfields and not copy_shape:
  3829. * # do not call releasebuffer
  3830. * info.obj = None # <<<<<<<<<<<<<<
  3831. * else:
  3832. * # need to call releasebuffer
  3833. */
  3834. __Pyx_INCREF(Py_None);
  3835. __Pyx_GIVEREF(Py_None);
  3836. __Pyx_GOTREF(__pyx_v_info->obj);
  3837. __Pyx_DECREF(__pyx_v_info->obj);
  3838. __pyx_v_info->obj = Py_None;
  3839. goto __pyx_L10;
  3840. }
  3841. /*else*/ {
  3842. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
  3843. * else:
  3844. * # need to call releasebuffer
  3845. * info.obj = self # <<<<<<<<<<<<<<
  3846. *
  3847. * if not hasfields:
  3848. */
  3849. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  3850. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  3851. __Pyx_GOTREF(__pyx_v_info->obj);
  3852. __Pyx_DECREF(__pyx_v_info->obj);
  3853. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  3854. }
  3855. __pyx_L10:;
  3856. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
  3857. * info.obj = self
  3858. *
  3859. * if not hasfields: # <<<<<<<<<<<<<<
  3860. * t = descr.type_num
  3861. * if ((descr.byteorder == c'>' and little_endian) or
  3862. */
  3863. __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  3864. if (__pyx_t_1) {
  3865. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
  3866. *
  3867. * if not hasfields:
  3868. * t = descr.type_num # <<<<<<<<<<<<<<
  3869. * if ((descr.byteorder == c'>' and little_endian) or
  3870. * (descr.byteorder == c'<' and not little_endian)):
  3871. */
  3872. __pyx_t_5 = __pyx_v_descr->type_num;
  3873. __pyx_v_t = __pyx_t_5;
  3874. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
  3875. * if not hasfields:
  3876. * t = descr.type_num
  3877. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  3878. * (descr.byteorder == c'<' and not little_endian)):
  3879. * raise ValueError(u"Non-native byte order not supported")
  3880. */
  3881. __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
  3882. if (__pyx_t_1) {
  3883. __pyx_t_2 = (__pyx_v_little_endian != 0);
  3884. } else {
  3885. __pyx_t_2 = __pyx_t_1;
  3886. }
  3887. if (!__pyx_t_2) {
  3888. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
  3889. * t = descr.type_num
  3890. * if ((descr.byteorder == c'>' and little_endian) or
  3891. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  3892. * raise ValueError(u"Non-native byte order not supported")
  3893. * if t == NPY_BYTE: f = "b"
  3894. */
  3895. __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
  3896. if (__pyx_t_1) {
  3897. __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
  3898. __pyx_t_7 = __pyx_t_3;
  3899. } else {
  3900. __pyx_t_7 = __pyx_t_1;
  3901. }
  3902. __pyx_t_1 = __pyx_t_7;
  3903. } else {
  3904. __pyx_t_1 = __pyx_t_2;
  3905. }
  3906. if (__pyx_t_1) {
  3907. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  3908. * if ((descr.byteorder == c'>' and little_endian) or
  3909. * (descr.byteorder == c'<' and not little_endian)):
  3910. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  3911. * if t == NPY_BYTE: f = "b"
  3912. * elif t == NPY_UBYTE: f = "B"
  3913. */
  3914. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3915. __Pyx_GOTREF(__pyx_t_4);
  3916. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  3917. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3918. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3919. }
  3920. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  3921. * elif t == NPY_CDOUBLE: f = "Zd"
  3922. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  3923. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  3924. * else:
  3925. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  3926. */
  3927. switch (__pyx_v_t) {
  3928. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
  3929. * (descr.byteorder == c'<' and not little_endian)):
  3930. * raise ValueError(u"Non-native byte order not supported")
  3931. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  3932. * elif t == NPY_UBYTE: f = "B"
  3933. * elif t == NPY_SHORT: f = "h"
  3934. */
  3935. case NPY_BYTE:
  3936. __pyx_v_f = __pyx_k_b;
  3937. break;
  3938. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
  3939. * raise ValueError(u"Non-native byte order not supported")
  3940. * if t == NPY_BYTE: f = "b"
  3941. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  3942. * elif t == NPY_SHORT: f = "h"
  3943. * elif t == NPY_USHORT: f = "H"
  3944. */
  3945. case NPY_UBYTE:
  3946. __pyx_v_f = __pyx_k_B;
  3947. break;
  3948. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
  3949. * if t == NPY_BYTE: f = "b"
  3950. * elif t == NPY_UBYTE: f = "B"
  3951. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  3952. * elif t == NPY_USHORT: f = "H"
  3953. * elif t == NPY_INT: f = "i"
  3954. */
  3955. case NPY_SHORT:
  3956. __pyx_v_f = __pyx_k_h;
  3957. break;
  3958. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
  3959. * elif t == NPY_UBYTE: f = "B"
  3960. * elif t == NPY_SHORT: f = "h"
  3961. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  3962. * elif t == NPY_INT: f = "i"
  3963. * elif t == NPY_UINT: f = "I"
  3964. */
  3965. case NPY_USHORT:
  3966. __pyx_v_f = __pyx_k_H;
  3967. break;
  3968. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
  3969. * elif t == NPY_SHORT: f = "h"
  3970. * elif t == NPY_USHORT: f = "H"
  3971. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  3972. * elif t == NPY_UINT: f = "I"
  3973. * elif t == NPY_LONG: f = "l"
  3974. */
  3975. case NPY_INT:
  3976. __pyx_v_f = __pyx_k_i;
  3977. break;
  3978. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
  3979. * elif t == NPY_USHORT: f = "H"
  3980. * elif t == NPY_INT: f = "i"
  3981. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  3982. * elif t == NPY_LONG: f = "l"
  3983. * elif t == NPY_ULONG: f = "L"
  3984. */
  3985. case NPY_UINT:
  3986. __pyx_v_f = __pyx_k_I;
  3987. break;
  3988. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
  3989. * elif t == NPY_INT: f = "i"
  3990. * elif t == NPY_UINT: f = "I"
  3991. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  3992. * elif t == NPY_ULONG: f = "L"
  3993. * elif t == NPY_LONGLONG: f = "q"
  3994. */
  3995. case NPY_LONG:
  3996. __pyx_v_f = __pyx_k_l;
  3997. break;
  3998. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
  3999. * elif t == NPY_UINT: f = "I"
  4000. * elif t == NPY_LONG: f = "l"
  4001. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  4002. * elif t == NPY_LONGLONG: f = "q"
  4003. * elif t == NPY_ULONGLONG: f = "Q"
  4004. */
  4005. case NPY_ULONG:
  4006. __pyx_v_f = __pyx_k_L;
  4007. break;
  4008. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
  4009. * elif t == NPY_LONG: f = "l"
  4010. * elif t == NPY_ULONG: f = "L"
  4011. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  4012. * elif t == NPY_ULONGLONG: f = "Q"
  4013. * elif t == NPY_FLOAT: f = "f"
  4014. */
  4015. case NPY_LONGLONG:
  4016. __pyx_v_f = __pyx_k_q;
  4017. break;
  4018. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
  4019. * elif t == NPY_ULONG: f = "L"
  4020. * elif t == NPY_LONGLONG: f = "q"
  4021. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  4022. * elif t == NPY_FLOAT: f = "f"
  4023. * elif t == NPY_DOUBLE: f = "d"
  4024. */
  4025. case NPY_ULONGLONG:
  4026. __pyx_v_f = __pyx_k_Q;
  4027. break;
  4028. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
  4029. * elif t == NPY_LONGLONG: f = "q"
  4030. * elif t == NPY_ULONGLONG: f = "Q"
  4031. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  4032. * elif t == NPY_DOUBLE: f = "d"
  4033. * elif t == NPY_LONGDOUBLE: f = "g"
  4034. */
  4035. case NPY_FLOAT:
  4036. __pyx_v_f = __pyx_k_f;
  4037. break;
  4038. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
  4039. * elif t == NPY_ULONGLONG: f = "Q"
  4040. * elif t == NPY_FLOAT: f = "f"
  4041. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  4042. * elif t == NPY_LONGDOUBLE: f = "g"
  4043. * elif t == NPY_CFLOAT: f = "Zf"
  4044. */
  4045. case NPY_DOUBLE:
  4046. __pyx_v_f = __pyx_k_d;
  4047. break;
  4048. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
  4049. * elif t == NPY_FLOAT: f = "f"
  4050. * elif t == NPY_DOUBLE: f = "d"
  4051. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  4052. * elif t == NPY_CFLOAT: f = "Zf"
  4053. * elif t == NPY_CDOUBLE: f = "Zd"
  4054. */
  4055. case NPY_LONGDOUBLE:
  4056. __pyx_v_f = __pyx_k_g;
  4057. break;
  4058. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
  4059. * elif t == NPY_DOUBLE: f = "d"
  4060. * elif t == NPY_LONGDOUBLE: f = "g"
  4061. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  4062. * elif t == NPY_CDOUBLE: f = "Zd"
  4063. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4064. */
  4065. case NPY_CFLOAT:
  4066. __pyx_v_f = __pyx_k_Zf;
  4067. break;
  4068. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
  4069. * elif t == NPY_LONGDOUBLE: f = "g"
  4070. * elif t == NPY_CFLOAT: f = "Zf"
  4071. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  4072. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4073. * elif t == NPY_OBJECT: f = "O"
  4074. */
  4075. case NPY_CDOUBLE:
  4076. __pyx_v_f = __pyx_k_Zd;
  4077. break;
  4078. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
  4079. * elif t == NPY_CFLOAT: f = "Zf"
  4080. * elif t == NPY_CDOUBLE: f = "Zd"
  4081. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  4082. * elif t == NPY_OBJECT: f = "O"
  4083. * else:
  4084. */
  4085. case NPY_CLONGDOUBLE:
  4086. __pyx_v_f = __pyx_k_Zg;
  4087. break;
  4088. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
  4089. * elif t == NPY_CDOUBLE: f = "Zd"
  4090. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  4091. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  4092. * else:
  4093. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4094. */
  4095. case NPY_OBJECT:
  4096. __pyx_v_f = __pyx_k_O;
  4097. break;
  4098. default:
  4099. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
  4100. * elif t == NPY_OBJECT: f = "O"
  4101. * else:
  4102. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  4103. * info.format = f
  4104. * return
  4105. */
  4106. __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;}
  4107. __Pyx_GOTREF(__pyx_t_4);
  4108. __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;}
  4109. __Pyx_GOTREF(__pyx_t_8);
  4110. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4111. __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;}
  4112. __Pyx_GOTREF(__pyx_t_4);
  4113. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
  4114. __Pyx_GIVEREF(__pyx_t_8);
  4115. __pyx_t_8 = 0;
  4116. __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;}
  4117. __Pyx_GOTREF(__pyx_t_8);
  4118. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4119. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  4120. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4121. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4122. break;
  4123. }
  4124. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
  4125. * else:
  4126. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4127. * info.format = f # <<<<<<<<<<<<<<
  4128. * return
  4129. * else:
  4130. */
  4131. __pyx_v_info->format = __pyx_v_f;
  4132. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
  4133. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  4134. * info.format = f
  4135. * return # <<<<<<<<<<<<<<
  4136. * else:
  4137. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4138. */
  4139. __pyx_r = 0;
  4140. goto __pyx_L0;
  4141. }
  4142. /*else*/ {
  4143. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
  4144. * return
  4145. * else:
  4146. * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  4147. * info.format[0] = c'^' # Native data types, manual alignment
  4148. * offset = 0
  4149. */
  4150. __pyx_v_info->format = ((char *)malloc(255));
  4151. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
  4152. * else:
  4153. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4154. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  4155. * offset = 0
  4156. * f = _util_dtypestring(descr, info.format + 1,
  4157. */
  4158. (__pyx_v_info->format[0]) = '^';
  4159. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
  4160. * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
  4161. * info.format[0] = c'^' # Native data types, manual alignment
  4162. * offset = 0 # <<<<<<<<<<<<<<
  4163. * f = _util_dtypestring(descr, info.format + 1,
  4164. * info.format + _buffer_format_string_len,
  4165. */
  4166. __pyx_v_offset = 0;
  4167. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
  4168. * info.format[0] = c'^' # Native data types, manual alignment
  4169. * offset = 0
  4170. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  4171. * info.format + _buffer_format_string_len,
  4172. * &offset)
  4173. */
  4174. __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;}
  4175. __pyx_v_f = __pyx_t_9;
  4176. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
  4177. * info.format + _buffer_format_string_len,
  4178. * &offset)
  4179. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  4180. *
  4181. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4182. */
  4183. (__pyx_v_f[0]) = '\x00';
  4184. }
  4185. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
  4186. * # experimental exception made for __getbuffer__ and __releasebuffer__
  4187. * # -- the details of this may change.
  4188. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  4189. * # This implementation of getbuffer is geared towards Cython
  4190. * # requirements, and does not yet fullfill the PEP.
  4191. */
  4192. /* function exit code */
  4193. __pyx_r = 0;
  4194. goto __pyx_L0;
  4195. __pyx_L1_error:;
  4196. __Pyx_XDECREF(__pyx_t_4);
  4197. __Pyx_XDECREF(__pyx_t_8);
  4198. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4199. __pyx_r = -1;
  4200. if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
  4201. __Pyx_GOTREF(__pyx_v_info->obj);
  4202. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  4203. }
  4204. goto __pyx_L2;
  4205. __pyx_L0:;
  4206. if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
  4207. __Pyx_GOTREF(Py_None);
  4208. __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  4209. }
  4210. __pyx_L2:;
  4211. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  4212. __Pyx_RefNannyFinishContext();
  4213. return __pyx_r;
  4214. }
  4215. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4216. * f[0] = c'\0' # Terminate format string
  4217. *
  4218. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4219. * if PyArray_HASFIELDS(self):
  4220. * stdlib.free(info.format)
  4221. */
  4222. /* Python wrapper */
  4223. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  4224. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4225. __Pyx_RefNannyDeclarations
  4226. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  4227. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  4228. /* function exit code */
  4229. __Pyx_RefNannyFinishContext();
  4230. }
  4231. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  4232. __Pyx_RefNannyDeclarations
  4233. int __pyx_t_1;
  4234. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  4235. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
  4236. *
  4237. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4238. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  4239. * stdlib.free(info.format)
  4240. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4241. */
  4242. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  4243. if (__pyx_t_1) {
  4244. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
  4245. * def __releasebuffer__(ndarray self, Py_buffer* info):
  4246. * if PyArray_HASFIELDS(self):
  4247. * stdlib.free(info.format) # <<<<<<<<<<<<<<
  4248. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4249. * stdlib.free(info.strides)
  4250. */
  4251. free(__pyx_v_info->format);
  4252. goto __pyx_L3;
  4253. }
  4254. __pyx_L3:;
  4255. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
  4256. * if PyArray_HASFIELDS(self):
  4257. * stdlib.free(info.format)
  4258. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  4259. * stdlib.free(info.strides)
  4260. * # info.shape was stored after info.strides in the same block
  4261. */
  4262. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  4263. if (__pyx_t_1) {
  4264. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
  4265. * stdlib.free(info.format)
  4266. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  4267. * stdlib.free(info.strides) # <<<<<<<<<<<<<<
  4268. * # info.shape was stored after info.strides in the same block
  4269. *
  4270. */
  4271. free(__pyx_v_info->strides);
  4272. goto __pyx_L4;
  4273. }
  4274. __pyx_L4:;
  4275. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
  4276. * f[0] = c'\0' # Terminate format string
  4277. *
  4278. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  4279. * if PyArray_HASFIELDS(self):
  4280. * stdlib.free(info.format)
  4281. */
  4282. /* function exit code */
  4283. __Pyx_RefNannyFinishContext();
  4284. }
  4285. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4286. * ctypedef npy_cdouble complex_t
  4287. *
  4288. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4289. * return PyArray_MultiIterNew(1, <void*>a)
  4290. *
  4291. */
  4292. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  4293. PyObject *__pyx_r = NULL;
  4294. __Pyx_RefNannyDeclarations
  4295. PyObject *__pyx_t_1 = NULL;
  4296. int __pyx_lineno = 0;
  4297. const char *__pyx_filename = NULL;
  4298. int __pyx_clineno = 0;
  4299. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  4300. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769
  4301. *
  4302. * cdef inline object PyArray_MultiIterNew1(a):
  4303. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  4304. *
  4305. * cdef inline object PyArray_MultiIterNew2(a, b):
  4306. */
  4307. __Pyx_XDECREF(__pyx_r);
  4308. __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;}
  4309. __Pyx_GOTREF(__pyx_t_1);
  4310. __pyx_r = __pyx_t_1;
  4311. __pyx_t_1 = 0;
  4312. goto __pyx_L0;
  4313. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
  4314. * ctypedef npy_cdouble complex_t
  4315. *
  4316. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  4317. * return PyArray_MultiIterNew(1, <void*>a)
  4318. *
  4319. */
  4320. /* function exit code */
  4321. __pyx_L1_error:;
  4322. __Pyx_XDECREF(__pyx_t_1);
  4323. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4324. __pyx_r = 0;
  4325. __pyx_L0:;
  4326. __Pyx_XGIVEREF(__pyx_r);
  4327. __Pyx_RefNannyFinishContext();
  4328. return __pyx_r;
  4329. }
  4330. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  4331. * return PyArray_MultiIterNew(1, <void*>a)
  4332. *
  4333. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  4334. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4335. *
  4336. */
  4337. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  4338. PyObject *__pyx_r = NULL;
  4339. __Pyx_RefNannyDeclarations
  4340. PyObject *__pyx_t_1 = NULL;
  4341. int __pyx_lineno = 0;
  4342. const char *__pyx_filename = NULL;
  4343. int __pyx_clineno = 0;
  4344. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  4345. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772
  4346. *
  4347. * cdef inline object PyArray_MultiIterNew2(a, b):
  4348. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  4349. *
  4350. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  4351. */
  4352. __Pyx_XDECREF(__pyx_r);
  4353. __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;}
  4354. __Pyx_GOTREF(__pyx_t_1);
  4355. __pyx_r = __pyx_t_1;
  4356. __pyx_t_1 = 0;
  4357. goto __pyx_L0;
  4358. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
  4359. * return PyArray_MultiIterNew(1, <void*>a)
  4360. *
  4361. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  4362. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4363. *
  4364. */
  4365. /* function exit code */
  4366. __pyx_L1_error:;
  4367. __Pyx_XDECREF(__pyx_t_1);
  4368. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4369. __pyx_r = 0;
  4370. __pyx_L0:;
  4371. __Pyx_XGIVEREF(__pyx_r);
  4372. __Pyx_RefNannyFinishContext();
  4373. return __pyx_r;
  4374. }
  4375. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  4376. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4377. *
  4378. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  4379. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4380. *
  4381. */
  4382. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  4383. PyObject *__pyx_r = NULL;
  4384. __Pyx_RefNannyDeclarations
  4385. PyObject *__pyx_t_1 = NULL;
  4386. int __pyx_lineno = 0;
  4387. const char *__pyx_filename = NULL;
  4388. int __pyx_clineno = 0;
  4389. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  4390. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775
  4391. *
  4392. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  4393. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  4394. *
  4395. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  4396. */
  4397. __Pyx_XDECREF(__pyx_r);
  4398. __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;}
  4399. __Pyx_GOTREF(__pyx_t_1);
  4400. __pyx_r = __pyx_t_1;
  4401. __pyx_t_1 = 0;
  4402. goto __pyx_L0;
  4403. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
  4404. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  4405. *
  4406. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  4407. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4408. *
  4409. */
  4410. /* function exit code */
  4411. __pyx_L1_error:;
  4412. __Pyx_XDECREF(__pyx_t_1);
  4413. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4414. __pyx_r = 0;
  4415. __pyx_L0:;
  4416. __Pyx_XGIVEREF(__pyx_r);
  4417. __Pyx_RefNannyFinishContext();
  4418. return __pyx_r;
  4419. }
  4420. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  4421. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4422. *
  4423. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  4424. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4425. *
  4426. */
  4427. 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) {
  4428. PyObject *__pyx_r = NULL;
  4429. __Pyx_RefNannyDeclarations
  4430. PyObject *__pyx_t_1 = NULL;
  4431. int __pyx_lineno = 0;
  4432. const char *__pyx_filename = NULL;
  4433. int __pyx_clineno = 0;
  4434. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  4435. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778
  4436. *
  4437. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  4438. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  4439. *
  4440. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  4441. */
  4442. __Pyx_XDECREF(__pyx_r);
  4443. __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;}
  4444. __Pyx_GOTREF(__pyx_t_1);
  4445. __pyx_r = __pyx_t_1;
  4446. __pyx_t_1 = 0;
  4447. goto __pyx_L0;
  4448. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
  4449. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  4450. *
  4451. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  4452. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4453. *
  4454. */
  4455. /* function exit code */
  4456. __pyx_L1_error:;
  4457. __Pyx_XDECREF(__pyx_t_1);
  4458. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4459. __pyx_r = 0;
  4460. __pyx_L0:;
  4461. __Pyx_XGIVEREF(__pyx_r);
  4462. __Pyx_RefNannyFinishContext();
  4463. return __pyx_r;
  4464. }
  4465. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  4466. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4467. *
  4468. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  4469. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4470. *
  4471. */
  4472. 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) {
  4473. PyObject *__pyx_r = NULL;
  4474. __Pyx_RefNannyDeclarations
  4475. PyObject *__pyx_t_1 = NULL;
  4476. int __pyx_lineno = 0;
  4477. const char *__pyx_filename = NULL;
  4478. int __pyx_clineno = 0;
  4479. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  4480. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":781
  4481. *
  4482. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  4483. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  4484. *
  4485. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  4486. */
  4487. __Pyx_XDECREF(__pyx_r);
  4488. __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;}
  4489. __Pyx_GOTREF(__pyx_t_1);
  4490. __pyx_r = __pyx_t_1;
  4491. __pyx_t_1 = 0;
  4492. goto __pyx_L0;
  4493. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
  4494. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  4495. *
  4496. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  4497. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4498. *
  4499. */
  4500. /* function exit code */
  4501. __pyx_L1_error:;
  4502. __Pyx_XDECREF(__pyx_t_1);
  4503. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4504. __pyx_r = 0;
  4505. __pyx_L0:;
  4506. __Pyx_XGIVEREF(__pyx_r);
  4507. __Pyx_RefNannyFinishContext();
  4508. return __pyx_r;
  4509. }
  4510. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  4511. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  4512. *
  4513. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  4514. * # Recursive utility function used in __getbuffer__ to get format
  4515. * # string. The new location in the format string is returned.
  4516. */
  4517. 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) {
  4518. PyArray_Descr *__pyx_v_child = 0;
  4519. int __pyx_v_endian_detector;
  4520. int __pyx_v_little_endian;
  4521. PyObject *__pyx_v_fields = 0;
  4522. PyObject *__pyx_v_childname = NULL;
  4523. PyObject *__pyx_v_new_offset = NULL;
  4524. PyObject *__pyx_v_t = NULL;
  4525. char *__pyx_r;
  4526. __Pyx_RefNannyDeclarations
  4527. PyObject *__pyx_t_1 = NULL;
  4528. Py_ssize_t __pyx_t_2;
  4529. PyObject *__pyx_t_3 = NULL;
  4530. PyObject *__pyx_t_4 = NULL;
  4531. int __pyx_t_5;
  4532. int __pyx_t_6;
  4533. int __pyx_t_7;
  4534. int __pyx_t_8;
  4535. int __pyx_t_9;
  4536. long __pyx_t_10;
  4537. char *__pyx_t_11;
  4538. int __pyx_lineno = 0;
  4539. const char *__pyx_filename = NULL;
  4540. int __pyx_clineno = 0;
  4541. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  4542. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
  4543. * cdef int delta_offset
  4544. * cdef tuple i
  4545. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  4546. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  4547. * cdef tuple fields
  4548. */
  4549. __pyx_v_endian_detector = 1;
  4550. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
  4551. * cdef tuple i
  4552. * cdef int endian_detector = 1
  4553. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  4554. * cdef tuple fields
  4555. *
  4556. */
  4557. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  4558. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
  4559. * cdef tuple fields
  4560. *
  4561. * for childname in descr.names: # <<<<<<<<<<<<<<
  4562. * fields = descr.fields[childname]
  4563. * child, new_offset = fields
  4564. */
  4565. if (unlikely(__pyx_v_descr->names == Py_None)) {
  4566. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  4567. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4568. }
  4569. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  4570. for (;;) {
  4571. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  4572. #if CYTHON_COMPILING_IN_CPYTHON
  4573. __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;}
  4574. #else
  4575. __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;}
  4576. #endif
  4577. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  4578. __pyx_t_3 = 0;
  4579. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795
  4580. *
  4581. * for childname in descr.names:
  4582. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  4583. * child, new_offset = fields
  4584. *
  4585. */
  4586. __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;};
  4587. __Pyx_GOTREF(__pyx_t_3);
  4588. 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;}
  4589. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  4590. __pyx_t_3 = 0;
  4591. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796
  4592. * for childname in descr.names:
  4593. * fields = descr.fields[childname]
  4594. * child, new_offset = fields # <<<<<<<<<<<<<<
  4595. *
  4596. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  4597. */
  4598. if (likely(__pyx_v_fields != Py_None)) {
  4599. PyObject* sequence = __pyx_v_fields;
  4600. #if CYTHON_COMPILING_IN_CPYTHON
  4601. Py_ssize_t size = Py_SIZE(sequence);
  4602. #else
  4603. Py_ssize_t size = PySequence_Size(sequence);
  4604. #endif
  4605. if (unlikely(size != 2)) {
  4606. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4607. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4608. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4609. }
  4610. #if CYTHON_COMPILING_IN_CPYTHON
  4611. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  4612. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  4613. __Pyx_INCREF(__pyx_t_3);
  4614. __Pyx_INCREF(__pyx_t_4);
  4615. #else
  4616. __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;}
  4617. __Pyx_GOTREF(__pyx_t_3);
  4618. __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;}
  4619. __Pyx_GOTREF(__pyx_t_4);
  4620. #endif
  4621. } else {
  4622. __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4623. }
  4624. 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;}
  4625. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  4626. __pyx_t_3 = 0;
  4627. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  4628. __pyx_t_4 = 0;
  4629. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798
  4630. * child, new_offset = fields
  4631. *
  4632. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  4633. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  4634. *
  4635. */
  4636. __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;}
  4637. __Pyx_GOTREF(__pyx_t_4);
  4638. __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;}
  4639. __Pyx_GOTREF(__pyx_t_3);
  4640. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4641. __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;}
  4642. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4643. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  4644. if (__pyx_t_6) {
  4645. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  4646. *
  4647. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  4648. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  4649. *
  4650. * if ((child.byteorder == c'>' and little_endian) or
  4651. */
  4652. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4653. __Pyx_GOTREF(__pyx_t_3);
  4654. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  4655. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4656. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4657. }
  4658. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
  4659. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  4660. *
  4661. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  4662. * (child.byteorder == c'<' and not little_endian)):
  4663. * raise ValueError(u"Non-native byte order not supported")
  4664. */
  4665. __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
  4666. if (__pyx_t_6) {
  4667. __pyx_t_7 = (__pyx_v_little_endian != 0);
  4668. } else {
  4669. __pyx_t_7 = __pyx_t_6;
  4670. }
  4671. if (!__pyx_t_7) {
  4672. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
  4673. *
  4674. * if ((child.byteorder == c'>' and little_endian) or
  4675. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  4676. * raise ValueError(u"Non-native byte order not supported")
  4677. * # One could encode it in the format string and have Cython
  4678. */
  4679. __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
  4680. if (__pyx_t_6) {
  4681. __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
  4682. __pyx_t_9 = __pyx_t_8;
  4683. } else {
  4684. __pyx_t_9 = __pyx_t_6;
  4685. }
  4686. __pyx_t_6 = __pyx_t_9;
  4687. } else {
  4688. __pyx_t_6 = __pyx_t_7;
  4689. }
  4690. if (__pyx_t_6) {
  4691. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  4692. * if ((child.byteorder == c'>' and little_endian) or
  4693. * (child.byteorder == c'<' and not little_endian)):
  4694. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  4695. * # One could encode it in the format string and have Cython
  4696. * # complain instead, BUT: < and > in format strings also imply
  4697. */
  4698. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4699. __Pyx_GOTREF(__pyx_t_3);
  4700. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  4701. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4702. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4703. }
  4704. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
  4705. *
  4706. * # Output padding bytes
  4707. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  4708. * f[0] = 120 # "x"; pad byte
  4709. * f += 1
  4710. */
  4711. while (1) {
  4712. __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;}
  4713. __Pyx_GOTREF(__pyx_t_3);
  4714. __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;}
  4715. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4716. __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;}
  4717. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4718. if (!__pyx_t_6) break;
  4719. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814
  4720. * # Output padding bytes
  4721. * while offset[0] < new_offset:
  4722. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  4723. * f += 1
  4724. * offset[0] += 1
  4725. */
  4726. (__pyx_v_f[0]) = 120;
  4727. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
  4728. * while offset[0] < new_offset:
  4729. * f[0] = 120 # "x"; pad byte
  4730. * f += 1 # <<<<<<<<<<<<<<
  4731. * offset[0] += 1
  4732. *
  4733. */
  4734. __pyx_v_f = (__pyx_v_f + 1);
  4735. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
  4736. * f[0] = 120 # "x"; pad byte
  4737. * f += 1
  4738. * offset[0] += 1 # <<<<<<<<<<<<<<
  4739. *
  4740. * offset[0] += child.itemsize
  4741. */
  4742. __pyx_t_10 = 0;
  4743. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
  4744. }
  4745. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
  4746. * offset[0] += 1
  4747. *
  4748. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  4749. *
  4750. * if not PyDataType_HASFIELDS(child):
  4751. */
  4752. __pyx_t_10 = 0;
  4753. (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
  4754. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
  4755. * offset[0] += child.itemsize
  4756. *
  4757. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  4758. * t = child.type_num
  4759. * if end - f < 5:
  4760. */
  4761. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  4762. if (__pyx_t_6) {
  4763. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821
  4764. *
  4765. * if not PyDataType_HASFIELDS(child):
  4766. * t = child.type_num # <<<<<<<<<<<<<<
  4767. * if end - f < 5:
  4768. * raise RuntimeError(u"Format string allocated too short.")
  4769. */
  4770. __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;}
  4771. __Pyx_GOTREF(__pyx_t_4);
  4772. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  4773. __pyx_t_4 = 0;
  4774. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822
  4775. * if not PyDataType_HASFIELDS(child):
  4776. * t = child.type_num
  4777. * if end - f < 5: # <<<<<<<<<<<<<<
  4778. * raise RuntimeError(u"Format string allocated too short.")
  4779. *
  4780. */
  4781. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  4782. if (__pyx_t_6) {
  4783. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  4784. * t = child.type_num
  4785. * if end - f < 5:
  4786. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  4787. *
  4788. * # Until ticket #99 is fixed, use integers to avoid warnings
  4789. */
  4790. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4791. __Pyx_GOTREF(__pyx_t_4);
  4792. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  4793. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4794. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4795. }
  4796. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
  4797. *
  4798. * # Until ticket #99 is fixed, use integers to avoid warnings
  4799. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  4800. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4801. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4802. */
  4803. __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;}
  4804. __Pyx_GOTREF(__pyx_t_4);
  4805. __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;}
  4806. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4807. __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;}
  4808. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4809. if (__pyx_t_6) {
  4810. (__pyx_v_f[0]) = 98;
  4811. goto __pyx_L11;
  4812. }
  4813. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827
  4814. * # Until ticket #99 is fixed, use integers to avoid warnings
  4815. * if t == NPY_BYTE: f[0] = 98 #"b"
  4816. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  4817. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4818. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4819. */
  4820. __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;}
  4821. __Pyx_GOTREF(__pyx_t_3);
  4822. __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;}
  4823. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4824. __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;}
  4825. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4826. if (__pyx_t_6) {
  4827. (__pyx_v_f[0]) = 66;
  4828. goto __pyx_L11;
  4829. }
  4830. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828
  4831. * if t == NPY_BYTE: f[0] = 98 #"b"
  4832. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4833. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  4834. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4835. * elif t == NPY_INT: f[0] = 105 #"i"
  4836. */
  4837. __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;}
  4838. __Pyx_GOTREF(__pyx_t_4);
  4839. __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;}
  4840. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4841. __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;}
  4842. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4843. if (__pyx_t_6) {
  4844. (__pyx_v_f[0]) = 104;
  4845. goto __pyx_L11;
  4846. }
  4847. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
  4848. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  4849. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4850. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  4851. * elif t == NPY_INT: f[0] = 105 #"i"
  4852. * elif t == NPY_UINT: f[0] = 73 #"I"
  4853. */
  4854. __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;}
  4855. __Pyx_GOTREF(__pyx_t_3);
  4856. __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;}
  4857. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4858. __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;}
  4859. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4860. if (__pyx_t_6) {
  4861. (__pyx_v_f[0]) = 72;
  4862. goto __pyx_L11;
  4863. }
  4864. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830
  4865. * elif t == NPY_SHORT: f[0] = 104 #"h"
  4866. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4867. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  4868. * elif t == NPY_UINT: f[0] = 73 #"I"
  4869. * elif t == NPY_LONG: f[0] = 108 #"l"
  4870. */
  4871. __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;}
  4872. __Pyx_GOTREF(__pyx_t_4);
  4873. __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;}
  4874. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4875. __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;}
  4876. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4877. if (__pyx_t_6) {
  4878. (__pyx_v_f[0]) = 105;
  4879. goto __pyx_L11;
  4880. }
  4881. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
  4882. * elif t == NPY_USHORT: f[0] = 72 #"H"
  4883. * elif t == NPY_INT: f[0] = 105 #"i"
  4884. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  4885. * elif t == NPY_LONG: f[0] = 108 #"l"
  4886. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4887. */
  4888. __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;}
  4889. __Pyx_GOTREF(__pyx_t_3);
  4890. __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;}
  4891. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4892. __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;}
  4893. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4894. if (__pyx_t_6) {
  4895. (__pyx_v_f[0]) = 73;
  4896. goto __pyx_L11;
  4897. }
  4898. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832
  4899. * elif t == NPY_INT: f[0] = 105 #"i"
  4900. * elif t == NPY_UINT: f[0] = 73 #"I"
  4901. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  4902. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4903. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4904. */
  4905. __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;}
  4906. __Pyx_GOTREF(__pyx_t_4);
  4907. __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;}
  4908. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4909. __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;}
  4910. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4911. if (__pyx_t_6) {
  4912. (__pyx_v_f[0]) = 108;
  4913. goto __pyx_L11;
  4914. }
  4915. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
  4916. * elif t == NPY_UINT: f[0] = 73 #"I"
  4917. * elif t == NPY_LONG: f[0] = 108 #"l"
  4918. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  4919. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4920. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4921. */
  4922. __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;}
  4923. __Pyx_GOTREF(__pyx_t_3);
  4924. __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;}
  4925. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4926. __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;}
  4927. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4928. if (__pyx_t_6) {
  4929. (__pyx_v_f[0]) = 76;
  4930. goto __pyx_L11;
  4931. }
  4932. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834
  4933. * elif t == NPY_LONG: f[0] = 108 #"l"
  4934. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4935. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  4936. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4937. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4938. */
  4939. __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;}
  4940. __Pyx_GOTREF(__pyx_t_4);
  4941. __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;}
  4942. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4943. __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;}
  4944. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4945. if (__pyx_t_6) {
  4946. (__pyx_v_f[0]) = 113;
  4947. goto __pyx_L11;
  4948. }
  4949. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
  4950. * elif t == NPY_ULONG: f[0] = 76 #"L"
  4951. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4952. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  4953. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4954. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  4955. */
  4956. __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;}
  4957. __Pyx_GOTREF(__pyx_t_3);
  4958. __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;}
  4959. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4960. __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;}
  4961. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4962. if (__pyx_t_6) {
  4963. (__pyx_v_f[0]) = 81;
  4964. goto __pyx_L11;
  4965. }
  4966. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836
  4967. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  4968. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4969. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  4970. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  4971. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  4972. */
  4973. __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;}
  4974. __Pyx_GOTREF(__pyx_t_4);
  4975. __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;}
  4976. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4977. __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;}
  4978. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4979. if (__pyx_t_6) {
  4980. (__pyx_v_f[0]) = 102;
  4981. goto __pyx_L11;
  4982. }
  4983. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
  4984. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  4985. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  4986. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  4987. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  4988. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  4989. */
  4990. __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;}
  4991. __Pyx_GOTREF(__pyx_t_3);
  4992. __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;}
  4993. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4994. __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;}
  4995. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4996. if (__pyx_t_6) {
  4997. (__pyx_v_f[0]) = 100;
  4998. goto __pyx_L11;
  4999. }
  5000. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
  5001. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  5002. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5003. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  5004. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5005. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5006. */
  5007. __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;}
  5008. __Pyx_GOTREF(__pyx_t_4);
  5009. __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;}
  5010. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5011. __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;}
  5012. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5013. if (__pyx_t_6) {
  5014. (__pyx_v_f[0]) = 103;
  5015. goto __pyx_L11;
  5016. }
  5017. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
  5018. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  5019. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5020. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  5021. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5022. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5023. */
  5024. __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;}
  5025. __Pyx_GOTREF(__pyx_t_3);
  5026. __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;}
  5027. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5028. __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;}
  5029. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5030. if (__pyx_t_6) {
  5031. (__pyx_v_f[0]) = 90;
  5032. (__pyx_v_f[1]) = 102;
  5033. __pyx_v_f = (__pyx_v_f + 1);
  5034. goto __pyx_L11;
  5035. }
  5036. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
  5037. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  5038. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5039. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  5040. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5041. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5042. */
  5043. __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;}
  5044. __Pyx_GOTREF(__pyx_t_4);
  5045. __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;}
  5046. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5047. __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;}
  5048. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5049. if (__pyx_t_6) {
  5050. (__pyx_v_f[0]) = 90;
  5051. (__pyx_v_f[1]) = 100;
  5052. __pyx_v_f = (__pyx_v_f + 1);
  5053. goto __pyx_L11;
  5054. }
  5055. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
  5056. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  5057. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5058. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  5059. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5060. * else:
  5061. */
  5062. __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;}
  5063. __Pyx_GOTREF(__pyx_t_3);
  5064. __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;}
  5065. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5066. __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;}
  5067. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5068. if (__pyx_t_6) {
  5069. (__pyx_v_f[0]) = 90;
  5070. (__pyx_v_f[1]) = 103;
  5071. __pyx_v_f = (__pyx_v_f + 1);
  5072. goto __pyx_L11;
  5073. }
  5074. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
  5075. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  5076. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  5077. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  5078. * else:
  5079. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5080. */
  5081. __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;}
  5082. __Pyx_GOTREF(__pyx_t_4);
  5083. __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;}
  5084. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5085. __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;}
  5086. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5087. if (__pyx_t_6) {
  5088. (__pyx_v_f[0]) = 79;
  5089. goto __pyx_L11;
  5090. }
  5091. /*else*/ {
  5092. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844
  5093. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  5094. * else:
  5095. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  5096. * f += 1
  5097. * else:
  5098. */
  5099. __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;}
  5100. __Pyx_GOTREF(__pyx_t_3);
  5101. __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;}
  5102. __Pyx_GOTREF(__pyx_t_4);
  5103. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  5104. __Pyx_GIVEREF(__pyx_t_3);
  5105. __pyx_t_3 = 0;
  5106. __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;}
  5107. __Pyx_GOTREF(__pyx_t_3);
  5108. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5109. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  5110. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5111. {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5112. }
  5113. __pyx_L11:;
  5114. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
  5115. * else:
  5116. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  5117. * f += 1 # <<<<<<<<<<<<<<
  5118. * else:
  5119. * # Cython ignores struct boundary information ("T{...}"),
  5120. */
  5121. __pyx_v_f = (__pyx_v_f + 1);
  5122. goto __pyx_L9;
  5123. }
  5124. /*else*/ {
  5125. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
  5126. * # Cython ignores struct boundary information ("T{...}"),
  5127. * # so don't output it
  5128. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  5129. * return f
  5130. *
  5131. */
  5132. __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;}
  5133. __pyx_v_f = __pyx_t_11;
  5134. }
  5135. __pyx_L9:;
  5136. }
  5137. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5138. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
  5139. * # so don't output it
  5140. * f = _util_dtypestring(child, f, end, offset)
  5141. * return f # <<<<<<<<<<<<<<
  5142. *
  5143. *
  5144. */
  5145. __pyx_r = __pyx_v_f;
  5146. goto __pyx_L0;
  5147. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
  5148. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  5149. *
  5150. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  5151. * # Recursive utility function used in __getbuffer__ to get format
  5152. * # string. The new location in the format string is returned.
  5153. */
  5154. /* function exit code */
  5155. __pyx_L1_error:;
  5156. __Pyx_XDECREF(__pyx_t_1);
  5157. __Pyx_XDECREF(__pyx_t_3);
  5158. __Pyx_XDECREF(__pyx_t_4);
  5159. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5160. __pyx_r = NULL;
  5161. __pyx_L0:;
  5162. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  5163. __Pyx_XDECREF(__pyx_v_fields);
  5164. __Pyx_XDECREF(__pyx_v_childname);
  5165. __Pyx_XDECREF(__pyx_v_new_offset);
  5166. __Pyx_XDECREF(__pyx_v_t);
  5167. __Pyx_RefNannyFinishContext();
  5168. return __pyx_r;
  5169. }
  5170. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5171. *
  5172. *
  5173. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5174. * cdef PyObject* baseptr
  5175. * if base is None:
  5176. */
  5177. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  5178. PyObject *__pyx_v_baseptr;
  5179. __Pyx_RefNannyDeclarations
  5180. int __pyx_t_1;
  5181. int __pyx_t_2;
  5182. __Pyx_RefNannySetupContext("set_array_base", 0);
  5183. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
  5184. * cdef inline void set_array_base(ndarray arr, object base):
  5185. * cdef PyObject* baseptr
  5186. * if base is None: # <<<<<<<<<<<<<<
  5187. * baseptr = NULL
  5188. * else:
  5189. */
  5190. __pyx_t_1 = (__pyx_v_base == Py_None);
  5191. __pyx_t_2 = (__pyx_t_1 != 0);
  5192. if (__pyx_t_2) {
  5193. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
  5194. * cdef PyObject* baseptr
  5195. * if base is None:
  5196. * baseptr = NULL # <<<<<<<<<<<<<<
  5197. * else:
  5198. * Py_INCREF(base) # important to do this before decref below!
  5199. */
  5200. __pyx_v_baseptr = NULL;
  5201. goto __pyx_L3;
  5202. }
  5203. /*else*/ {
  5204. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
  5205. * baseptr = NULL
  5206. * else:
  5207. * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
  5208. * baseptr = <PyObject*>base
  5209. * Py_XDECREF(arr.base)
  5210. */
  5211. Py_INCREF(__pyx_v_base);
  5212. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
  5213. * else:
  5214. * Py_INCREF(base) # important to do this before decref below!
  5215. * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
  5216. * Py_XDECREF(arr.base)
  5217. * arr.base = baseptr
  5218. */
  5219. __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  5220. }
  5221. __pyx_L3:;
  5222. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
  5223. * Py_INCREF(base) # important to do this before decref below!
  5224. * baseptr = <PyObject*>base
  5225. * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
  5226. * arr.base = baseptr
  5227. *
  5228. */
  5229. Py_XDECREF(__pyx_v_arr->base);
  5230. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
  5231. * baseptr = <PyObject*>base
  5232. * Py_XDECREF(arr.base)
  5233. * arr.base = baseptr # <<<<<<<<<<<<<<
  5234. *
  5235. * cdef inline object get_array_base(ndarray arr):
  5236. */
  5237. __pyx_v_arr->base = __pyx_v_baseptr;
  5238. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
  5239. *
  5240. *
  5241. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  5242. * cdef PyObject* baseptr
  5243. * if base is None:
  5244. */
  5245. /* function exit code */
  5246. __Pyx_RefNannyFinishContext();
  5247. }
  5248. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5249. * arr.base = baseptr
  5250. *
  5251. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5252. * if arr.base is NULL:
  5253. * return None
  5254. */
  5255. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  5256. PyObject *__pyx_r = NULL;
  5257. __Pyx_RefNannyDeclarations
  5258. int __pyx_t_1;
  5259. __Pyx_RefNannySetupContext("get_array_base", 0);
  5260. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
  5261. *
  5262. * cdef inline object get_array_base(ndarray arr):
  5263. * if arr.base is NULL: # <<<<<<<<<<<<<<
  5264. * return None
  5265. * else:
  5266. */
  5267. __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  5268. if (__pyx_t_1) {
  5269. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978
  5270. * cdef inline object get_array_base(ndarray arr):
  5271. * if arr.base is NULL:
  5272. * return None # <<<<<<<<<<<<<<
  5273. * else:
  5274. * return <object>arr.base
  5275. */
  5276. __Pyx_XDECREF(__pyx_r);
  5277. __Pyx_INCREF(Py_None);
  5278. __pyx_r = Py_None;
  5279. goto __pyx_L0;
  5280. }
  5281. /*else*/ {
  5282. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
  5283. * return None
  5284. * else:
  5285. * return <object>arr.base # <<<<<<<<<<<<<<
  5286. */
  5287. __Pyx_XDECREF(__pyx_r);
  5288. __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
  5289. __pyx_r = ((PyObject *)__pyx_v_arr->base);
  5290. goto __pyx_L0;
  5291. }
  5292. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
  5293. * arr.base = baseptr
  5294. *
  5295. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  5296. * if arr.base is NULL:
  5297. * return None
  5298. */
  5299. /* function exit code */
  5300. __pyx_L0:;
  5301. __Pyx_XGIVEREF(__pyx_r);
  5302. __Pyx_RefNannyFinishContext();
  5303. return __pyx_r;
  5304. }
  5305. /* "vector.from_py":45
  5306. *
  5307. * @cname("__pyx_convert_vector_from_py_double")
  5308. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  5309. * cdef vector[X] v
  5310. * for item in o:
  5311. */
  5312. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  5313. std::vector<double> __pyx_v_v;
  5314. PyObject *__pyx_v_item = NULL;
  5315. std::vector<double> __pyx_r;
  5316. __Pyx_RefNannyDeclarations
  5317. PyObject *__pyx_t_1 = NULL;
  5318. Py_ssize_t __pyx_t_2;
  5319. PyObject *(*__pyx_t_3)(PyObject *);
  5320. PyObject *__pyx_t_4 = NULL;
  5321. double __pyx_t_5;
  5322. int __pyx_lineno = 0;
  5323. const char *__pyx_filename = NULL;
  5324. int __pyx_clineno = 0;
  5325. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  5326. /* "vector.from_py":47
  5327. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  5328. * cdef vector[X] v
  5329. * for item in o: # <<<<<<<<<<<<<<
  5330. * v.push_back(X_from_py(item))
  5331. * return v
  5332. */
  5333. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  5334. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  5335. __pyx_t_3 = NULL;
  5336. } else {
  5337. __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;}
  5338. __Pyx_GOTREF(__pyx_t_1);
  5339. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  5340. }
  5341. for (;;) {
  5342. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  5343. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  5344. #if CYTHON_COMPILING_IN_CPYTHON
  5345. __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;}
  5346. #else
  5347. __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;}
  5348. #endif
  5349. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  5350. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  5351. #if CYTHON_COMPILING_IN_CPYTHON
  5352. __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;}
  5353. #else
  5354. __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;}
  5355. #endif
  5356. } else {
  5357. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  5358. if (unlikely(!__pyx_t_4)) {
  5359. PyObject* exc_type = PyErr_Occurred();
  5360. if (exc_type) {
  5361. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  5362. else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5363. }
  5364. break;
  5365. }
  5366. __Pyx_GOTREF(__pyx_t_4);
  5367. }
  5368. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  5369. __pyx_t_4 = 0;
  5370. /* "vector.from_py":48
  5371. * cdef vector[X] v
  5372. * for item in o:
  5373. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  5374. * return v
  5375. *
  5376. */
  5377. __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;}
  5378. __pyx_v_v.push_back(__pyx_t_5);
  5379. }
  5380. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5381. /* "vector.from_py":49
  5382. * for item in o:
  5383. * v.push_back(X_from_py(item))
  5384. * return v # <<<<<<<<<<<<<<
  5385. *
  5386. *
  5387. */
  5388. __pyx_r = __pyx_v_v;
  5389. goto __pyx_L0;
  5390. /* "vector.from_py":45
  5391. *
  5392. * @cname("__pyx_convert_vector_from_py_double")
  5393. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  5394. * cdef vector[X] v
  5395. * for item in o:
  5396. */
  5397. /* function exit code */
  5398. __pyx_L1_error:;
  5399. __Pyx_XDECREF(__pyx_t_1);
  5400. __Pyx_XDECREF(__pyx_t_4);
  5401. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5402. __pyx_L0:;
  5403. __Pyx_XDECREF(__pyx_v_item);
  5404. __Pyx_RefNannyFinishContext();
  5405. return __pyx_r;
  5406. }
  5407. /* "vector.from_py":46
  5408. *
  5409. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  5410. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  5411. * cdef vector[X] v
  5412. * for item in o:
  5413. */
  5414. static std::vector<__pyx_t_double_complex> __pyx_convert_vector_from_py___pyx_t_double_complex(PyObject *__pyx_v_o) {
  5415. std::vector<__pyx_t_double_complex> __pyx_v_v;
  5416. PyObject *__pyx_v_item = NULL;
  5417. std::vector<__pyx_t_double_complex> __pyx_r;
  5418. __Pyx_RefNannyDeclarations
  5419. PyObject *__pyx_t_1 = NULL;
  5420. Py_ssize_t __pyx_t_2;
  5421. PyObject *(*__pyx_t_3)(PyObject *);
  5422. PyObject *__pyx_t_4 = NULL;
  5423. __pyx_t_double_complex __pyx_t_5;
  5424. int __pyx_lineno = 0;
  5425. const char *__pyx_filename = NULL;
  5426. int __pyx_clineno = 0;
  5427. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py___pyx_t_double_complex", 0);
  5428. /* "vector.from_py":48
  5429. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *:
  5430. * cdef vector[X] v
  5431. * for item in o: # <<<<<<<<<<<<<<
  5432. * v.push_back(X_from_py(item))
  5433. * return v
  5434. */
  5435. if (PyList_CheckExact(__pyx_v_o) || PyTuple_CheckExact(__pyx_v_o)) {
  5436. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  5437. __pyx_t_3 = NULL;
  5438. } else {
  5439. __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;}
  5440. __Pyx_GOTREF(__pyx_t_1);
  5441. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  5442. }
  5443. for (;;) {
  5444. if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
  5445. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  5446. #if CYTHON_COMPILING_IN_CPYTHON
  5447. __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;}
  5448. #else
  5449. __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;}
  5450. #endif
  5451. } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
  5452. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  5453. #if CYTHON_COMPILING_IN_CPYTHON
  5454. __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;}
  5455. #else
  5456. __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;}
  5457. #endif
  5458. } else {
  5459. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  5460. if (unlikely(!__pyx_t_4)) {
  5461. PyObject* exc_type = PyErr_Occurred();
  5462. if (exc_type) {
  5463. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  5464. else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5465. }
  5466. break;
  5467. }
  5468. __Pyx_GOTREF(__pyx_t_4);
  5469. }
  5470. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  5471. __pyx_t_4 = 0;
  5472. /* "vector.from_py":49
  5473. * cdef vector[X] v
  5474. * for item in o:
  5475. * v.push_back(X_from_py(item)) # <<<<<<<<<<<<<<
  5476. * return v
  5477. *
  5478. */
  5479. __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;}
  5480. __pyx_v_v.push_back(__pyx_t_5);
  5481. }
  5482. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5483. /* "vector.from_py":50
  5484. * for item in o:
  5485. * v.push_back(X_from_py(item))
  5486. * return v # <<<<<<<<<<<<<<
  5487. *
  5488. *
  5489. */
  5490. __pyx_r = __pyx_v_v;
  5491. goto __pyx_L0;
  5492. /* "vector.from_py":46
  5493. *
  5494. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  5495. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  5496. * cdef vector[X] v
  5497. * for item in o:
  5498. */
  5499. /* function exit code */
  5500. __pyx_L1_error:;
  5501. __Pyx_XDECREF(__pyx_t_1);
  5502. __Pyx_XDECREF(__pyx_t_4);
  5503. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py___pyx_t_double_complex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5504. __pyx_L0:;
  5505. __Pyx_XDECREF(__pyx_v_item);
  5506. __Pyx_RefNannyFinishContext();
  5507. return __pyx_r;
  5508. }
  5509. static PyMethodDef __pyx_methods[] = {
  5510. {0, 0, 0, 0}
  5511. };
  5512. #if PY_MAJOR_VERSION >= 3
  5513. static struct PyModuleDef __pyx_moduledef = {
  5514. #if PY_VERSION_HEX < 0x03020000
  5515. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  5516. #else
  5517. PyModuleDef_HEAD_INIT,
  5518. #endif
  5519. __Pyx_NAMESTR("scattnlay"),
  5520. 0, /* m_doc */
  5521. -1, /* m_size */
  5522. __pyx_methods /* m_methods */,
  5523. NULL, /* m_reload */
  5524. NULL, /* m_traverse */
  5525. NULL, /* m_clear */
  5526. NULL /* m_free */
  5527. };
  5528. #endif
  5529. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  5530. {&__pyx_n_s_Albedo, __pyx_k_Albedo, sizeof(__pyx_k_Albedo), 0, 0, 1, 1},
  5531. {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  5532. {&__pyx_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
  5533. {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
  5534. {&__pyx_n_s_Ei, __pyx_k_Ei, sizeof(__pyx_k_Ei), 0, 0, 1, 1},
  5535. {&__pyx_n_s_Er, __pyx_k_Er, sizeof(__pyx_k_Er), 0, 0, 1, 1},
  5536. {&__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},
  5537. {&__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},
  5538. {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
  5539. {&__pyx_n_s_Hi, __pyx_k_Hi, sizeof(__pyx_k_Hi), 0, 0, 1, 1},
  5540. {&__pyx_n_s_Hr, __pyx_k_Hr, sizeof(__pyx_k_Hr), 0, 0, 1, 1},
  5541. {&__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},
  5542. {&__pyx_n_s_Qabs, __pyx_k_Qabs, sizeof(__pyx_k_Qabs), 0, 0, 1, 1},
  5543. {&__pyx_n_s_Qbk, __pyx_k_Qbk, sizeof(__pyx_k_Qbk), 0, 0, 1, 1},
  5544. {&__pyx_n_s_Qext, __pyx_k_Qext, sizeof(__pyx_k_Qext), 0, 0, 1, 1},
  5545. {&__pyx_n_s_Qpr, __pyx_k_Qpr, sizeof(__pyx_k_Qpr), 0, 0, 1, 1},
  5546. {&__pyx_n_s_Qsca, __pyx_k_Qsca, sizeof(__pyx_k_Qsca), 0, 0, 1, 1},
  5547. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  5548. {&__pyx_n_s_S1, __pyx_k_S1, sizeof(__pyx_k_S1), 0, 0, 1, 1},
  5549. {&__pyx_n_s_S1i, __pyx_k_S1i, sizeof(__pyx_k_S1i), 0, 0, 1, 1},
  5550. {&__pyx_n_s_S1r, __pyx_k_S1r, sizeof(__pyx_k_S1r), 0, 0, 1, 1},
  5551. {&__pyx_n_s_S2, __pyx_k_S2, sizeof(__pyx_k_S2), 0, 0, 1, 1},
  5552. {&__pyx_n_s_S2i, __pyx_k_S2i, sizeof(__pyx_k_S2i), 0, 0, 1, 1},
  5553. {&__pyx_n_s_S2r, __pyx_k_S2r, sizeof(__pyx_k_S2r), 0, 0, 1, 1},
  5554. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  5555. {&__pyx_n_s_complex128, __pyx_k_complex128, sizeof(__pyx_k_complex128), 0, 0, 1, 1},
  5556. {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1},
  5557. {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  5558. {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  5559. {&__pyx_n_s_fieldnlay, __pyx_k_fieldnlay, sizeof(__pyx_k_fieldnlay), 0, 0, 1, 1},
  5560. {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  5561. {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  5562. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  5563. {&__pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_k_home_ovidio_scattering_scattnla, sizeof(__pyx_k_home_ovidio_scattering_scattnla), 0, 0, 1, 0},
  5564. {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  5565. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  5566. {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
  5567. {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  5568. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  5569. {&__pyx_n_s_n_max, __pyx_k_n_max, sizeof(__pyx_k_n_max), 0, 0, 1, 1},
  5570. {&__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},
  5571. {&__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},
  5572. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  5573. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  5574. {&__pyx_n_s_pl, __pyx_k_pl, sizeof(__pyx_k_pl), 0, 0, 1, 1},
  5575. {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
  5576. {&__pyx_n_s_pyx_releasebuffer, __pyx_k_pyx_releasebuffer, sizeof(__pyx_k_pyx_releasebuffer), 0, 0, 1, 1},
  5577. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  5578. {&__pyx_n_s_scattnlay, __pyx_k_scattnlay, sizeof(__pyx_k_scattnlay), 0, 0, 1, 1},
  5579. {&__pyx_n_s_terms, __pyx_k_terms, sizeof(__pyx_k_terms), 0, 0, 1, 1},
  5580. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  5581. {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  5582. {&__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},
  5583. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  5584. {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
  5585. {0, 0, 0, 0, 0, 0, 0}
  5586. };
  5587. static int __Pyx_InitCachedBuiltins(void) {
  5588. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5589. __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;}
  5590. __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;}
  5591. return 0;
  5592. __pyx_L1_error:;
  5593. return -1;
  5594. }
  5595. static int __Pyx_InitCachedConstants(void) {
  5596. __Pyx_RefNannyDeclarations
  5597. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  5598. /* "scattnlay.pyx":47
  5599. *
  5600. * if not (<object>a).flags["C_CONTIGUOUS"]: # Array is not contiguous, need to make contiguous copy
  5601. * a = a.copy('C') # <<<<<<<<<<<<<<
  5602. *
  5603. * # Return data pointer
  5604. */
  5605. __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5606. __Pyx_GOTREF(__pyx_tuple_);
  5607. __Pyx_GIVEREF(__pyx_tuple_);
  5608. /* "scattnlay.pyx":83
  5609. * S2i = np.zeros(theta.shape[0], dtype = np.float64)
  5610. *
  5611. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i)) # <<<<<<<<<<<<<<
  5612. *
  5613. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  5614. */
  5615. __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5616. __Pyx_GOTREF(__pyx_tuple__3);
  5617. __Pyx_GIVEREF(__pyx_tuple__3);
  5618. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5619. __Pyx_GOTREF(__pyx_tuple__4);
  5620. __Pyx_GIVEREF(__pyx_tuple__4);
  5621. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5622. __Pyx_GOTREF(__pyx_tuple__5);
  5623. __Pyx_GIVEREF(__pyx_tuple__5);
  5624. /* "scattnlay.pyx":85
  5625. * terms[i] = nMie(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), theta.shape[0], theta.copy('C'), n_max, &Qext[i], &Qsca[i], &Qabs[i], &Qbk[i], &Qpr[i], &g[i], &Albedo[i], npy2c(S1r), npy2c(S1i), npy2c(S2r), npy2c(S2i))
  5626. *
  5627. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C') # <<<<<<<<<<<<<<
  5628. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C')
  5629. *
  5630. */
  5631. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5632. __Pyx_GOTREF(__pyx_tuple__6);
  5633. __Pyx_GIVEREF(__pyx_tuple__6);
  5634. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5635. __Pyx_GOTREF(__pyx_tuple__7);
  5636. __Pyx_GIVEREF(__pyx_tuple__7);
  5637. /* "scattnlay.pyx":86
  5638. *
  5639. * S1[i] = S1r.copy('C') + 1.0j*S1i.copy('C')
  5640. * S2[i] = S2r.copy('C') + 1.0j*S2i.copy('C') # <<<<<<<<<<<<<<
  5641. *
  5642. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5643. */
  5644. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5645. __Pyx_GOTREF(__pyx_tuple__8);
  5646. __Pyx_GIVEREF(__pyx_tuple__8);
  5647. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5648. __Pyx_GOTREF(__pyx_tuple__9);
  5649. __Pyx_GIVEREF(__pyx_tuple__9);
  5650. /* "scattnlay.pyx":109
  5651. * Hi = np.zeros(coords.shape[0], dtype = np.float64)
  5652. *
  5653. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), n_max, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi)) # <<<<<<<<<<<<<<
  5654. *
  5655. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  5656. */
  5657. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5658. __Pyx_GOTREF(__pyx_tuple__11);
  5659. __Pyx_GIVEREF(__pyx_tuple__11);
  5660. __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5661. __Pyx_GOTREF(__pyx_tuple__12);
  5662. __Pyx_GIVEREF(__pyx_tuple__12);
  5663. __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5664. __Pyx_GOTREF(__pyx_slice__13);
  5665. __Pyx_GIVEREF(__pyx_slice__13);
  5666. __pyx_tuple__14 = PyTuple_Pack(2, __pyx_slice__13, __pyx_int_0); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5667. __Pyx_GOTREF(__pyx_tuple__14);
  5668. __Pyx_GIVEREF(__pyx_tuple__14);
  5669. __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5670. __Pyx_GOTREF(__pyx_tuple__15);
  5671. __Pyx_GIVEREF(__pyx_tuple__15);
  5672. __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5673. __Pyx_GOTREF(__pyx_slice__16);
  5674. __Pyx_GIVEREF(__pyx_slice__16);
  5675. __pyx_tuple__17 = PyTuple_Pack(2, __pyx_slice__16, __pyx_int_1); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5676. __Pyx_GOTREF(__pyx_tuple__17);
  5677. __Pyx_GIVEREF(__pyx_tuple__17);
  5678. __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5679. __Pyx_GOTREF(__pyx_tuple__18);
  5680. __Pyx_GIVEREF(__pyx_tuple__18);
  5681. __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5682. __Pyx_GOTREF(__pyx_slice__19);
  5683. __Pyx_GIVEREF(__pyx_slice__19);
  5684. __pyx_tuple__20 = PyTuple_Pack(2, __pyx_slice__19, __pyx_int_2); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5685. __Pyx_GOTREF(__pyx_tuple__20);
  5686. __Pyx_GIVEREF(__pyx_tuple__20);
  5687. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5688. __Pyx_GOTREF(__pyx_tuple__21);
  5689. __Pyx_GIVEREF(__pyx_tuple__21);
  5690. /* "scattnlay.pyx":111
  5691. * terms[i] = nField(x.shape[1], pl, x[i].copy('C'), m[i].copy('C'), n_max, coords.shape[0], coords[:, 0].copy('C'), coords[:, 1].copy('C'), coords[:, 2].copy('C'), npy2c(Er), npy2c(Ei), npy2c(Hr), npy2c(Hi))
  5692. *
  5693. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C') # <<<<<<<<<<<<<<
  5694. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C')
  5695. *
  5696. */
  5697. __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5698. __Pyx_GOTREF(__pyx_tuple__22);
  5699. __Pyx_GIVEREF(__pyx_tuple__22);
  5700. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5701. __Pyx_GOTREF(__pyx_tuple__23);
  5702. __Pyx_GIVEREF(__pyx_tuple__23);
  5703. /* "scattnlay.pyx":112
  5704. *
  5705. * E[i] = Er.copy('C') + 1.0j*Ei.copy('C')
  5706. * H[i] = Hr.copy('C') + 1.0j*Hi.copy('C') # <<<<<<<<<<<<<<
  5707. *
  5708. * return terms, E, H
  5709. */
  5710. __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5711. __Pyx_GOTREF(__pyx_tuple__24);
  5712. __Pyx_GIVEREF(__pyx_tuple__24);
  5713. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_C); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5714. __Pyx_GOTREF(__pyx_tuple__25);
  5715. __Pyx_GIVEREF(__pyx_tuple__25);
  5716. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
  5717. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  5718. * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
  5719. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  5720. *
  5721. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  5722. */
  5723. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5724. __Pyx_GOTREF(__pyx_tuple__26);
  5725. __Pyx_GIVEREF(__pyx_tuple__26);
  5726. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
  5727. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  5728. * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
  5729. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  5730. *
  5731. * info.buf = PyArray_DATA(self)
  5732. */
  5733. __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5734. __Pyx_GOTREF(__pyx_tuple__27);
  5735. __Pyx_GIVEREF(__pyx_tuple__27);
  5736. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
  5737. * if ((descr.byteorder == c'>' and little_endian) or
  5738. * (descr.byteorder == c'<' and not little_endian)):
  5739. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5740. * if t == NPY_BYTE: f = "b"
  5741. * elif t == NPY_UBYTE: f = "B"
  5742. */
  5743. __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5744. __Pyx_GOTREF(__pyx_tuple__28);
  5745. __Pyx_GIVEREF(__pyx_tuple__28);
  5746. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
  5747. *
  5748. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  5749. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  5750. *
  5751. * if ((child.byteorder == c'>' and little_endian) or
  5752. */
  5753. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5754. __Pyx_GOTREF(__pyx_tuple__29);
  5755. __Pyx_GIVEREF(__pyx_tuple__29);
  5756. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
  5757. * if ((child.byteorder == c'>' and little_endian) or
  5758. * (child.byteorder == c'<' and not little_endian)):
  5759. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  5760. * # One could encode it in the format string and have Cython
  5761. * # complain instead, BUT: < and > in format strings also imply
  5762. */
  5763. __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5764. __Pyx_GOTREF(__pyx_tuple__30);
  5765. __Pyx_GIVEREF(__pyx_tuple__30);
  5766. /* "/usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
  5767. * t = child.type_num
  5768. * if end - f < 5:
  5769. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  5770. *
  5771. * # Until ticket #99 is fixed, use integers to avoid warnings
  5772. */
  5773. __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5774. __Pyx_GOTREF(__pyx_tuple__31);
  5775. __Pyx_GIVEREF(__pyx_tuple__31);
  5776. /* "scattnlay.pyx":56
  5777. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int n_max, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Er[], double Ei[], double Hr[], double Hi[])
  5778. *
  5779. * 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 n_max = -1): # <<<<<<<<<<<<<<
  5780. * cdef Py_ssize_t i
  5781. *
  5782. */
  5783. __pyx_tuple__32 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5784. __Pyx_GOTREF(__pyx_tuple__32);
  5785. __Pyx_GIVEREF(__pyx_tuple__32);
  5786. __pyx_tuple__33 = PyTuple_Pack(20, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_theta, __pyx_n_s_pl, __pyx_n_s_n_max, __pyx_n_s_i, __pyx_n_s_terms, __pyx_n_s_Qext, __pyx_n_s_Qabs, __pyx_n_s_Qsca, __pyx_n_s_Qbk, __pyx_n_s_Qpr, __pyx_n_s_g, __pyx_n_s_Albedo, __pyx_n_s_S1, __pyx_n_s_S2, __pyx_n_s_S1r, __pyx_n_s_S1i, __pyx_n_s_S2r, __pyx_n_s_S2i); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5787. __Pyx_GOTREF(__pyx_tuple__33);
  5788. __Pyx_GIVEREF(__pyx_tuple__33);
  5789. __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_scattnlay, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5790. /* "scattnlay.pyx":90
  5791. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5792. *
  5793. * 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 n_max = 0): # <<<<<<<<<<<<<<
  5794. * cdef Py_ssize_t i
  5795. *
  5796. */
  5797. __pyx_tuple__35 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_3); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5798. __Pyx_GOTREF(__pyx_tuple__35);
  5799. __Pyx_GIVEREF(__pyx_tuple__35);
  5800. __pyx_tuple__36 = PyTuple_Pack(1, __pyx_tuple__35); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5801. __Pyx_GOTREF(__pyx_tuple__36);
  5802. __Pyx_GIVEREF(__pyx_tuple__36);
  5803. __pyx_tuple__37 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_m, __pyx_n_s_coords, __pyx_n_s_pl, __pyx_n_s_n_max, __pyx_n_s_i, __pyx_n_s_terms, __pyx_n_s_E, __pyx_n_s_H, __pyx_n_s_Er, __pyx_n_s_Ei, __pyx_n_s_Hr, __pyx_n_s_Hi); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5804. __Pyx_GOTREF(__pyx_tuple__37);
  5805. __Pyx_GIVEREF(__pyx_tuple__37);
  5806. __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ovidio_scattering_scattnla, __pyx_n_s_fieldnlay, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5807. __Pyx_RefNannyFinishContext();
  5808. return 0;
  5809. __pyx_L1_error:;
  5810. __Pyx_RefNannyFinishContext();
  5811. return -1;
  5812. }
  5813. static int __Pyx_InitGlobals(void) {
  5814. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5815. __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;}
  5816. __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;}
  5817. __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;}
  5818. __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;}
  5819. return 0;
  5820. __pyx_L1_error:;
  5821. return -1;
  5822. }
  5823. #if PY_MAJOR_VERSION < 3
  5824. PyMODINIT_FUNC initscattnlay(void); /*proto*/
  5825. PyMODINIT_FUNC initscattnlay(void)
  5826. #else
  5827. PyMODINIT_FUNC PyInit_scattnlay(void); /*proto*/
  5828. PyMODINIT_FUNC PyInit_scattnlay(void)
  5829. #endif
  5830. {
  5831. PyObject *__pyx_t_1 = NULL;
  5832. PyObject *__pyx_t_2 = NULL;
  5833. PyObject *__pyx_t_3 = NULL;
  5834. PyObject *__pyx_t_4 = NULL;
  5835. int __pyx_lineno = 0;
  5836. const char *__pyx_filename = NULL;
  5837. int __pyx_clineno = 0;
  5838. __Pyx_RefNannyDeclarations
  5839. #if CYTHON_REFNANNY
  5840. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  5841. if (!__Pyx_RefNanny) {
  5842. PyErr_Clear();
  5843. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  5844. if (!__Pyx_RefNanny)
  5845. Py_FatalError("failed to import 'refnanny' module");
  5846. }
  5847. #endif
  5848. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scattnlay(void)", 0);
  5849. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5850. __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;}
  5851. __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;}
  5852. #ifdef __Pyx_CyFunction_USED
  5853. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5854. #endif
  5855. #ifdef __Pyx_FusedFunction_USED
  5856. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5857. #endif
  5858. #ifdef __Pyx_Generator_USED
  5859. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5860. #endif
  5861. /*--- Library function declarations ---*/
  5862. /*--- Threads initialization code ---*/
  5863. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  5864. #ifdef WITH_THREAD /* Python build with threading support? */
  5865. PyEval_InitThreads();
  5866. #endif
  5867. #endif
  5868. /*--- Module creation code ---*/
  5869. #if PY_MAJOR_VERSION < 3
  5870. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("scattnlay"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  5871. #else
  5872. __pyx_m = PyModule_Create(&__pyx_moduledef);
  5873. #endif
  5874. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5875. __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;}
  5876. Py_INCREF(__pyx_d);
  5877. __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;}
  5878. #if CYTHON_COMPILING_IN_PYPY
  5879. Py_INCREF(__pyx_b);
  5880. #endif
  5881. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  5882. /*--- Initialize various global constants etc. ---*/
  5883. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5884. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  5885. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5886. #endif
  5887. if (__pyx_module_is_main_scattnlay) {
  5888. 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;};
  5889. }
  5890. #if PY_MAJOR_VERSION >= 3
  5891. {
  5892. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5893. if (!PyDict_GetItemString(modules, "scattnlay")) {
  5894. if (unlikely(PyDict_SetItemString(modules, "scattnlay", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5895. }
  5896. }
  5897. #endif
  5898. /*--- Builtin init code ---*/
  5899. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5900. /*--- Constants init code ---*/
  5901. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5902. /*--- Global init code ---*/
  5903. /*--- Variable export code ---*/
  5904. /*--- Function export code ---*/
  5905. /*--- Type init code ---*/
  5906. /*--- Type import code ---*/
  5907. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
  5908. #if CYTHON_COMPILING_IN_PYPY
  5909. sizeof(PyTypeObject),
  5910. #else
  5911. sizeof(PyHeapTypeObject),
  5912. #endif
  5913. 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5914. __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;}
  5915. __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;}
  5916. __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;}
  5917. __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;}
  5918. __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;}
  5919. /*--- Variable import code ---*/
  5920. /*--- Function import code ---*/
  5921. /*--- Execution code ---*/
  5922. /* "scattnlay.pyx":26
  5923. *
  5924. * from __future__ import division
  5925. * import numpy as np # <<<<<<<<<<<<<<
  5926. * cimport numpy as np
  5927. *
  5928. */
  5929. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5930. __Pyx_GOTREF(__pyx_t_1);
  5931. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5933. /* "scattnlay.pyx":56
  5934. * cdef int nField(int L, int pl, vector[double] x, vector[complex] m, int n_max, int nCoords, vector[double] Xp, vector[double] Yp, vector[double] Zp, double Er[], double Ei[], double Hr[], double Hi[])
  5935. *
  5936. * 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 n_max = -1): # <<<<<<<<<<<<<<
  5937. * cdef Py_ssize_t i
  5938. *
  5939. */
  5940. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5941. __Pyx_GOTREF(__pyx_t_1);
  5942. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5943. __Pyx_GOTREF(__pyx_t_2);
  5944. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5945. __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5946. __Pyx_GOTREF(__pyx_t_1);
  5947. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5948. __Pyx_GOTREF(__pyx_t_3);
  5949. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5950. __Pyx_GOTREF(__pyx_t_4);
  5951. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5952. if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5953. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5954. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5955. __Pyx_GOTREF(__pyx_t_4);
  5956. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5957. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5958. 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;}
  5959. __pyx_k__2 = ((PyArrayObject *)__pyx_t_4);
  5960. __Pyx_GIVEREF(__pyx_t_4);
  5961. __pyx_t_4 = 0;
  5962. __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_9scattnlay_1scattnlay, NULL, __pyx_n_s_scattnlay); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5963. __Pyx_GOTREF(__pyx_t_4);
  5964. if (PyDict_SetItem(__pyx_d, __pyx_n_s_scattnlay, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5965. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5966. /* "scattnlay.pyx":90
  5967. * return terms, Qext, Qsca, Qabs, Qbk, Qpr, g, Albedo, S1, S2
  5968. *
  5969. * 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 n_max = 0): # <<<<<<<<<<<<<<
  5970. * cdef Py_ssize_t i
  5971. *
  5972. */
  5973. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5974. __Pyx_GOTREF(__pyx_t_4);
  5975. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5976. __Pyx_GOTREF(__pyx_t_1);
  5977. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5978. __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5979. __Pyx_GOTREF(__pyx_t_4);
  5980. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5981. __Pyx_GOTREF(__pyx_t_2);
  5982. __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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5983. __Pyx_GOTREF(__pyx_t_3);
  5984. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5985. if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5986. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5987. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5988. __Pyx_GOTREF(__pyx_t_3);
  5989. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5990. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5991. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5992. __pyx_k__10 = ((PyArrayObject *)__pyx_t_3);
  5993. __Pyx_GIVEREF(__pyx_t_3);
  5994. __pyx_t_3 = 0;
  5995. __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_9scattnlay_3fieldnlay, NULL, __pyx_n_s_scattnlay); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5996. __Pyx_GOTREF(__pyx_t_3);
  5997. if (PyDict_SetItem(__pyx_d, __pyx_n_s_fieldnlay, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5998. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5999. /* "scattnlay.pyx":1
  6000. * # Copyright (C) 2009-2015 Ovidio Pena <ovidio@bytesfall.com> # <<<<<<<<<<<<<<
  6001. * #
  6002. * # This file is part of python-scattnlay
  6003. */
  6004. __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6005. __Pyx_GOTREF(__pyx_t_3);
  6006. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6007. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6008. /* "vector.from_py":46
  6009. *
  6010. * @cname("__pyx_convert_vector_from_py___pyx_t_double_complex")
  6011. * cdef vector[X] __pyx_convert_vector_from_py___pyx_t_double_complex(object o) except *: # <<<<<<<<<<<<<<
  6012. * cdef vector[X] v
  6013. * for item in o:
  6014. */
  6015. goto __pyx_L0;
  6016. __pyx_L1_error:;
  6017. __Pyx_XDECREF(__pyx_t_1);
  6018. __Pyx_XDECREF(__pyx_t_2);
  6019. __Pyx_XDECREF(__pyx_t_3);
  6020. __Pyx_XDECREF(__pyx_t_4);
  6021. if (__pyx_m) {
  6022. __Pyx_AddTraceback("init scattnlay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6023. Py_DECREF(__pyx_m); __pyx_m = 0;
  6024. } else if (!PyErr_Occurred()) {
  6025. PyErr_SetString(PyExc_ImportError, "init scattnlay");
  6026. }
  6027. __pyx_L0:;
  6028. __Pyx_RefNannyFinishContext();
  6029. #if PY_MAJOR_VERSION < 3
  6030. return;
  6031. #else
  6032. return __pyx_m;
  6033. #endif
  6034. }
  6035. /* Runtime support code */
  6036. #if CYTHON_REFNANNY
  6037. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  6038. PyObject *m = NULL, *p = NULL;
  6039. void *r = NULL;
  6040. m = PyImport_ImportModule((char *)modname);
  6041. if (!m) goto end;
  6042. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  6043. if (!p) goto end;
  6044. r = PyLong_AsVoidPtr(p);
  6045. end:
  6046. Py_XDECREF(p);
  6047. Py_XDECREF(m);
  6048. return (__Pyx_RefNannyAPIStruct *)r;
  6049. }
  6050. #endif /* CYTHON_REFNANNY */
  6051. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  6052. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  6053. if (unlikely(!result)) {
  6054. PyErr_Format(PyExc_NameError,
  6055. #if PY_MAJOR_VERSION >= 3
  6056. "name '%U' is not defined", name);
  6057. #else
  6058. "name '%.200s' is not defined", PyString_AS_STRING(name));
  6059. #endif
  6060. }
  6061. return result;
  6062. }
  6063. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  6064. PyObject *result;
  6065. #if CYTHON_COMPILING_IN_CPYTHON
  6066. result = PyDict_GetItem(__pyx_d, name);
  6067. if (result) {
  6068. Py_INCREF(result);
  6069. } else {
  6070. #else
  6071. result = PyObject_GetItem(__pyx_d, name);
  6072. if (!result) {
  6073. PyErr_Clear();
  6074. #endif
  6075. result = __Pyx_GetBuiltinName(name);
  6076. }
  6077. return result;
  6078. }
  6079. #if CYTHON_COMPILING_IN_CPYTHON
  6080. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  6081. PyObject *result;
  6082. ternaryfunc call = func->ob_type->tp_call;
  6083. if (unlikely(!call))
  6084. return PyObject_Call(func, arg, kw);
  6085. #if PY_VERSION_HEX >= 0x02060000
  6086. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  6087. return NULL;
  6088. #endif
  6089. result = (*call)(func, arg, kw);
  6090. #if PY_VERSION_HEX >= 0x02060000
  6091. Py_LeaveRecursiveCall();
  6092. #endif
  6093. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  6094. PyErr_SetString(
  6095. PyExc_SystemError,
  6096. "NULL result without error in PyObject_Call");
  6097. }
  6098. return result;
  6099. }
  6100. #endif
  6101. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  6102. if (unlikely(!type)) {
  6103. PyErr_SetString(PyExc_SystemError, "Missing type object");
  6104. return 0;
  6105. }
  6106. if (likely(PyObject_TypeCheck(obj, type)))
  6107. return 1;
  6108. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  6109. Py_TYPE(obj)->tp_name, type->tp_name);
  6110. return 0;
  6111. }
  6112. static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
  6113. #if CYTHON_COMPILING_IN_CPYTHON
  6114. PyObject *tmp_type, *tmp_value, *tmp_tb;
  6115. PyThreadState *tstate = PyThreadState_GET();
  6116. tmp_type = tstate->curexc_type;
  6117. tmp_value = tstate->curexc_value;
  6118. tmp_tb = tstate->curexc_traceback;
  6119. tstate->curexc_type = type;
  6120. tstate->curexc_value = value;
  6121. tstate->curexc_traceback = tb;
  6122. Py_XDECREF(tmp_type);
  6123. Py_XDECREF(tmp_value);
  6124. Py_XDECREF(tmp_tb);
  6125. #else
  6126. PyErr_Restore(type, value, tb);
  6127. #endif
  6128. }
  6129. static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
  6130. #if CYTHON_COMPILING_IN_CPYTHON
  6131. PyThreadState *tstate = PyThreadState_GET();
  6132. *type = tstate->curexc_type;
  6133. *value = tstate->curexc_value;
  6134. *tb = tstate->curexc_traceback;
  6135. tstate->curexc_type = 0;
  6136. tstate->curexc_value = 0;
  6137. tstate->curexc_traceback = 0;
  6138. #else
  6139. PyErr_Fetch(type, value, tb);
  6140. #endif
  6141. }
  6142. static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
  6143. CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
  6144. int full_traceback) {
  6145. PyObject *old_exc, *old_val, *old_tb;
  6146. PyObject *ctx;
  6147. __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
  6148. if (full_traceback) {
  6149. Py_XINCREF(old_exc);
  6150. Py_XINCREF(old_val);
  6151. Py_XINCREF(old_tb);
  6152. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6153. PyErr_PrintEx(1);
  6154. }
  6155. #if PY_MAJOR_VERSION < 3
  6156. ctx = PyString_FromString(name);
  6157. #else
  6158. ctx = PyUnicode_FromString(name);
  6159. #endif
  6160. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  6161. if (!ctx) {
  6162. PyErr_WriteUnraisable(Py_None);
  6163. } else {
  6164. PyErr_WriteUnraisable(ctx);
  6165. Py_DECREF(ctx);
  6166. }
  6167. }
  6168. static void __Pyx_RaiseArgtupleInvalid(
  6169. const char* func_name,
  6170. int exact,
  6171. Py_ssize_t num_min,
  6172. Py_ssize_t num_max,
  6173. Py_ssize_t num_found)
  6174. {
  6175. Py_ssize_t num_expected;
  6176. const char *more_or_less;
  6177. if (num_found < num_min) {
  6178. num_expected = num_min;
  6179. more_or_less = "at least";
  6180. } else {
  6181. num_expected = num_max;
  6182. more_or_less = "at most";
  6183. }
  6184. if (exact) {
  6185. more_or_less = "exactly";
  6186. }
  6187. PyErr_Format(PyExc_TypeError,
  6188. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  6189. func_name, more_or_less, num_expected,
  6190. (num_expected == 1) ? "" : "s", num_found);
  6191. }
  6192. static void __Pyx_RaiseDoubleKeywordsError(
  6193. const char* func_name,
  6194. PyObject* kw_name)
  6195. {
  6196. PyErr_Format(PyExc_TypeError,
  6197. #if PY_MAJOR_VERSION >= 3
  6198. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  6199. #else
  6200. "%s() got multiple values for keyword argument '%s'", func_name,
  6201. PyString_AsString(kw_name));
  6202. #endif
  6203. }
  6204. static int __Pyx_ParseOptionalKeywords(
  6205. PyObject *kwds,
  6206. PyObject **argnames[],
  6207. PyObject *kwds2,
  6208. PyObject *values[],
  6209. Py_ssize_t num_pos_args,
  6210. const char* function_name)
  6211. {
  6212. PyObject *key = 0, *value = 0;
  6213. Py_ssize_t pos = 0;
  6214. PyObject*** name;
  6215. PyObject*** first_kw_arg = argnames + num_pos_args;
  6216. while (PyDict_Next(kwds, &pos, &key, &value)) {
  6217. name = first_kw_arg;
  6218. while (*name && (**name != key)) name++;
  6219. if (*name) {
  6220. values[name-argnames] = value;
  6221. continue;
  6222. }
  6223. name = first_kw_arg;
  6224. #if PY_MAJOR_VERSION < 3
  6225. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  6226. while (*name) {
  6227. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  6228. && _PyString_Eq(**name, key)) {
  6229. values[name-argnames] = value;
  6230. break;
  6231. }
  6232. name++;
  6233. }
  6234. if (*name) continue;
  6235. else {
  6236. PyObject*** argname = argnames;
  6237. while (argname != first_kw_arg) {
  6238. if ((**argname == key) || (
  6239. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  6240. && _PyString_Eq(**argname, key))) {
  6241. goto arg_passed_twice;
  6242. }
  6243. argname++;
  6244. }
  6245. }
  6246. } else
  6247. #endif
  6248. if (likely(PyUnicode_Check(key))) {
  6249. while (*name) {
  6250. int cmp = (**name == key) ? 0 :
  6251. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6252. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  6253. #endif
  6254. PyUnicode_Compare(**name, key);
  6255. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6256. if (cmp == 0) {
  6257. values[name-argnames] = value;
  6258. break;
  6259. }
  6260. name++;
  6261. }
  6262. if (*name) continue;
  6263. else {
  6264. PyObject*** argname = argnames;
  6265. while (argname != first_kw_arg) {
  6266. int cmp = (**argname == key) ? 0 :
  6267. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  6268. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  6269. #endif
  6270. PyUnicode_Compare(**argname, key);
  6271. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  6272. if (cmp == 0) goto arg_passed_twice;
  6273. argname++;
  6274. }
  6275. }
  6276. } else
  6277. goto invalid_keyword_type;
  6278. if (kwds2) {
  6279. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  6280. } else {
  6281. goto invalid_keyword;
  6282. }
  6283. }
  6284. return 0;
  6285. arg_passed_twice:
  6286. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  6287. goto bad;
  6288. invalid_keyword_type:
  6289. PyErr_Format(PyExc_TypeError,
  6290. "%.200s() keywords must be strings", function_name);
  6291. goto bad;
  6292. invalid_keyword:
  6293. PyErr_Format(PyExc_TypeError,
  6294. #if PY_MAJOR_VERSION < 3
  6295. "%.200s() got an unexpected keyword argument '%.200s'",
  6296. function_name, PyString_AsString(key));
  6297. #else
  6298. "%s() got an unexpected keyword argument '%U'",
  6299. function_name, key);
  6300. #endif
  6301. bad:
  6302. return -1;
  6303. }
  6304. static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
  6305. PyErr_Format(PyExc_TypeError,
  6306. "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
  6307. name, type->tp_name, Py_TYPE(obj)->tp_name);
  6308. }
  6309. static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
  6310. const char *name, int exact)
  6311. {
  6312. if (unlikely(!type)) {
  6313. PyErr_SetString(PyExc_SystemError, "Missing type object");
  6314. return 0;
  6315. }
  6316. if (none_allowed && obj == Py_None) return 1;
  6317. else if (exact) {
  6318. if (likely(Py_TYPE(obj) == type)) return 1;
  6319. #if PY_MAJOR_VERSION == 2
  6320. else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
  6321. #endif
  6322. }
  6323. else {
  6324. if (likely(PyObject_TypeCheck(obj, type))) return 1;
  6325. }
  6326. __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
  6327. return 0;
  6328. }
  6329. static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  6330. unsigned int n = 1;
  6331. return *(unsigned char*)(&n) != 0;
  6332. }
  6333. static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
  6334. __Pyx_BufFmt_StackElem* stack,
  6335. __Pyx_TypeInfo* type) {
  6336. stack[0].field = &ctx->root;
  6337. stack[0].parent_offset = 0;
  6338. ctx->root.type = type;
  6339. ctx->root.name = "buffer dtype";
  6340. ctx->root.offset = 0;
  6341. ctx->head = stack;
  6342. ctx->head->field = &ctx->root;
  6343. ctx->fmt_offset = 0;
  6344. ctx->head->parent_offset = 0;
  6345. ctx->new_packmode = '@';
  6346. ctx->enc_packmode = '@';
  6347. ctx->new_count = 1;
  6348. ctx->enc_count = 0;
  6349. ctx->enc_type = 0;
  6350. ctx->is_complex = 0;
  6351. ctx->is_valid_array = 0;
  6352. ctx->struct_alignment = 0;
  6353. while (type->typegroup == 'S') {
  6354. ++ctx->head;
  6355. ctx->head->field = type->fields;
  6356. ctx->head->parent_offset = 0;
  6357. type = type->fields->type;
  6358. }
  6359. }
  6360. static int __Pyx_BufFmt_ParseNumber(const char** ts) {
  6361. int count;
  6362. const char* t = *ts;
  6363. if (*t < '0' || *t > '9') {
  6364. return -1;
  6365. } else {
  6366. count = *t++ - '0';
  6367. while (*t >= '0' && *t < '9') {
  6368. count *= 10;
  6369. count += *t++ - '0';
  6370. }
  6371. }
  6372. *ts = t;
  6373. return count;
  6374. }
  6375. static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
  6376. int number = __Pyx_BufFmt_ParseNumber(ts);
  6377. if (number == -1) /* First char was not a digit */
  6378. PyErr_Format(PyExc_ValueError,\
  6379. "Does not understand character buffer dtype format string ('%c')", **ts);
  6380. return number;
  6381. }
  6382. static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  6383. PyErr_Format(PyExc_ValueError,
  6384. "Unexpected format string character: '%c'", ch);
  6385. }
  6386. static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  6387. switch (ch) {
  6388. case 'c': return "'char'";
  6389. case 'b': return "'signed char'";
  6390. case 'B': return "'unsigned char'";
  6391. case 'h': return "'short'";
  6392. case 'H': return "'unsigned short'";
  6393. case 'i': return "'int'";
  6394. case 'I': return "'unsigned int'";
  6395. case 'l': return "'long'";
  6396. case 'L': return "'unsigned long'";
  6397. case 'q': return "'long long'";
  6398. case 'Q': return "'unsigned long long'";
  6399. case 'f': return (is_complex ? "'complex float'" : "'float'");
  6400. case 'd': return (is_complex ? "'complex double'" : "'double'");
  6401. case 'g': return (is_complex ? "'complex long double'" : "'long double'");
  6402. case 'T': return "a struct";
  6403. case 'O': return "Python object";
  6404. case 'P': return "a pointer";
  6405. case 's': case 'p': return "a string";
  6406. case 0: return "end";
  6407. default: return "unparseable format string";
  6408. }
  6409. }
  6410. static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  6411. switch (ch) {
  6412. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6413. case 'h': case 'H': return 2;
  6414. case 'i': case 'I': case 'l': case 'L': return 4;
  6415. case 'q': case 'Q': return 8;
  6416. case 'f': return (is_complex ? 8 : 4);
  6417. case 'd': return (is_complex ? 16 : 8);
  6418. case 'g': {
  6419. PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
  6420. return 0;
  6421. }
  6422. case 'O': case 'P': return sizeof(void*);
  6423. default:
  6424. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6425. return 0;
  6426. }
  6427. }
  6428. static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  6429. switch (ch) {
  6430. case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6431. case 'h': case 'H': return sizeof(short);
  6432. case 'i': case 'I': return sizeof(int);
  6433. case 'l': case 'L': return sizeof(long);
  6434. #ifdef HAVE_LONG_LONG
  6435. case 'q': case 'Q': return sizeof(PY_LONG_LONG);
  6436. #endif
  6437. case 'f': return sizeof(float) * (is_complex ? 2 : 1);
  6438. case 'd': return sizeof(double) * (is_complex ? 2 : 1);
  6439. case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
  6440. case 'O': case 'P': return sizeof(void*);
  6441. default: {
  6442. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6443. return 0;
  6444. }
  6445. }
  6446. }
  6447. typedef struct { char c; short x; } __Pyx_st_short;
  6448. typedef struct { char c; int x; } __Pyx_st_int;
  6449. typedef struct { char c; long x; } __Pyx_st_long;
  6450. typedef struct { char c; float x; } __Pyx_st_float;
  6451. typedef struct { char c; double x; } __Pyx_st_double;
  6452. typedef struct { char c; long double x; } __Pyx_st_longdouble;
  6453. typedef struct { char c; void *x; } __Pyx_st_void_p;
  6454. #ifdef HAVE_LONG_LONG
  6455. typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
  6456. #endif
  6457. static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
  6458. switch (ch) {
  6459. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6460. case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
  6461. case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
  6462. case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
  6463. #ifdef HAVE_LONG_LONG
  6464. case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
  6465. #endif
  6466. case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
  6467. case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
  6468. case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
  6469. case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
  6470. default:
  6471. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6472. return 0;
  6473. }
  6474. }
  6475. /* These are for computing the padding at the end of the struct to align
  6476. on the first member of the struct. This will probably the same as above,
  6477. but we don't have any guarantees.
  6478. */
  6479. typedef struct { short x; char c; } __Pyx_pad_short;
  6480. typedef struct { int x; char c; } __Pyx_pad_int;
  6481. typedef struct { long x; char c; } __Pyx_pad_long;
  6482. typedef struct { float x; char c; } __Pyx_pad_float;
  6483. typedef struct { double x; char c; } __Pyx_pad_double;
  6484. typedef struct { long double x; char c; } __Pyx_pad_longdouble;
  6485. typedef struct { void *x; char c; } __Pyx_pad_void_p;
  6486. #ifdef HAVE_LONG_LONG
  6487. typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
  6488. #endif
  6489. static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
  6490. switch (ch) {
  6491. case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
  6492. case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
  6493. case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
  6494. case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
  6495. #ifdef HAVE_LONG_LONG
  6496. case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
  6497. #endif
  6498. case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
  6499. case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
  6500. case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
  6501. case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
  6502. default:
  6503. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6504. return 0;
  6505. }
  6506. }
  6507. static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  6508. switch (ch) {
  6509. case 'c':
  6510. return 'H';
  6511. case 'b': case 'h': case 'i':
  6512. case 'l': case 'q': case 's': case 'p':
  6513. return 'I';
  6514. case 'B': case 'H': case 'I': case 'L': case 'Q':
  6515. return 'U';
  6516. case 'f': case 'd': case 'g':
  6517. return (is_complex ? 'C' : 'R');
  6518. case 'O':
  6519. return 'O';
  6520. case 'P':
  6521. return 'P';
  6522. default: {
  6523. __Pyx_BufFmt_RaiseUnexpectedChar(ch);
  6524. return 0;
  6525. }
  6526. }
  6527. }
  6528. static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  6529. if (ctx->head == NULL || ctx->head->field == &ctx->root) {
  6530. const char* expected;
  6531. const char* quote;
  6532. if (ctx->head == NULL) {
  6533. expected = "end";
  6534. quote = "";
  6535. } else {
  6536. expected = ctx->head->field->type->name;
  6537. quote = "'";
  6538. }
  6539. PyErr_Format(PyExc_ValueError,
  6540. "Buffer dtype mismatch, expected %s%s%s but got %s",
  6541. quote, expected, quote,
  6542. __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  6543. } else {
  6544. __Pyx_StructField* field = ctx->head->field;
  6545. __Pyx_StructField* parent = (ctx->head - 1)->field;
  6546. PyErr_Format(PyExc_ValueError,
  6547. "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
  6548. field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
  6549. parent->type->name, field->name);
  6550. }
  6551. }
  6552. static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  6553. char group;
  6554. size_t size, offset, arraysize = 1;
  6555. if (ctx->enc_type == 0) return 0;
  6556. if (ctx->head->field->type->arraysize[0]) {
  6557. int i, ndim = 0;
  6558. if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
  6559. ctx->is_valid_array = ctx->head->field->type->ndim == 1;
  6560. ndim = 1;
  6561. if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
  6562. PyErr_Format(PyExc_ValueError,
  6563. "Expected a dimension of size %zu, got %zu",
  6564. ctx->head->field->type->arraysize[0], ctx->enc_count);
  6565. return -1;
  6566. }
  6567. }
  6568. if (!ctx->is_valid_array) {
  6569. PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
  6570. ctx->head->field->type->ndim, ndim);
  6571. return -1;
  6572. }
  6573. for (i = 0; i < ctx->head->field->type->ndim; i++) {
  6574. arraysize *= ctx->head->field->type->arraysize[i];
  6575. }
  6576. ctx->is_valid_array = 0;
  6577. ctx->enc_count = 1;
  6578. }
  6579. group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  6580. do {
  6581. __Pyx_StructField* field = ctx->head->field;
  6582. __Pyx_TypeInfo* type = field->type;
  6583. if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
  6584. size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
  6585. } else {
  6586. size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
  6587. }
  6588. if (ctx->enc_packmode == '@') {
  6589. size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
  6590. size_t align_mod_offset;
  6591. if (align_at == 0) return -1;
  6592. align_mod_offset = ctx->fmt_offset % align_at;
  6593. if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
  6594. if (ctx->struct_alignment == 0)
  6595. ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
  6596. ctx->is_complex);
  6597. }
  6598. if (type->size != size || type->typegroup != group) {
  6599. if (type->typegroup == 'C' && type->fields != NULL) {
  6600. size_t parent_offset = ctx->head->parent_offset + field->offset;
  6601. ++ctx->head;
  6602. ctx->head->field = type->fields;
  6603. ctx->head->parent_offset = parent_offset;
  6604. continue;
  6605. }
  6606. if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
  6607. } else {
  6608. __Pyx_BufFmt_RaiseExpected(ctx);
  6609. return -1;
  6610. }
  6611. }
  6612. offset = ctx->head->parent_offset + field->offset;
  6613. if (ctx->fmt_offset != offset) {
  6614. PyErr_Format(PyExc_ValueError,
  6615. "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
  6616. (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
  6617. return -1;
  6618. }
  6619. ctx->fmt_offset += size;
  6620. if (arraysize)
  6621. ctx->fmt_offset += (arraysize - 1) * size;
  6622. --ctx->enc_count; /* Consume from buffer string */
  6623. while (1) {
  6624. if (field == &ctx->root) {
  6625. ctx->head = NULL;
  6626. if (ctx->enc_count != 0) {
  6627. __Pyx_BufFmt_RaiseExpected(ctx);
  6628. return -1;
  6629. }
  6630. break; /* breaks both loops as ctx->enc_count == 0 */
  6631. }
  6632. ctx->head->field = ++field;
  6633. if (field->type == NULL) {
  6634. --ctx->head;
  6635. field = ctx->head->field;
  6636. continue;
  6637. } else if (field->type->typegroup == 'S') {
  6638. size_t parent_offset = ctx->head->parent_offset + field->offset;
  6639. if (field->type->fields->type == NULL) continue; /* empty struct */
  6640. field = field->type->fields;
  6641. ++ctx->head;
  6642. ctx->head->field = field;
  6643. ctx->head->parent_offset = parent_offset;
  6644. break;
  6645. } else {
  6646. break;
  6647. }
  6648. }
  6649. } while (ctx->enc_count);
  6650. ctx->enc_type = 0;
  6651. ctx->is_complex = 0;
  6652. return 0;
  6653. }
  6654. static CYTHON_INLINE PyObject *
  6655. __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
  6656. {
  6657. const char *ts = *tsp;
  6658. int i = 0, number;
  6659. int ndim = ctx->head->field->type->ndim;
  6660. ;
  6661. ++ts;
  6662. if (ctx->new_count != 1) {
  6663. PyErr_SetString(PyExc_ValueError,
  6664. "Cannot handle repeated arrays in format string");
  6665. return NULL;
  6666. }
  6667. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6668. while (*ts && *ts != ')') {
  6669. switch (*ts) {
  6670. case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
  6671. default: break; /* not a 'break' in the loop */
  6672. }
  6673. number = __Pyx_BufFmt_ExpectNumber(&ts);
  6674. if (number == -1) return NULL;
  6675. if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
  6676. return PyErr_Format(PyExc_ValueError,
  6677. "Expected a dimension of size %zu, got %d",
  6678. ctx->head->field->type->arraysize[i], number);
  6679. if (*ts != ',' && *ts != ')')
  6680. return PyErr_Format(PyExc_ValueError,
  6681. "Expected a comma in format string, got '%c'", *ts);
  6682. if (*ts == ',') ts++;
  6683. i++;
  6684. }
  6685. if (i != ndim)
  6686. return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
  6687. ctx->head->field->type->ndim, i);
  6688. if (!*ts) {
  6689. PyErr_SetString(PyExc_ValueError,
  6690. "Unexpected end of format string, expected ')'");
  6691. return NULL;
  6692. }
  6693. ctx->is_valid_array = 1;
  6694. ctx->new_count = 1;
  6695. *tsp = ++ts;
  6696. return Py_None;
  6697. }
  6698. static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  6699. int got_Z = 0;
  6700. while (1) {
  6701. switch(*ts) {
  6702. case 0:
  6703. if (ctx->enc_type != 0 && ctx->head == NULL) {
  6704. __Pyx_BufFmt_RaiseExpected(ctx);
  6705. return NULL;
  6706. }
  6707. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6708. if (ctx->head != NULL) {
  6709. __Pyx_BufFmt_RaiseExpected(ctx);
  6710. return NULL;
  6711. }
  6712. return ts;
  6713. case ' ':
  6714. case '\r':
  6715. case '\n':
  6716. ++ts;
  6717. break;
  6718. case '<':
  6719. if (!__Pyx_IsLittleEndian()) {
  6720. PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
  6721. return NULL;
  6722. }
  6723. ctx->new_packmode = '=';
  6724. ++ts;
  6725. break;
  6726. case '>':
  6727. case '!':
  6728. if (__Pyx_IsLittleEndian()) {
  6729. PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
  6730. return NULL;
  6731. }
  6732. ctx->new_packmode = '=';
  6733. ++ts;
  6734. break;
  6735. case '=':
  6736. case '@':
  6737. case '^':
  6738. ctx->new_packmode = *ts++;
  6739. break;
  6740. case 'T': /* substruct */
  6741. {
  6742. const char* ts_after_sub;
  6743. size_t i, struct_count = ctx->new_count;
  6744. size_t struct_alignment = ctx->struct_alignment;
  6745. ctx->new_count = 1;
  6746. ++ts;
  6747. if (*ts != '{') {
  6748. PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
  6749. return NULL;
  6750. }
  6751. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6752. ctx->enc_type = 0; /* Erase processed last struct element */
  6753. ctx->enc_count = 0;
  6754. ctx->struct_alignment = 0;
  6755. ++ts;
  6756. ts_after_sub = ts;
  6757. for (i = 0; i != struct_count; ++i) {
  6758. ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
  6759. if (!ts_after_sub) return NULL;
  6760. }
  6761. ts = ts_after_sub;
  6762. if (struct_alignment) ctx->struct_alignment = struct_alignment;
  6763. }
  6764. break;
  6765. case '}': /* end of substruct; either repeat or move on */
  6766. {
  6767. size_t alignment = ctx->struct_alignment;
  6768. ++ts;
  6769. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6770. ctx->enc_type = 0; /* Erase processed last struct element */
  6771. if (alignment && ctx->fmt_offset % alignment) {
  6772. ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
  6773. }
  6774. }
  6775. return ts;
  6776. case 'x':
  6777. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6778. ctx->fmt_offset += ctx->new_count;
  6779. ctx->new_count = 1;
  6780. ctx->enc_count = 0;
  6781. ctx->enc_type = 0;
  6782. ctx->enc_packmode = ctx->new_packmode;
  6783. ++ts;
  6784. break;
  6785. case 'Z':
  6786. got_Z = 1;
  6787. ++ts;
  6788. if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
  6789. __Pyx_BufFmt_RaiseUnexpectedChar('Z');
  6790. return NULL;
  6791. }
  6792. case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
  6793. case 'l': case 'L': case 'q': case 'Q':
  6794. case 'f': case 'd': case 'g':
  6795. case 'O': case 'p':
  6796. if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
  6797. ctx->enc_packmode == ctx->new_packmode) {
  6798. ctx->enc_count += ctx->new_count;
  6799. ctx->new_count = 1;
  6800. got_Z = 0;
  6801. ++ts;
  6802. break;
  6803. }
  6804. case 's':
  6805. if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
  6806. ctx->enc_count = ctx->new_count;
  6807. ctx->enc_packmode = ctx->new_packmode;
  6808. ctx->enc_type = *ts;
  6809. ctx->is_complex = got_Z;
  6810. ++ts;
  6811. ctx->new_count = 1;
  6812. got_Z = 0;
  6813. break;
  6814. case ':':
  6815. ++ts;
  6816. while(*ts != ':') ++ts;
  6817. ++ts;
  6818. break;
  6819. case '(':
  6820. if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
  6821. break;
  6822. default:
  6823. {
  6824. int number = __Pyx_BufFmt_ExpectNumber(&ts);
  6825. if (number == -1) return NULL;
  6826. ctx->new_count = (size_t)number;
  6827. }
  6828. }
  6829. }
  6830. }
  6831. static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  6832. buf->buf = NULL;
  6833. buf->obj = NULL;
  6834. buf->strides = __Pyx_zeros;
  6835. buf->shape = __Pyx_zeros;
  6836. buf->suboffsets = __Pyx_minusones;
  6837. }
  6838. static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
  6839. Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
  6840. int nd, int cast, __Pyx_BufFmt_StackElem* stack)
  6841. {
  6842. if (obj == Py_None || obj == NULL) {
  6843. __Pyx_ZeroBuffer(buf);
  6844. return 0;
  6845. }
  6846. buf->buf = NULL;
  6847. if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  6848. if (buf->ndim != nd) {
  6849. PyErr_Format(PyExc_ValueError,
  6850. "Buffer has wrong number of dimensions (expected %d, got %d)",
  6851. nd, buf->ndim);
  6852. goto fail;
  6853. }
  6854. if (!cast) {
  6855. __Pyx_BufFmt_Context ctx;
  6856. __Pyx_BufFmt_Init(&ctx, stack, dtype);
  6857. if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  6858. }
  6859. if ((unsigned)buf->itemsize != dtype->size) {
  6860. PyErr_Format(PyExc_ValueError,
  6861. "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
  6862. buf->itemsize, (buf->itemsize > 1) ? "s" : "",
  6863. dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
  6864. goto fail;
  6865. }
  6866. if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  6867. return 0;
  6868. fail:;
  6869. __Pyx_ZeroBuffer(buf);
  6870. return -1;
  6871. }
  6872. static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  6873. if (info->buf == NULL) return;
  6874. if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  6875. __Pyx_ReleaseBuffer(info);
  6876. }
  6877. static void __Pyx_RaiseBufferFallbackError(void) {
  6878. PyErr_SetString(PyExc_ValueError,
  6879. "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
  6880. }
  6881. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  6882. PyObject *r;
  6883. if (!j) return NULL;
  6884. r = PyObject_GetItem(o, j);
  6885. Py_DECREF(j);
  6886. return r;
  6887. }
  6888. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  6889. int wraparound, int boundscheck) {
  6890. #if CYTHON_COMPILING_IN_CPYTHON
  6891. if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
  6892. if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
  6893. PyObject *r = PyList_GET_ITEM(o, i);
  6894. Py_INCREF(r);
  6895. return r;
  6896. }
  6897. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6898. #else
  6899. return PySequence_GetItem(o, i);
  6900. #endif
  6901. }
  6902. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  6903. int wraparound, int boundscheck) {
  6904. #if CYTHON_COMPILING_IN_CPYTHON
  6905. if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
  6906. if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
  6907. PyObject *r = PyTuple_GET_ITEM(o, i);
  6908. Py_INCREF(r);
  6909. return r;
  6910. }
  6911. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6912. #else
  6913. return PySequence_GetItem(o, i);
  6914. #endif
  6915. }
  6916. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  6917. int is_list, int wraparound, int boundscheck) {
  6918. #if CYTHON_COMPILING_IN_CPYTHON
  6919. if (is_list || PyList_CheckExact(o)) {
  6920. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  6921. if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
  6922. PyObject *r = PyList_GET_ITEM(o, n);
  6923. Py_INCREF(r);
  6924. return r;
  6925. }
  6926. }
  6927. else if (PyTuple_CheckExact(o)) {
  6928. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  6929. if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
  6930. PyObject *r = PyTuple_GET_ITEM(o, n);
  6931. Py_INCREF(r);
  6932. return r;
  6933. }
  6934. } else {
  6935. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  6936. if (likely(m && m->sq_item)) {
  6937. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  6938. Py_ssize_t l = m->sq_length(o);
  6939. if (likely(l >= 0)) {
  6940. i += l;
  6941. } else {
  6942. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  6943. PyErr_Clear();
  6944. else
  6945. return NULL;
  6946. }
  6947. }
  6948. return m->sq_item(o, i);
  6949. }
  6950. }
  6951. #else
  6952. if (is_list || PySequence_Check(o)) {
  6953. return PySequence_GetItem(o, i);
  6954. }
  6955. #endif
  6956. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  6957. }
  6958. static void __Pyx_RaiseBufferIndexError(int axis) {
  6959. PyErr_Format(PyExc_IndexError,
  6960. "Out of bounds on buffer access (axis %d)", axis);
  6961. }
  6962. static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
  6963. int r;
  6964. if (!j) return -1;
  6965. r = PyObject_SetItem(o, j, v);
  6966. Py_DECREF(j);
  6967. return r;
  6968. }
  6969. static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
  6970. int is_list, int wraparound, int boundscheck) {
  6971. #if CYTHON_COMPILING_IN_CPYTHON
  6972. if (is_list || PyList_CheckExact(o)) {
  6973. Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
  6974. if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
  6975. PyObject* old = PyList_GET_ITEM(o, n);
  6976. Py_INCREF(v);
  6977. PyList_SET_ITEM(o, n, v);
  6978. Py_DECREF(old);
  6979. return 1;
  6980. }
  6981. } else {
  6982. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  6983. if (likely(m && m->sq_ass_item)) {
  6984. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  6985. Py_ssize_t l = m->sq_length(o);
  6986. if (likely(l >= 0)) {
  6987. i += l;
  6988. } else {
  6989. if (PyErr_ExceptionMatches(PyExc_OverflowError))
  6990. PyErr_Clear();
  6991. else
  6992. return -1;
  6993. }
  6994. }
  6995. return m->sq_ass_item(o, i, v);
  6996. }
  6997. }
  6998. #else
  6999. #if CYTHON_COMPILING_IN_PYPY
  7000. if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
  7001. #else
  7002. if (is_list || PySequence_Check(o)) {
  7003. #endif
  7004. return PySequence_SetItem(o, i, v);
  7005. }
  7006. #endif
  7007. return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
  7008. }
  7009. #if PY_MAJOR_VERSION < 3
  7010. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  7011. CYTHON_UNUSED PyObject *cause) {
  7012. Py_XINCREF(type);
  7013. if (!value || value == Py_None)
  7014. value = NULL;
  7015. else
  7016. Py_INCREF(value);
  7017. if (!tb || tb == Py_None)
  7018. tb = NULL;
  7019. else {
  7020. Py_INCREF(tb);
  7021. if (!PyTraceBack_Check(tb)) {
  7022. PyErr_SetString(PyExc_TypeError,
  7023. "raise: arg 3 must be a traceback or None");
  7024. goto raise_error;
  7025. }
  7026. }
  7027. #if PY_VERSION_HEX < 0x02050000
  7028. if (PyClass_Check(type)) {
  7029. #else
  7030. if (PyType_Check(type)) {
  7031. #endif
  7032. #if CYTHON_COMPILING_IN_PYPY
  7033. if (!value) {
  7034. Py_INCREF(Py_None);
  7035. value = Py_None;
  7036. }
  7037. #endif
  7038. PyErr_NormalizeException(&type, &value, &tb);
  7039. } else {
  7040. if (value) {
  7041. PyErr_SetString(PyExc_TypeError,
  7042. "instance exception may not have a separate value");
  7043. goto raise_error;
  7044. }
  7045. value = type;
  7046. #if PY_VERSION_HEX < 0x02050000
  7047. if (PyInstance_Check(type)) {
  7048. type = (PyObject*) ((PyInstanceObject*)type)->in_class;
  7049. Py_INCREF(type);
  7050. } else {
  7051. type = 0;
  7052. PyErr_SetString(PyExc_TypeError,
  7053. "raise: exception must be an old-style class or instance");
  7054. goto raise_error;
  7055. }
  7056. #else
  7057. type = (PyObject*) Py_TYPE(type);
  7058. Py_INCREF(type);
  7059. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  7060. PyErr_SetString(PyExc_TypeError,
  7061. "raise: exception class must be a subclass of BaseException");
  7062. goto raise_error;
  7063. }
  7064. #endif
  7065. }
  7066. __Pyx_ErrRestore(type, value, tb);
  7067. return;
  7068. raise_error:
  7069. Py_XDECREF(value);
  7070. Py_XDECREF(type);
  7071. Py_XDECREF(tb);
  7072. return;
  7073. }
  7074. #else /* Python 3+ */
  7075. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  7076. PyObject* owned_instance = NULL;
  7077. if (tb == Py_None) {
  7078. tb = 0;
  7079. } else if (tb && !PyTraceBack_Check(tb)) {
  7080. PyErr_SetString(PyExc_TypeError,
  7081. "raise: arg 3 must be a traceback or None");
  7082. goto bad;
  7083. }
  7084. if (value == Py_None)
  7085. value = 0;
  7086. if (PyExceptionInstance_Check(type)) {
  7087. if (value) {
  7088. PyErr_SetString(PyExc_TypeError,
  7089. "instance exception may not have a separate value");
  7090. goto bad;
  7091. }
  7092. value = type;
  7093. type = (PyObject*) Py_TYPE(value);
  7094. } else if (PyExceptionClass_Check(type)) {
  7095. PyObject *instance_class = NULL;
  7096. if (value && PyExceptionInstance_Check(value)) {
  7097. instance_class = (PyObject*) Py_TYPE(value);
  7098. if (instance_class != type) {
  7099. if (PyObject_IsSubclass(instance_class, type)) {
  7100. type = instance_class;
  7101. } else {
  7102. instance_class = NULL;
  7103. }
  7104. }
  7105. }
  7106. if (!instance_class) {
  7107. PyObject *args;
  7108. if (!value)
  7109. args = PyTuple_New(0);
  7110. else if (PyTuple_Check(value)) {
  7111. Py_INCREF(value);
  7112. args = value;
  7113. } else
  7114. args = PyTuple_Pack(1, value);
  7115. if (!args)
  7116. goto bad;
  7117. owned_instance = PyObject_Call(type, args, NULL);
  7118. Py_DECREF(args);
  7119. if (!owned_instance)
  7120. goto bad;
  7121. value = owned_instance;
  7122. if (!PyExceptionInstance_Check(value)) {
  7123. PyErr_Format(PyExc_TypeError,
  7124. "calling %R should have returned an instance of "
  7125. "BaseException, not %R",
  7126. type, Py_TYPE(value));
  7127. goto bad;
  7128. }
  7129. }
  7130. } else {
  7131. PyErr_SetString(PyExc_TypeError,
  7132. "raise: exception class must be a subclass of BaseException");
  7133. goto bad;
  7134. }
  7135. #if PY_VERSION_HEX >= 0x03030000
  7136. if (cause) {
  7137. #else
  7138. if (cause && cause != Py_None) {
  7139. #endif
  7140. PyObject *fixed_cause;
  7141. if (cause == Py_None) {
  7142. fixed_cause = NULL;
  7143. } else if (PyExceptionClass_Check(cause)) {
  7144. fixed_cause = PyObject_CallObject(cause, NULL);
  7145. if (fixed_cause == NULL)
  7146. goto bad;
  7147. } else if (PyExceptionInstance_Check(cause)) {
  7148. fixed_cause = cause;
  7149. Py_INCREF(fixed_cause);
  7150. } else {
  7151. PyErr_SetString(PyExc_TypeError,
  7152. "exception causes must derive from "
  7153. "BaseException");
  7154. goto bad;
  7155. }
  7156. PyException_SetCause(value, fixed_cause);
  7157. }
  7158. PyErr_SetObject(type, value);
  7159. if (tb) {
  7160. PyThreadState *tstate = PyThreadState_GET();
  7161. PyObject* tmp_tb = tstate->curexc_traceback;
  7162. if (tb != tmp_tb) {
  7163. Py_INCREF(tb);
  7164. tstate->curexc_traceback = tb;
  7165. Py_XDECREF(tmp_tb);
  7166. }
  7167. }
  7168. bad:
  7169. Py_XDECREF(owned_instance);
  7170. return;
  7171. }
  7172. #endif
  7173. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  7174. PyErr_Format(PyExc_ValueError,
  7175. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  7176. }
  7177. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  7178. PyErr_Format(PyExc_ValueError,
  7179. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  7180. index, (index == 1) ? "" : "s");
  7181. }
  7182. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  7183. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  7184. }
  7185. #if PY_MAJOR_VERSION < 3
  7186. static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  7187. #if PY_VERSION_HEX >= 0x02060000
  7188. if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  7189. #endif
  7190. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
  7191. #if PY_VERSION_HEX < 0x02060000
  7192. if (obj->ob_type->tp_dict) {
  7193. PyObject *getbuffer_cobj = PyObject_GetItem(
  7194. obj->ob_type->tp_dict, __pyx_n_s_pyx_getbuffer);
  7195. if (getbuffer_cobj) {
  7196. getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
  7197. Py_DECREF(getbuffer_cobj);
  7198. if (!func)
  7199. goto fail;
  7200. return func(obj, view, flags);
  7201. } else {
  7202. PyErr_Clear();
  7203. }
  7204. }
  7205. #endif
  7206. PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  7207. #if PY_VERSION_HEX < 0x02060000
  7208. fail:
  7209. #endif
  7210. return -1;
  7211. }
  7212. static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  7213. PyObject *obj = view->obj;
  7214. if (!obj) return;
  7215. #if PY_VERSION_HEX >= 0x02060000
  7216. if (PyObject_CheckBuffer(obj)) {
  7217. PyBuffer_Release(view);
  7218. return;
  7219. }
  7220. #endif
  7221. if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
  7222. #if PY_VERSION_HEX < 0x02060000
  7223. if (obj->ob_type->tp_dict) {
  7224. PyObject *releasebuffer_cobj = PyObject_GetItem(
  7225. obj->ob_type->tp_dict, __pyx_n_s_pyx_releasebuffer);
  7226. if (releasebuffer_cobj) {
  7227. releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
  7228. Py_DECREF(releasebuffer_cobj);
  7229. if (!func)
  7230. goto fail;
  7231. func(obj, view);
  7232. return;
  7233. } else {
  7234. PyErr_Clear();
  7235. }
  7236. }
  7237. #endif
  7238. goto nofail;
  7239. #if PY_VERSION_HEX < 0x02060000
  7240. fail:
  7241. #endif
  7242. PyErr_WriteUnraisable(obj);
  7243. nofail:
  7244. Py_DECREF(obj);
  7245. view->obj = NULL;
  7246. }
  7247. #endif /* PY_MAJOR_VERSION < 3 */
  7248. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  7249. PyObject *empty_list = 0;
  7250. PyObject *module = 0;
  7251. PyObject *global_dict = 0;
  7252. PyObject *empty_dict = 0;
  7253. PyObject *list;
  7254. #if PY_VERSION_HEX < 0x03030000
  7255. PyObject *py_import;
  7256. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  7257. if (!py_import)
  7258. goto bad;
  7259. #endif
  7260. if (from_list)
  7261. list = from_list;
  7262. else {
  7263. empty_list = PyList_New(0);
  7264. if (!empty_list)
  7265. goto bad;
  7266. list = empty_list;
  7267. }
  7268. global_dict = PyModule_GetDict(__pyx_m);
  7269. if (!global_dict)
  7270. goto bad;
  7271. empty_dict = PyDict_New();
  7272. if (!empty_dict)
  7273. goto bad;
  7274. #if PY_VERSION_HEX >= 0x02050000
  7275. {
  7276. #if PY_MAJOR_VERSION >= 3
  7277. if (level == -1) {
  7278. if (strchr(__Pyx_MODULE_NAME, '.')) {
  7279. #if PY_VERSION_HEX < 0x03030000
  7280. PyObject *py_level = PyInt_FromLong(1);
  7281. if (!py_level)
  7282. goto bad;
  7283. module = PyObject_CallFunctionObjArgs(py_import,
  7284. name, global_dict, empty_dict, list, py_level, NULL);
  7285. Py_DECREF(py_level);
  7286. #else
  7287. module = PyImport_ImportModuleLevelObject(
  7288. name, global_dict, empty_dict, list, 1);
  7289. #endif
  7290. if (!module) {
  7291. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  7292. goto bad;
  7293. PyErr_Clear();
  7294. }
  7295. }
  7296. level = 0; /* try absolute import on failure */
  7297. }
  7298. #endif
  7299. if (!module) {
  7300. #if PY_VERSION_HEX < 0x03030000
  7301. PyObject *py_level = PyInt_FromLong(level);
  7302. if (!py_level)
  7303. goto bad;
  7304. module = PyObject_CallFunctionObjArgs(py_import,
  7305. name, global_dict, empty_dict, list, py_level, NULL);
  7306. Py_DECREF(py_level);
  7307. #else
  7308. module = PyImport_ImportModuleLevelObject(
  7309. name, global_dict, empty_dict, list, level);
  7310. #endif
  7311. }
  7312. }
  7313. #else
  7314. if (level>0) {
  7315. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  7316. goto bad;
  7317. }
  7318. module = PyObject_CallFunctionObjArgs(py_import,
  7319. name, global_dict, empty_dict, list, NULL);
  7320. #endif
  7321. bad:
  7322. #if PY_VERSION_HEX < 0x03030000
  7323. Py_XDECREF(py_import);
  7324. #endif
  7325. Py_XDECREF(empty_list);
  7326. Py_XDECREF(empty_dict);
  7327. return module;
  7328. }
  7329. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  7330. { \
  7331. func_type value = func(x); \
  7332. if (sizeof(target_type) < sizeof(func_type)) { \
  7333. if (unlikely(value != (func_type) (target_type) value)) { \
  7334. func_type zero = 0; \
  7335. PyErr_SetString(PyExc_OverflowError, \
  7336. (is_unsigned && unlikely(value < zero)) ? \
  7337. "can't convert negative value to " #target_type : \
  7338. "value too large to convert to " #target_type); \
  7339. return (target_type) -1; \
  7340. } \
  7341. } \
  7342. return (target_type) value; \
  7343. }
  7344. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7345. #if CYTHON_USE_PYLONG_INTERNALS
  7346. #include "longintrepr.h"
  7347. #endif
  7348. #endif
  7349. static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) {
  7350. const npy_long neg_one = (npy_long) -1, const_zero = 0;
  7351. const int is_unsigned = neg_one > const_zero;
  7352. #if PY_MAJOR_VERSION < 3
  7353. if (likely(PyInt_Check(x))) {
  7354. if (sizeof(npy_long) < sizeof(long)) {
  7355. __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG)
  7356. } else {
  7357. long val = PyInt_AS_LONG(x);
  7358. if (is_unsigned && unlikely(val < 0)) {
  7359. PyErr_SetString(PyExc_OverflowError,
  7360. "can't convert negative value to npy_long");
  7361. return (npy_long) -1;
  7362. }
  7363. return (npy_long) val;
  7364. }
  7365. } else
  7366. #endif
  7367. if (likely(PyLong_Check(x))) {
  7368. if (is_unsigned) {
  7369. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7370. #if CYTHON_USE_PYLONG_INTERNALS
  7371. if (sizeof(digit) <= sizeof(npy_long)) {
  7372. switch (Py_SIZE(x)) {
  7373. case 0: return 0;
  7374. case 1: return (npy_long) ((PyLongObject*)x)->ob_digit[0];
  7375. }
  7376. }
  7377. #endif
  7378. #endif
  7379. if (unlikely(Py_SIZE(x) < 0)) {
  7380. PyErr_SetString(PyExc_OverflowError,
  7381. "can't convert negative value to npy_long");
  7382. return (npy_long) -1;
  7383. }
  7384. if (sizeof(npy_long) <= sizeof(unsigned long)) {
  7385. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, PyLong_AsUnsignedLong)
  7386. } else if (sizeof(npy_long) <= sizeof(unsigned long long)) {
  7387. __PYX_VERIFY_RETURN_INT(npy_long, unsigned long long, PyLong_AsUnsignedLongLong)
  7388. }
  7389. } else {
  7390. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7391. #if CYTHON_USE_PYLONG_INTERNALS
  7392. if (sizeof(digit) <= sizeof(npy_long)) {
  7393. switch (Py_SIZE(x)) {
  7394. case 0: return 0;
  7395. case 1: return +(npy_long) ((PyLongObject*)x)->ob_digit[0];
  7396. case -1: return -(npy_long) ((PyLongObject*)x)->ob_digit[0];
  7397. }
  7398. }
  7399. #endif
  7400. #endif
  7401. if (sizeof(npy_long) <= sizeof(long)) {
  7402. __PYX_VERIFY_RETURN_INT(npy_long, long, PyLong_AsLong)
  7403. } else if (sizeof(npy_long) <= sizeof(long long)) {
  7404. __PYX_VERIFY_RETURN_INT(npy_long, long long, PyLong_AsLongLong)
  7405. }
  7406. }
  7407. {
  7408. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7409. PyErr_SetString(PyExc_RuntimeError,
  7410. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7411. #else
  7412. npy_long val;
  7413. PyObject *v = __Pyx_PyNumber_Int(x);
  7414. #if PY_MAJOR_VERSION < 3
  7415. if (likely(v) && !PyLong_Check(v)) {
  7416. PyObject *tmp = v;
  7417. v = PyNumber_Long(tmp);
  7418. Py_DECREF(tmp);
  7419. }
  7420. #endif
  7421. if (likely(v)) {
  7422. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7423. unsigned char *bytes = (unsigned char *)&val;
  7424. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7425. bytes, sizeof(val),
  7426. is_little, !is_unsigned);
  7427. Py_DECREF(v);
  7428. if (likely(!ret))
  7429. return val;
  7430. }
  7431. #endif
  7432. return (npy_long) -1;
  7433. }
  7434. } else {
  7435. npy_long val;
  7436. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7437. if (!tmp) return (npy_long) -1;
  7438. val = __Pyx_PyInt_As_npy_long(tmp);
  7439. Py_DECREF(tmp);
  7440. return val;
  7441. }
  7442. }
  7443. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
  7444. const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0;
  7445. const int is_unsigned = neg_one > const_zero;
  7446. if (is_unsigned) {
  7447. if (sizeof(Py_intptr_t) < sizeof(long)) {
  7448. return PyInt_FromLong((long) value);
  7449. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
  7450. return PyLong_FromUnsignedLong((unsigned long) value);
  7451. } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) {
  7452. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7453. }
  7454. } else {
  7455. if (sizeof(Py_intptr_t) <= sizeof(long)) {
  7456. return PyInt_FromLong((long) value);
  7457. } else if (sizeof(Py_intptr_t) <= sizeof(long long)) {
  7458. return PyLong_FromLongLong((long long) value);
  7459. }
  7460. }
  7461. {
  7462. int one = 1; int little = (int)*(unsigned char *)&one;
  7463. unsigned char *bytes = (unsigned char *)&value;
  7464. return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
  7465. little, !is_unsigned);
  7466. }
  7467. }
  7468. #if CYTHON_CCOMPLEX
  7469. #ifdef __cplusplus
  7470. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7471. return ::std::complex< double >(x, y);
  7472. }
  7473. #else
  7474. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7475. return x + y*(__pyx_t_double_complex)_Complex_I;
  7476. }
  7477. #endif
  7478. #else
  7479. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  7480. __pyx_t_double_complex z;
  7481. z.real = x;
  7482. z.imag = y;
  7483. return z;
  7484. }
  7485. #endif
  7486. static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
  7487. Py_complex cval;
  7488. #if CYTHON_COMPILING_IN_CPYTHON
  7489. if (PyComplex_CheckExact(o))
  7490. cval = ((PyComplexObject *)o)->cval;
  7491. else
  7492. #endif
  7493. cval = PyComplex_AsCComplex(o);
  7494. return __pyx_t_double_complex_from_parts(
  7495. (double)cval.real,
  7496. (double)cval.imag);
  7497. }
  7498. #if CYTHON_CCOMPLEX
  7499. #else
  7500. static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7501. return (a.real == b.real) && (a.imag == b.imag);
  7502. }
  7503. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7504. __pyx_t_double_complex z;
  7505. z.real = a.real + b.real;
  7506. z.imag = a.imag + b.imag;
  7507. return z;
  7508. }
  7509. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7510. __pyx_t_double_complex z;
  7511. z.real = a.real - b.real;
  7512. z.imag = a.imag - b.imag;
  7513. return z;
  7514. }
  7515. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7516. __pyx_t_double_complex z;
  7517. z.real = a.real * b.real - a.imag * b.imag;
  7518. z.imag = a.real * b.imag + a.imag * b.real;
  7519. return z;
  7520. }
  7521. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7522. __pyx_t_double_complex z;
  7523. double denom = b.real * b.real + b.imag * b.imag;
  7524. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  7525. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  7526. return z;
  7527. }
  7528. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
  7529. __pyx_t_double_complex z;
  7530. z.real = -a.real;
  7531. z.imag = -a.imag;
  7532. return z;
  7533. }
  7534. static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
  7535. return (a.real == 0) && (a.imag == 0);
  7536. }
  7537. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
  7538. __pyx_t_double_complex z;
  7539. z.real = a.real;
  7540. z.imag = -a.imag;
  7541. return z;
  7542. }
  7543. #if 1
  7544. static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
  7545. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  7546. return sqrt(z.real*z.real + z.imag*z.imag);
  7547. #else
  7548. return hypot(z.real, z.imag);
  7549. #endif
  7550. }
  7551. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  7552. __pyx_t_double_complex z;
  7553. double r, lnr, theta, z_r, z_theta;
  7554. if (b.imag == 0 && b.real == (int)b.real) {
  7555. if (b.real < 0) {
  7556. double denom = a.real * a.real + a.imag * a.imag;
  7557. a.real = a.real / denom;
  7558. a.imag = -a.imag / denom;
  7559. b.real = -b.real;
  7560. }
  7561. switch ((int)b.real) {
  7562. case 0:
  7563. z.real = 1;
  7564. z.imag = 0;
  7565. return z;
  7566. case 1:
  7567. return a;
  7568. case 2:
  7569. z = __Pyx_c_prod(a, a);
  7570. return __Pyx_c_prod(a, a);
  7571. case 3:
  7572. z = __Pyx_c_prod(a, a);
  7573. return __Pyx_c_prod(z, a);
  7574. case 4:
  7575. z = __Pyx_c_prod(a, a);
  7576. return __Pyx_c_prod(z, z);
  7577. }
  7578. }
  7579. if (a.imag == 0) {
  7580. if (a.real == 0) {
  7581. return a;
  7582. }
  7583. r = a.real;
  7584. theta = 0;
  7585. } else {
  7586. r = __Pyx_c_abs(a);
  7587. theta = atan2(a.imag, a.real);
  7588. }
  7589. lnr = log(r);
  7590. z_r = exp(lnr * b.real - theta * b.imag);
  7591. z_theta = theta * b.real + lnr * b.imag;
  7592. z.real = z_r * cos(z_theta);
  7593. z.imag = z_r * sin(z_theta);
  7594. return z;
  7595. }
  7596. #endif
  7597. #endif
  7598. #if CYTHON_CCOMPLEX
  7599. #ifdef __cplusplus
  7600. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7601. return ::std::complex< float >(x, y);
  7602. }
  7603. #else
  7604. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7605. return x + y*(__pyx_t_float_complex)_Complex_I;
  7606. }
  7607. #endif
  7608. #else
  7609. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  7610. __pyx_t_float_complex z;
  7611. z.real = x;
  7612. z.imag = y;
  7613. return z;
  7614. }
  7615. #endif
  7616. #if CYTHON_CCOMPLEX
  7617. #else
  7618. static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7619. return (a.real == b.real) && (a.imag == b.imag);
  7620. }
  7621. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7622. __pyx_t_float_complex z;
  7623. z.real = a.real + b.real;
  7624. z.imag = a.imag + b.imag;
  7625. return z;
  7626. }
  7627. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7628. __pyx_t_float_complex z;
  7629. z.real = a.real - b.real;
  7630. z.imag = a.imag - b.imag;
  7631. return z;
  7632. }
  7633. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7634. __pyx_t_float_complex z;
  7635. z.real = a.real * b.real - a.imag * b.imag;
  7636. z.imag = a.real * b.imag + a.imag * b.real;
  7637. return z;
  7638. }
  7639. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7640. __pyx_t_float_complex z;
  7641. float denom = b.real * b.real + b.imag * b.imag;
  7642. z.real = (a.real * b.real + a.imag * b.imag) / denom;
  7643. z.imag = (a.imag * b.real - a.real * b.imag) / denom;
  7644. return z;
  7645. }
  7646. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
  7647. __pyx_t_float_complex z;
  7648. z.real = -a.real;
  7649. z.imag = -a.imag;
  7650. return z;
  7651. }
  7652. static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
  7653. return (a.real == 0) && (a.imag == 0);
  7654. }
  7655. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
  7656. __pyx_t_float_complex z;
  7657. z.real = a.real;
  7658. z.imag = -a.imag;
  7659. return z;
  7660. }
  7661. #if 1
  7662. static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
  7663. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  7664. return sqrtf(z.real*z.real + z.imag*z.imag);
  7665. #else
  7666. return hypotf(z.real, z.imag);
  7667. #endif
  7668. }
  7669. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  7670. __pyx_t_float_complex z;
  7671. float r, lnr, theta, z_r, z_theta;
  7672. if (b.imag == 0 && b.real == (int)b.real) {
  7673. if (b.real < 0) {
  7674. float denom = a.real * a.real + a.imag * a.imag;
  7675. a.real = a.real / denom;
  7676. a.imag = -a.imag / denom;
  7677. b.real = -b.real;
  7678. }
  7679. switch ((int)b.real) {
  7680. case 0:
  7681. z.real = 1;
  7682. z.imag = 0;
  7683. return z;
  7684. case 1:
  7685. return a;
  7686. case 2:
  7687. z = __Pyx_c_prodf(a, a);
  7688. return __Pyx_c_prodf(a, a);
  7689. case 3:
  7690. z = __Pyx_c_prodf(a, a);
  7691. return __Pyx_c_prodf(z, a);
  7692. case 4:
  7693. z = __Pyx_c_prodf(a, a);
  7694. return __Pyx_c_prodf(z, z);
  7695. }
  7696. }
  7697. if (a.imag == 0) {
  7698. if (a.real == 0) {
  7699. return a;
  7700. }
  7701. r = a.real;
  7702. theta = 0;
  7703. } else {
  7704. r = __Pyx_c_absf(a);
  7705. theta = atan2f(a.imag, a.real);
  7706. }
  7707. lnr = logf(r);
  7708. z_r = expf(lnr * b.real - theta * b.imag);
  7709. z_theta = theta * b.real + lnr * b.imag;
  7710. z.real = z_r * cosf(z_theta);
  7711. z.imag = z_r * sinf(z_theta);
  7712. return z;
  7713. }
  7714. #endif
  7715. #endif
  7716. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  7717. const int neg_one = (int) -1, const_zero = 0;
  7718. const int is_unsigned = neg_one > const_zero;
  7719. if (is_unsigned) {
  7720. if (sizeof(int) < sizeof(long)) {
  7721. return PyInt_FromLong((long) value);
  7722. } else if (sizeof(int) <= sizeof(unsigned long)) {
  7723. return PyLong_FromUnsignedLong((unsigned long) value);
  7724. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  7725. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7726. }
  7727. } else {
  7728. if (sizeof(int) <= sizeof(long)) {
  7729. return PyInt_FromLong((long) value);
  7730. } else if (sizeof(int) <= sizeof(long long)) {
  7731. return PyLong_FromLongLong((long long) value);
  7732. }
  7733. }
  7734. {
  7735. int one = 1; int little = (int)*(unsigned char *)&one;
  7736. unsigned char *bytes = (unsigned char *)&value;
  7737. return _PyLong_FromByteArray(bytes, sizeof(int),
  7738. little, !is_unsigned);
  7739. }
  7740. }
  7741. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7742. #if CYTHON_USE_PYLONG_INTERNALS
  7743. #include "longintrepr.h"
  7744. #endif
  7745. #endif
  7746. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  7747. const int neg_one = (int) -1, const_zero = 0;
  7748. const int is_unsigned = neg_one > const_zero;
  7749. #if PY_MAJOR_VERSION < 3
  7750. if (likely(PyInt_Check(x))) {
  7751. if (sizeof(int) < sizeof(long)) {
  7752. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  7753. } else {
  7754. long val = PyInt_AS_LONG(x);
  7755. if (is_unsigned && unlikely(val < 0)) {
  7756. PyErr_SetString(PyExc_OverflowError,
  7757. "can't convert negative value to int");
  7758. return (int) -1;
  7759. }
  7760. return (int) val;
  7761. }
  7762. } else
  7763. #endif
  7764. if (likely(PyLong_Check(x))) {
  7765. if (is_unsigned) {
  7766. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7767. #if CYTHON_USE_PYLONG_INTERNALS
  7768. if (sizeof(digit) <= sizeof(int)) {
  7769. switch (Py_SIZE(x)) {
  7770. case 0: return 0;
  7771. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  7772. }
  7773. }
  7774. #endif
  7775. #endif
  7776. if (unlikely(Py_SIZE(x) < 0)) {
  7777. PyErr_SetString(PyExc_OverflowError,
  7778. "can't convert negative value to int");
  7779. return (int) -1;
  7780. }
  7781. if (sizeof(int) <= sizeof(unsigned long)) {
  7782. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  7783. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  7784. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  7785. }
  7786. } else {
  7787. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7788. #if CYTHON_USE_PYLONG_INTERNALS
  7789. if (sizeof(digit) <= sizeof(int)) {
  7790. switch (Py_SIZE(x)) {
  7791. case 0: return 0;
  7792. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  7793. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  7794. }
  7795. }
  7796. #endif
  7797. #endif
  7798. if (sizeof(int) <= sizeof(long)) {
  7799. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  7800. } else if (sizeof(int) <= sizeof(long long)) {
  7801. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  7802. }
  7803. }
  7804. {
  7805. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7806. PyErr_SetString(PyExc_RuntimeError,
  7807. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7808. #else
  7809. int val;
  7810. PyObject *v = __Pyx_PyNumber_Int(x);
  7811. #if PY_MAJOR_VERSION < 3
  7812. if (likely(v) && !PyLong_Check(v)) {
  7813. PyObject *tmp = v;
  7814. v = PyNumber_Long(tmp);
  7815. Py_DECREF(tmp);
  7816. }
  7817. #endif
  7818. if (likely(v)) {
  7819. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7820. unsigned char *bytes = (unsigned char *)&val;
  7821. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7822. bytes, sizeof(val),
  7823. is_little, !is_unsigned);
  7824. Py_DECREF(v);
  7825. if (likely(!ret))
  7826. return val;
  7827. }
  7828. #endif
  7829. return (int) -1;
  7830. }
  7831. } else {
  7832. int val;
  7833. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7834. if (!tmp) return (int) -1;
  7835. val = __Pyx_PyInt_As_int(tmp);
  7836. Py_DECREF(tmp);
  7837. return val;
  7838. }
  7839. }
  7840. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  7841. const long neg_one = (long) -1, const_zero = 0;
  7842. const int is_unsigned = neg_one > const_zero;
  7843. if (is_unsigned) {
  7844. if (sizeof(long) < sizeof(long)) {
  7845. return PyInt_FromLong((long) value);
  7846. } else if (sizeof(long) <= sizeof(unsigned long)) {
  7847. return PyLong_FromUnsignedLong((unsigned long) value);
  7848. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7849. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  7850. }
  7851. } else {
  7852. if (sizeof(long) <= sizeof(long)) {
  7853. return PyInt_FromLong((long) value);
  7854. } else if (sizeof(long) <= sizeof(long long)) {
  7855. return PyLong_FromLongLong((long long) value);
  7856. }
  7857. }
  7858. {
  7859. int one = 1; int little = (int)*(unsigned char *)&one;
  7860. unsigned char *bytes = (unsigned char *)&value;
  7861. return _PyLong_FromByteArray(bytes, sizeof(long),
  7862. little, !is_unsigned);
  7863. }
  7864. }
  7865. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7866. #if CYTHON_USE_PYLONG_INTERNALS
  7867. #include "longintrepr.h"
  7868. #endif
  7869. #endif
  7870. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  7871. const long neg_one = (long) -1, const_zero = 0;
  7872. const int is_unsigned = neg_one > const_zero;
  7873. #if PY_MAJOR_VERSION < 3
  7874. if (likely(PyInt_Check(x))) {
  7875. if (sizeof(long) < sizeof(long)) {
  7876. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  7877. } else {
  7878. long val = PyInt_AS_LONG(x);
  7879. if (is_unsigned && unlikely(val < 0)) {
  7880. PyErr_SetString(PyExc_OverflowError,
  7881. "can't convert negative value to long");
  7882. return (long) -1;
  7883. }
  7884. return (long) val;
  7885. }
  7886. } else
  7887. #endif
  7888. if (likely(PyLong_Check(x))) {
  7889. if (is_unsigned) {
  7890. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7891. #if CYTHON_USE_PYLONG_INTERNALS
  7892. if (sizeof(digit) <= sizeof(long)) {
  7893. switch (Py_SIZE(x)) {
  7894. case 0: return 0;
  7895. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  7896. }
  7897. }
  7898. #endif
  7899. #endif
  7900. if (unlikely(Py_SIZE(x) < 0)) {
  7901. PyErr_SetString(PyExc_OverflowError,
  7902. "can't convert negative value to long");
  7903. return (long) -1;
  7904. }
  7905. if (sizeof(long) <= sizeof(unsigned long)) {
  7906. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  7907. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  7908. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  7909. }
  7910. } else {
  7911. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  7912. #if CYTHON_USE_PYLONG_INTERNALS
  7913. if (sizeof(digit) <= sizeof(long)) {
  7914. switch (Py_SIZE(x)) {
  7915. case 0: return 0;
  7916. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  7917. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  7918. }
  7919. }
  7920. #endif
  7921. #endif
  7922. if (sizeof(long) <= sizeof(long)) {
  7923. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  7924. } else if (sizeof(long) <= sizeof(long long)) {
  7925. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  7926. }
  7927. }
  7928. {
  7929. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  7930. PyErr_SetString(PyExc_RuntimeError,
  7931. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  7932. #else
  7933. long val;
  7934. PyObject *v = __Pyx_PyNumber_Int(x);
  7935. #if PY_MAJOR_VERSION < 3
  7936. if (likely(v) && !PyLong_Check(v)) {
  7937. PyObject *tmp = v;
  7938. v = PyNumber_Long(tmp);
  7939. Py_DECREF(tmp);
  7940. }
  7941. #endif
  7942. if (likely(v)) {
  7943. int one = 1; int is_little = (int)*(unsigned char *)&one;
  7944. unsigned char *bytes = (unsigned char *)&val;
  7945. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  7946. bytes, sizeof(val),
  7947. is_little, !is_unsigned);
  7948. Py_DECREF(v);
  7949. if (likely(!ret))
  7950. return val;
  7951. }
  7952. #endif
  7953. return (long) -1;
  7954. }
  7955. } else {
  7956. long val;
  7957. PyObject *tmp = __Pyx_PyNumber_Int(x);
  7958. if (!tmp) return (long) -1;
  7959. val = __Pyx_PyInt_As_long(tmp);
  7960. Py_DECREF(tmp);
  7961. return val;
  7962. }
  7963. }
  7964. static int __Pyx_check_binary_version(void) {
  7965. char ctversion[4], rtversion[4];
  7966. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  7967. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  7968. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  7969. char message[200];
  7970. PyOS_snprintf(message, sizeof(message),
  7971. "compiletime version %s of module '%.100s' "
  7972. "does not match runtime version %s",
  7973. ctversion, __Pyx_MODULE_NAME, rtversion);
  7974. #if PY_VERSION_HEX < 0x02050000
  7975. return PyErr_Warn(NULL, message);
  7976. #else
  7977. return PyErr_WarnEx(NULL, message, 1);
  7978. #endif
  7979. }
  7980. return 0;
  7981. }
  7982. #ifndef __PYX_HAVE_RT_ImportModule
  7983. #define __PYX_HAVE_RT_ImportModule
  7984. static PyObject *__Pyx_ImportModule(const char *name) {
  7985. PyObject *py_name = 0;
  7986. PyObject *py_module = 0;
  7987. py_name = __Pyx_PyIdentifier_FromString(name);
  7988. if (!py_name)
  7989. goto bad;
  7990. py_module = PyImport_Import(py_name);
  7991. Py_DECREF(py_name);
  7992. return py_module;
  7993. bad:
  7994. Py_XDECREF(py_name);
  7995. return 0;
  7996. }
  7997. #endif
  7998. #ifndef __PYX_HAVE_RT_ImportType
  7999. #define __PYX_HAVE_RT_ImportType
  8000. static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
  8001. size_t size, int strict)
  8002. {
  8003. PyObject *py_module = 0;
  8004. PyObject *result = 0;
  8005. PyObject *py_name = 0;
  8006. char warning[200];
  8007. Py_ssize_t basicsize;
  8008. #ifdef Py_LIMITED_API
  8009. PyObject *py_basicsize;
  8010. #endif
  8011. py_module = __Pyx_ImportModule(module_name);
  8012. if (!py_module)
  8013. goto bad;
  8014. py_name = __Pyx_PyIdentifier_FromString(class_name);
  8015. if (!py_name)
  8016. goto bad;
  8017. result = PyObject_GetAttr(py_module, py_name);
  8018. Py_DECREF(py_name);
  8019. py_name = 0;
  8020. Py_DECREF(py_module);
  8021. py_module = 0;
  8022. if (!result)
  8023. goto bad;
  8024. if (!PyType_Check(result)) {
  8025. PyErr_Format(PyExc_TypeError,
  8026. "%.200s.%.200s is not a type object",
  8027. module_name, class_name);
  8028. goto bad;
  8029. }
  8030. #ifndef Py_LIMITED_API
  8031. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  8032. #else
  8033. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  8034. if (!py_basicsize)
  8035. goto bad;
  8036. basicsize = PyLong_AsSsize_t(py_basicsize);
  8037. Py_DECREF(py_basicsize);
  8038. py_basicsize = 0;
  8039. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  8040. goto bad;
  8041. #endif
  8042. if (!strict && (size_t)basicsize > size) {
  8043. PyOS_snprintf(warning, sizeof(warning),
  8044. "%s.%s size changed, may indicate binary incompatibility",
  8045. module_name, class_name);
  8046. #if PY_VERSION_HEX < 0x02050000
  8047. if (PyErr_Warn(NULL, warning) < 0) goto bad;
  8048. #else
  8049. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  8050. #endif
  8051. }
  8052. else if ((size_t)basicsize != size) {
  8053. PyErr_Format(PyExc_ValueError,
  8054. "%.200s.%.200s has the wrong size, try recompiling",
  8055. module_name, class_name);
  8056. goto bad;
  8057. }
  8058. return (PyTypeObject *)result;
  8059. bad:
  8060. Py_XDECREF(py_module);
  8061. Py_XDECREF(result);
  8062. return NULL;
  8063. }
  8064. #endif
  8065. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  8066. int start = 0, mid = 0, end = count - 1;
  8067. if (end >= 0 && code_line > entries[end].code_line) {
  8068. return count;
  8069. }
  8070. while (start < end) {
  8071. mid = (start + end) / 2;
  8072. if (code_line < entries[mid].code_line) {
  8073. end = mid;
  8074. } else if (code_line > entries[mid].code_line) {
  8075. start = mid + 1;
  8076. } else {
  8077. return mid;
  8078. }
  8079. }
  8080. if (code_line <= entries[mid].code_line) {
  8081. return mid;
  8082. } else {
  8083. return mid + 1;
  8084. }
  8085. }
  8086. static PyCodeObject *__pyx_find_code_object(int code_line) {
  8087. PyCodeObject* code_object;
  8088. int pos;
  8089. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  8090. return NULL;
  8091. }
  8092. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8093. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  8094. return NULL;
  8095. }
  8096. code_object = __pyx_code_cache.entries[pos].code_object;
  8097. Py_INCREF(code_object);
  8098. return code_object;
  8099. }
  8100. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  8101. int pos, i;
  8102. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  8103. if (unlikely(!code_line)) {
  8104. return;
  8105. }
  8106. if (unlikely(!entries)) {
  8107. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  8108. if (likely(entries)) {
  8109. __pyx_code_cache.entries = entries;
  8110. __pyx_code_cache.max_count = 64;
  8111. __pyx_code_cache.count = 1;
  8112. entries[0].code_line = code_line;
  8113. entries[0].code_object = code_object;
  8114. Py_INCREF(code_object);
  8115. }
  8116. return;
  8117. }
  8118. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  8119. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  8120. PyCodeObject* tmp = entries[pos].code_object;
  8121. entries[pos].code_object = code_object;
  8122. Py_DECREF(tmp);
  8123. return;
  8124. }
  8125. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  8126. int new_max = __pyx_code_cache.max_count + 64;
  8127. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  8128. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  8129. if (unlikely(!entries)) {
  8130. return;
  8131. }
  8132. __pyx_code_cache.entries = entries;
  8133. __pyx_code_cache.max_count = new_max;
  8134. }
  8135. for (i=__pyx_code_cache.count; i>pos; i--) {
  8136. entries[i] = entries[i-1];
  8137. }
  8138. entries[pos].code_line = code_line;
  8139. entries[pos].code_object = code_object;
  8140. __pyx_code_cache.count++;
  8141. Py_INCREF(code_object);
  8142. }
  8143. #include "compile.h"
  8144. #include "frameobject.h"
  8145. #include "traceback.h"
  8146. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  8147. const char *funcname, int c_line,
  8148. int py_line, const char *filename) {
  8149. PyCodeObject *py_code = 0;
  8150. PyObject *py_srcfile = 0;
  8151. PyObject *py_funcname = 0;
  8152. #if PY_MAJOR_VERSION < 3
  8153. py_srcfile = PyString_FromString(filename);
  8154. #else
  8155. py_srcfile = PyUnicode_FromString(filename);
  8156. #endif
  8157. if (!py_srcfile) goto bad;
  8158. if (c_line) {
  8159. #if PY_MAJOR_VERSION < 3
  8160. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8161. #else
  8162. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  8163. #endif
  8164. }
  8165. else {
  8166. #if PY_MAJOR_VERSION < 3
  8167. py_funcname = PyString_FromString(funcname);
  8168. #else
  8169. py_funcname = PyUnicode_FromString(funcname);
  8170. #endif
  8171. }
  8172. if (!py_funcname) goto bad;
  8173. py_code = __Pyx_PyCode_New(
  8174. 0, /*int argcount,*/
  8175. 0, /*int kwonlyargcount,*/
  8176. 0, /*int nlocals,*/
  8177. 0, /*int stacksize,*/
  8178. 0, /*int flags,*/
  8179. __pyx_empty_bytes, /*PyObject *code,*/
  8180. __pyx_empty_tuple, /*PyObject *consts,*/
  8181. __pyx_empty_tuple, /*PyObject *names,*/
  8182. __pyx_empty_tuple, /*PyObject *varnames,*/
  8183. __pyx_empty_tuple, /*PyObject *freevars,*/
  8184. __pyx_empty_tuple, /*PyObject *cellvars,*/
  8185. py_srcfile, /*PyObject *filename,*/
  8186. py_funcname, /*PyObject *name,*/
  8187. py_line, /*int firstlineno,*/
  8188. __pyx_empty_bytes /*PyObject *lnotab*/
  8189. );
  8190. Py_DECREF(py_srcfile);
  8191. Py_DECREF(py_funcname);
  8192. return py_code;
  8193. bad:
  8194. Py_XDECREF(py_srcfile);
  8195. Py_XDECREF(py_funcname);
  8196. return NULL;
  8197. }
  8198. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  8199. int py_line, const char *filename) {
  8200. PyCodeObject *py_code = 0;
  8201. PyObject *py_globals = 0;
  8202. PyFrameObject *py_frame = 0;
  8203. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  8204. if (!py_code) {
  8205. py_code = __Pyx_CreateCodeObjectForTraceback(
  8206. funcname, c_line, py_line, filename);
  8207. if (!py_code) goto bad;
  8208. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  8209. }
  8210. py_globals = PyModule_GetDict(__pyx_m);
  8211. if (!py_globals) goto bad;
  8212. py_frame = PyFrame_New(
  8213. PyThreadState_GET(), /*PyThreadState *tstate,*/
  8214. py_code, /*PyCodeObject *code,*/
  8215. py_globals, /*PyObject *globals,*/
  8216. 0 /*PyObject *locals*/
  8217. );
  8218. if (!py_frame) goto bad;
  8219. py_frame->f_lineno = py_line;
  8220. PyTraceBack_Here(py_frame);
  8221. bad:
  8222. Py_XDECREF(py_code);
  8223. Py_XDECREF(py_frame);
  8224. }
  8225. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  8226. while (t->p) {
  8227. #if PY_MAJOR_VERSION < 3
  8228. if (t->is_unicode) {
  8229. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  8230. } else if (t->intern) {
  8231. *t->p = PyString_InternFromString(t->s);
  8232. } else {
  8233. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  8234. }
  8235. #else /* Python 3+ has unicode identifiers */
  8236. if (t->is_unicode | t->is_str) {
  8237. if (t->intern) {
  8238. *t->p = PyUnicode_InternFromString(t->s);
  8239. } else if (t->encoding) {
  8240. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  8241. } else {
  8242. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  8243. }
  8244. } else {
  8245. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  8246. }
  8247. #endif
  8248. if (!*t->p)
  8249. return -1;
  8250. ++t;
  8251. }
  8252. return 0;
  8253. }
  8254. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  8255. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  8256. }
  8257. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  8258. Py_ssize_t ignore;
  8259. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  8260. }
  8261. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  8262. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  8263. if (
  8264. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8265. __Pyx_sys_getdefaultencoding_not_ascii &&
  8266. #endif
  8267. PyUnicode_Check(o)) {
  8268. #if PY_VERSION_HEX < 0x03030000
  8269. char* defenc_c;
  8270. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  8271. if (!defenc) return NULL;
  8272. defenc_c = PyBytes_AS_STRING(defenc);
  8273. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8274. {
  8275. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  8276. char* c;
  8277. for (c = defenc_c; c < end; c++) {
  8278. if ((unsigned char) (*c) >= 128) {
  8279. PyUnicode_AsASCIIString(o);
  8280. return NULL;
  8281. }
  8282. }
  8283. }
  8284. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  8285. *length = PyBytes_GET_SIZE(defenc);
  8286. return defenc_c;
  8287. #else /* PY_VERSION_HEX < 0x03030000 */
  8288. if (PyUnicode_READY(o) == -1) return NULL;
  8289. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  8290. if (PyUnicode_IS_ASCII(o)) {
  8291. *length = PyUnicode_GET_LENGTH(o);
  8292. return PyUnicode_AsUTF8(o);
  8293. } else {
  8294. PyUnicode_AsASCIIString(o);
  8295. return NULL;
  8296. }
  8297. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  8298. return PyUnicode_AsUTF8AndSize(o, length);
  8299. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  8300. #endif /* PY_VERSION_HEX < 0x03030000 */
  8301. } else
  8302. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  8303. #if !CYTHON_COMPILING_IN_PYPY
  8304. #if PY_VERSION_HEX >= 0x02060000
  8305. if (PyByteArray_Check(o)) {
  8306. *length = PyByteArray_GET_SIZE(o);
  8307. return PyByteArray_AS_STRING(o);
  8308. } else
  8309. #endif
  8310. #endif
  8311. {
  8312. char* result;
  8313. int r = PyBytes_AsStringAndSize(o, &result, length);
  8314. if (unlikely(r < 0)) {
  8315. return NULL;
  8316. } else {
  8317. return result;
  8318. }
  8319. }
  8320. }
  8321. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  8322. int is_true = x == Py_True;
  8323. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  8324. else return PyObject_IsTrue(x);
  8325. }
  8326. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  8327. PyNumberMethods *m;
  8328. const char *name = NULL;
  8329. PyObject *res = NULL;
  8330. #if PY_MAJOR_VERSION < 3
  8331. if (PyInt_Check(x) || PyLong_Check(x))
  8332. #else
  8333. if (PyLong_Check(x))
  8334. #endif
  8335. return Py_INCREF(x), x;
  8336. m = Py_TYPE(x)->tp_as_number;
  8337. #if PY_MAJOR_VERSION < 3
  8338. if (m && m->nb_int) {
  8339. name = "int";
  8340. res = PyNumber_Int(x);
  8341. }
  8342. else if (m && m->nb_long) {
  8343. name = "long";
  8344. res = PyNumber_Long(x);
  8345. }
  8346. #else
  8347. if (m && m->nb_int) {
  8348. name = "int";
  8349. res = PyNumber_Long(x);
  8350. }
  8351. #endif
  8352. if (res) {
  8353. #if PY_MAJOR_VERSION < 3
  8354. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  8355. #else
  8356. if (!PyLong_Check(res)) {
  8357. #endif
  8358. PyErr_Format(PyExc_TypeError,
  8359. "__%.4s__ returned non-%.4s (type %.200s)",
  8360. name, name, Py_TYPE(res)->tp_name);
  8361. Py_DECREF(res);
  8362. return NULL;
  8363. }
  8364. }
  8365. else if (!PyErr_Occurred()) {
  8366. PyErr_SetString(PyExc_TypeError,
  8367. "an integer is required");
  8368. }
  8369. return res;
  8370. }
  8371. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8372. #if CYTHON_USE_PYLONG_INTERNALS
  8373. #include "longintrepr.h"
  8374. #endif
  8375. #endif
  8376. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  8377. Py_ssize_t ival;
  8378. PyObject *x;
  8379. #if PY_MAJOR_VERSION < 3
  8380. if (likely(PyInt_CheckExact(b)))
  8381. return PyInt_AS_LONG(b);
  8382. #endif
  8383. if (likely(PyLong_CheckExact(b))) {
  8384. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  8385. #if CYTHON_USE_PYLONG_INTERNALS
  8386. switch (Py_SIZE(b)) {
  8387. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  8388. case 0: return 0;
  8389. case 1: return ((PyLongObject*)b)->ob_digit[0];
  8390. }
  8391. #endif
  8392. #endif
  8393. #if PY_VERSION_HEX < 0x02060000
  8394. return PyInt_AsSsize_t(b);
  8395. #else
  8396. return PyLong_AsSsize_t(b);
  8397. #endif
  8398. }
  8399. x = PyNumber_Index(b);
  8400. if (!x) return -1;
  8401. ival = PyInt_AsSsize_t(x);
  8402. Py_DECREF(x);
  8403. return ival;
  8404. }
  8405. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  8406. #if PY_VERSION_HEX < 0x02050000
  8407. if (ival <= LONG_MAX)
  8408. return PyInt_FromLong((long)ival);
  8409. else {
  8410. unsigned char *bytes = (unsigned char *) &ival;
  8411. int one = 1; int little = (int)*(unsigned char*)&one;
  8412. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  8413. }
  8414. #else
  8415. return PyInt_FromSize_t(ival);
  8416. #endif
  8417. }
  8418. #endif /* Py_PYTHON_H */