35 #ifndef _BLAZE_MATH_LAPACK_GESVDX_H_ 36 #define _BLAZE_MATH_LAPACK_GESVDX_H_ 79 template<
typename MT,
bool SO,
typename VT,
bool TF >
80 inline size_t gesvdx( DenseMatrix<MT,SO>& A, DenseVector<VT,TF>& s );
82 template<
typename MT,
bool SO,
typename VT,
bool TF,
typename ST >
83 inline size_t gesvdx( DenseMatrix<MT,SO>& A, DenseVector<VT,TF>& s, ST low, ST upp );
85 template<
typename MT1,
bool SO,
typename MT2,
typename VT,
bool TF >
86 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseMatrix<MT2,SO>& U, DenseVector<VT,TF>& s );
88 template<
typename MT1,
bool SO,
typename MT2,
typename VT,
bool TF,
typename ST >
89 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseMatrix<MT2,SO>& U,
90 DenseVector<VT,TF>& s, ST low, ST upp );
92 template<
typename MT1,
bool SO,
typename VT,
bool TF,
typename MT2 >
93 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseVector<VT,TF>& s, DenseMatrix<MT2,SO>& V );
95 template<
typename MT1,
bool SO,
typename VT,
bool TF,
typename MT2,
typename ST >
96 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseVector<VT,TF>& s,
97 DenseMatrix<MT2,SO>& V, ST low, ST upp );
99 template<
typename MT1,
bool SO,
typename MT2,
typename VT,
bool TF,
typename MT3 >
100 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseMatrix<MT2,SO>& U,
101 DenseVector<VT,TF>& s, DenseMatrix<MT3,SO>& V );
103 template<
typename MT1,
bool SO,
typename MT2,
typename VT,
bool TF,
typename MT3,
typename ST >
104 inline size_t gesvdx( DenseMatrix<MT1,SO>& A, DenseMatrix<MT2,SO>& U,
105 DenseVector<VT,TF>& s, DenseMatrix<MT3,SO>& V, ST low, ST upp );
132 template<
typename MT
137 inline DisableIf_< IsComplex< ElementType_<MT> >,
size_t >
138 gesvdx_backend( DenseMatrix<MT,SO>& A, DenseVector<VT,TF>& s,
139 char range, ST vl, ST vu,
int il,
int iu )
141 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
148 using ET = ElementType_<MT>;
150 const size_t M( (~A).
rows() );
151 const size_t N( (~A).
columns() );
152 const size_t mindim(
min( M, N ) );
154 int m ( numeric_cast<int>( SO ? (~A).
rows() : (~A).
columns() ) );
155 int n ( numeric_cast<int>( SO ? (~A).
columns() : (~A).
rows() ) );
156 int lda ( numeric_cast<int>( (~A).
spacing() ) );
160 ET* sptr( (~s).
data() );
161 std::unique_ptr<ET[]> stmp;
163 const bool tmpRequired( (~s).
size() < mindim );
166 stmp.reset(
new ET[2UL*mindim] );
170 const int minimum(
min( m, n ) );
172 int lwork( minimum*( minimum*3 + 20 ) + 2 );
173 const std::unique_ptr<ET[]> work (
new ET[lwork] );
174 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
176 gesvdx(
'N',
'N', range, m, n, (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
177 nullptr, 1,
nullptr, 1, work.get(), lwork, iwork.get(), &info );
179 const size_t num( numeric_cast<size_t>( ns ) );
189 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
222 template<
typename MT
227 inline EnableIf_< IsComplex< ElementType_<MT> >,
size_t >
228 gesvdx_backend( DenseMatrix<MT,SO>& A, DenseVector<VT,TF>& s,
229 char range, ST vl, ST vu,
int il,
int iu )
231 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
238 using CT = ElementType_<MT>;
239 using BT = UnderlyingElement_<CT>;
241 const size_t M( (~A).
rows() );
242 const size_t N( (~A).
columns() );
243 const size_t mindim(
min( M, N ) );
245 int m ( numeric_cast<int>( SO ? (~A).
rows() : (~A).
columns() ) );
246 int n ( numeric_cast<int>( SO ? (~A).
columns() : (~A).
rows() ) );
247 int lda ( numeric_cast<int>( (~A).
spacing() ) );
251 BT* sptr( (~s).
data() );
252 std::unique_ptr<BT[]> stmp;
254 const bool tmpRequired( (~s).
size() < mindim );
257 stmp.reset(
new BT[2UL*mindim] );
261 const int minimum(
min( m, n ) );
263 int lwork( minimum*( minimum*3 + 20 ) + 2 );
264 const std::unique_ptr<CT[]> work (
new CT[lwork] );
265 const std::unique_ptr<BT[]> rwork(
new BT[17*minimum*minimum] );
266 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
268 gesvdx(
'N',
'N', range, m, n, (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
269 nullptr, 1,
nullptr, 1, work.get(), lwork, rwork.get(), iwork.get(), &info );
271 const size_t num( numeric_cast<size_t>( ns ) );
281 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
344 template<
typename MT
362 const size_t M( (~A).
rows() );
363 const size_t N( (~A).
columns() );
364 const size_t mindim(
min( M, N ) );
366 resize( ~s, mindim,
false );
368 if( M == 0UL || N == 0UL ) {
372 return gesvdx_backend( ~A, ~s,
'A', UT(), UT(), 0, 0 );
458 template<
typename MT
484 const size_t M( (~A).
rows() );
485 const size_t N( (~A).
columns() );
486 const size_t mindim(
min( M, N ) );
493 resize( ~s, expected,
false );
495 if( M == 0UL || N == 0UL ) {
505 const size_t actual( gesvdx_backend( ~A, ~s, range, vl, vu, il, iu ) );
508 resize( ~s, actual,
true );
539 template<
typename MT1
547 char range, ST vl, ST vu,
int il,
int iu )
549 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
560 const size_t M( (~A).
rows() );
561 const size_t N( (~A).
columns() );
562 const size_t mindim(
min( M, N ) );
564 int m ( numeric_cast<int>( SO ? M : N ) );
565 int n ( numeric_cast<int>( SO ? N : M ) );
566 int lda ( numeric_cast<int>( (~A).
spacing() ) );
567 int ldu ( numeric_cast<int>( (~U).
spacing() ) );
571 ET* sptr( (~s).
data() );
572 ET* uptr( (~U).
data() );
573 std::unique_ptr<ET[]> stmp;
574 std::unique_ptr<ET[]> utmp;
576 const bool tmpRequired( (~s).
size() < mindim );
579 stmp.reset(
new ET[2UL*mindim] );
580 utmp.reset(
new ET[M*mindim] );
585 const int minimum(
min( m, n ) );
587 int lwork( minimum*( minimum*3 + 20 ) + 2 );
588 const std::unique_ptr<ET[]> work (
new ET[lwork] );
589 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
591 gesvdx( ( SO ?
'V' :
'N' ), ( SO ?
'N' :
'V' ), range, m, n,
592 (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
593 ( SO ? uptr :
nullptr ), ( tmpRequired ? m : ( SO ? ldu : 1 ) ),
594 ( SO ?
nullptr : uptr ), ( tmpRequired ? mindim : ( SO ? 1 : ldu ) ),
595 work.get(), lwork, iwork.get(), &info );
597 const size_t num( numeric_cast<size_t>( ns ) );
608 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
614 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
615 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
616 (~U)(i,j) = utmp[i+j*M];
622 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
623 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
624 (~U)(i,j) = utmp[i*mindim+j];
659 template<
typename MT1
667 char range, ST vl, ST vu,
int il,
int iu )
669 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
681 const size_t M( (~A).
rows() );
682 const size_t N( (~A).
columns() );
683 const size_t mindim(
min( M, N ) );
685 int m ( numeric_cast<int>( SO ? M : N ) );
686 int n ( numeric_cast<int>( SO ? N : M ) );
687 int lda ( numeric_cast<int>( (~A).
spacing() ) );
688 int ldu ( numeric_cast<int>( (~U).
spacing() ) );
692 BT* sptr( (~s).
data() );
693 CT* uptr( (~U).
data() );
694 std::unique_ptr<BT[]> stmp;
695 std::unique_ptr<CT[]> utmp;
697 const bool tmpRequired( (~s).
size() < mindim );
700 stmp.reset(
new BT[2UL*mindim] );
701 utmp.reset(
new CT[M*mindim] );
706 const int minimum(
min( m, n ) );
708 int lwork( minimum*( minimum*3 + 20 ) + 2 );
709 const std::unique_ptr<CT[]> work (
new CT[lwork] );
710 const std::unique_ptr<BT[]> rwork(
new BT[17*minimum*minimum] );
711 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
713 gesvdx( ( SO ?
'V' :
'N' ), ( SO ?
'N' :
'V' ), range, m, n,
714 (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
715 ( SO ? uptr :
nullptr ), ( tmpRequired ? m : ( SO ? ldu : 1 ) ),
716 ( SO ?
nullptr : uptr ), ( tmpRequired ? mindim : ( SO ? 1 : ldu ) ),
717 work.get(), lwork, rwork.get(), iwork.get(), &info );
719 const size_t num( numeric_cast<size_t>( ns ) );
730 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
736 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
737 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
738 (~U)(i,j) = utmp[i+j*M];
744 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
745 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
746 (~U)(i,j) = utmp[i*mindim+j];
815 template<
typename MT1
839 const size_t M( (~A).
rows() );
840 const size_t N( (~A).
columns() );
841 const size_t mindim(
min( M, N ) );
843 resize( ~s, mindim,
false );
844 resize( ~U, M, mindim,
false );
846 if( M == 0UL || N == 0UL ) {
850 return gesvdx_backend( ~A, ~U, ~s,
'A', UT(), UT(), 0, 0 );
945 template<
typename MT1
978 const size_t M( (~A).
rows() );
979 const size_t N( (~A).
columns() );
980 const size_t mindim(
min( M, N ) );
987 resize( ~s, expected,
false );
988 resize( ~U, M, expected,
false );
990 if( M == 0UL || N == 0UL ) {
1000 const size_t actual( gesvdx_backend( ~A, ~U, ~s, range, vl, vu, il, iu ) );
1003 resize( ~s, actual,
true );
1007 resize( ~U, M, actual,
true );
1038 template<
typename MT1
1044 inline DisableIf_< IsComplex< ElementType_<MT1> >,
size_t >
1046 char range, ST vl, ST vu,
int il,
int iu )
1048 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
1059 const size_t M( (~A).
rows() );
1060 const size_t N( (~A).
columns() );
1061 const size_t mindim(
min( M, N ) );
1063 int m ( numeric_cast<int>( SO ? M : N ) );
1064 int n ( numeric_cast<int>( SO ? N : M ) );
1065 int lda ( numeric_cast<int>( (~A).
spacing() ) );
1066 int ldv ( numeric_cast<int>( (~V).
spacing() ) );
1070 ET* sptr( (~s).
data() );
1071 ET* vptr( (~V).
data() );
1072 std::unique_ptr<ET[]> stmp;
1073 std::unique_ptr<ET[]> vtmp;
1075 const bool tmpRequired( (~s).
size() < mindim );
1078 stmp.reset(
new ET[2UL*mindim] );
1079 vtmp.reset(
new ET[mindim*N] );
1084 const int minimum(
min( m, n ) );
1086 int lwork( minimum*( minimum*3 + 20 ) + 2 );
1087 const std::unique_ptr<ET[]> work (
new ET[lwork] );
1088 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
1090 gesvdx( ( SO ?
'N' :
'V' ), ( SO ?
'V' :
'N' ), range, m, n,
1091 (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
1092 ( SO ?
nullptr : vptr ), ( tmpRequired ? m : ( SO ? 1 : ldv ) ),
1093 ( SO ? vptr :
nullptr ), ( tmpRequired ? mindim : ( SO ? ldv : 1 ) ),
1094 work.get(), lwork, iwork.get(), &info );
1096 const size_t num( numeric_cast<size_t>( ns ) );
1107 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
1113 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1114 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1115 (~V)(i,j) = vtmp[i+j*mindim];
1121 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1122 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1123 (~V)(i,j) = vtmp[i*N+j];
1158 template<
typename MT1
1164 inline EnableIf_< IsComplex< ElementType_<MT1> >,
size_t >
1166 char range, ST vl, ST vu,
int il,
int iu )
1168 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
1180 const size_t M( (~A).
rows() );
1181 const size_t N( (~A).
columns() );
1182 const size_t mindim(
min( M, N ) );
1184 int m ( numeric_cast<int>( SO ? M : N ) );
1185 int n ( numeric_cast<int>( SO ? N : M ) );
1186 int lda ( numeric_cast<int>( (~A).
spacing() ) );
1187 int ldv ( numeric_cast<int>( (~V).
spacing() ) );
1191 BT* sptr( (~s).
data() );
1192 CT* vptr( (~V).
data() );
1193 std::unique_ptr<BT[]> stmp;
1194 std::unique_ptr<CT[]> vtmp;
1196 const bool tmpRequired( (~s).
size() < mindim );
1199 stmp.reset(
new BT[2UL*mindim] );
1200 vtmp.reset(
new CT[mindim*N] );
1205 const int minimum(
min( m, n ) );
1207 int lwork( minimum*( minimum*3 + 20 ) + 2 );
1208 const std::unique_ptr<CT[]> work (
new CT[lwork] );
1209 const std::unique_ptr<BT[]> rwork(
new BT[17*minimum*minimum] );
1210 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
1212 gesvdx( ( SO ?
'N' :
'V' ), ( SO ?
'V' :
'N' ), range, m, n,
1213 (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
1214 ( SO ?
nullptr : vptr ), ( tmpRequired ? m : ( SO ? 1 : ldv ) ),
1215 ( SO ? vptr :
nullptr ), ( tmpRequired ? mindim : ( SO ? ldv : 1 ) ),
1216 work.get(), lwork, rwork.get(), iwork.get(), &info );
1218 const size_t num( numeric_cast<size_t>( ns ) );
1229 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
1235 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1236 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1237 (~V)(i,j) = vtmp[i+j*mindim];
1243 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1244 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1245 (~V)(i,j) = vtmp[i*N+j];
1314 template<
typename MT1
1338 const size_t M( (~A).
rows() );
1339 const size_t N( (~A).
columns() );
1340 const size_t mindim(
min( M, N ) );
1342 resize( ~s, mindim,
false );
1343 resize( ~V, mindim, N,
false );
1345 if( M == 0UL || N == 0UL ) {
1349 return gesvdx_backend( ~A, ~s, ~V,
'A', UT(), UT(), 0, 0 );
1444 template<
typename MT1
1477 const size_t M( (~A).
rows() );
1478 const size_t N( (~A).
columns() );
1479 const size_t mindim(
min( M, N ) );
1486 resize( ~s, expected,
false );
1487 resize( ~V, expected, N,
false );
1489 if( M == 0UL || N == 0UL ) {
1499 const size_t actual( gesvdx_backend( ~A, ~s, ~V, range, vl, vu, il, iu ) );
1502 resize( ~s, actual,
true );
1506 resize( ~V, actual, N,
true );
1538 template<
typename MT1
1545 inline DisableIf_< IsComplex< ElementType_<MT1> >,
size_t >
1549 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
1562 const size_t M( (~A).
rows() );
1563 const size_t N( (~A).
columns() );
1564 const size_t mindim(
min( M, N ) );
1566 int m ( numeric_cast<int>( SO ? M : N ) );
1567 int n ( numeric_cast<int>( SO ? N : M ) );
1568 int lda ( numeric_cast<int>( (~A).
spacing() ) );
1569 int ldu ( numeric_cast<int>( (~U).
spacing() ) );
1570 int ldv ( numeric_cast<int>( (~V).
spacing() ) );
1574 ET* sptr( (~s).
data() );
1575 ET* uptr( (~U).
data() );
1576 ET* vptr( (~V).
data() );
1577 std::unique_ptr<ET[]> stmp;
1578 std::unique_ptr<ET[]> utmp;
1579 std::unique_ptr<ET[]> vtmp;
1581 const bool tmpRequired( (~s).
size() < mindim );
1584 stmp.reset(
new ET[2UL*mindim] );
1585 utmp.reset(
new ET[M*mindim] );
1586 vtmp.reset(
new ET[mindim*N] );
1592 const int minimum(
min( m, n ) );
1594 int lwork( minimum*( minimum*3 + 20 ) + 2 );
1595 const std::unique_ptr<ET[]> work (
new ET[lwork] );
1596 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
1598 gesvdx(
'V',
'V', range, m, n, (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
1599 ( SO ? uptr : vptr ), ( tmpRequired ? m : ( SO ? ldu : ldv ) ),
1600 ( SO ? vptr : uptr ), ( tmpRequired ? mindim : ( SO ? ldv : ldu ) ),
1601 work.get(), lwork, iwork.get(), &info );
1603 const size_t num( numeric_cast<size_t>( ns ) );
1614 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
1620 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
1621 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
1622 (~U)(i,j) = utmp[i+j*M];
1626 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1627 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1628 (~V)(i,j) = vtmp[i+j*mindim];
1634 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
1635 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
1636 (~U)(i,j) = utmp[i*mindim+j];
1640 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1641 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1642 (~V)(i,j) = vtmp[i*N+j];
1678 template<
typename MT1
1685 inline EnableIf_< IsComplex< ElementType_<MT1> >,
size_t >
1689 BLAZE_INTERNAL_ASSERT( range ==
'A' || range ==
'V' || range ==
'I',
"Invalid range flag detected" );
1703 const size_t M( (~A).
rows() );
1704 const size_t N( (~A).
columns() );
1705 const size_t mindim(
min( M, N ) );
1707 int m ( numeric_cast<int>( SO ? M : N ) );
1708 int n ( numeric_cast<int>( SO ? N : M ) );
1709 int lda ( numeric_cast<int>( (~A).
spacing() ) );
1710 int ldu ( numeric_cast<int>( (~U).
spacing() ) );
1711 int ldv ( numeric_cast<int>( (~V).
spacing() ) );
1715 BT* sptr( (~s).
data() );
1716 CT* uptr( (~U).
data() );
1717 CT* vptr( (~V).
data() );
1718 std::unique_ptr<BT[]> stmp;
1719 std::unique_ptr<CT[]> utmp;
1720 std::unique_ptr<CT[]> vtmp;
1722 const bool tmpRequired( (~s).
size() < mindim );
1725 stmp.reset(
new BT[2UL*mindim] );
1726 utmp.reset(
new CT[M*mindim] );
1727 vtmp.reset(
new CT[mindim*N] );
1733 const int minimum(
min( m, n ) );
1735 int lwork( minimum*( minimum*3 + 20 ) + 2 );
1736 const std::unique_ptr<CT[]> work (
new CT[lwork] );
1737 const std::unique_ptr<BT[]> rwork(
new BT[17*minimum*minimum] );
1738 const std::unique_ptr<int[]> iwork(
new int[12*minimum] );
1740 gesvdx(
'V',
'V', range, m, n, (~A).
data(), lda, vl, vu, il, iu, &ns, sptr,
1741 ( SO ? uptr : vptr ), ( tmpRequired ? m : ( SO ? ldu : ldv ) ),
1742 ( SO ? vptr : uptr ), ( tmpRequired ? mindim : ( SO ? ldv : ldu ) ),
1743 work.get(), lwork, rwork.get(), iwork.get(), &info );
1745 const size_t num( numeric_cast<size_t>( ns ) );
1756 for(
size_t i=0UL; i<(~s).
size(); ++i ) {
1762 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
1763 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
1764 (~U)(i,j) = utmp[i+j*M];
1768 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1769 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1770 (~V)(i,j) = vtmp[i+j*mindim];
1776 for(
size_t i=0UL; i<(~U).
rows(); ++i ) {
1777 for(
size_t j=0UL; j<(~U).
columns(); ++j ) {
1778 (~U)(i,j) = utmp[i*mindim+j];
1782 for(
size_t i=0UL; i<(~V).
rows(); ++i ) {
1783 for(
size_t j=0UL; j<(~V).
columns(); ++j ) {
1784 (~V)(i,j) = vtmp[i*N+j];
1857 template<
typename MT1
1888 const size_t M( (~A).
rows() );
1889 const size_t N( (~A).
columns() );
1890 const size_t mindim(
min( M, N ) );
1892 resize( ~s, mindim,
false );
1893 resize( ~U, M, mindim,
false );
1894 resize( ~V, mindim, N,
false );
1896 if( M == 0UL || N == 0UL ) {
1900 return gesvdx_backend( ~A, ~U, ~s, ~V,
'A', UT(), UT(), 0, 0 );
2002 template<
typename MT1
2041 const size_t M( (~A).
rows() );
2042 const size_t N( (~A).
columns() );
2043 const size_t mindim(
min( M, N ) );
2050 resize( ~s, expected,
false );
2051 resize( ~U, M, expected,
false );
2052 resize( ~V, expected, N,
false );
2054 if( M == 0UL || N == 0UL ) {
2064 const size_t actual( gesvdx_backend( ~A, ~U, ~s, ~V, range, vl, vu, il, iu ) );
2067 resize( ~s, actual,
true );
2071 resize( ~U, M, actual,
true );
2075 resize( ~V, actual, N,
true );
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
#define BLAZE_CONSTRAINT_MUST_HAVE_MUTABLE_DATA_ACCESS(T)
Constraint on the data type.In case the given data type T does not provide low-level data access to m...
Definition: MutableDataAccess.h:61
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
Header file for the DenseVector base class.
Header file for the UnderlyingElement type trait.
Constraint on the data type.
Cast operators for numeric types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ADAPTOR_TYPE(T)
Constraint on the data type.In case the given data type T is an adaptor type (as for instance LowerMa...
Definition: Adaptor.h:81
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Header file for the implementation of the Subvector view.
Constraint on the data type.
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the IsFloatingPoint type trait.
Header file for the DenseMatrix base class.
typename UnderlyingElement< T >::Type UnderlyingElement_
Auxiliary alias declaration for the UnderlyingElement type trait.The UnderlyingElement_ alias declara...
Definition: UnderlyingElement.h:132
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Header file for the exception macros of the math module.
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:75
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:714
Constraint on the data type.
Header file for the EnableIf class template.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Header file for the CLAPACK gesvdx wrapper functions.
Header file for run time assertion macros.
void gesvdx(char jobu, char jobv, char range, int m, int n, float *A, int lda, float vl, float vu, int il, int iu, int *ns, float *s, float *U, int ldu, float *V, int ldv, float *work, int lwork, int *iwork, int *info)
LAPACK kernel for the singular value decomposition (SVD) of the given dense general single precision ...
Definition: gesvdx.h:179
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BLASCompatible.h:61
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
#define BLAZE_CONSTRAINT_MUST_BE_BUILTIN_TYPE(T)
Constraint on the data type.In case the given data type T is not a built-in data type, a compilation error is created.
Definition: Builtin.h:60
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
#define BLAZE_THROW_LAPACK_ERROR(MESSAGE)
Macro for the emission of an exception on detection of a LAPACK error.This macro encapsulates the def...
Definition: Exception.h:146
Header file for the IsComplex type trait.
Header file for the IsResizable type trait.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Constraint on the data type.