Skip to content

Commit af560c1

Browse files
authored
Merge pull request #6161 from martin-frbg/lapack1424
Add D/S SSTEBR: value-only boundary-row DC eigensolvers (Reference-LAPACK PR 1424)
2 parents b20e846 + 1ceccd5 commit af560c1

46 files changed

Lines changed: 9948 additions & 40 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎cmake/lapack.cmake‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ set(SLASRC
136136
slaorhr_col_getrfnp2.f sorgtsqr.f sorgtsqr_row.f sorhr_col.f
137137
slatrs3.f strsyl3.f sgelst.f sgedmd.f90 sgedmdq.f90 sgecxx.f
138138
sbdsvdmr3.f sbdsvdmr3_work.f sgesvdmr3.f sbdtgk.f slar1v_tgk.f
139-
slarrf_tgk.f slarrb_tgk.f slarrv_tgk.f)
139+
slarrf_tgk.f slarrb_tgk.f slarrv_tgk.f slaed0_br.f slaed0_merge_pair.f
140+
slaed4_br.f slaed7_br.f slaed8_br.f slaed9_br.f sstebr.f ssteqr_boundary_br.f)
140141

141142
set(SXLASRC sgesvxx.f sgerfsx.f sla_gerfsx_extended.f sla_geamv.f
142143
sla_gercond.f sla_gerpvgrw.f ssysvxx.f ssyrfsx.f
@@ -332,7 +333,8 @@ set(DLASRC
332333
dlaorhr_col_getrfnp2.f dorgtsqr.f dorgtsqr_row.f dorhr_col.f
333334
dlatrs3.f dtrsyl3.f dgelst.f dgedmd.f90 dgedmdq.f90 dgecxx.f
334335
dbdsvdmr3.f dbdsvdmr3_work.f dgesvdmr3.f dbdtgk.f dlar1v_tgk.f
335-
dlarrf_tgk.f dlarrb_tgk.f dlarrv_tgk.f)
336+
dlarrf_tgk.f dlarrb_tgk.f dlarrv_tgk.f dlaed0_br.f dlaed0_merge_pair.f
337+
dlaed4_br.f dlaed7_br.f dlaed8_br.f dlaed9_br.f dstebr.f dsteqr_boundary_br.f)
336338

337339
set(DXLASRC dgesvxx.f dgerfsx.f dla_gerfsx_extended.f dla_geamv.f
338340
dla_gercond.f dla_gerpvgrw.f dsysvxx.f dsyrfsx.f
@@ -647,7 +649,8 @@ set(SLASRC
647649
slaorhr_col_getrfnp2.c sorgtsqr.c sorgtsqr_row.c sorhr_col.c
648650
slatrs3.c strsyl3.c sgelst.c sgedmd.c sgedmdq.c sgecxx.c
649651
sbdsvdmr3.c sbdsvdmr3_work.c sgesvdmr3.c sbdtgk.c slar1v_tgk.c
650-
slarrf_tgk.c slarrb_tgk.c slarrv_tgk.c)
652+
slarrf_tgk.c slarrb_tgk.c slarrv_tgk.c slaed0_br.c slaed0_merge_pair.c
653+
slaed4_br.c slaed7_br.c slaed8_br.c slaed9_br.c sstebr.c ssteqr_boundary_br.c)
651654

652655
set(SXLASRC sgesvxx.c sgerfsx.c sla_gerfsx_extended.c sla_geamv.c
653656
sla_gercond.c sla_gerpvgrw.c ssysvxx.c ssyrfsx.c
@@ -840,7 +843,8 @@ set(DLASRC
840843
dlaorhr_col_getrfnp2.c dorgtsqr.c dorgtsqr_row.c dorhr_col.c
841844
dlatrs3.c dtrsyl3.c dgelst.c dgedmd.c dgedmdq.c dgecxx.c
842845
dbdsvdmr3.c dbdsvdmr3_work.c dgesvdmr3.c dbdtgk.c dlar1v_tgk.c
843-
dlarrf_tgk.c dlarrb_tgk.c dlarrv_tgk.c)
846+
dlarrf_tgk.c dlarrb_tgk.c dlarrv_tgk.c dlaed0_br.c dlaed0_merge_pair.c
847+
dlaed4_br.c dlaed7_br.c dlaed8_br.c dlaed9_br.c dstebr.c dsteqr_boundary_br.c)
844848

845849
set(DXLASRC dgesvxx.c dgerfsx.c dla_gerfsx_extended.c dla_geamv.c
846850
dla_gercond.c dla_gerpvgrw.c dsysvxx.c dsyrfsx.c

‎cmake/lapacke.cmake‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,8 @@ set(DSRC
10361036
lapacke_dsptri_work.c
10371037
lapacke_dsptrs.c
10381038
lapacke_dsptrs_work.c
1039+
lapacke_dstebr.c
1040+
lapacke_dstebr_work.c
10391041
lapacke_dstebz.c
10401042
lapacke_dstebz_work.c
10411043
lapacke_dstedc.c
@@ -1619,6 +1621,8 @@ set(SSRC
16191621
lapacke_ssptri_work.c
16201622
lapacke_ssptrs.c
16211623
lapacke_ssptrs_work.c
1624+
lapacke_sstebr.c
1625+
lapacke_sstebr_work.c
16221626
lapacke_sstebz.c
16231627
lapacke_sstebz_work.c
16241628
lapacke_sstedc.c

‎exports/gensymbol‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,14 @@ lapackobjs2d="$lapackobjs2d
949949
dlarrb_tgk
950950
dlarrf_tgk
951951
dlarrv_tgk
952+
dlaed0_br
953+
dlaed0_merge_pair
954+
dlaed4_br
955+
dlaed7_br
956+
dlaed8_br
957+
dlaed9_br
958+
dstebr
959+
dsteqr_boundary_br
952960
"
953961
# dlaqz0
954962
# dlaqz1
@@ -973,6 +981,14 @@ lapackobjs2s="$lapackobjs2s
973981
slarrb_tgk
974982
slarrf_tgk
975983
slarrv_tgk
984+
dlaed0_br
985+
dlaed0_merge_pair
986+
dlaed4_br
987+
dlaed7_br
988+
dlaed8_br
989+
dlaed9_br
990+
dstebr
991+
dsteqr_boundary_br
976992
"
977993

978994
lapackobjs2z="$lapackobjs2z
@@ -2401,6 +2417,8 @@ lapackeobjsd="
24012417
LAPACKE_dbdsvdmr3_work
24022418
LAPACKE_dgesvdmr3
24032419
LAPACKE_dgesvdmr3_work
2420+
LAPACKE_dstebr
2421+
LAPACKE_dstebr_work
24042422
"
24052423

24062424
lapackeobjss="
@@ -3024,6 +3042,8 @@ lapackeobjss="
30243042
LAPACKE_sbdsvdmr3_work
30253043
LAPACKE_sgesvdmr3
30263044
LAPACKE_sgesvdmr3_work
3045+
LAPACKE_sstebr
3046+
LAPACKE_sstebr_work
30273047
"
30283048

30293049
lapackeobjsz="

‎exports/gensymbol.pl‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,15 @@
922922
dlar1v_tgk,
923923
dlarrb_tgk,
924924
dlarrf_tgk,
925-
dlarrv_tgk
925+
dlarrv_tgk,
926+
dlaed0_br,
927+
dlaed0_merge_pair,
928+
dlaed4_br,
929+
dlaed7_br,
930+
dlaed8_br,
931+
dlaed9_br,
932+
dstebr,
933+
dsteqr_boundary_br
926934
);
927935

928936
@lapackobjs2s = (@lapackobjs2s,
@@ -941,7 +949,15 @@
941949
slar1v_tgk,
942950
slarrb_tgk,
943951
slarrf_tgk,
944-
slarrv_tgk
952+
slarrv_tgk,
953+
slaed0_br,
954+
slaed0_merge_pair,
955+
slaed4_br,
956+
slaed7_br,
957+
slaed8_br,
958+
slaed9_br,
959+
sstebr,
960+
ssteqr_boundary_br
945961
);
946962

947963
@lapackobjs2z = (@lapackobjs2z,
@@ -2364,7 +2380,9 @@
23642380
LAPACKE_dbdsvdmr3,
23652381
LAPACKE_dbdsvdmr3_work,
23662382
LAPACKE_dgesvdmr3,
2367-
LAPACKE_dgesvdmr3_work
2383+
LAPACKE_dgesvdmr3_work,
2384+
LAPACKE_dstebr,
2385+
LAPACKE_dstebr_work
23682386
);
23692387
@lapackeobjss = (
23702388
LAPACKE_sgb_nancheck,
@@ -2986,7 +3004,9 @@
29863004
LAPACKE_sbdsvdmr3,
29873005
LAPACKE_sbdsvdmr3_work,
29883006
LAPACKE_sgesvdmr3,
2989-
LAPACKE_sgesvdmr3_work
3007+
LAPACKE_sgesvdmr3_work,
3008+
LAPACKE_sstebr,
3009+
LAPACKE_sstebr_work
29903010
);
29913011
@lapackeobjsz = (
29923012
LAPACKE_zgb_nancheck,

‎lapack-netlib/LAPACKE/include/lapack.h‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16650,6 +16650,24 @@ void LAPACK_sstebz_base(
1665016650
#define LAPACK_sstebz(...) LAPACK_sstebz_base(__VA_ARGS__)
1665116651
#endif
1665216652

16653+
#define LAPACK_dstebr LAPACK_GLOBAL(dstebr,DSTEBR)
16654+
void LAPACK_dstebr(
16655+
lapack_int const* n,
16656+
double* D,
16657+
double* E,
16658+
double* work, lapack_int const* lwork,
16659+
lapack_int* iwork, lapack_int const* liwork,
16660+
lapack_int* info );
16661+
16662+
#define LAPACK_sstebr LAPACK_GLOBAL(sstebr,SSTEBR)
16663+
void LAPACK_sstebr(
16664+
lapack_int const* n,
16665+
float* D,
16666+
float* E,
16667+
float* work, lapack_int const* lwork,
16668+
lapack_int* iwork, lapack_int const* liwork,
16669+
lapack_int* info );
16670+
1665316671
#define LAPACK_cstedc_base LAPACK_GLOBAL(cstedc,CSTEDC)
1665416672
void LAPACK_cstedc_base(
1665516673
char const* compz,

‎lapack-netlib/LAPACKE/include/lapacke.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,6 +3653,9 @@ lapack_int LAPACKE_dstebz( char range, char order, lapack_int n, double vl,
36533653
lapack_int* m, lapack_int* nsplit, double* w,
36543654
lapack_int* iblock, lapack_int* isplit );
36553655

3656+
lapack_int LAPACKE_sstebr( lapack_int n, float* d, float* e );
3657+
lapack_int LAPACKE_dstebr( lapack_int n, double* d, double* e );
3658+
36563659
lapack_int LAPACKE_sstedc( int matrix_layout, char compz, lapack_int n, float* d,
36573660
float* e, float* z, lapack_int ldz );
36583661
lapack_int LAPACKE_dstedc( int matrix_layout, char compz, lapack_int n,
@@ -9367,6 +9370,13 @@ lapack_int LAPACKE_dstebz_work( char range, char order, lapack_int n, double vl,
93679370
lapack_int* iblock, lapack_int* isplit,
93689371
double* work, lapack_int* iwork );
93699372

9373+
lapack_int LAPACKE_sstebr_work( lapack_int n, float* d, float* e, float* work,
9374+
lapack_int lwork, lapack_int* iwork,
9375+
lapack_int liwork );
9376+
lapack_int LAPACKE_dstebr_work( lapack_int n, double* d, double* e,
9377+
double* work, lapack_int lwork,
9378+
lapack_int* iwork, lapack_int liwork );
9379+
93709380
lapack_int LAPACKE_sstedc_work( int matrix_layout, char compz, lapack_int n,
93719381
float* d, float* e, float* z, lapack_int ldz,
93729382
float* work, lapack_int lwork,

‎lapack-netlib/LAPACKE/src/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,8 @@ lapacke_dsptri.o \
10831083
lapacke_dsptri_work.o \
10841084
lapacke_dsptrs.o \
10851085
lapacke_dsptrs_work.o \
1086+
lapacke_dstebr.o \
1087+
lapacke_dstebr_work.o \
10861088
lapacke_dstebz.o \
10871089
lapacke_dstebz_work.o \
10881090
lapacke_dstedc.o \
@@ -1667,6 +1669,8 @@ lapacke_ssptri.o \
16671669
lapacke_ssptri_work.o \
16681670
lapacke_ssptrs.o \
16691671
lapacke_ssptrs_work.o \
1672+
lapacke_sstebr.o \
1673+
lapacke_sstebr_work.o \
16701674
lapacke_sstebz.o \
16711675
lapacke_sstebz_work.o \
16721676
lapacke_sstedc.o \
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*****************************************************************************
2+
Copyright (c) 2014, Intel Corp.
3+
Copyright (c) 2026, Ruiyi Zhan and Shaoshuai Zhang.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
* Neither the name of Intel Corporation nor the names of its contributors
15+
may be used to endorse or promote products derived from this software
16+
without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28+
THE POSSIBILITY OF SUCH DAMAGE.
29+
*****************************************************************************
30+
* Contents: Native high-level C interface to LAPACK function dstebr
31+
* Author: Ruiyi Zhan and Shaoshuai Zhang
32+
*****************************************************************************/
33+
34+
#include "lapacke_utils.h"
35+
36+
lapack_int API_SUFFIX(LAPACKE_dstebr)( lapack_int n, double* d, double* e )
37+
{
38+
lapack_int info = 0;
39+
lapack_int liwork = -1;
40+
lapack_int lwork = -1;
41+
lapack_int* iwork = NULL;
42+
double* work = NULL;
43+
lapack_int iwork_query;
44+
double work_query;
45+
#ifndef LAPACK_DISABLE_NAN_CHECK
46+
if( LAPACKE_get_nancheck() ) {
47+
/* Optionally check input matrices for NaNs */
48+
if( API_SUFFIX(LAPACKE_d_nancheck)( n, d, 1 ) ) {
49+
return -2;
50+
}
51+
if( API_SUFFIX(LAPACKE_d_nancheck)( n-1, e, 1 ) ) {
52+
return -3;
53+
}
54+
}
55+
#endif
56+
/* Query optimal working array(s) size */
57+
info = API_SUFFIX(LAPACKE_dstebr_work)( n, d, e, &work_query, lwork,
58+
&iwork_query, liwork );
59+
if( info != 0 ) {
60+
goto exit_level_0;
61+
}
62+
liwork = iwork_query;
63+
lwork = (lapack_int)work_query;
64+
/* Allocate memory for work arrays */
65+
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
66+
if( iwork == NULL ) {
67+
info = LAPACK_WORK_MEMORY_ERROR;
68+
goto exit_level_0;
69+
}
70+
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
71+
if( work == NULL ) {
72+
info = LAPACK_WORK_MEMORY_ERROR;
73+
goto exit_level_1;
74+
}
75+
/* Call middle-level interface */
76+
info = API_SUFFIX(LAPACKE_dstebr_work)( n, d, e, work, lwork, iwork,
77+
liwork );
78+
/* Release memory and exit */
79+
LAPACKE_free( work );
80+
exit_level_1:
81+
LAPACKE_free( iwork );
82+
exit_level_0:
83+
if( info == LAPACK_WORK_MEMORY_ERROR ) {
84+
API_SUFFIX(LAPACKE_xerbla)( "LAPACKE_dstebr", info );
85+
}
86+
return info;
87+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*****************************************************************************
2+
Copyright (c) 2014, Intel Corp.
3+
Copyright (c) 2026, Ruiyi Zhan and Shaoshuai Zhang.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
* Neither the name of Intel Corporation nor the names of its contributors
15+
may be used to endorse or promote products derived from this software
16+
without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28+
THE POSSIBILITY OF SUCH DAMAGE.
29+
*****************************************************************************
30+
* Contents: Native middle-level C interface to LAPACK function dstebr
31+
* Author: Ruiyi Zhan and Shaoshuai Zhang
32+
*****************************************************************************/
33+
34+
#include "lapacke_utils.h"
35+
36+
lapack_int API_SUFFIX(LAPACKE_dstebr_work)( lapack_int n, double* d, double* e,
37+
double* work, lapack_int lwork,
38+
lapack_int* iwork, lapack_int liwork )
39+
{
40+
lapack_int info = 0;
41+
/* Call LAPACK function and adjust info */
42+
LAPACK_dstebr( &n, d, e, work, &lwork, iwork, &liwork, &info );
43+
return info;
44+
}

0 commit comments

Comments
 (0)