-
Notifications
You must be signed in to change notification settings - Fork 0
/
gsl.lua
2664 lines (2108 loc) · 107 KB
/
gsl.lua
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
local ffi = require 'ffi'
ffi.cdef[[
struct _IO_FILE;
typedef struct _IO_FILE FILE;
extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;
void * malloc(size_t n);
void free(void *p);
enum {
GSL_SUCCESS = 0,
GSL_FAILURE = -1,
GSL_CONTINUE = -2,
GSL_EDOM = 1,
GSL_ERANGE = 2,
GSL_EFAULT = 3,
GSL_EINVAL = 4,
GSL_EFAILED = 5,
GSL_EFACTOR = 6,
GSL_ESANITY = 7,
GSL_ENOMEM = 8,
GSL_EBADFUNC = 9,
GSL_ERUNAWAY = 10,
GSL_EMAXITER = 11,
GSL_EZERODIV = 12,
GSL_EBADTOL = 13,
GSL_ETOL = 14,
GSL_EUNDRFLW = 15,
GSL_EOVRFLW = 16,
GSL_ELOSS = 17,
GSL_EROUND = 18,
GSL_EBADLEN = 19,
GSL_ENOTSQR = 20,
GSL_ESING = 21,
GSL_EDIVERGE = 22,
GSL_EUNSUP = 23,
GSL_EUNIMPL = 24,
GSL_ECACHE = 25,
GSL_ETABLE = 26,
GSL_ENOPROG = 27,
GSL_ENOPROGJ = 28,
GSL_ETOLF = 29,
GSL_ETOLX = 30,
GSL_ETOLG = 31,
GSL_EOF = 32
} ;
const char * gsl_strerror (const int gsl_errno);
typedef complex gsl_complex;
typedef struct
{
size_t size;
double * data;
int ref_count;
} gsl_block;
typedef gsl_block gsl_block_complex;
gsl_block *gsl_block_alloc (const size_t n);
gsl_block *gsl_block_calloc (const size_t n);
void gsl_block_free (gsl_block * b);
gsl_block_complex *gsl_block_complex_alloc (const size_t n);
gsl_block_complex *gsl_block_complex_calloc (const size_t n);
void gsl_block_complex_free (gsl_block_complex * b);
typedef struct
{
size_t size;
size_t stride;
double * data;
gsl_block * block;
int owner;
} gsl_vector;
typedef struct
{
size_t size;
size_t stride;
double *data;
gsl_block_complex *block;
int owner;
} gsl_vector_complex;
typedef struct
{
size_t size1;
size_t size2;
size_t tda;
double * data;
gsl_block * block;
int owner;
} gsl_matrix;
typedef struct
{
size_t size1;
size_t size2;
size_t tda;
double * data;
gsl_block_complex * block;
int owner;
} gsl_matrix_complex;
typedef gsl_vector gsl_vector_view;
typedef gsl_vector gsl_vector_const_view;
typedef gsl_matrix gsl_matrix_view;
typedef gsl_matrix gsl_matrix_const_view;
typedef gsl_vector_complex gsl_vector_complex_view;
typedef gsl_vector_complex gsl_vector_complex_const_view;
typedef gsl_matrix_complex gsl_matrix_complex_view;
typedef gsl_matrix_complex gsl_matrix_complex_const_view;
typedef struct
{
size_t size;
size_t *data;
} gsl_permutation;
double gsl_complex_arg (gsl_complex z);
double gsl_complex_abs (gsl_complex z);
double gsl_complex_abs2 (gsl_complex z);
double gsl_complex_logabs (gsl_complex z);
gsl_complex gsl_complex_add (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_sub (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_mul (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_div (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_add_real (gsl_complex a, double x);
gsl_complex gsl_complex_sub_real (gsl_complex a, double x);
gsl_complex gsl_complex_mul_real (gsl_complex a, double x);
gsl_complex gsl_complex_div_real (gsl_complex a, double x);
gsl_complex gsl_complex_add_imag (gsl_complex a, double y);
gsl_complex gsl_complex_sub_imag (gsl_complex a, double y);
gsl_complex gsl_complex_mul_imag (gsl_complex a, double y);
gsl_complex gsl_complex_div_imag (gsl_complex a, double y);
gsl_complex gsl_complex_conjugate (gsl_complex z);
gsl_complex gsl_complex_inverse (gsl_complex a);
gsl_complex gsl_complex_negative (gsl_complex a);
gsl_complex gsl_complex_sqrt (gsl_complex z);
gsl_complex gsl_complex_sqrt_real (double x);
gsl_complex gsl_complex_pow (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_pow_real (gsl_complex a, double b);
gsl_complex gsl_complex_exp (gsl_complex a);
gsl_complex gsl_complex_log (gsl_complex a);
gsl_complex gsl_complex_log10 (gsl_complex a);
gsl_complex gsl_complex_log_b (gsl_complex a, gsl_complex b);
gsl_complex gsl_complex_sin (gsl_complex a);
gsl_complex gsl_complex_cos (gsl_complex a);
gsl_complex gsl_complex_sec (gsl_complex a);
gsl_complex gsl_complex_csc (gsl_complex a);
gsl_complex gsl_complex_tan (gsl_complex a);
gsl_complex gsl_complex_cot (gsl_complex a);
gsl_complex gsl_complex_arcsin (gsl_complex a);
gsl_complex gsl_complex_arcsin_real (double a);
gsl_complex gsl_complex_arccos (gsl_complex a);
gsl_complex gsl_complex_arccos_real (double a);
gsl_complex gsl_complex_arcsec (gsl_complex a);
gsl_complex gsl_complex_arcsec_real (double a);
gsl_complex gsl_complex_arccsc (gsl_complex a);
gsl_complex gsl_complex_arccsc_real (double a);
gsl_complex gsl_complex_arctan (gsl_complex a);
gsl_complex gsl_complex_arccot (gsl_complex a);
gsl_complex gsl_complex_sinh (gsl_complex a);
gsl_complex gsl_complex_cosh (gsl_complex a);
gsl_complex gsl_complex_sech (gsl_complex a);
gsl_complex gsl_complex_csch (gsl_complex a);
gsl_complex gsl_complex_tanh (gsl_complex a);
gsl_complex gsl_complex_coth (gsl_complex a);
gsl_complex gsl_complex_arcsinh (gsl_complex a);
gsl_complex gsl_complex_arccosh (gsl_complex a);
gsl_complex gsl_complex_arccosh_real (double a);
gsl_complex gsl_complex_arcsech (gsl_complex a);
gsl_complex gsl_complex_arccsch (gsl_complex a);
gsl_complex gsl_complex_arctanh (gsl_complex a);
gsl_complex gsl_complex_arctanh_real (double a);
gsl_complex gsl_complex_arccoth (gsl_complex a);
gsl_vector *gsl_vector_alloc (const size_t n);
gsl_vector *gsl_vector_calloc (const size_t n);
gsl_vector *gsl_vector_alloc_from_block (gsl_block * b,
const size_t offset,
const size_t n,
const size_t stride);
gsl_vector *gsl_vector_alloc_from_vector (gsl_vector * v,
const size_t offset,
const size_t n,
const size_t stride);
void gsl_vector_free (gsl_vector * v);
gsl_vector_view
gsl_vector_view_array (double *v, size_t n);
gsl_vector_view
gsl_vector_view_array_with_stride (double *base,
size_t stride,
size_t n);
gsl_vector_const_view
gsl_vector_const_view_array (const double *v, size_t n);
gsl_vector_const_view
gsl_vector_const_view_array_with_stride (const double *base,
size_t stride,
size_t n);
gsl_vector_view
gsl_vector_subvector (gsl_vector *v,
size_t i,
size_t n);
gsl_vector_view
gsl_vector_subvector_with_stride (gsl_vector *v,
size_t i,
size_t stride,
size_t n);
gsl_vector_const_view
gsl_vector_const_subvector (const gsl_vector *v,
size_t i,
size_t n);
gsl_vector_const_view
gsl_vector_const_subvector_with_stride (const gsl_vector *v,
size_t i,
size_t stride,
size_t n);
void gsl_vector_set_zero (gsl_vector * v);
void gsl_vector_set_all (gsl_vector * v, double x);
int gsl_vector_set_basis (gsl_vector * v, size_t i);
int gsl_vector_fread (FILE * stream, gsl_vector * v);
int gsl_vector_fwrite (FILE * stream, const gsl_vector * v);
int gsl_vector_fscanf (FILE * stream, gsl_vector * v);
int gsl_vector_fprintf (FILE * stream, const gsl_vector * v,
const char *format);
int gsl_vector_memcpy (gsl_vector * dest, const gsl_vector * src);
int gsl_vector_reverse (gsl_vector * v);
int gsl_vector_swap (gsl_vector * v, gsl_vector * w);
int gsl_vector_swap_elements (gsl_vector * v, const size_t i, const size_t j);
double gsl_vector_max (const gsl_vector * v);
double gsl_vector_min (const gsl_vector * v);
void gsl_vector_minmax (const gsl_vector * v, double * min_out, double * max_out);
size_t gsl_vector_max_index (const gsl_vector * v);
size_t gsl_vector_min_index (const gsl_vector * v);
void gsl_vector_minmax_index (const gsl_vector * v, size_t * imin, size_t * imax);
int gsl_vector_add (gsl_vector * a, const gsl_vector * b);
int gsl_vector_sub (gsl_vector * a, const gsl_vector * b);
int gsl_vector_mul (gsl_vector * a, const gsl_vector * b);
int gsl_vector_div (gsl_vector * a, const gsl_vector * b);
int gsl_vector_scale (gsl_vector * a, const double x);
int gsl_vector_add_constant (gsl_vector * a, const double x);
int gsl_vector_isnull (const gsl_vector * v);
int gsl_vector_ispos (const gsl_vector * v);
int gsl_vector_isneg (const gsl_vector * v);
int gsl_vector_isnonneg (const gsl_vector * v);
double gsl_vector_get (const gsl_vector * v, const size_t i);
void gsl_vector_set (gsl_vector * v, const size_t i, double x);
double * gsl_vector_ptr (gsl_vector * v, const size_t i);
const double * gsl_vector_const_ptr (const gsl_vector * v, const size_t i);
gsl_matrix *
gsl_matrix_alloc (const size_t n1, const size_t n2);
gsl_matrix *
gsl_matrix_calloc (const size_t n1, const size_t n2);
gsl_matrix *
gsl_matrix_alloc_from_block (gsl_block * b,
const size_t offset,
const size_t n1,
const size_t n2,
const size_t d2);
gsl_matrix *
gsl_matrix_alloc_from_matrix (gsl_matrix * m,
const size_t k1,
const size_t k2,
const size_t n1,
const size_t n2);
gsl_vector *
gsl_vector_alloc_row_from_matrix (gsl_matrix * m,
const size_t i);
gsl_vector *
gsl_vector_alloc_col_from_matrix (gsl_matrix * m,
const size_t j);
void gsl_matrix_free (gsl_matrix * m);
gsl_matrix_view
gsl_matrix_submatrix (gsl_matrix * m,
const size_t i, const size_t j,
const size_t n1, const size_t n2);
gsl_vector_view
gsl_matrix_row (gsl_matrix * m, const size_t i);
gsl_vector_view
gsl_matrix_column (gsl_matrix * m, const size_t j);
gsl_vector_view
gsl_matrix_diagonal (gsl_matrix * m);
gsl_vector_view
gsl_matrix_subdiagonal (gsl_matrix * m, const size_t k);
gsl_vector_view
gsl_matrix_superdiagonal (gsl_matrix * m, const size_t k);
gsl_vector_view
gsl_matrix_subrow (gsl_matrix * m, const size_t i,
const size_t offset, const size_t n);
gsl_vector_view
gsl_matrix_subcolumn (gsl_matrix * m, const size_t j,
const size_t offset, const size_t n);
gsl_matrix_view
gsl_matrix_view_array (double * base,
const size_t n1,
const size_t n2);
gsl_matrix_view
gsl_matrix_view_array_with_tda (double * base,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_view
gsl_matrix_view_vector (gsl_vector * v,
const size_t n1,
const size_t n2);
gsl_matrix_view
gsl_matrix_view_vector_with_tda (gsl_vector * v,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_const_view
gsl_matrix_const_submatrix (const gsl_matrix * m,
const size_t i, const size_t j,
const size_t n1, const size_t n2);
gsl_vector_const_view
gsl_matrix_const_row (const gsl_matrix * m,
const size_t i);
gsl_vector_const_view
gsl_matrix_const_column (const gsl_matrix * m,
const size_t j);
gsl_vector_const_view
gsl_matrix_const_diagonal (const gsl_matrix * m);
gsl_vector_const_view
gsl_matrix_const_subdiagonal (const gsl_matrix * m,
const size_t k);
gsl_vector_const_view
gsl_matrix_const_superdiagonal (const gsl_matrix * m,
const size_t k);
gsl_vector_const_view
gsl_matrix_const_subrow (const gsl_matrix * m, const size_t i,
const size_t offset, const size_t n);
gsl_vector_const_view
gsl_matrix_const_subcolumn (const gsl_matrix * m, const size_t j,
const size_t offset, const size_t n);
gsl_matrix_const_view
gsl_matrix_const_view_array (const double * base,
const size_t n1,
const size_t n2);
gsl_matrix_const_view
gsl_matrix_const_view_array_with_tda (const double * base,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_const_view
gsl_matrix_const_view_vector (const gsl_vector * v,
const size_t n1,
const size_t n2);
gsl_matrix_const_view
gsl_matrix_const_view_vector_with_tda (const gsl_vector * v,
const size_t n1,
const size_t n2,
const size_t tda);
void gsl_matrix_set_zero (gsl_matrix * m);
void gsl_matrix_set_identity (gsl_matrix * m);
void gsl_matrix_set_all (gsl_matrix * m, double x);
int gsl_matrix_fread (FILE * stream, gsl_matrix * m) ;
int gsl_matrix_fwrite (FILE * stream, const gsl_matrix * m) ;
int gsl_matrix_fscanf (FILE * stream, gsl_matrix * m);
int gsl_matrix_fprintf (FILE * stream, const gsl_matrix * m, const char * format);
int gsl_matrix_memcpy(gsl_matrix * dest, const gsl_matrix * src);
int gsl_matrix_swap(gsl_matrix * m1, gsl_matrix * m2);
int gsl_matrix_swap_rows(gsl_matrix * m, const size_t i, const size_t j);
int gsl_matrix_swap_columns(gsl_matrix * m, const size_t i, const size_t j);
int gsl_matrix_swap_rowcol(gsl_matrix * m, const size_t i, const size_t j);
int gsl_matrix_transpose (gsl_matrix * m);
int gsl_matrix_transpose_memcpy (gsl_matrix * dest, const gsl_matrix * src);
double gsl_matrix_max (const gsl_matrix * m);
double gsl_matrix_min (const gsl_matrix * m);
void gsl_matrix_minmax (const gsl_matrix * m, double * min_out, double * max_out);
void gsl_matrix_max_index (const gsl_matrix * m, size_t * imax, size_t *jmax);
void gsl_matrix_min_index (const gsl_matrix * m, size_t * imin, size_t *jmin);
void gsl_matrix_minmax_index (const gsl_matrix * m, size_t * imin, size_t * jmin, size_t * imax, size_t * jmax);
int gsl_matrix_isnull (const gsl_matrix * m);
int gsl_matrix_ispos (const gsl_matrix * m);
int gsl_matrix_isneg (const gsl_matrix * m);
int gsl_matrix_isnonneg (const gsl_matrix * m);
int gsl_matrix_add (gsl_matrix * a, const gsl_matrix * b);
int gsl_matrix_sub (gsl_matrix * a, const gsl_matrix * b);
int gsl_matrix_mul_elements (gsl_matrix * a, const gsl_matrix * b);
int gsl_matrix_div_elements (gsl_matrix * a, const gsl_matrix * b);
int gsl_matrix_scale (gsl_matrix * a, const double x);
int gsl_matrix_add_constant (gsl_matrix * a, const double x);
int gsl_matrix_add_diagonal (gsl_matrix * a, const double x);
double gsl_matrix_get(const gsl_matrix * m, const size_t i, const size_t j);
void gsl_matrix_set(gsl_matrix * m, const size_t i, const size_t j, const double x);
double * gsl_matrix_ptr(gsl_matrix * m, const size_t i, const size_t j);
const double * gsl_matrix_const_ptr(const gsl_matrix * m, const size_t i, const size_t j);
gsl_matrix_complex *
gsl_matrix_complex_alloc (const size_t n1, const size_t n2);
gsl_matrix_complex *
gsl_matrix_complex_calloc (const size_t n1, const size_t n2);
gsl_matrix_complex *
gsl_matrix_complex_alloc_from_block (gsl_block_complex * b,
const size_t offset,
const size_t n1, const size_t n2, const size_t d2);
gsl_matrix_complex *
gsl_matrix_complex_alloc_from_matrix (gsl_matrix_complex * b,
const size_t k1, const size_t k2,
const size_t n1, const size_t n2);
gsl_vector_complex *
gsl_vector_complex_alloc_row_from_matrix (gsl_matrix_complex * m,
const size_t i);
gsl_vector_complex *
gsl_vector_complex_alloc_col_from_matrix (gsl_matrix_complex * m,
const size_t j);
void gsl_matrix_complex_free (gsl_matrix_complex * m);
gsl_matrix_complex_view
gsl_matrix_complex_submatrix (gsl_matrix_complex * m,
const size_t i, const size_t j,
const size_t n1, const size_t n2);
gsl_vector_complex_view
gsl_matrix_complex_row (gsl_matrix_complex * m, const size_t i);
gsl_vector_complex_view
gsl_matrix_complex_column (gsl_matrix_complex * m, const size_t j);
gsl_vector_complex_view
gsl_matrix_complex_diagonal (gsl_matrix_complex * m);
gsl_vector_complex_view
gsl_matrix_complex_subdiagonal (gsl_matrix_complex * m, const size_t k);
gsl_vector_complex_view
gsl_matrix_complex_superdiagonal (gsl_matrix_complex * m, const size_t k);
gsl_vector_complex_view
gsl_matrix_complex_subrow (gsl_matrix_complex * m,
const size_t i, const size_t offset,
const size_t n);
gsl_vector_complex_view
gsl_matrix_complex_subcolumn (gsl_matrix_complex * m,
const size_t j, const size_t offset,
const size_t n);
gsl_matrix_complex_view
gsl_matrix_complex_view_array (double * base,
const size_t n1,
const size_t n2);
gsl_matrix_complex_view
gsl_matrix_complex_view_array_with_tda (double * base,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_complex_view
gsl_matrix_complex_view_vector (gsl_vector_complex * v,
const size_t n1,
const size_t n2);
gsl_matrix_complex_view
gsl_matrix_complex_view_vector_with_tda (gsl_vector_complex * v,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_complex_const_view
gsl_matrix_complex_const_submatrix (const gsl_matrix_complex * m,
const size_t i, const size_t j,
const size_t n1, const size_t n2);
gsl_vector_complex_const_view
gsl_matrix_complex_const_row (const gsl_matrix_complex * m,
const size_t i);
gsl_vector_complex_const_view
gsl_matrix_complex_const_column (const gsl_matrix_complex * m,
const size_t j);
gsl_vector_complex_const_view
gsl_matrix_complex_const_diagonal (const gsl_matrix_complex * m);
gsl_vector_complex_const_view
gsl_matrix_complex_const_subdiagonal (const gsl_matrix_complex * m,
const size_t k);
gsl_vector_complex_const_view
gsl_matrix_complex_const_superdiagonal (const gsl_matrix_complex * m,
const size_t k);
gsl_vector_complex_const_view
gsl_matrix_complex_const_subrow (const gsl_matrix_complex * m,
const size_t i, const size_t offset,
const size_t n);
gsl_vector_complex_const_view
gsl_matrix_complex_const_subcolumn (const gsl_matrix_complex * m,
const size_t j, const size_t offset,
const size_t n);
gsl_matrix_complex_const_view
gsl_matrix_complex_const_view_array (const double * base,
const size_t n1,
const size_t n2);
gsl_matrix_complex_const_view
gsl_matrix_complex_const_view_array_with_tda (const double * base,
const size_t n1,
const size_t n2,
const size_t tda);
gsl_matrix_complex_const_view
gsl_matrix_complex_const_view_vector (const gsl_vector_complex * v,
const size_t n1,
const size_t n2);
gsl_matrix_complex_const_view
gsl_matrix_complex_const_view_vector_with_tda (const gsl_vector_complex * v,
const size_t n1,
const size_t n2,
const size_t tda);
void gsl_matrix_complex_set_zero (gsl_matrix_complex * m);
void gsl_matrix_complex_set_identity (gsl_matrix_complex * m);
void gsl_matrix_complex_set_all (gsl_matrix_complex * m, gsl_complex x);
int gsl_matrix_complex_fread (FILE * stream, gsl_matrix_complex * m) ;
int gsl_matrix_complex_fwrite (FILE * stream, const gsl_matrix_complex * m) ;
int gsl_matrix_complex_fscanf (FILE * stream, gsl_matrix_complex * m);
int gsl_matrix_complex_fprintf (FILE * stream, const gsl_matrix_complex * m, const char * format);
int gsl_matrix_complex_memcpy(gsl_matrix_complex * dest, const gsl_matrix_complex * src);
int gsl_matrix_complex_swap(gsl_matrix_complex * m1, gsl_matrix_complex * m2);
int gsl_matrix_complex_swap_rows(gsl_matrix_complex * m, const size_t i, const size_t j);
int gsl_matrix_complex_swap_columns(gsl_matrix_complex * m, const size_t i, const size_t j);
int gsl_matrix_complex_swap_rowcol(gsl_matrix_complex * m, const size_t i, const size_t j);
int gsl_matrix_complex_transpose (gsl_matrix_complex * m);
int gsl_matrix_complex_transpose_memcpy (gsl_matrix_complex * dest, const gsl_matrix_complex * src);
int gsl_matrix_complex_isnull (const gsl_matrix_complex * m);
int gsl_matrix_complex_ispos (const gsl_matrix_complex * m);
int gsl_matrix_complex_isneg (const gsl_matrix_complex * m);
int gsl_matrix_complex_isnonneg (const gsl_matrix_complex * m);
int gsl_matrix_complex_add (gsl_matrix_complex * a, const gsl_matrix_complex * b);
int gsl_matrix_complex_sub (gsl_matrix_complex * a, const gsl_matrix_complex * b);
int gsl_matrix_complex_mul_elements (gsl_matrix_complex * a, const gsl_matrix_complex * b);
int gsl_matrix_complex_div_elements (gsl_matrix_complex * a, const gsl_matrix_complex * b);
int gsl_matrix_complex_scale (gsl_matrix_complex * a, const gsl_complex x);
int gsl_matrix_complex_add_constant (gsl_matrix_complex * a, const gsl_complex x);
int gsl_matrix_complex_add_diagonal (gsl_matrix_complex * a, const gsl_complex x);
gsl_complex gsl_matrix_complex_get(const gsl_matrix_complex * m, const size_t i, const size_t j);
void gsl_matrix_complex_set(gsl_matrix_complex * m, const size_t i, const size_t j, const gsl_complex x);
gsl_complex * gsl_matrix_complex_ptr(gsl_matrix_complex * m, const size_t i, const size_t j);
const gsl_complex * gsl_matrix_complex_const_ptr(const gsl_matrix_complex * m, const size_t i, const size_t j);
gsl_permutation *gsl_permutation_alloc (const size_t n);
gsl_permutation *gsl_permutation_calloc (const size_t n);
void gsl_permutation_init (gsl_permutation * p);
void gsl_permutation_free (gsl_permutation * p);
int gsl_permutation_memcpy (gsl_permutation * dest, const gsl_permutation * src);
int gsl_permutation_fread (FILE * stream, gsl_permutation * p);
int gsl_permutation_fwrite (FILE * stream, const gsl_permutation * p);
int gsl_permutation_fscanf (FILE * stream, gsl_permutation * p);
int gsl_permutation_fprintf (FILE * stream, const gsl_permutation * p, const char *format);
size_t gsl_permutation_size (const gsl_permutation * p);
size_t * gsl_permutation_data (const gsl_permutation * p);
int gsl_permutation_swap (gsl_permutation * p, const size_t i, const size_t j);
int gsl_permutation_valid (const gsl_permutation * p);
void gsl_permutation_reverse (gsl_permutation * p);
int gsl_permutation_inverse (gsl_permutation * inv, const gsl_permutation * p);
int gsl_permutation_next (gsl_permutation * p);
int gsl_permutation_prev (gsl_permutation * p);
int gsl_permutation_mul (gsl_permutation * p, const gsl_permutation * pa, const gsl_permutation * pb);
int gsl_permutation_linear_to_canonical (gsl_permutation * q, const gsl_permutation * p);
int gsl_permutation_canonical_to_linear (gsl_permutation * p, const gsl_permutation * q);
size_t gsl_permutation_inversions (const gsl_permutation * p);
size_t gsl_permutation_linear_cycles (const gsl_permutation * p);
size_t gsl_permutation_canonical_cycles (const gsl_permutation * q);
size_t gsl_permutation_get (const gsl_permutation * p, const size_t i);
int gsl_permute_vector (const gsl_permutation * p, gsl_vector * v);
int gsl_permute_vector_inverse (const gsl_permutation * p, gsl_vector * v);
double gsl_linalg_householder_transform (gsl_vector * v);
gsl_complex gsl_linalg_complex_householder_transform (gsl_vector_complex * v);
int gsl_linalg_householder_hm (double tau,
const gsl_vector * v,
gsl_matrix * A);
int gsl_linalg_householder_mh (double tau,
const gsl_vector * v,
gsl_matrix * A);
int gsl_linalg_householder_hv (double tau,
const gsl_vector * v,
gsl_vector * w);
int gsl_linalg_householder_hm1 (double tau,
gsl_matrix * A);
int gsl_linalg_complex_householder_hm (gsl_complex tau,
const gsl_vector_complex * v,
gsl_matrix_complex * A);
int gsl_linalg_complex_householder_mh (gsl_complex tau,
const gsl_vector_complex * v,
gsl_matrix_complex * A);
int gsl_linalg_complex_householder_hv (gsl_complex tau,
const gsl_vector_complex * v,
gsl_vector_complex * w);
int gsl_linalg_hessenberg_decomp(gsl_matrix *A, gsl_vector *tau);
int gsl_linalg_hessenberg_unpack(gsl_matrix * H, gsl_vector * tau,
gsl_matrix * U);
int gsl_linalg_hessenberg_unpack_accum(gsl_matrix * H, gsl_vector * tau,
gsl_matrix * U);
int gsl_linalg_hessenberg_set_zero(gsl_matrix * H);
int gsl_linalg_hessenberg_submatrix(gsl_matrix *M, gsl_matrix *A,
size_t top, gsl_vector *tau);
int gsl_linalg_hessenberg(gsl_matrix *A, gsl_vector *tau);
int gsl_linalg_hesstri_decomp(gsl_matrix * A, gsl_matrix * B,
gsl_matrix * U, gsl_matrix * V,
gsl_vector * work);
int
gsl_linalg_SV_decomp (gsl_matrix * A,
gsl_matrix * V,
gsl_vector * S,
gsl_vector * work);
int
gsl_linalg_SV_decomp_mod (gsl_matrix * A,
gsl_matrix * X,
gsl_matrix * V,
gsl_vector * S,
gsl_vector * work);
int gsl_linalg_SV_decomp_jacobi (gsl_matrix * A,
gsl_matrix * Q,
gsl_vector * S);
int
gsl_linalg_SV_solve (const gsl_matrix * U,
const gsl_matrix * Q,
const gsl_vector * S,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_LU_decomp (gsl_matrix * A, gsl_permutation * p, int *signum);
int gsl_linalg_LU_solve (const gsl_matrix * LU,
const gsl_permutation * p,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_LU_svx (const gsl_matrix * LU,
const gsl_permutation * p,
gsl_vector * x);
int gsl_linalg_LU_refine (const gsl_matrix * A,
const gsl_matrix * LU,
const gsl_permutation * p,
const gsl_vector * b,
gsl_vector * x,
gsl_vector * residual);
int gsl_linalg_LU_invert (const gsl_matrix * LU,
const gsl_permutation * p,
gsl_matrix * inverse);
double gsl_linalg_LU_det (gsl_matrix * LU, int signum);
double gsl_linalg_LU_lndet (gsl_matrix * LU);
int gsl_linalg_LU_sgndet (gsl_matrix * lu, int signum);
int gsl_linalg_complex_LU_decomp (gsl_matrix_complex * A,
gsl_permutation * p,
int *signum);
int gsl_linalg_complex_LU_solve (const gsl_matrix_complex * LU,
const gsl_permutation * p,
const gsl_vector_complex * b,
gsl_vector_complex * x);
int gsl_linalg_complex_LU_svx (const gsl_matrix_complex * LU,
const gsl_permutation * p,
gsl_vector_complex * x);
int gsl_linalg_complex_LU_refine (const gsl_matrix_complex * A,
const gsl_matrix_complex * LU,
const gsl_permutation * p,
const gsl_vector_complex * b,
gsl_vector_complex * x,
gsl_vector_complex * residual);
int gsl_linalg_complex_LU_invert (const gsl_matrix_complex * LU,
const gsl_permutation * p,
gsl_matrix_complex * inverse);
gsl_complex gsl_linalg_complex_LU_det (gsl_matrix_complex * LU,
int signum);
double gsl_linalg_complex_LU_lndet (gsl_matrix_complex * LU);
gsl_complex gsl_linalg_complex_LU_sgndet (gsl_matrix_complex * LU,
int signum);
int gsl_linalg_QR_decomp (gsl_matrix * A,
gsl_vector * tau);
int gsl_linalg_QR_solve (const gsl_matrix * QR,
const gsl_vector * tau,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QR_svx (const gsl_matrix * QR,
const gsl_vector * tau,
gsl_vector * x);
int gsl_linalg_QR_lssolve (const gsl_matrix * QR,
const gsl_vector * tau,
const gsl_vector * b,
gsl_vector * x,
gsl_vector * residual);
int gsl_linalg_QR_QRsolve (gsl_matrix * Q,
gsl_matrix * R,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QR_Rsolve (const gsl_matrix * QR,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QR_Rsvx (const gsl_matrix * QR,
gsl_vector * x);
int gsl_linalg_QR_update (gsl_matrix * Q,
gsl_matrix * R,
gsl_vector * w,
const gsl_vector * v);
int gsl_linalg_QR_QTvec (const gsl_matrix * QR,
const gsl_vector * tau,
gsl_vector * v);
int gsl_linalg_QR_Qvec (const gsl_matrix * QR,
const gsl_vector * tau,
gsl_vector * v);
int gsl_linalg_QR_QTmat (const gsl_matrix * QR,
const gsl_vector * tau,
gsl_matrix * A);
int gsl_linalg_QR_unpack (const gsl_matrix * QR,
const gsl_vector * tau,
gsl_matrix * Q,
gsl_matrix * R);
int gsl_linalg_R_solve (const gsl_matrix * R,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_R_svx (const gsl_matrix * R,
gsl_vector * x);
int gsl_linalg_QRPT_decomp (gsl_matrix * A,
gsl_vector * tau,
gsl_permutation * p,
int *signum,
gsl_vector * norm);
int gsl_linalg_QRPT_decomp2 (const gsl_matrix * A,
gsl_matrix * q, gsl_matrix * r,
gsl_vector * tau,
gsl_permutation * p,
int *signum,
gsl_vector * norm);
int gsl_linalg_QRPT_solve (const gsl_matrix * QR,
const gsl_vector * tau,
const gsl_permutation * p,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QRPT_svx (const gsl_matrix * QR,
const gsl_vector * tau,
const gsl_permutation * p,
gsl_vector * x);
int gsl_linalg_QRPT_QRsolve (const gsl_matrix * Q,
const gsl_matrix * R,
const gsl_permutation * p,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QRPT_Rsolve (const gsl_matrix * QR,
const gsl_permutation * p,
const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_QRPT_Rsvx (const gsl_matrix * QR,
const gsl_permutation * p,
gsl_vector * x);
int gsl_linalg_QRPT_update (gsl_matrix * Q,
gsl_matrix * R,
const gsl_permutation * p,
gsl_vector * u,
const gsl_vector * v);
int gsl_linalg_LQ_decomp (gsl_matrix * A, gsl_vector * tau);
int gsl_linalg_LQ_solve_T (const gsl_matrix * LQ, const gsl_vector * tau,
const gsl_vector * b, gsl_vector * x);
int gsl_linalg_LQ_svx_T (const gsl_matrix * LQ, const gsl_vector * tau,
gsl_vector * x);
int gsl_linalg_LQ_lssolve_T (const gsl_matrix * LQ, const gsl_vector * tau,
const gsl_vector * b, gsl_vector * x,
gsl_vector * residual);
int gsl_linalg_LQ_Lsolve_T (const gsl_matrix * LQ, const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_LQ_Lsvx_T (const gsl_matrix * LQ, gsl_vector * x);
int gsl_linalg_L_solve_T (const gsl_matrix * L, const gsl_vector * b,
gsl_vector * x);
int gsl_linalg_LQ_vecQ (const gsl_matrix * LQ, const gsl_vector * tau,
gsl_vector * v);
int gsl_linalg_LQ_vecQT (const gsl_matrix * LQ, const gsl_vector * tau,
gsl_vector * v);
int gsl_linalg_LQ_unpack (const gsl_matrix * LQ, const gsl_vector * tau,
gsl_matrix * Q, gsl_matrix * L);
int gsl_linalg_LQ_update (gsl_matrix * Q, gsl_matrix * R,
const gsl_vector * v, gsl_vector * w);
int gsl_linalg_LQ_LQsolve (gsl_matrix * Q, gsl_matrix * L,
const gsl_vector * b, gsl_vector * x);
int gsl_linalg_PTLQ_decomp (gsl_matrix * A, gsl_vector * tau,
gsl_permutation * p, int *signum,
gsl_vector * norm);
int gsl_linalg_PTLQ_decomp2 (const gsl_matrix * A, gsl_matrix * q,