forked from andreas-h/pyloess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_loess.c
6453 lines (5794 loc) · 276 KB
/
_loess.c
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
/* Generated by Pyrex 0.9.5.1a on Sun Mar 25 18:15:15 2007 */
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
__PYX_EXTERN_C double pow(double, double);
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "loess.h"
#include "cloess.h"
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;
static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/
static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
/* Declarations from c_python */
/* Declarations from c_numpy */
static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_7c_numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_7c_numpy_broadcast = 0;
/* Declarations from c_loess */
/* Declarations from _loess */
struct __pyx_obj_6_loess_loess_inputs {
PyObject_HEAD
loess_inputs (*_base);
PyArrayObject *w_ndr;
PyArrayObject *x;
PyArrayObject *y;
PyArrayObject *masked;
PyArrayObject *x_eff;
PyArrayObject *y_eff;
int nobs;
int npar;
};
struct __pyx_obj_6_loess_loess_control {
PyObject_HEAD
loess_control (*_base);
};
struct __pyx_obj_6_loess_loess_kd_tree {
PyObject_HEAD
loess_kd_tree (*_base);
};
struct __pyx_obj_6_loess_loess_model {
PyObject_HEAD
struct __pyx_vtabstruct_6_loess_loess_model *__pyx_vtab;
loess_model (*_base);
long npar;
};
struct __pyx_vtabstruct_6_loess_loess_model {
PyObject *((*setup)(struct __pyx_obj_6_loess_loess_model *,loess_model (*),long ));
};
static struct __pyx_vtabstruct_6_loess_loess_model *__pyx_vtabptr_6_loess_loess_model;
struct __pyx_obj_6_loess_loess_outputs {
PyObject_HEAD
struct __pyx_vtabstruct_6_loess_loess_outputs *__pyx_vtab;
loess_outputs (*_base);
long nobs;
long npar;
int activated;
};
struct __pyx_vtabstruct_6_loess_loess_outputs {
PyObject *((*setup)(struct __pyx_obj_6_loess_loess_outputs *,loess_outputs (*),long ,long ));
};
static struct __pyx_vtabstruct_6_loess_loess_outputs *__pyx_vtabptr_6_loess_loess_outputs;
struct __pyx_obj_6_loess_conf_intervals {
PyObject_HEAD
struct __pyx_vtabstruct_6_loess_conf_intervals *__pyx_vtab;
conf_inv _base;
PyArrayObject *lower;
PyArrayObject *fit;
PyArrayObject *upper;
};
struct __pyx_vtabstruct_6_loess_conf_intervals {
PyObject *((*setup)(struct __pyx_obj_6_loess_conf_intervals *,conf_inv ,long ));
};
static struct __pyx_vtabstruct_6_loess_conf_intervals *__pyx_vtabptr_6_loess_conf_intervals;
struct __pyx_obj_6_loess_loess_predicted {
PyObject_HEAD
struct __pyx_vtabstruct_6_loess_loess_predicted *__pyx_vtab;
prediction _base;
long nest;
struct __pyx_obj_6_loess_conf_intervals *confidence_intervals;
};
struct __pyx_vtabstruct_6_loess_loess_predicted {
PyObject *((*setup)(struct __pyx_obj_6_loess_loess_predicted *,prediction ,long ));
};
static struct __pyx_vtabstruct_6_loess_loess_predicted *__pyx_vtabptr_6_loess_loess_predicted;
struct __pyx_obj_6_loess_loess {
PyObject_HEAD
loess _base;
struct __pyx_obj_6_loess_loess_inputs *inputs;
struct __pyx_obj_6_loess_loess_model *model;
struct __pyx_obj_6_loess_loess_control *control;
struct __pyx_obj_6_loess_loess_kd_tree *kd_tree;
struct __pyx_obj_6_loess_loess_outputs *outputs;
struct __pyx_obj_6_loess_loess_predicted *predicted;
};
struct __pyx_obj_6_loess_anova {
PyObject_HEAD
double dfn;
double dfd;
double F_value;
double Pr_F;
};
static PyTypeObject *__pyx_ptype_6_loess_loess_inputs = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess_control = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess_kd_tree = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess_model = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess_outputs = 0;
static PyTypeObject *__pyx_ptype_6_loess_conf_intervals = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess_predicted = 0;
static PyTypeObject *__pyx_ptype_6_loess_loess = 0;
static PyTypeObject *__pyx_ptype_6_loess_anova = 0;
static PyObject *__pyx_k9;
static PyObject *__pyx_k10;
static PyObject *__pyx_k11;
static PyObject *(__pyx_f_6_loess_floatarray_from_data(int ,int ,double (*))); /*proto*/
static PyObject *(__pyx_f_6_loess_boolarray_from_data(int ,int ,int (*))); /*proto*/
/* Implementation of _loess */
static char (__pyx_k1[]) = "A (n,) ndarray of weights to be given to individual observations in the \n sum of squared residuals that forms the local fitting criterion. If not\n None, the weights should be non negative. If the different observations\n have non-equal variances, the weights should be inversely proportional \n to the variances.\n By default, an unweighted fit is carried out (all the weights are one).\n ";
static char (__pyx_k2[]) = "\n surface : string [\"interpolate\"]\n Determines whether the fitted surface is computed directly at all points\n (\"direct\") or whether an interpolation method is used (\"interpolate\").\n The default (\"interpolate\") is what most users should use unless special \n circumstances warrant.\n ";
static char (__pyx_k3[]) = "\n statistics : string [\"approximate\"]\n Determines whether the statistical quantities are computed exactly \n (\"exact\") or approximately (\"approximate\"). \"exact\" should only be used \n for testing the approximation in statistical development and is not meant \n for routine usage because computation time can be horrendous.\n ";
static char (__pyx_k4[]) = "\n trace_hat : string [\"wait.to.decide\"]\n Determines how the trace of the hat matrix should be computed. The hat\n matrix is used in the computation of the statistical quantities. \n If \"exact\", an exact computation is done; this could be slow when the\n number of observations n becomes large. If \"wait.to.decide\" is selected, \n then a default is \"exact\" for n < 500 and \"approximate\" otherwise. \n This option is only useful when the fitted surface is interpolated. If \n surface is \"exact\", an exact computation is always done for the trace. \n Setting trace_hat to \"approximate\" for large dataset will substantially \n reduce the computation time.\n ";
static char (__pyx_k5[]) = "\n iterations : integer\n Number of iterations of the robust fitting method. If the family is \n \"gaussian\", the number of iterations is set to 0.\n ";
static char (__pyx_k6[]) = "\n cell : integer\n Maximum cell size of the kd-tree. Suppose k = floor(n*cell*span),\n where n is the number of observations, and span the smoothing parameter.\n Then, a cell is further divided if the number of observations within it \n is greater than or equal to k. This option is only used if the surface \n is interpolated.\n ";
static char (__pyx_k8[]) = "\n \n\n newdata : ndarray\n The (m,p) array of independent variables where the surface must be estimated.\n values : ndarray\n The (m,) ndarray of loess values evaluated at newdata\n stderr : ndarray\n The (m,) ndarray of the estimates of the standard error on the estimated\n values.\n residual_scale : float\n Estimate of the scale of the residuals\n df : integer\n Degrees of freedom of the t-distribution used to compute pointwise \n confidence intervals for the evaluated surface.\n nest : integer\n Number of new observations.\n \n \n";
static PyObject *__pyx_n_c_python;
static PyObject *__pyx_n_c_numpy;
static PyObject *__pyx_n_numpy;
static PyObject *__pyx_n_narray;
static PyObject *__pyx_n_float_;
static PyObject *__pyx_n_c_loess;
static PyObject *__pyx_n_array;
static PyObject *__pyx_n_False;
static PyObject *__pyx_n_shape;
static PyObject *__pyx_f_6_loess_floatarray_from_data(int __pyx_v_rows,int __pyx_v_cols,double (*__pyx_v_data)) {
PyArrayObject *__pyx_v_a_ndr;
npy_intp __pyx_v_size;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
__pyx_v_a_ndr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":20 */
__pyx_v_size = (__pyx_v_rows * __pyx_v_cols);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":21 */
__pyx_1 = PyArray_SimpleNewFromData(1,(&__pyx_v_size),NPY_DOUBLE,__pyx_v_data); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_1));
Py_DECREF(((PyObject *)__pyx_v_a_ndr));
__pyx_v_a_ndr = ((PyArrayObject *)((PyObject *)__pyx_1));
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":22 */
__pyx_2 = (__pyx_v_cols > 1);
if (__pyx_2) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":23 */
__pyx_1 = PyInt_FromLong(__pyx_v_rows); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
__pyx_3 = PyInt_FromLong(__pyx_v_cols); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
__pyx_1 = 0;
__pyx_3 = 0;
if (PyObject_SetAttr(((PyObject *)__pyx_v_a_ndr), __pyx_n_shape, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":24 */
Py_INCREF(((PyObject *)__pyx_v_a_ndr));
__pyx_r = ((PyObject *)__pyx_v_a_ndr);
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.floatarray_from_data");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_a_ndr);
return __pyx_r;
}
static PyObject *__pyx_n_astype;
static PyObject *__pyx_n_bool;
static PyObject *__pyx_f_6_loess_boolarray_from_data(int __pyx_v_rows,int __pyx_v_cols,int (*__pyx_v_data)) {
PyArrayObject *__pyx_v_a_ndr;
npy_intp __pyx_v_size;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
__pyx_v_a_ndr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":29 */
__pyx_v_size = (__pyx_v_rows * __pyx_v_cols);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":30 */
__pyx_1 = PyArray_SimpleNewFromData(1,(&__pyx_v_size),NPY_DOUBLE,__pyx_v_data); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_1));
Py_DECREF(((PyObject *)__pyx_v_a_ndr));
__pyx_v_a_ndr = ((PyArrayObject *)((PyObject *)__pyx_1));
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":31 */
__pyx_2 = (__pyx_v_cols > 1);
if (__pyx_2) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":32 */
__pyx_1 = PyInt_FromLong(__pyx_v_rows); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
__pyx_3 = PyInt_FromLong(__pyx_v_cols); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
__pyx_1 = 0;
__pyx_3 = 0;
if (PyObject_SetAttr(((PyObject *)__pyx_v_a_ndr), __pyx_n_shape, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":33 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_a_ndr), __pyx_n_astype); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
__pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_bool); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.boolarray_from_data");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_a_ndr);
return __pyx_r;
}
static PyObject *__pyx_n_copy;
static PyObject *__pyx_n_True;
static PyObject *__pyx_n_subok;
static PyObject *__pyx_n_dtype;
static PyObject *__pyx_n_order;
static PyObject *__pyx_n_C;
static PyObject *__pyx_n_ndim;
static PyObject *__pyx_n_ValueError;
static PyObject *__pyx_n_len;
static PyObject *__pyx_n_ravel;
static PyObject *__pyx_n_ones;
static PyObject *__pyx_k22p;
static char (__pyx_k22[]) = "The array of indepedent varibales should be 2D at most!";
static int __pyx_f_6_loess_12loess_inputs___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_6_loess_12loess_inputs___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x_data = 0;
PyObject *__pyx_v_y_data = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
static char *__pyx_argnames[] = {"x_data","y_data",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_x_data, &__pyx_v_y_data)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x_data);
Py_INCREF(__pyx_v_y_data);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":89 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_narray); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_INCREF(__pyx_v_x_data);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x_data);
__pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_copy, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_subok, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_float_); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyDict_SetItem(__pyx_3, __pyx_n_order, __pyx_n_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x = ((PyArrayObject *)__pyx_4);
__pyx_4 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":90 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_narray); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_INCREF(__pyx_v_y_data);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_y_data);
__pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_copy, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_True); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_subok, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_float_); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_dtype, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyDict_SetItem(__pyx_3, __pyx_n_order, __pyx_n_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y = ((PyArrayObject *)__pyx_4);
__pyx_4 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":92 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x), __pyx_n_ndim); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_5 = __pyx_5 == 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_5) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":93 */
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->npar = 1;
goto __pyx_L2;
}
__pyx_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x), __pyx_n_ndim); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
__pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
__pyx_5 = __pyx_5 == 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_5) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":95 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x), __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong((-1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
__pyx_3 = PyObject_GetItem(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_5 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->npar = __pyx_5;
goto __pyx_L2;
}
/*else*/ {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":97 */
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_INCREF(__pyx_k22p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k22p);
__pyx_2 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":98 */
__pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x));
PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x));
__pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_5 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->nobs = __pyx_5;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":100 */
__pyx_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x), __pyx_n_ravel); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x_eff));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->x_eff = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":101 */
Py_INCREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y));
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y_eff));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y_eff = ((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->y;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":102 */
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_numpy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_ones); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_2 = PyInt_FromLong(((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->nobs); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_float_); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_n_dtype, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr = ((PyArrayObject *)__pyx_3);
__pyx_3 = 0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.loess_inputs.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_x_data);
Py_DECREF(__pyx_v_y_data);
return __pyx_r;
}
static PyObject *__pyx_f_6_loess_12loess_inputs_7weights___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6_loess_12loess_inputs_7weights___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":114 */
Py_INCREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr));
__pyx_r = ((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr);
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_n_size;
static PyObject *__pyx_k26p;
static char (__pyx_k26[]) = "Invalid size of the 'weights' vector!";
static int __pyx_f_6_loess_12loess_inputs_7weights___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_w); /*proto*/
static int __pyx_f_6_loess_12loess_inputs_7weights___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_w) {
PyArrayObject *__pyx_v_w_ndr;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_w);
__pyx_v_w_ndr = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":119 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_narray); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_INCREF(__pyx_v_w);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_w);
__pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_copy, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_3, __pyx_n_subok, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_w_ndr));
__pyx_v_w_ndr = ((PyArrayObject *)__pyx_4);
__pyx_4 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":120 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_w_ndr), __pyx_n_ndim); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_5 = __pyx_5 > 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__pyx_5) {
__pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_w_ndr), __pyx_n_size); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_4 = PyInt_FromLong(((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->nobs); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_5 = __pyx_5 != 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
}
if (__pyx_5) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":121 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
__Pyx_Raise(__pyx_1, __pyx_k26p, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":122 */
Py_INCREF(((PyObject *)__pyx_v_w_ndr));
Py_DECREF(((PyObject *)((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr));
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->w_ndr = __pyx_v_w_ndr;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":123 */
((struct __pyx_obj_6_loess_loess_inputs *)__pyx_v_self)->_base->weights = ((double (*))__pyx_v_w_ndr->data);
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.loess_inputs.weights.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_w_ndr);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_w);
return __pyx_r;
}
static PyObject *__pyx_f_6_loess_13loess_control_7surface___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6_loess_13loess_control_7surface___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":174 */
__pyx_1 = PyString_FromString(((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->surface); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("_loess.loess_control.surface.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_n_lower;
static PyObject *__pyx_n_interpolate;
static PyObject *__pyx_n_direct;
static PyObject *__pyx_k29p;
static PyObject *__pyx_k30p;
static char (__pyx_k29[]) = "Invalid value for the 'surface' argument: ";
static char (__pyx_k30[]) = "should be in ('interpolate', 'direct').";
static int __pyx_f_6_loess_13loess_control_7surface___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_surface); /*proto*/
static int __pyx_f_6_loess_13loess_control_7surface___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_surface) {
PyObject *__pyx_v_tmpx;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
char (*__pyx_5);
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_surface);
__pyx_v_tmpx = Py_None; Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":176 */
__pyx_1 = PyObject_GetAttr(__pyx_v_surface, __pyx_n_lower); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
Py_INCREF(__pyx_n_interpolate);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_interpolate);
Py_INCREF(__pyx_n_direct);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_direct);
__pyx_3 = PySequence_Contains(__pyx_1, __pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
__pyx_3 = !__pyx_3;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":177 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
__pyx_1 = PyNumber_Add(__pyx_k29p, __pyx_k30p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_1, 0, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":179 */
__pyx_2 = PyObject_GetAttr(__pyx_v_surface, __pyx_n_lower); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
__pyx_4 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_tmpx);
__pyx_v_tmpx = __pyx_4;
__pyx_4 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":180 */
__pyx_5 = PyString_AsString(__pyx_v_tmpx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->surface = __pyx_5;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.loess_control.surface.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_tmpx);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_surface);
return __pyx_r;
}
static PyObject *__pyx_f_6_loess_13loess_control_10statistics___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6_loess_13loess_control_10statistics___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":191 */
__pyx_1 = PyString_FromString(((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->statistics); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("_loess.loess_control.statistics.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_n_approximate;
static PyObject *__pyx_n_exact;
static PyObject *__pyx_k33p;
static char (__pyx_k33[]) = "Invalid value for the 'statistics' argument: should be in ('approximate', 'exact').";
static int __pyx_f_6_loess_13loess_control_10statistics___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_statistics); /*proto*/
static int __pyx_f_6_loess_13loess_control_10statistics___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_statistics) {
PyObject *__pyx_v_tmpx;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
char (*__pyx_5);
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_statistics);
__pyx_v_tmpx = Py_None; Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":193 */
__pyx_1 = PyObject_GetAttr(__pyx_v_statistics, __pyx_n_lower); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
Py_INCREF(__pyx_n_approximate);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_approximate);
Py_INCREF(__pyx_n_exact);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_exact);
__pyx_3 = PySequence_Contains(__pyx_1, __pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
__pyx_3 = !__pyx_3;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":194 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
Py_INCREF(__pyx_k33p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k33p);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":196 */
__pyx_2 = PyObject_GetAttr(__pyx_v_statistics, __pyx_n_lower); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
__pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_tmpx);
__pyx_v_tmpx = __pyx_1;
__pyx_1 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":197 */
__pyx_5 = PyString_AsString(__pyx_v_tmpx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->statistics = __pyx_5;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.loess_control.statistics.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_tmpx);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_statistics);
return __pyx_r;
}
static PyObject *__pyx_f_6_loess_13loess_control_9trace_hat___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6_loess_13loess_control_9trace_hat___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":213 */
__pyx_1 = PyString_FromString(((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->trace_hat); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("_loess.loess_control.trace_hat.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_k36p;
static char (__pyx_k36[]) = "Invalid value for the 'trace_hat' argument: should be in ('approximate', 'exact').";
static int __pyx_f_6_loess_13loess_control_9trace_hat___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_trace_hat); /*proto*/
static int __pyx_f_6_loess_13loess_control_9trace_hat___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_trace_hat) {
PyObject *__pyx_v_tmpx;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
char (*__pyx_5);
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_trace_hat);
__pyx_v_tmpx = Py_None; Py_INCREF(Py_None);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":215 */
__pyx_1 = PyObject_GetAttr(__pyx_v_trace_hat, __pyx_n_lower); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
Py_INCREF(__pyx_n_approximate);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_approximate);
Py_INCREF(__pyx_n_exact);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_exact);
__pyx_3 = PySequence_Contains(__pyx_1, __pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
__pyx_3 = !__pyx_3;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":216 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
Py_INCREF(__pyx_k36p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k36p);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":218 */
__pyx_2 = PyObject_GetAttr(__pyx_v_trace_hat, __pyx_n_lower); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
__pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_tmpx);
__pyx_v_tmpx = __pyx_1;
__pyx_1 = 0;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":219 */
__pyx_5 = PyString_AsString(__pyx_v_tmpx); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->trace_hat = __pyx_5;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_loess.loess_control.trace_hat.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_tmpx);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_trace_hat);
return __pyx_r;
}
static PyObject *__pyx_f_6_loess_13loess_control_10iterations___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6_loess_13loess_control_10iterations___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":228 */
__pyx_1 = PyInt_FromLong(((struct __pyx_obj_6_loess_loess_control *)__pyx_v_self)->_base->iterations); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("_loess.loess_control.iterations.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_k37p;
static char (__pyx_k37[]) = "Invalid number of iterations: should be positive";
static int __pyx_f_6_loess_13loess_control_10iterations___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_iterations); /*proto*/
static int __pyx_f_6_loess_13loess_control_10iterations___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_iterations) {
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_iterations);
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":230 */
__pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_v_iterations, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
__pyx_2 = __pyx_2 < 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":231 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
Py_INCREF(__pyx_k37p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k37p);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/home/backtopop/workspace/pyloess/src/_loess.pyx":232 */