-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
969 lines (898 loc) · 60.3 KB
/
README
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
These files provide the routine 'mrrr'. Its purpose is to compute all
or a subset of eigenvalues and optionally eigenvectors of a symmetric
tridiagonal matrix. 'mrrr' is based on the algorithm of Multiple
Relatively Robust Representations (MRRR). The routine thereby targets
multi-core processors and SMP systems made out of them. The
implementation is based on LAPACK's routine 'dstemr'.
Building the archive libmrrr.a:
--------------------------------
1) In the folder INSTALL, depending on the compiler used,
replace the file 'make.inc' (which assumes GNU gcc)
with the corresponding file.
For example if you want to use Intel's compilers:
$cp ./INSTALL/make.inc.intel ./make.inc
If you do not find a file matching your compiler, then use any of
the files as a basis to edit.
2) Edit the file 'make.inc' according to your system. Especially, set
the variable INCLAPACK to zero if you plan to link to LAPACK and
BLAS, instead of compiling the necessary routines and including
them in the archive. (LAPACK 3.3 or equivalent is recommended.)
3) Run make.
Known issues:
-------------
- PROBLEM: Spinlocks are not supported
SOLUTION: Compile the library with SPINLOCK_SUPPORT=0 in 'make.inc'
- PROBLEM: The C99 feature of complex numbers is not supported
SOLUTION: Use a newer compiler or compile the library with
COMPLEX_SUPPORT=0 (default) in 'make.inc'. In the latter case the
dense Hermitian routines will not be available in the archive
Using libmrrr.a:
----------------
The folder EXAMPLES contains simple examples of how to use the routine
'mrrr' in C and Fortran code. Edit the 'Makefile' in these folders if
you do not use the GNU compilers and run 'make' to compile the
examples.
In general, the code that calls 'mrrr' needs to be linked to the
library 'libmrrr.a', which is created in the LIB folder.
Below are given the C and Fortran prototypes of the function 'mrrr'.
For more information please see 'INCLUDE/mrrr.h'.
######################################################################
# C function prototype: #
######################################################################
# #
# int mrrr(char *jobz, char *range, int *n, double *D, #
# double *E, double *vl, double *vu, int *il, int *iu, #
# int *tryrac, int *m, double *W, double *Z, int *ldz, #
# int *Zsupp); #
# #
# INPUTS: #
# ------- #
# jobz "N" or "n" - compute only eigenvalues #
# "V" or "v" - compute also eigenvectors #
# "C" or "c" - count the maximal number of #
# locally computed eigenvectors #
# range "A" or "a" - all #
# "V" or "v" - by interval: (VL,VU] #
# "I" or "i" - by index: IL-IU #
# n Matrix size #
# ldz Leading dimension of eigenvector matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# D (double[n]) Diagonal elements of tridiagonal T. #
# (On output the array will be overwritten). #
# E (double[n]) Off-diagonal elements of tridiagonal T. #
# First n-1 elements contain off-diagonals, #
# the last element can have an abitrary value. #
# (On output the array will be overwritten.) #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index 'il' to 'iu'#
# are computed. #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index 'il' to 'iu'#
# are computed. #
# tryrac 0 - do not try to achieve high relative accuracy.#
# 1 - relative accuracy will be attempted; #
# on output it is set to zero if high relative #
# accuracy is not achieved. #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed. #
# If jobz="C", 'm' will be set to the number of #
# eigenvalues/eigenvectors that will be computed. #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues. #
# Z Eigenvectors #
# (double[n*m]) Enough space must be provided to store the #
# vectors. 'm' should be bigger or equal #
# to 'n' for range="A" and 'iu-il+1' for range="I".#
# For range="V" the minimum 'm' can be queried #
# using jobz="C". #
# Zsupp Support of eigenvectors, which is given by #
# (double[2*n]) Z[2*i] to Z[2*i+1] for the i-th eigenvector #
# stored locally (1-based indexing). #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# MRRR(JOBZ, RANGE, N, D, E, VL, VU, IL, IU, TRYRAC, M, W, #
# Z, LDZ, ZSUPP, INFO) #
# #
# CHARACTER JOBZ, RANGE #
# INTEGER N, IL, IU, TRYRAC, M, LDZ, ZSUPP(*), INFO #
# DOUBLE PRECISION D(*), D(*), VL, VU, W(*), Z(*,*) #
######################################################################
The number of threads created can be specified via the environment
variable PMR_NUM_THREADS. In case this variable is not
defined, then the routine will create as many threads as specified by
the variable DEFAULT_NUM_THREADS (which is set in 'mrrr.h').
ADDITIONAL ROUTINES FOR DENSE STANDARD AND GENERALIZED EIGENPROBLEMS
--------------------------------------------------------------------
For convinience there are also routines for the standard and
generalized symmetric and Hermitian eigenproblem added that make use
of the multi-threaded MRRR. The functionality is similar to LAPACK's
routines for this operations. The routines using packed storage should
be avoided whenever possible, since their performance is much worse.
The routines are (using a LAPACK like notation):
----------------------------------------------------------------------
Standard eigenvector problem A*x = lambda*x:
Computing all or a subset of eigenvalues, and optionally
eigenvectors
----------------------------------------------------------------------
dsyeig: A is symmetric
zheeig: A is Hermitian
dspeig: A is symmetric and stored in packed storage
zhpeig: A is Hermitian and stored in packed storage
----------------------------------------------------------------------
----------------------------------------------------------------------
Standard eigenvector problem A*x = lambda*B*x or A*B*x = lambda*x
or B*A*x = lambda*x:
Computing all or a subset of eigenvalues, and optionally
eigenvectors
----------------------------------------------------------------------
dsygeig: A and B are symmetric and B is definite
zhegeig: A and B are Hermitian and B is definite
dspgeig: A and B are symmetric, stored in packed storage,
and B is definite
zhpgeig: A and B are Hermitian, stored in packed storage,
and B is definite
----------------------------------------------------------------------
The dense standard eigenvalue problem:
--------------------------------------
For the reduction and back-transformation the routines call the
corresponding LAPACK routines. Therefore LAPACK is required to run
the routines. Simply code snippets of how to call the functions are
included in the examples folder.
The prototypes are similar to LAPACK's "dsyevx" and are as follows.
The symmetric case:
######################################################################
# C function prototype: #
######################################################################
# #
# int dsyeig(char *jobz, char *range, char *uplo, int *n, double *A, #
# int *lda, double *vl, double *vu, int *il, int *iu, #
# int *m, double *W, double *Z, int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A stored #
# "U" - Upper triangle of A stored #
# n Order of the matrix A #
# lda Leading dimension of matrix A; #
# often equal to matrix size n #
# ldz Leading dimension of eigenvector matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# A On entry symmetric input matrix, stored #
# (double[lda*n]) in column major ordering. Depending on the #
# value of 'uplo' only the upper or lower #
# triangular part is referenced. #
# (On output the array will be overwritten). #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed. #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues. #
# Z Eigenvectors. #
# (double[n*m]) Enough space must be provided to store the #
# vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I". #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# DSYEIG(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, M, W, #
# Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDA, LDZ, INFO #
# DOUBLE PRECISION A(*,*), VL, VU, W(*), Z(*,*) #
# #
######################################################################
The symmetric case (packed storage):
######################################################################
# C function prototype: #
######################################################################
# #
# int dspeig(char *jobz, char *range, char *uplo, int *n, #
# double *AP, double *vl, double *vu, int *il, int *iu, #
# int *m, double *W, double *Z, int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A stored #
# "U" - Upper triangle of A stored #
# n Order of the matrix A #
# ldz Leading dimension of eigenvector matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# AP (double[s]) On entry symmetric input matrix, stored #
# s = (n*(n+1))/2 in column major ordering. Depending on the #
# value of 'uplo' only the upper or lower #
# triangular part is stored. #
# (On output the array will be overwritten). #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues #
# Z Eigenvectors #
# (double[n*m]) Enough space must be provided to store the #
# vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I" #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# DSPEIG(JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU, M, W, #
# Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDZ, INFO #
# DOUBLE PRECISION AP(*), VL, VU, W(*), Z(*,*) #
# #
######################################################################
The Hermitian case (only added to 'libmrrr.a' if specified in
'make.inc'):
######################################################################
# C function prototype: #
######################################################################
# #
# int zheeig(char *jobz, char *range, char *uplo, int *n, #
# double complex *A, int *lda, double *vl, double *vu, #
# int *il, int *iu, int *m, double *W, double complex *Z, #
# int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A stored #
# "U" - Upper triangle of A stored #
# n Order of the matrix A #
# lda Leading dimension of matrix A; #
# often equal to matrix size n #
# ldz Leading dimension of eigenvector matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# A On entry Hermitian input matrix, stored #
# (double complex in column major ordering. Depending on the #
# [lda*n]) value of 'uplo' only the upper or lower #
# triangular part is referenced. #
# (On output the array will be overwritten). #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed. #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues. #
# Z Eigenvectors. #
# (double complex Enough space must be provided to store the #
# [n*m]) vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I". #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# DSYEIG(JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, M, W, #
# Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDA, LDZ, INFO #
# DOUBLE PRECISION VL, VU, W(*) #
# COMPLEX*16 A(*,*), Z(*,*) #
# #
######################################################################
The Hermitian case (packed storage; only added to if specified in
'make.inc'):
######################################################################
# C function prototype: #
######################################################################
# #
# int zhpeig(char *jobz, char *range, char *uplo, int *n, #
# double complex *AP, double *vl, double *vu, #
# int *il, int *iu, int *m, double *W, #
# double complex *Z, int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A stored #
# "U" - Upper triangle of A stored #
# n Order of the matrix A #
# ldz Leading dimension of eigenvector matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# AP (double On entry Hermitian input matrix, stored #
# complex[s]) in packed storage by columns. Depending on the #
# s = (n*(n+1))/2 value of 'uplo' only the upper or lower #
# triangular part is stored. #
# (On output the array will be overwritten). #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined. #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues. #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu'. #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed. #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed. #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues. #
# Z Eigenvectors #
# (double Enough space must be provided to store the #
# complex[n*m]) vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I". #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# ZHPEIG(JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU, M, W, #
# Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDZ, INFO #
# DOUBLE PRECISION VL, VU, W(*) #
# COMPLEX*16 AP(*), Z(*,*) #
# #
######################################################################
The dense generalized definite eigenvalue problem:
--------------------------------------------------
Using LAPACK notation the routines are called DSYGEIG and ZHEGEIG.
Simply code snippets of how to call the functions are included in the
examples folder.
The problems that can be solved have the following form:
A*x = lambda*B*x or A*B*x = lambda*x or B*A*x = lambda*x,
where A and B are symmetric/Hermitian and B is definite.
Symmetric-definite case:
######################################################################
# C function prototype: #
######################################################################
# #
# int dsygeig(int *itype, char *jobz, char *range, char *uplo, #
# int *n, double *A, int *lda, double *B, int *ldb, #
# double *vl, double *vu, int *il, int *iu, int *m, #
# double *W); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# itype 1 - A*x = lambda*B*x #
# 2 - A*B*x = lambda*x #
# 3 - B*A*x = lambda*x #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A and B stored #
# "U" - Upper triangle of A and B stored #
# n Order of the matrix A and B #
# lda Leading dimension of matrix A; #
# often equal to matrix size n #
# ldb Leading dimension of eigenvector matrix B; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# A On entry symmetric input matrix, stored #
# (double[lda*n]) in column major ordering. Depending on the #
# value of 'uplo' only the upper or lower #
# triangular part is referenced #
# On output the array will contain the #
# 'm' computed eigenvectors #
# B On entry symmetric definite input matrix, #
# (double[ldb*n]) stored in column major ordering. #
# Depending on the value of 'uplo' only the upper #
# or lower triangular part is referenced #
# On output overwritten #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input #
# On output the eigenvalues with index il to iu #
# are computed #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues #
# #
# NOTICE: The routine will allocate work space of size #
# double[n*n] for range="A" or "V" and double[m*n] #
# for range="I" #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# DSYGEIG(ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB, #
# VL, VU, IL, IU, M, W, INFO); #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDA, LDB, INFO #
# DOUBLE PRECISION A(*,*), B(*,*), VL, VU, W(*) #
# #
######################################################################
Symmetric-definite case (packed storage):
######################################################################
# C function prototype: #
######################################################################
# #
# int dspgeig(int *itype, char *jobz, char *range, char *uplo, #
# int *n, double *AP, double *BP, double *vl, #
# double *vu, int *il, int *iu, int *m, double *W, #
# double *Z, int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# itype 1 - A*x = lambda*B*x #
# 2 - A*B*x = lambda*x #
# 3 - B*A*x = lambda*x #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A and B stored #
# "U" - Upper triangle of A and B stored #
# n Order of the matrix A and B #
# ldz Leading dimension of matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# AP On entry symmetric input matrix, stored in #
# (double[s]) packed format by columns. Depending on the #
# s = (n*(n+1))/2 value of 'uplo' only the upper or lower #
# triangular part is stored #
# On output the array will contain the #
# 'm' computed eigenvectors #
# BP On entry symmetric definite input matrix, stored #
# (double[s]) in packed format by columns. #
# s = (n*(n+1))/2 Depending on the value of 'uplo' only the upper #
# or lower triangular part is stored #
# On output overwritten #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input #
# On output the eigenvalues with index il to iu #
# are computed #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues #
# Z (double[m*n]) Eigenvectors #
# Enough space must be provided to store the #
# vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I". #
# #
# NOTICE: The routine will allocate work space of size #
# double[n*n] for range="A" or "V" and double[m*n] #
# for range="I" #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# DSPGEIG(ITYPE, JOBZ, RANGE, UPLO, N, AP, BP, #
# VL, VU, IL, IU, M, W, Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDZ, INFO #
# DOUBLE PRECISION AP(*), BP(*), VL, VU, W(*), Z(*,*) #
# #
######################################################################
Hermitian-definite case:
######################################################################
# C function prototype: #
######################################################################
# #
# int zhegeig(int *itype, char *jobz, char *range, char *uplo, #
# int *n, double complex *A, int *lda, #
# double complex *B, int *ldb, double *vl, double *vu, #
# int *il, int *iu, int *m, double *W); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# itype 1 - A*x = lambda*B*x #
# 2 - A*B*x = lambda*x #
# 3 - B*A*x = lambda*x #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A and B stored #
# "U" - Upper triangle of A and B stored #
# n Order of the matrix A and B #
# lda Leading dimension of matrix A; #
# often equal to matrix size n #
# ldb Leading dimension of eigenvector matrix B; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# A On entry symmetric input matrix, stored #
# (double in column major ordering. Depending on the #
# complex[lda*n]) value of 'uplo' only the upper or lower #
# triangular part is referenced #
# On output the array will contain the #
# 'm' computed eigenvectors #
# B On entry symmetric definite input matrix, #
# (double stored in column major ordering. #
# complex[ldb*n]) Depending on the value of 'uplo' only the upper #
# or lower triangular part is referenced #
# On output overwritten #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input #
# On output the eigenvalues with index il to iu #
# are computed #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues #
# #
# NOTICE: The routine will allocate work space of size #
# double[n*n] for range="A" or "V" and double[m*n] #
# for range="I" #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# ZHEGEIG(ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB, #
# VL, VU, IL, IU, M, W, INFO); #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDA, LDB, INFO #
# DOUBLE PRECISION VL, VU, W(*) #
# COMPLEX*16 A(*,*), B(*,*) #
# #
######################################################################
Hermitian-definite case (packed storage):
######################################################################
# C function prototype: #
######################################################################
# #
# int zhpgeig(int *itype, char *jobz, char *range, char *uplo, #
# int *n, double complex *AP, double complex *BP, #
# double *vl, double *vu, int *il, int *iu, int *m, #
# double *W, double complex *Z, int *ldz); #
# #
# Arguments: #
# ---------- #
# #
# INPUTS: #
# ------- #
# itype 1 - A*x = lambda*B*x #
# 2 - A*B*x = lambda*x #
# 3 - B*A*x = lambda*x #
# jobz "N" - compute only eigenvalues #
# "V" - compute also eigenvectors #
# range "A" - all #
# "V" - by interval: (VL,VU] #
# "I" - by index: IL-IU #
# uplo "L" - Lower triangle of A and B stored #
# "U" - Upper triangle of A and B stored #
# n Order of the matrix A and B #
# ldz Leading dimension of matrix Z; #
# often equal to matrix size n #
# #
# INPUT + OUTPUT: #
# --------------- #
# AP On entry Hermitian input matrix, stored in #
# (double packed format by columns. Depending on the #
# complex[s]) value of 'uplo' only the upper or lower #
# s = (n*(n+1))/2 triangular part is stored #
# On output the array will contain the #
# 'm' computed eigenvectors #
# BP On entry Hermitian definite input matrix, stored #
# (double in packed format by columns. #
# complex[s]) Depending on the value of 'uplo' only the upper #
# s = (n*(n+1))/2 or lower triangular part is stored #
# On output overwritten #
# vl If range="V", lower bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# vu If range="V", upper bound of interval #
# (vl,vu], on output refined #
# If range="A" or "I" not referenced as input. #
# On output the interval (vl,vu] contains ALL #
# the computed eigenvalues #
# il If range="I", lower index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input. #
# On output the eigenvalues with index il to iu #
# are computed #
# iu If range="I", upper index (1-based indexing) of #
# the subset 'il' to 'iu' #
# If range="A" or "V" not referenced as input #
# On output the eigenvalues with index il to iu #
# are computed #
# #
# OUTPUT: #
# ------- #
# m Number of eigenvalues and eigenvectors computed #
# W (double[n]) Eigenvalues #
# The first 'm' entries contain the eigenvalues #
# Z (double Eigenvectors #
# complex[m*n]) Enough space must be provided to store the #
# vectors. 'm' should be bigger or equal #
# to 'n' for range="A" or "V" and 'iu-il+1' for #
# range="I". #
# #
# NOTICE: The routine will allocate work space of size #
# double[n*n] for range="A" or "V" and double[m*n] #
# for range="I" #
# #
# RETURN VALUE: #
# ------------- #
# 0 - Success #
# 1 - Wrong input parameter #
# 2 - Misc errors #
# #
######################################################################
######################################################################
# Fortran prototype: #
######################################################################
# #
# ZHPGEIG(ITYPE, JOBZ, RANGE, UPLO, N, AP, BP, #
# VL, VU, IL, IU, M, W, Z, LDZ, INFO) #
# #
# CHARACTER JOBZ, RANGE, UPLO #
# INTEGER N, IL, IU, M, LDZ, INFO #
# DOUBLE PRECISION VL, VU, W(*) #
# COMPLEX*16 AP(*), BP(*), Z(*,*) #
# #
######################################################################
COMMENTS AND BUGS:
petschow@aices.rwth-aachen.de