-
Notifications
You must be signed in to change notification settings - Fork 0
/
rewrite.html
2143 lines (2121 loc) · 170 KB
/
rewrite.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!-- Generated by Cython 3.0.11 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cython: rewrite.pyx</title>
<style type="text/css">
body.cython { font-family: courier; font-size: 12; }
.cython.tag { }
.cython.line { color: #000000; margin: 0em }
.cython.code { font-size: 9; color: #444444; display: none; margin: 0px 0px 0px 8px; border-left: 8px none; }
.cython.line .run { background-color: #B0FFB0; }
.cython.line .mis { background-color: #FFB0B0; }
.cython.code.run { border-left: 8px solid #B0FFB0; }
.cython.code.mis { border-left: 8px solid #FFB0B0; }
.cython.code .py_c_api { color: red; }
.cython.code .py_macro_api { color: #FF7000; }
.cython.code .pyx_c_api { color: #FF3000; }
.cython.code .pyx_macro_api { color: #FF7000; }
.cython.code .refnanny { color: #FFA000; }
.cython.code .trace { color: #FFA000; }
.cython.code .error_goto { color: #FFA000; }
.cython.code .coerce { color: #008000; border: 1px dotted #008000 }
.cython.code .py_attr { color: #FF0000; font-weight: bold; }
.cython.code .c_attr { color: #0000FF; }
.cython.code .py_call { color: #FF0000; font-weight: bold; }
.cython.code .c_call { color: #0000FF; }
.cython.score-0 {background-color: #FFFFff;}
.cython.score-1 {background-color: #FFFFe7;}
.cython.score-2 {background-color: #FFFFd4;}
.cython.score-3 {background-color: #FFFFc4;}
.cython.score-4 {background-color: #FFFFb6;}
.cython.score-5 {background-color: #FFFFaa;}
.cython.score-6 {background-color: #FFFF9f;}
.cython.score-7 {background-color: #FFFF96;}
.cython.score-8 {background-color: #FFFF8d;}
.cython.score-9 {background-color: #FFFF86;}
.cython.score-10 {background-color: #FFFF7f;}
.cython.score-11 {background-color: #FFFF79;}
.cython.score-12 {background-color: #FFFF73;}
.cython.score-13 {background-color: #FFFF6e;}
.cython.score-14 {background-color: #FFFF6a;}
.cython.score-15 {background-color: #FFFF66;}
.cython.score-16 {background-color: #FFFF62;}
.cython.score-17 {background-color: #FFFF5e;}
.cython.score-18 {background-color: #FFFF5b;}
.cython.score-19 {background-color: #FFFF57;}
.cython.score-20 {background-color: #FFFF55;}
.cython.score-21 {background-color: #FFFF52;}
.cython.score-22 {background-color: #FFFF4f;}
.cython.score-23 {background-color: #FFFF4d;}
.cython.score-24 {background-color: #FFFF4b;}
.cython.score-25 {background-color: #FFFF48;}
.cython.score-26 {background-color: #FFFF46;}
.cython.score-27 {background-color: #FFFF44;}
.cython.score-28 {background-color: #FFFF43;}
.cython.score-29 {background-color: #FFFF41;}
.cython.score-30 {background-color: #FFFF3f;}
.cython.score-31 {background-color: #FFFF3e;}
.cython.score-32 {background-color: #FFFF3c;}
.cython.score-33 {background-color: #FFFF3b;}
.cython.score-34 {background-color: #FFFF39;}
.cython.score-35 {background-color: #FFFF38;}
.cython.score-36 {background-color: #FFFF37;}
.cython.score-37 {background-color: #FFFF36;}
.cython.score-38 {background-color: #FFFF35;}
.cython.score-39 {background-color: #FFFF34;}
.cython.score-40 {background-color: #FFFF33;}
.cython.score-41 {background-color: #FFFF32;}
.cython.score-42 {background-color: #FFFF31;}
.cython.score-43 {background-color: #FFFF30;}
.cython.score-44 {background-color: #FFFF2f;}
.cython.score-45 {background-color: #FFFF2e;}
.cython.score-46 {background-color: #FFFF2d;}
.cython.score-47 {background-color: #FFFF2c;}
.cython.score-48 {background-color: #FFFF2b;}
.cython.score-49 {background-color: #FFFF2b;}
.cython.score-50 {background-color: #FFFF2a;}
.cython.score-51 {background-color: #FFFF29;}
.cython.score-52 {background-color: #FFFF29;}
.cython.score-53 {background-color: #FFFF28;}
.cython.score-54 {background-color: #FFFF27;}
.cython.score-55 {background-color: #FFFF27;}
.cython.score-56 {background-color: #FFFF26;}
.cython.score-57 {background-color: #FFFF26;}
.cython.score-58 {background-color: #FFFF25;}
.cython.score-59 {background-color: #FFFF24;}
.cython.score-60 {background-color: #FFFF24;}
.cython.score-61 {background-color: #FFFF23;}
.cython.score-62 {background-color: #FFFF23;}
.cython.score-63 {background-color: #FFFF22;}
.cython.score-64 {background-color: #FFFF22;}
.cython.score-65 {background-color: #FFFF22;}
.cython.score-66 {background-color: #FFFF21;}
.cython.score-67 {background-color: #FFFF21;}
.cython.score-68 {background-color: #FFFF20;}
.cython.score-69 {background-color: #FFFF20;}
.cython.score-70 {background-color: #FFFF1f;}
.cython.score-71 {background-color: #FFFF1f;}
.cython.score-72 {background-color: #FFFF1f;}
.cython.score-73 {background-color: #FFFF1e;}
.cython.score-74 {background-color: #FFFF1e;}
.cython.score-75 {background-color: #FFFF1e;}
.cython.score-76 {background-color: #FFFF1d;}
.cython.score-77 {background-color: #FFFF1d;}
.cython.score-78 {background-color: #FFFF1c;}
.cython.score-79 {background-color: #FFFF1c;}
.cython.score-80 {background-color: #FFFF1c;}
.cython.score-81 {background-color: #FFFF1c;}
.cython.score-82 {background-color: #FFFF1b;}
.cython.score-83 {background-color: #FFFF1b;}
.cython.score-84 {background-color: #FFFF1b;}
.cython.score-85 {background-color: #FFFF1a;}
.cython.score-86 {background-color: #FFFF1a;}
.cython.score-87 {background-color: #FFFF1a;}
.cython.score-88 {background-color: #FFFF1a;}
.cython.score-89 {background-color: #FFFF19;}
.cython.score-90 {background-color: #FFFF19;}
.cython.score-91 {background-color: #FFFF19;}
.cython.score-92 {background-color: #FFFF19;}
.cython.score-93 {background-color: #FFFF18;}
.cython.score-94 {background-color: #FFFF18;}
.cython.score-95 {background-color: #FFFF18;}
.cython.score-96 {background-color: #FFFF18;}
.cython.score-97 {background-color: #FFFF17;}
.cython.score-98 {background-color: #FFFF17;}
.cython.score-99 {background-color: #FFFF17;}
.cython.score-100 {background-color: #FFFF17;}
.cython.score-101 {background-color: #FFFF16;}
.cython.score-102 {background-color: #FFFF16;}
.cython.score-103 {background-color: #FFFF16;}
.cython.score-104 {background-color: #FFFF16;}
.cython.score-105 {background-color: #FFFF16;}
.cython.score-106 {background-color: #FFFF15;}
.cython.score-107 {background-color: #FFFF15;}
.cython.score-108 {background-color: #FFFF15;}
.cython.score-109 {background-color: #FFFF15;}
.cython.score-110 {background-color: #FFFF15;}
.cython.score-111 {background-color: #FFFF15;}
.cython.score-112 {background-color: #FFFF14;}
.cython.score-113 {background-color: #FFFF14;}
.cython.score-114 {background-color: #FFFF14;}
.cython.score-115 {background-color: #FFFF14;}
.cython.score-116 {background-color: #FFFF14;}
.cython.score-117 {background-color: #FFFF14;}
.cython.score-118 {background-color: #FFFF13;}
.cython.score-119 {background-color: #FFFF13;}
.cython.score-120 {background-color: #FFFF13;}
.cython.score-121 {background-color: #FFFF13;}
.cython.score-122 {background-color: #FFFF13;}
.cython.score-123 {background-color: #FFFF13;}
.cython.score-124 {background-color: #FFFF13;}
.cython.score-125 {background-color: #FFFF12;}
.cython.score-126 {background-color: #FFFF12;}
.cython.score-127 {background-color: #FFFF12;}
.cython.score-128 {background-color: #FFFF12;}
.cython.score-129 {background-color: #FFFF12;}
.cython.score-130 {background-color: #FFFF12;}
.cython.score-131 {background-color: #FFFF12;}
.cython.score-132 {background-color: #FFFF11;}
.cython.score-133 {background-color: #FFFF11;}
.cython.score-134 {background-color: #FFFF11;}
.cython.score-135 {background-color: #FFFF11;}
.cython.score-136 {background-color: #FFFF11;}
.cython.score-137 {background-color: #FFFF11;}
.cython.score-138 {background-color: #FFFF11;}
.cython.score-139 {background-color: #FFFF11;}
.cython.score-140 {background-color: #FFFF11;}
.cython.score-141 {background-color: #FFFF10;}
.cython.score-142 {background-color: #FFFF10;}
.cython.score-143 {background-color: #FFFF10;}
.cython.score-144 {background-color: #FFFF10;}
.cython.score-145 {background-color: #FFFF10;}
.cython.score-146 {background-color: #FFFF10;}
.cython.score-147 {background-color: #FFFF10;}
.cython.score-148 {background-color: #FFFF10;}
.cython.score-149 {background-color: #FFFF10;}
.cython.score-150 {background-color: #FFFF0f;}
.cython.score-151 {background-color: #FFFF0f;}
.cython.score-152 {background-color: #FFFF0f;}
.cython.score-153 {background-color: #FFFF0f;}
.cython.score-154 {background-color: #FFFF0f;}
.cython.score-155 {background-color: #FFFF0f;}
.cython.score-156 {background-color: #FFFF0f;}
.cython.score-157 {background-color: #FFFF0f;}
.cython.score-158 {background-color: #FFFF0f;}
.cython.score-159 {background-color: #FFFF0f;}
.cython.score-160 {background-color: #FFFF0f;}
.cython.score-161 {background-color: #FFFF0e;}
.cython.score-162 {background-color: #FFFF0e;}
.cython.score-163 {background-color: #FFFF0e;}
.cython.score-164 {background-color: #FFFF0e;}
.cython.score-165 {background-color: #FFFF0e;}
.cython.score-166 {background-color: #FFFF0e;}
.cython.score-167 {background-color: #FFFF0e;}
.cython.score-168 {background-color: #FFFF0e;}
.cython.score-169 {background-color: #FFFF0e;}
.cython.score-170 {background-color: #FFFF0e;}
.cython.score-171 {background-color: #FFFF0e;}
.cython.score-172 {background-color: #FFFF0e;}
.cython.score-173 {background-color: #FFFF0d;}
.cython.score-174 {background-color: #FFFF0d;}
.cython.score-175 {background-color: #FFFF0d;}
.cython.score-176 {background-color: #FFFF0d;}
.cython.score-177 {background-color: #FFFF0d;}
.cython.score-178 {background-color: #FFFF0d;}
.cython.score-179 {background-color: #FFFF0d;}
.cython.score-180 {background-color: #FFFF0d;}
.cython.score-181 {background-color: #FFFF0d;}
.cython.score-182 {background-color: #FFFF0d;}
.cython.score-183 {background-color: #FFFF0d;}
.cython.score-184 {background-color: #FFFF0d;}
.cython.score-185 {background-color: #FFFF0d;}
.cython.score-186 {background-color: #FFFF0d;}
.cython.score-187 {background-color: #FFFF0c;}
.cython.score-188 {background-color: #FFFF0c;}
.cython.score-189 {background-color: #FFFF0c;}
.cython.score-190 {background-color: #FFFF0c;}
.cython.score-191 {background-color: #FFFF0c;}
.cython.score-192 {background-color: #FFFF0c;}
.cython.score-193 {background-color: #FFFF0c;}
.cython.score-194 {background-color: #FFFF0c;}
.cython.score-195 {background-color: #FFFF0c;}
.cython.score-196 {background-color: #FFFF0c;}
.cython.score-197 {background-color: #FFFF0c;}
.cython.score-198 {background-color: #FFFF0c;}
.cython.score-199 {background-color: #FFFF0c;}
.cython.score-200 {background-color: #FFFF0c;}
.cython.score-201 {background-color: #FFFF0c;}
.cython.score-202 {background-color: #FFFF0c;}
.cython.score-203 {background-color: #FFFF0b;}
.cython.score-204 {background-color: #FFFF0b;}
.cython.score-205 {background-color: #FFFF0b;}
.cython.score-206 {background-color: #FFFF0b;}
.cython.score-207 {background-color: #FFFF0b;}
.cython.score-208 {background-color: #FFFF0b;}
.cython.score-209 {background-color: #FFFF0b;}
.cython.score-210 {background-color: #FFFF0b;}
.cython.score-211 {background-color: #FFFF0b;}
.cython.score-212 {background-color: #FFFF0b;}
.cython.score-213 {background-color: #FFFF0b;}
.cython.score-214 {background-color: #FFFF0b;}
.cython.score-215 {background-color: #FFFF0b;}
.cython.score-216 {background-color: #FFFF0b;}
.cython.score-217 {background-color: #FFFF0b;}
.cython.score-218 {background-color: #FFFF0b;}
.cython.score-219 {background-color: #FFFF0b;}
.cython.score-220 {background-color: #FFFF0b;}
.cython.score-221 {background-color: #FFFF0b;}
.cython.score-222 {background-color: #FFFF0a;}
.cython.score-223 {background-color: #FFFF0a;}
.cython.score-224 {background-color: #FFFF0a;}
.cython.score-225 {background-color: #FFFF0a;}
.cython.score-226 {background-color: #FFFF0a;}
.cython.score-227 {background-color: #FFFF0a;}
.cython.score-228 {background-color: #FFFF0a;}
.cython.score-229 {background-color: #FFFF0a;}
.cython.score-230 {background-color: #FFFF0a;}
.cython.score-231 {background-color: #FFFF0a;}
.cython.score-232 {background-color: #FFFF0a;}
.cython.score-233 {background-color: #FFFF0a;}
.cython.score-234 {background-color: #FFFF0a;}
.cython.score-235 {background-color: #FFFF0a;}
.cython.score-236 {background-color: #FFFF0a;}
.cython.score-237 {background-color: #FFFF0a;}
.cython.score-238 {background-color: #FFFF0a;}
.cython.score-239 {background-color: #FFFF0a;}
.cython.score-240 {background-color: #FFFF0a;}
.cython.score-241 {background-color: #FFFF0a;}
.cython.score-242 {background-color: #FFFF0a;}
.cython.score-243 {background-color: #FFFF0a;}
.cython.score-244 {background-color: #FFFF0a;}
.cython.score-245 {background-color: #FFFF0a;}
.cython.score-246 {background-color: #FFFF09;}
.cython.score-247 {background-color: #FFFF09;}
.cython.score-248 {background-color: #FFFF09;}
.cython.score-249 {background-color: #FFFF09;}
.cython.score-250 {background-color: #FFFF09;}
.cython.score-251 {background-color: #FFFF09;}
.cython.score-252 {background-color: #FFFF09;}
.cython.score-253 {background-color: #FFFF09;}
.cython.score-254 {background-color: #FFFF09;}
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.cython .hll { background-color: #ffffcc }
.cython { background: #f8f8f8; }
.cython .c { color: #3D7B7B; font-style: italic } /* Comment */
.cython .err { border: 1px solid #FF0000 } /* Error */
.cython .k { color: #008000; font-weight: bold } /* Keyword */
.cython .o { color: #666666 } /* Operator */
.cython .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.cython .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.cython .cp { color: #9C6500 } /* Comment.Preproc */
.cython .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.cython .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.cython .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.cython .gd { color: #A00000 } /* Generic.Deleted */
.cython .ge { font-style: italic } /* Generic.Emph */
.cython .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.cython .gr { color: #E40000 } /* Generic.Error */
.cython .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.cython .gi { color: #008400 } /* Generic.Inserted */
.cython .go { color: #717171 } /* Generic.Output */
.cython .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.cython .gs { font-weight: bold } /* Generic.Strong */
.cython .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.cython .gt { color: #0044DD } /* Generic.Traceback */
.cython .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.cython .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.cython .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.cython .kp { color: #008000 } /* Keyword.Pseudo */
.cython .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.cython .kt { color: #B00040 } /* Keyword.Type */
.cython .m { color: #666666 } /* Literal.Number */
.cython .s { color: #BA2121 } /* Literal.String */
.cython .na { color: #687822 } /* Name.Attribute */
.cython .nb { color: #008000 } /* Name.Builtin */
.cython .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.cython .no { color: #880000 } /* Name.Constant */
.cython .nd { color: #AA22FF } /* Name.Decorator */
.cython .ni { color: #717171; font-weight: bold } /* Name.Entity */
.cython .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.cython .nf { color: #0000FF } /* Name.Function */
.cython .nl { color: #767600 } /* Name.Label */
.cython .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.cython .nt { color: #008000; font-weight: bold } /* Name.Tag */
.cython .nv { color: #19177C } /* Name.Variable */
.cython .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.cython .w { color: #bbbbbb } /* Text.Whitespace */
.cython .mb { color: #666666 } /* Literal.Number.Bin */
.cython .mf { color: #666666 } /* Literal.Number.Float */
.cython .mh { color: #666666 } /* Literal.Number.Hex */
.cython .mi { color: #666666 } /* Literal.Number.Integer */
.cython .mo { color: #666666 } /* Literal.Number.Oct */
.cython .sa { color: #BA2121 } /* Literal.String.Affix */
.cython .sb { color: #BA2121 } /* Literal.String.Backtick */
.cython .sc { color: #BA2121 } /* Literal.String.Char */
.cython .dl { color: #BA2121 } /* Literal.String.Delimiter */
.cython .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.cython .s2 { color: #BA2121 } /* Literal.String.Double */
.cython .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.cython .sh { color: #BA2121 } /* Literal.String.Heredoc */
.cython .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.cython .sx { color: #008000 } /* Literal.String.Other */
.cython .sr { color: #A45A77 } /* Literal.String.Regex */
.cython .s1 { color: #BA2121 } /* Literal.String.Single */
.cython .ss { color: #19177C } /* Literal.String.Symbol */
.cython .bp { color: #008000 } /* Name.Builtin.Pseudo */
.cython .fm { color: #0000FF } /* Name.Function.Magic */
.cython .vc { color: #19177C } /* Name.Variable.Class */
.cython .vg { color: #19177C } /* Name.Variable.Global */
.cython .vi { color: #19177C } /* Name.Variable.Instance */
.cython .vm { color: #19177C } /* Name.Variable.Magic */
.cython .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
</head>
<body class="cython">
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 3.0.11</span></p>
<p>
<span style="background-color: #FFFF00">Yellow lines</span> hint at Python interaction.<br />
Click on a line that starts with a "<code>+</code>" to see the C code that Cython generated for it.
</p>
<p>Raw output: <a href="rewrite.c">rewrite.c</a></p>
<div class="cython"><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">001</span>: <span class="c"># cython: language_level=3, boundscheck=False, wraparound=False</span></pre>
<pre class='cython code score-8 '> __pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyDict_NewPresized</span>(0);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) <span class='error_goto'>__PYX_ERR(0, 1, __pyx_L1_error)</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-0"> <span class="">002</span>: </pre>
<pre class="cython line score-0"> <span class="">003</span>: <span class="k">from</span> <span class="nn">libc.math</span> <span class="k">cimport</span> <span class="n">exp</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">sin</span></pre>
<pre class="cython line score-0"> <span class="">004</span>: <span class="k">cimport</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span></pre>
<pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">005</span>: <span class="k">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span></pre>
<pre class='cython code score-8 '> __pyx_t_7 = <span class='pyx_c_api'>__Pyx_ImportDottedModule</span>(__pyx_n_s_numpy, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) <span class='error_goto'>__PYX_ERR(0, 5, __pyx_L1_error)</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
</pre><pre class="cython line score-0"> <span class="">006</span>: <span class="k">from</span> <span class="nn">cython.parallel</span> <span class="k">import</span> <span class="n">prange</span><span class="p">,</span> <span class="n">parallel</span></pre>
<pre class="cython line score-0"> <span class="">007</span>: <span class="k">from</span> <span class="nn">libc.stdlib</span> <span class="k">cimport</span> <span class="n">malloc</span><span class="p">,</span> <span class="n">free</span></pre>
<pre class="cython line score-31" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">008</span>: <span class="k">from</span> <span class="nn">typing</span> <span class="k">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Dict</span></pre>
<pre class='cython code score-31 '> __pyx_t_7 = <span class='py_c_api'>PyList_New</span>(2);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_List);
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_List);
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_7, 0, __pyx_n_s_List)) <span class='error_goto'>__PYX_ERR(0, 8, __pyx_L1_error)</span>;
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Dict);
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Dict);
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_7, 1, __pyx_n_s_Dict)) <span class='error_goto'>__PYX_ERR(0, 8, __pyx_L1_error)</span>;
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_typing, __pyx_t_7, 0);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_4, __pyx_n_s_List);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_List, __pyx_t_7) < 0) <span class='error_goto'>__PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_4, __pyx_n_s_Dict);<span class='error_goto'> if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_7);
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Dict, __pyx_t_7) < 0) <span class='error_goto'>__PYX_ERR(0, 8, __pyx_L1_error)</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_7); __pyx_t_7 = 0;
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
</pre><pre class="cython line score-0"> <span class="">009</span>: </pre>
<pre class="cython line score-109" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">010</span>: <span class="k">cpdef</span> <span class="kt">np</span>.<span class="kt">ndarray</span>[<span class="nf">complex</span><span class="p">,</span> <span class="nf">ndim</span><span class="o">=</span><span class="mf">1</span><span class="p">]</span> <span class="n">cython_stable_sdft</span><span class="p">(</span><span class="nb">complex</span><span class="p">[::</span><span class="mf">1</span><span class="p">]</span> <span class="n">signal</span><span class="p">,</span> <span class="nb">int</span> <span class="n">N</span><span class="p">,</span> <span class="nb">int</span> <span class="n">k</span><span class="p">):</span></pre>
<pre class='cython code score-109 '>static PyObject *__pyx_pw_7rewrite_1cython_stable_sdft(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyArrayObject *__pyx_f_7rewrite_cython_stable_sdft(__Pyx_memviewslice __pyx_v_signal, int __pyx_v_N, int __pyx_v_k, CYTHON_UNUSED int __pyx_skip_dispatch) {
int __pyx_v_n;
__pyx_t_double_complex __pyx_v_exp_factor;
__pyx_t_double_complex __pyx_v_cos_factor;
__pyx_t_double_complex *__pyx_v_B;
__pyx_t_double_complex *__pyx_v_A;
__pyx_t_double_complex *__pyx_v_y;
__pyx_t_double_complex *__pyx_v_norm_factor;
int __pyx_v_i;
int __pyx_v_j;
__pyx_t_double_complex *__pyx_v_x;
__pyx_t_double_complex __pyx_v_sum_val;
PyObject *__pyx_v_result = NULL;
PyArrayObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_12);
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_13);
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_14);
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_15);
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("rewrite.cython_stable_sdft", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_result);
<span class='refnanny'>__Pyx_XGIVEREF</span>((PyObject *)__pyx_r);
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_7rewrite_1cython_stable_sdft(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_7rewrite_cython_stable_sdft, "\n Compute the Stable SDFT of a given signal at frequency bin k.\n\n Parameters:\n signal (complex[::1]): Input signal array.\n N (int): Number of points in the DFT.\n k (int): Frequency bin index.\n\n Returns:\n np.ndarray[complex, ndim=1]: The computed SDFT at frequency bin k.\n ");
static PyMethodDef __pyx_mdef_7rewrite_1cython_stable_sdft = {"cython_stable_sdft", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_7rewrite_1cython_stable_sdft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_7rewrite_cython_stable_sdft};
static PyObject *__pyx_pw_7rewrite_1cython_stable_sdft(PyObject *__pyx_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
__Pyx_memviewslice __pyx_v_signal = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_N;
int __pyx_v_k;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("cython_stable_sdft (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_MACROS
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
#else
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
{
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signal,&__pyx_n_s_N,&__pyx_n_s_k,0};
PyObject* values[3] = {0,0,0};
if (__pyx_kwds) {
Py_ssize_t kw_args;
switch (__pyx_nargs) {
case 3: values[2] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
switch (__pyx_nargs) {
case 0:
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_signal)) != 0)) {
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
kw_args--;
}
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_N)) != 0)) {
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[1]);
kw_args--;
}
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
else {
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("cython_stable_sdft", 1, 3, 3, 1); <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[2]);
kw_args--;
}
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
else {
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("cython_stable_sdft", 1, 3, 3, 2); <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
}
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "cython_stable_sdft") < 0)) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
values[1] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 1);
values[2] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 2);
}
__pyx_v_signal = <span class='pyx_c_api'>__Pyx_PyObject_to_MemoryviewSlice_dc___pyx_t_double_complex</span>(values[0], PyBUF_WRITABLE);<span class='error_goto'> if (unlikely(!__pyx_v_signal.memview)) __PYX_ERR(0, 10, __pyx_L3_error)</span>
__pyx_v_N = <span class='pyx_c_api'>__Pyx_PyInt_As_int</span>(values[1]); if (unlikely((__pyx_v_N == (int)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
__pyx_v_k = <span class='pyx_c_api'>__Pyx_PyInt_As_int</span>(values[2]); if (unlikely((__pyx_v_k == (int)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("cython_stable_sdft", 1, 3, 3, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L3_error)</span>
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
{
Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
}
}
__PYX_XCLEAR_MEMVIEW(&__pyx_v_signal, 1);
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("rewrite.cython_stable_sdft", __pyx_clineno, __pyx_lineno, __pyx_filename);
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_7rewrite_cython_stable_sdft(__pyx_self, __pyx_v_signal, __pyx_v_N, __pyx_v_k);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
__PYX_XCLEAR_MEMVIEW(&__pyx_v_signal, 1);
{
Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
}
}
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
return __pyx_r;
}
static PyObject *__pyx_pf_7rewrite_cython_stable_sdft(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_signal, int __pyx_v_N, int __pyx_v_k) {
PyObject *__pyx_r = NULL;
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
if (unlikely(!__pyx_v_signal.memview)) { <span class='pyx_c_api'>__Pyx_RaiseUnboundLocalError</span>("signal"); <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L1_error)</span> }
__pyx_t_1 = ((PyObject *)__pyx_f_7rewrite_cython_stable_sdft(__pyx_v_signal, __pyx_v_N, __pyx_v_k, 0));<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("rewrite.cython_stable_sdft", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
return __pyx_r;
}
/* … */
__pyx_tuple__32 = <span class='py_c_api'>PyTuple_Pack</span>(3, __pyx_n_s_signal, __pyx_n_s_N, __pyx_n_s_k);<span class='error_goto'> if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 10, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__32);
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__32);
/* … */
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_7rewrite_1cython_stable_sdft, 0, __pyx_n_s_cython_stable_sdft, NULL, __pyx_n_s_rewrite, __pyx_d, ((PyObject *)__pyx_codeobj__33));<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_cython_stable_sdft, __pyx_t_4) < 0) <span class='error_goto'>__PYX_ERR(0, 10, __pyx_L1_error)</span>
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
__pyx_codeobj__33 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_rewrite_pyx, __pyx_n_s_cython_stable_sdft, 10, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 10, __pyx_L1_error)</span>
</pre><pre class="cython line score-0"> <span class="">011</span>: <span class="w"> </span><span class="sd">"""</span></pre>
<pre class="cython line score-0"> <span class="">012</span>: <span class="sd"> Compute the Stable SDFT of a given signal at frequency bin k.</span></pre>
<pre class="cython line score-0"> <span class="">013</span>: </pre>
<pre class="cython line score-0"> <span class="">014</span>: <span class="sd"> Parameters:</span></pre>
<pre class="cython line score-0"> <span class="">015</span>: <span class="sd"> signal (complex[::1]): Input signal array.</span></pre>
<pre class="cython line score-0"> <span class="">016</span>: <span class="sd"> N (int): Number of points in the DFT.</span></pre>
<pre class="cython line score-0"> <span class="">017</span>: <span class="sd"> k (int): Frequency bin index.</span></pre>
<pre class="cython line score-0"> <span class="">018</span>: </pre>
<pre class="cython line score-0"> <span class="">019</span>: <span class="sd"> Returns:</span></pre>
<pre class="cython line score-0"> <span class="">020</span>: <span class="sd"> np.ndarray[complex, ndim=1]: The computed SDFT at frequency bin k.</span></pre>
<pre class="cython line score-0"> <span class="">021</span>: <span class="sd"> """</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">022</span>: <span class="k">cdef</span> <span class="kt">int</span> <span class="nf">n</span> <span class="o">=</span> <span class="n">signal</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span></pre>
<pre class='cython code score-0 '> __pyx_v_n = (__pyx_v_signal.shape[0]);
</pre><pre class="cython line score-0"> <span class="">023</span>: <span class="k">cdef</span> <span class="kt">complex</span> <span class="nf">exp_factor</span><span class="p">,</span> <span class="nf">cos_factor</span></pre>
<pre class="cython line score-0"> <span class="">024</span>: <span class="k">cdef</span> <span class="kt">complex</span> *<span class="nf">B</span></pre>
<pre class="cython line score-0"> <span class="">025</span>: <span class="k">cdef</span> <span class="kt">complex</span> *<span class="nf">A</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">026</span>: <span class="k">cdef</span> <span class="kt">complex</span> *<span class="nf">y</span> <span class="o">=</span> <span class="o"><</span><span class="nb">complex</span> <span class="o">*></span> <span class="n">malloc</span><span class="p">(</span><span class="n">n</span> <span class="o">*</span> <span class="n">sizeof</span><span class="p">(</span><span class="nb">complex</span><span class="p">))</span></pre>
<pre class='cython code score-0 '> __pyx_v_y = ((__pyx_t_double_complex *)malloc((__pyx_v_n * (sizeof(__pyx_t_double_complex)))));
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">027</span>: <span class="k">cdef</span> <span class="kt">complex</span> *<span class="nf">norm_factor</span> <span class="o">=</span> <span class="o"><</span><span class="nb">complex</span> <span class="o">*></span> <span class="n">malloc</span><span class="p">(</span><span class="n">n</span> <span class="o">*</span> <span class="n">sizeof</span><span class="p">(</span><span class="nb">complex</span><span class="p">))</span></pre>
<pre class='cython code score-0 '> __pyx_v_norm_factor = ((__pyx_t_double_complex *)malloc((__pyx_v_n * (sizeof(__pyx_t_double_complex)))));
</pre><pre class="cython line score-0"> <span class="">028</span>: <span class="k">cdef</span> <span class="kt">int</span> <span class="nf">i</span><span class="p">,</span> <span class="nf">j</span></pre>
<pre class="cython line score-0"> <span class="">029</span>: </pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">030</span>: <span class="k">if</span> <span class="n">y</span> <span class="ow">is</span> <span class="bp">NULL</span> <span class="ow">or</span> <span class="n">norm_factor</span> <span class="ow">is</span> <span class="bp">NULL</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_2 = (__pyx_v_y == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_norm_factor == NULL);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* … */
}
</pre><pre class="cython line score-10" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">031</span>: <span class="k">raise</span> <span class="ne">MemoryError</span><span class="p">(</span><span class="s">"Could not allocate buffer."</span><span class="p">)</span></pre>
<pre class='cython code score-10 '> __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
<span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_3, 0, 0, 0);
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
<span class='error_goto'>__PYX_ERR(0, 31, __pyx_L1_error)</span>
/* … */
__pyx_tuple__11 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Could_not_allocate_buffer);<span class='error_goto'> if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 31, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__11);
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__11);
</pre><pre class="cython line score-0"> <span class="">032</span>: </pre>
<pre class="cython line score-0"> <span class="">033</span>: <span class="c"># Calculate filter coefficients</span></pre>
<pre class="cython line score-10" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">034</span>: <span class="n">exp_factor</span> <span class="o">=</span> <span class="n">cos</span><span class="p">(</span><span class="mf">2</span> <span class="o">*</span> <span class="n">pi</span> <span class="o">*</span> <span class="n">k</span> <span class="o">/</span> <span class="n">N</span><span class="p">)</span> <span class="o">+</span> <span class="mf">1</span><span class="n">j</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="mf">2</span> <span class="o">*</span> <span class="n">pi</span> <span class="o">*</span> <span class="n">k</span> <span class="o">/</span> <span class="n">N</span><span class="p">)</span></pre>
<pre class='cython code score-10 '> __pyx_t_4 = ((2.0 * M_PI) * __pyx_v_k);
if (unlikely(__pyx_v_N == 0)) {
<span class='py_c_api'>PyErr_SetString</span>(PyExc_ZeroDivisionError, "float division");
<span class='error_goto'>__PYX_ERR(0, 34, __pyx_L1_error)</span>
}
__pyx_t_5 = ((2.0 * M_PI) * __pyx_v_k);
if (unlikely(__pyx_v_N == 0)) {
<span class='py_c_api'>PyErr_SetString</span>(PyExc_ZeroDivisionError, "float division");
<span class='error_goto'>__PYX_ERR(0, 34, __pyx_L1_error)</span>
}
__pyx_v_exp_factor = __Pyx_c_sum_double(__pyx_t_double_complex_from_parts(cos((__pyx_t_4 / ((double)__pyx_v_N))), 0), __Pyx_c_prod_double(__pyx_t_double_complex_from_parts(0, 1.0), __pyx_t_double_complex_from_parts(sin((__pyx_t_5 / ((double)__pyx_v_N))), 0)));
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">035</span>: <span class="n">cos_factor</span> <span class="o">=</span> <span class="o">-</span><span class="mf">2</span> <span class="o">*</span> <span class="n">cos</span><span class="p">(</span><span class="mf">2</span> <span class="o">*</span> <span class="n">pi</span> <span class="o">*</span> <span class="n">k</span> <span class="o">/</span> <span class="n">N</span><span class="p">)</span></pre>
<pre class='cython code score-5 '> __pyx_t_5 = ((2.0 * M_PI) * __pyx_v_k);
if (unlikely(__pyx_v_N == 0)) {
<span class='py_c_api'>PyErr_SetString</span>(PyExc_ZeroDivisionError, "float division");
<span class='error_goto'>__PYX_ERR(0, 35, __pyx_L1_error)</span>
}
__pyx_v_cos_factor = __pyx_t_double_complex_from_parts((-2.0 * cos((__pyx_t_5 / ((double)__pyx_v_N)))), 0);
</pre><pre class="cython line score-0"> <span class="">036</span>: </pre>
<pre class="cython line score-0"> <span class="">037</span>: <span class="c"># Allocate coefficient arrays</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">038</span>: <span class="n">B</span> <span class="o">=</span> <span class="o"><</span><span class="nb">complex</span> <span class="o">*></span> <span class="n">malloc</span><span class="p">(</span><span class="mf">4</span> <span class="o">*</span> <span class="n">sizeof</span><span class="p">(</span><span class="nb">complex</span><span class="p">))</span></pre>
<pre class='cython code score-0 '> __pyx_v_B = ((__pyx_t_double_complex *)malloc((4 * (sizeof(__pyx_t_double_complex)))));
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">039</span>: <span class="n">A</span> <span class="o">=</span> <span class="o"><</span><span class="nb">complex</span> <span class="o">*></span> <span class="n">malloc</span><span class="p">(</span><span class="mf">3</span> <span class="o">*</span> <span class="n">sizeof</span><span class="p">(</span><span class="nb">complex</span><span class="p">))</span></pre>
<pre class='cython code score-0 '> __pyx_v_A = ((__pyx_t_double_complex *)malloc((3 * (sizeof(__pyx_t_double_complex)))));
</pre><pre class="cython line score-0"> <span class="">040</span>: </pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">041</span>: <span class="k">if</span> <span class="n">B</span> <span class="ow">is</span> <span class="bp">NULL</span> <span class="ow">or</span> <span class="n">A</span> <span class="ow">is</span> <span class="bp">NULL</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_2 = (__pyx_v_B == NULL);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_2 = (__pyx_v_A == NULL);
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* … */
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">042</span>: <span class="n">free</span><span class="p">(</span><span class="n">y</span><span class="p">)</span></pre>
<pre class='cython code score-0 '> free(__pyx_v_y);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">043</span>: <span class="n">free</span><span class="p">(</span><span class="n">norm_factor</span><span class="p">)</span></pre>
<pre class='cython code score-0 '> free(__pyx_v_norm_factor);
</pre><pre class="cython line score-10" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">044</span>: <span class="k">raise</span> <span class="ne">MemoryError</span><span class="p">(</span><span class="s">"Could not allocate coefficient buffers."</span><span class="p">)</span></pre>
<pre class='cython code score-10 '> __pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_Call</span>(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
<span class='pyx_c_api'>__Pyx_Raise</span>(__pyx_t_3, 0, 0, 0);
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
<span class='error_goto'>__PYX_ERR(0, 44, __pyx_L1_error)</span>
/* … */
__pyx_tuple__12 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_kp_u_Could_not_allocate_coefficient_b);<span class='error_goto'> if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 44, __pyx_L1_error)</span>
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__12);
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__12);
</pre><pre class="cython line score-0"> <span class="">045</span>: </pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">046</span>: <span class="n">B</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">exp_factor</span> <span class="c"># Corresponds to z^0 term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_B[0]) = __pyx_v_exp_factor;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">047</span>: <span class="n">B</span><span class="p">[</span><span class="mf">1</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="mf">1</span> <span class="c"># Corresponds to z^{-1} term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_B[1]) = __pyx_t_double_complex_from_parts(-1L, 0);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">048</span>: <span class="n">B</span><span class="p">[</span><span class="mf">2</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">exp_factor</span> <span class="c"># Corresponds to z^{-2} term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_B[2]) = __Pyx_c_neg_double(__pyx_v_exp_factor);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">049</span>: <span class="n">B</span><span class="p">[</span><span class="mf">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1</span> <span class="c"># Corresponds to z^{-3} term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_B[3]) = __pyx_t_double_complex_from_parts(1, 0);
</pre><pre class="cython line score-0"> <span class="">050</span>: </pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">051</span>: <span class="n">A</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1</span> <span class="c"># Corresponds to z^0 term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_A[0]) = __pyx_t_double_complex_from_parts(1, 0);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">052</span>: <span class="n">A</span><span class="p">[</span><span class="mf">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">cos_factor</span> <span class="c"># Corresponds to z^{-1} term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_A[1]) = __pyx_v_cos_factor;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">053</span>: <span class="n">A</span><span class="p">[</span><span class="mf">2</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1</span> <span class="c"># Corresponds to z^{-2} term</span></pre>
<pre class='cython code score-0 '> (__pyx_v_A[2]) = __pyx_t_double_complex_from_parts(1, 0);
</pre><pre class="cython line score-0"> <span class="">054</span>: </pre>
<pre class="cython line score-0"> <span class="">055</span>: <span class="c"># Apply the filter to the signal</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">056</span>: <span class="k">cdef</span> <span class="kt">complex</span> *<span class="nf">x</span> <span class="o">=</span> <span class="o">&</span><span class="n">signal</span><span class="p">[</span><span class="mf">0</span><span class="p">]</span> <span class="c"># Direct pointer to the input signal</span></pre>
<pre class='cython code score-0 '> __pyx_t_6 = 0;
__pyx_v_x = (&(*((__pyx_t_double_complex *) ( /* dim=0 */ ((char *) (((__pyx_t_double_complex *) __pyx_v_signal.data) + __pyx_t_6)) ))));
</pre><pre class="cython line score-0"> <span class="">057</span>: </pre>
<pre class="cython line score-0"> <span class="">058</span>: <span class="c"># Initialize output array</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">059</span>: <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> __pyx_t_7 = __pyx_v_n;
__pyx_t_8 = __pyx_t_7;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">060</span>: <span class="n">y</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-0 '> (__pyx_v_y[__pyx_v_i]) = __pyx_t_double_complex_from_parts(0, 0);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">061</span>: <span class="n">norm_factor</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0</span></pre>
<pre class='cython code score-0 '> (__pyx_v_norm_factor[__pyx_v_i]) = __pyx_t_double_complex_from_parts(0, 0);
}
</pre><pre class="cython line score-0"> <span class="">062</span>: </pre>
<pre class="cython line score-0"> <span class="">063</span>: <span class="k">cdef</span> <span class="kt">complex</span> <span class="nf">sum_val</span></pre>
<pre class="cython line score-0"> <span class="">064</span>: </pre>
<pre class="cython line score-0"> <span class="">065</span>: <span class="c"># Apply the filter</span></pre>
<pre class="cython line score-4" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">066</span>: <span class="k">with</span> <span class="k">nogil</span><span class="p">:</span></pre>
<pre class='cython code score-4 '> {
#ifdef WITH_THREAD
PyThreadState *_save;
_save = NULL;
Py_UNBLOCK_THREADS
<span class='pyx_c_api'>__Pyx_FastGIL_Remember</span>();
#endif
/*try:*/ {
/* … */
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_FastGIL_Forget</span>();
Py_BLOCK_THREADS
#endif
goto __pyx_L13;
}
__pyx_L13:;
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">067</span>: <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> __pyx_t_7 = __pyx_v_n;
__pyx_t_8 = __pyx_t_7;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
</pre><pre class="cython line score-0"> <span class="">068</span>: <span class="c"># Feedforward part</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">069</span>: <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mf">4</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> for (__pyx_t_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">070</span>: <span class="k">if</span> <span class="n">i</span> <span class="o">-</span> <span class="n">j</span> <span class="o">>=</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_1 = ((__pyx_v_i - __pyx_v_j) >= 0);
if (__pyx_t_1) {
/* … */
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">071</span>: <span class="n">sum_val</span> <span class="o">+=</span> <span class="n">B</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">*</span> <span class="n">x</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="n">j</span><span class="p">]</span></pre>
<pre class='cython code score-0 '> __pyx_v_sum_val = __Pyx_c_sum_double(__pyx_v_sum_val, __Pyx_c_prod_double((__pyx_v_B[__pyx_v_j]), (__pyx_v_x[(__pyx_v_i - __pyx_v_j)])));
</pre><pre class="cython line score-0"> <span class="">072</span>: <span class="c"># Feedback part</span></pre>
<pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">073</span>: <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mf">1</span><span class="p">,</span> <span class="mf">3</span><span class="p">):</span> <span class="c"># Skip A[0] because it's assumed to be 1</span></pre>
<pre class='cython code score-0 '> for (__pyx_t_10 = 1; __pyx_t_10 < 3; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">074</span>: <span class="k">if</span> <span class="n">i</span> <span class="o">-</span> <span class="n">j</span> <span class="o">>=</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_1 = ((__pyx_v_i - __pyx_v_j) >= 0);
if (__pyx_t_1) {
/* … */
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">075</span>: <span class="n">sum_val</span> <span class="o">-=</span> <span class="n">A</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">*</span> <span class="n">y</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="n">j</span><span class="p">]</span></pre>
<pre class='cython code score-0 '> __pyx_v_sum_val = __Pyx_c_diff_double(__pyx_v_sum_val, __Pyx_c_prod_double((__pyx_v_A[__pyx_v_j]), (__pyx_v_y[(__pyx_v_i - __pyx_v_j)])));
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">076</span>: <span class="n">y</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">sum_val</span></pre>
<pre class='cython code score-0 '> (__pyx_v_y[__pyx_v_i]) = __pyx_v_sum_val;
}
}
</pre><pre class="cython line score-0"> <span class="">077</span>: </pre>
<pre class="cython line score-0"> <span class="">078</span>: <span class="c"># Compute normalization factor</span></pre>
<pre class="cython line score-4" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">079</span>: <span class="k">with</span> <span class="k">nogil</span><span class="p">:</span></pre>
<pre class='cython code score-4 '> {
#ifdef WITH_THREAD
PyThreadState *_save;
_save = NULL;
Py_UNBLOCK_THREADS
<span class='pyx_c_api'>__Pyx_FastGIL_Remember</span>();
#endif
/*try:*/ {
/* … */
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_FastGIL_Forget</span>();
Py_BLOCK_THREADS
#endif
goto __pyx_L24;
}
__pyx_L24:;
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">080</span>: <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> __pyx_t_7 = __pyx_v_n;
__pyx_t_8 = __pyx_t_7;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">081</span>: <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mf">3</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> for (__pyx_t_10 = 0; __pyx_t_10 < 3; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">082</span>: <span class="k">if</span> <span class="n">i</span> <span class="o">-</span> <span class="n">j</span> <span class="o">>=</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_1 = ((__pyx_v_i - __pyx_v_j) >= 0);
if (__pyx_t_1) {
/* … */
}
}
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">083</span>: <span class="n">norm_factor</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+=</span> <span class="n">A</span><span class="p">[</span><span class="n">j</span><span class="p">]</span></pre>
<pre class='cython code score-0 '> __pyx_t_11 = __pyx_v_i;
(__pyx_v_norm_factor[__pyx_t_11]) = __Pyx_c_sum_double((__pyx_v_norm_factor[__pyx_t_11]), (__pyx_v_A[__pyx_v_j]));
</pre><pre class="cython line score-0"> <span class="">084</span>: </pre>
<pre class="cython line score-0"> <span class="">085</span>: <span class="c"># Normalize the output</span></pre>
<pre class="cython line score-6" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">086</span>: <span class="k">with</span> <span class="k">nogil</span><span class="p">,</span> <span class="n">parallel</span><span class="p">():</span></pre>
<pre class='cython code score-6 '> {
#ifdef WITH_THREAD
PyThreadState *_save;
_save = NULL;
Py_UNBLOCK_THREADS
<span class='pyx_c_api'>__Pyx_FastGIL_Remember</span>();
#endif
/*try:*/ {
{
#if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))))
#undef likely
#undef unlikely
#define likely(x) (x)
#define unlikely(x) (x)
#endif
#ifdef _OPENMP
#pragma omp parallel
#endif /* _OPENMP */
{
/* … */
/*finally:*/ {
/*normal exit:*/{
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_FastGIL_Forget</span>();
Py_BLOCK_THREADS
#endif
goto __pyx_L32;
}
__pyx_L31_error: {
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_FastGIL_Forget</span>();
Py_BLOCK_THREADS
#endif
goto __pyx_L1_error;
}
__pyx_L32:;
}
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">087</span>: <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">prange</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">schedule</span><span class="o">=</span><span class="s">'static'</span><span class="p">):</span></pre>
<pre class='cython code score-0 '> __pyx_t_7 = __pyx_v_n;
{
__pyx_t_9 = (__pyx_t_7 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_9 > 0)
{
#ifdef _OPENMP
#pragma omp for firstprivate(__pyx_v_i) lastprivate(__pyx_v_i) schedule(static)
#endif /* _OPENMP */
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_9; __pyx_t_8++){
{
__pyx_v_i = (int)(0 + 1 * __pyx_t_8);
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">088</span>: <span class="k">if</span> <span class="n">norm_factor</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="mf">0</span><span class="p">:</span></pre>
<pre class='cython code score-0 '> __pyx_t_1 = (__Pyx_c_eq_double((__pyx_v_norm_factor[__pyx_v_i]), __pyx_t_double_complex_from_parts(0, 0)));
if (__pyx_t_1) {
/* … */
}
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">089</span>: <span class="n">norm_factor</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1e-30</span> <span class="c"># Prevent division by zero</span></pre>
<pre class='cython code score-0 '> (__pyx_v_norm_factor[__pyx_v_i]) = __pyx_t_double_complex_from_parts(1e-30, 0);
</pre><pre class="cython line score-37" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">090</span>: <span class="n">y</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">/=</span> <span class="n">norm_factor</span><span class="p">[</span><span class="n">i</span><span class="p">]</span></pre>
<pre class='cython code score-37 '> __pyx_t_10 = __pyx_v_i;
if (unlikely(__Pyx_c_is_zero_double((__pyx_v_norm_factor[__pyx_v_i])))) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = <span class='pyx_c_api'>__Pyx_PyGILState_Ensure</span>();
#endif
<span class='py_c_api'>PyErr_SetString</span>(PyExc_ZeroDivisionError, "float division");
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_PyGILState_Release</span>(__pyx_gilstate_save);
#endif
<span class='error_goto'>__PYX_ERR(0, 90, __pyx_L39_error)</span>
}
(__pyx_v_y[__pyx_t_10]) = __Pyx_c_quot_double((__pyx_v_y[__pyx_t_10]), (__pyx_v_norm_factor[__pyx_v_i]));
goto __pyx_L43;
__pyx_L39_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = <span class='pyx_c_api'>__Pyx_PyGILState_Ensure</span>();
#endif
#ifdef _OPENMP
#pragma omp flush(__pyx_parallel_exc_type)
#endif /* _OPENMP */
if (!__pyx_parallel_exc_type) {
<span class='pyx_c_api'>__Pyx_ErrFetchWithState</span>(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
__pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_parallel_exc_type);
}
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_PyGILState_Release</span>(__pyx_gilstate_save);
#endif
}
__pyx_parallel_why = 4;
goto __pyx_L42;
__pyx_L42:;
#ifdef _OPENMP
#pragma omp critical(__pyx_parallel_lastprivates0)
#endif /* _OPENMP */
{
__pyx_parallel_temp0 = __pyx_v_i;
}
__pyx_L43:;
#ifdef _OPENMP
#pragma omp flush(__pyx_parallel_why)
#endif /* _OPENMP */
}
}
}
if (__pyx_parallel_exc_type) {
/* This may have been overridden by a continue, break or return in another thread. Prefer the error. */
__pyx_parallel_why = 4;
}
if (__pyx_parallel_why) {
__pyx_v_i = __pyx_parallel_temp0;
switch (__pyx_parallel_why) {
case 4:
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = <span class='pyx_c_api'>__Pyx_PyGILState_Ensure</span>();
#endif
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_parallel_exc_type);
<span class='pyx_c_api'>__Pyx_ErrRestoreWithState</span>(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb);
__pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno;
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_PyGILState_Release</span>(__pyx_gilstate_save);
#endif
}
goto __pyx_L35_error;
}
}
}
goto __pyx_L45;
__pyx_L35_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = <span class='pyx_c_api'>__Pyx_PyGILState_Ensure</span>();
#endif
#ifdef _OPENMP
#pragma omp flush(__pyx_parallel_exc_type)
#endif /* _OPENMP */
if (!__pyx_parallel_exc_type) {
<span class='pyx_c_api'>__Pyx_ErrFetchWithState</span>(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb);
__pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno;
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_parallel_exc_type);
}
#ifdef WITH_THREAD
<span class='pyx_c_api'>__Pyx_PyGILState_Release</span>(__pyx_gilstate_save);
#endif
}
__pyx_parallel_why = 4;
goto __pyx_L45;
__pyx_L45:;
#ifdef _OPENMP
Py_END_ALLOW_THREADS
#else
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = <span class='pyx_c_api'>__Pyx_PyGILState_Ensure</span>();
#endif
#endif /* _OPENMP */
/* Clean up any temporaries */