adfa5456 commited on
Commit
42b9c42
·
verified ·
1 Parent(s): 3c089c4

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. CMakeLists.txt +37 -0
  2. include/eigen/failtest/bdcsvd_int.cpp +14 -0
  3. include/eigen/failtest/block_nonconst_ctor_on_const_xpr_2.cpp +16 -0
  4. include/eigen/failtest/block_on_const_type_actually_const_1.cpp +16 -0
  5. include/eigen/failtest/const_qualified_block_method_retval_0.cpp +15 -0
  6. include/eigen/failtest/const_qualified_block_method_retval_1.cpp +15 -0
  7. include/eigen/failtest/const_qualified_diagonal_method_retval.cpp +15 -0
  8. include/eigen/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp +15 -0
  9. include/eigen/failtest/eigensolver_cplx.cpp +14 -0
  10. include/eigen/failtest/failtest_sanity_check.cpp +5 -0
  11. include/eigen/failtest/jacobisvd_int.cpp +14 -0
  12. include/eigen/failtest/ldlt_int.cpp +14 -0
  13. include/eigen/failtest/llt_int.cpp +14 -0
  14. include/eigen/failtest/map_nonconst_ctor_on_const_ptr_0.cpp +15 -0
  15. include/eigen/failtest/map_nonconst_ctor_on_const_ptr_1.cpp +15 -0
  16. include/eigen/failtest/map_nonconst_ctor_on_const_ptr_2.cpp +15 -0
  17. include/eigen/failtest/map_nonconst_ctor_on_const_ptr_4.cpp +15 -0
  18. include/eigen/failtest/map_on_const_type_actually_const_1.cpp +15 -0
  19. include/eigen/failtest/partialpivlu_int.cpp +14 -0
  20. include/eigen/failtest/qr_int.cpp +14 -0
  21. include/eigen/failtest/ref_1.cpp +18 -0
  22. include/eigen/failtest/ref_2.cpp +15 -0
  23. include/eigen/failtest/ref_3.cpp +15 -0
  24. include/eigen/failtest/ref_5.cpp +16 -0
  25. include/eigen/failtest/selfadjointview_on_const_type_actually_const.cpp +16 -0
  26. include/eigen/failtest/sparse_ref_3.cpp +15 -0
  27. include/eigen/failtest/sparse_ref_4.cpp +15 -0
  28. include/eigen/failtest/transpose_nonconst_ctor_on_const_xpr.cpp +15 -0
  29. include/eigen/failtest/transpose_on_const_type_actually_const.cpp +16 -0
  30. include/eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp +15 -0
  31. include/eigen/lapack/CMakeLists.txt +465 -0
  32. include/eigen/lapack/clarf.f +232 -0
  33. include/eigen/lapack/clarfb.f +771 -0
  34. include/eigen/lapack/clarft.f +328 -0
  35. include/eigen/lapack/complex_double.cpp +18 -0
  36. include/eigen/lapack/dladiv.f +128 -0
  37. include/eigen/lapack/dlamch.f +189 -0
  38. include/eigen/lapack/dlapy2.f +104 -0
  39. include/eigen/lapack/dlarf.f +227 -0
  40. include/eigen/lapack/double.cpp +18 -0
  41. include/eigen/lapack/dsecnd_NONE.f +52 -0
  42. include/eigen/lapack/iladlc.f +118 -0
  43. include/eigen/lapack/ilaslr.f +121 -0
  44. include/eigen/lapack/ilazlc.f +118 -0
  45. include/eigen/lapack/lapack_common.h +29 -0
  46. include/eigen/lapack/single.cpp +18 -0
  47. include/eigen/lapack/slarfg.f +196 -0
  48. include/eigen/lapack/zladiv.f +97 -0
  49. include/eigen/lapack/zlarf.f +232 -0
  50. include/eigen/lapack/zlarft.f +327 -0
CMakeLists.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 2.8)
2
+ project(FRICP)
3
+
4
+ #--- CMake configuration
5
+ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
6
+
7
+ #--- Compiler configuration
8
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
9
+
10
+ #--- OpenMP (cannot work in clang)
11
+ find_package(OpenMP QUIET)
12
+ if(OPENMP_FOUND)
13
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
14
+ endif()
15
+
16
+ #--- Eigen3
17
+ find_package(Eigen3 REQUIRED)
18
+ include_directories(${EIGEN3_INCLUDE_DIRS})
19
+
20
+ #--- Nanoflann
21
+ find_package(NanoFlann REQUIRED)
22
+ include_directories(${NANOFLANN_INCLUDE_DIR})
23
+
24
+ #--- Build example
25
+ include_directories(.)
26
+ file(GLOB SOURCES "*.cpp")
27
+ file(GLOB HEADERS "*.h")
28
+ add_executable(FRICP ${SOURCES} ${HEADERS})
29
+
30
+ if(APPLE OR UNIX)
31
+ #--- Deploy data folder link
32
+ execute_process(COMMAND ln -f -s ${CMAKE_SOURCE_DIR}/data WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
33
+ #--- "Dummy" target to have data appear in QtCreator
34
+ add_custom_target(data SOURCES ${CMAKE_SOURCE_DIR}/data)
35
+ else()
36
+ file(COPY ${CMAKE_SOURCE_DIR}/data DESTINATION ${PROJECT_BINARY_DIR})
37
+ endif()
include/eigen/failtest/bdcsvd_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/SVD"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ BDCSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/block_nonconst_ctor_on_const_xpr_2.cpp ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ // row/column constructor
13
+ Block<Matrix3d,3,1> b(m,0);
14
+ }
15
+
16
+ int main() {}
include/eigen/failtest/block_on_const_type_actually_const_1.cpp ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(){
12
+ MatrixXf m;
13
+ Block<CV_QUALIFIER MatrixXf, 3, 3>(m, 0, 0).coeffRef(0, 0) = 1.0f;
14
+ }
15
+
16
+ int main() {}
include/eigen/failtest/const_qualified_block_method_retval_0.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ Block<Matrix3d,3,3> b(m.block<3,3>(0,0));
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/const_qualified_block_method_retval_1.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ Block<Matrix3d> b(m.block(0,0,3,3));
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/const_qualified_diagonal_method_retval.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ Diagonal<Matrix3d> b(m.diagonal());
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/diagonal_nonconst_ctor_on_const_xpr.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ Diagonal<Matrix3d> d(m);
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/eigensolver_cplx.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Eigenvalues"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR std::complex<double>
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ EigenSolver<Matrix<SCALAR,Dynamic,Dynamic> > eig(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/failtest_sanity_check.cpp ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
2
+ This is just some text that won't compile as a C++ file, as a basic sanity check for failtest.
3
+ #else
4
+ int main() {}
5
+ #endif
include/eigen/failtest/jacobisvd_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/SVD"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/ldlt_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Cholesky"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ LDLT<Matrix<SCALAR,Dynamic,Dynamic> > ldlt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/llt_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Cholesky"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ LLT<Matrix<SCALAR,Dynamic,Dynamic> > llt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/map_nonconst_ctor_on_const_ptr_0.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER float *ptr){
12
+ Map<Matrix3f> m(ptr);
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/map_nonconst_ctor_on_const_ptr_1.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER float *ptr, DenseIndex size){
12
+ Map<ArrayXf> m(ptr, size);
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/map_nonconst_ctor_on_const_ptr_2.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER float *ptr, DenseIndex rows, DenseIndex cols){
12
+ Map<MatrixXf> m(ptr, rows, cols);
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/map_nonconst_ctor_on_const_ptr_4.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER
5
+ #else
6
+ #define CV_QUALIFIER const
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(const float *ptr, DenseIndex rows, DenseIndex cols){
12
+ Map<CV_QUALIFIER MatrixXf, Unaligned, OuterStride<> > m(ptr, rows, cols, OuterStride<>(2));
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/map_on_const_type_actually_const_1.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(float *ptr){
12
+ Map<CV_QUALIFIER Vector3f>(ptr).coeffRef(0) = 1.0f;
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/partialpivlu_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/LU"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ PartialPivLU<Matrix<SCALAR,Dynamic,Dynamic> > lu(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/qr_int.cpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/QR"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define SCALAR int
5
+ #else
6
+ #define SCALAR float
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ int main()
12
+ {
13
+ HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
14
+ }
include/eigen/failtest/ref_1.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void call_ref(Ref<VectorXf> a) { }
12
+
13
+ int main()
14
+ {
15
+ VectorXf a(10);
16
+ CV_QUALIFIER VectorXf& ac(a);
17
+ call_ref(ac);
18
+ }
include/eigen/failtest/ref_2.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ using namespace Eigen;
4
+
5
+ void call_ref(Ref<VectorXf> a) { }
6
+
7
+ int main()
8
+ {
9
+ MatrixXf A(10,10);
10
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
11
+ call_ref(A.row(3));
12
+ #else
13
+ call_ref(A.col(3));
14
+ #endif
15
+ }
include/eigen/failtest/ref_3.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ using namespace Eigen;
4
+
5
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
6
+ void call_ref(Ref<VectorXf> a) { }
7
+ #else
8
+ void call_ref(const Ref<const VectorXf> &a) { }
9
+ #endif
10
+
11
+ int main()
12
+ {
13
+ VectorXf a(10);
14
+ call_ref(a+a);
15
+ }
include/eigen/failtest/ref_5.cpp ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ using namespace Eigen;
4
+
5
+ void call_ref(Ref<VectorXf> a) { }
6
+
7
+ int main()
8
+ {
9
+ VectorXf a(10);
10
+ DenseBase<VectorXf> &ac(a);
11
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
12
+ call_ref(ac);
13
+ #else
14
+ call_ref(ac.derived());
15
+ #endif
16
+ }
include/eigen/failtest/selfadjointview_on_const_type_actually_const.cpp ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(){
12
+ MatrixXf m;
13
+ SelfAdjointView<CV_QUALIFIER MatrixXf,Upper>(m).coeffRef(0, 0) = 1.0f;
14
+ }
15
+
16
+ int main() {}
include/eigen/failtest/sparse_ref_3.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Sparse"
2
+
3
+ using namespace Eigen;
4
+
5
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
6
+ void call_ref(Ref<SparseMatrix<float> > a) { }
7
+ #else
8
+ void call_ref(const Ref<const SparseMatrix<float> > &a) { }
9
+ #endif
10
+
11
+ int main()
12
+ {
13
+ SparseMatrix<float> a(10,10);
14
+ call_ref(a+a);
15
+ }
include/eigen/failtest/sparse_ref_4.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Sparse"
2
+
3
+ using namespace Eigen;
4
+
5
+ void call_ref(Ref<SparseMatrix<float> > a) {}
6
+
7
+ int main()
8
+ {
9
+ SparseMatrix<float> A(10,10);
10
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
11
+ call_ref(A.transpose());
12
+ #else
13
+ call_ref(A);
14
+ #endif
15
+ }
include/eigen/failtest/transpose_nonconst_ctor_on_const_xpr.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ Transpose<Matrix3d> t(m);
13
+ }
14
+
15
+ int main() {}
include/eigen/failtest/transpose_on_const_type_actually_const.cpp ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(){
12
+ MatrixXf m;
13
+ Transpose<CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
14
+ }
15
+
16
+ int main() {}
include/eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "../Eigen/Core"
2
+
3
+ #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
4
+ #define CV_QUALIFIER const
5
+ #else
6
+ #define CV_QUALIFIER
7
+ #endif
8
+
9
+ using namespace Eigen;
10
+
11
+ void foo(CV_QUALIFIER Matrix3d &m){
12
+ TriangularView<Matrix3d,Upper> t(m);
13
+ }
14
+
15
+ int main() {}
include/eigen/lapack/CMakeLists.txt ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ project(EigenLapack CXX)
2
+
3
+ if(EIGEN_BUILD_LAPACK AND EIGEN_BUILD_BLAS)
4
+
5
+ include(CheckLanguage)
6
+ check_language(Fortran)
7
+ if(CMAKE_Fortran_COMPILER)
8
+ enable_language(Fortran)
9
+ if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
10
+ if ("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER_EQUAL 10.0)
11
+ # We use an old version of LAPACK with argument type mismatches.
12
+ # Allow them to compile anyway with newer GNU versions.
13
+ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
14
+ endif()
15
+ endif()
16
+ set(EIGEN_Fortran_COMPILER_WORKS ON)
17
+ else()
18
+ set(EIGEN_Fortran_COMPILER_WORKS OFF)
19
+ endif()
20
+
21
+ add_custom_target(lapack)
22
+ include_directories(../blas)
23
+
24
+ set(EigenLapack_SRCS
25
+ single.cpp double.cpp complex_single.cpp complex_double.cpp ../blas/xerbla.cpp
26
+ )
27
+
28
+ if(EIGEN_Fortran_COMPILER_WORKS)
29
+
30
+ set(EigenLapack_SRCS ${EigenLapack_SRCS}
31
+ slarft.f dlarft.f clarft.f zlarft.f
32
+ slarfb.f dlarfb.f clarfb.f zlarfb.f
33
+ slarfg.f dlarfg.f clarfg.f zlarfg.f
34
+ slarf.f dlarf.f clarf.f zlarf.f
35
+ sladiv.f dladiv.f cladiv.f zladiv.f
36
+ ilaslr.f iladlr.f ilaclr.f ilazlr.f
37
+ ilaslc.f iladlc.f ilaclc.f ilazlc.f
38
+ dlapy2.f dlapy3.f slapy2.f slapy3.f
39
+ clacgv.f zlacgv.f
40
+ slamch.f dlamch.f
41
+ second_NONE.f dsecnd_NONE.f
42
+ )
43
+
44
+ option(EIGEN_ENABLE_LAPACK_TESTS OFF "Enable the Lapack unit tests")
45
+
46
+ if(EIGEN_ENABLE_LAPACK_TESTS)
47
+
48
+ get_filename_component(eigen_full_path_to_reference_lapack "./reference/" ABSOLUTE)
49
+ if(NOT EXISTS ${eigen_full_path_to_reference_lapack})
50
+ # Download lapack and install sources and testing at the right place
51
+ message(STATUS "Download lapack_addons_3.4.1.tgz...")
52
+
53
+ file(DOWNLOAD "http://downloads.tuxfamily.org/eigen/lapack_addons_3.4.1.tgz"
54
+ "${CMAKE_CURRENT_SOURCE_DIR}/lapack_addons_3.4.1.tgz"
55
+ INACTIVITY_TIMEOUT 15
56
+ TIMEOUT 240
57
+ STATUS download_status
58
+ EXPECTED_MD5 ab5742640617e3221a873aba44bbdc93
59
+ SHOW_PROGRESS)
60
+
61
+ message(STATUS ${download_status})
62
+ list(GET download_status 0 download_status_num)
63
+ set(download_status_num 0)
64
+ if(download_status_num EQUAL 0)
65
+ message(STATUS "Setup lapack reference and lapack unit tests")
66
+ execute_process(COMMAND tar xzf "lapack_addons_3.4.1.tgz" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
67
+ else()
68
+ message(STATUS "Download of lapack_addons_3.4.1.tgz failed, LAPACK unit tests won't be enabled")
69
+ set(EIGEN_ENABLE_LAPACK_TESTS false)
70
+ endif()
71
+
72
+ endif()
73
+
74
+ get_filename_component(eigen_full_path_to_reference_lapack "./reference/" ABSOLUTE)
75
+ if(EXISTS ${eigen_full_path_to_reference_lapack})
76
+ set(EigenLapack_funcfilenames
77
+ ssyev.f dsyev.f csyev.f zsyev.f
78
+ spotrf.f dpotrf.f cpotrf.f zpotrf.f
79
+ spotrs.f dpotrs.f cpotrs.f zpotrs.f
80
+ sgetrf.f dgetrf.f cgetrf.f zgetrf.f
81
+ sgetrs.f dgetrs.f cgetrs.f zgetrs.f)
82
+
83
+ file(GLOB ReferenceLapack_SRCS0 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "reference/*.f")
84
+ foreach(filename1 IN LISTS ReferenceLapack_SRCS0)
85
+ string(REPLACE "reference/" "" filename ${filename1})
86
+ list(FIND EigenLapack_SRCS ${filename} id1)
87
+ list(FIND EigenLapack_funcfilenames ${filename} id2)
88
+ if((id1 EQUAL -1) AND (id2 EQUAL -1))
89
+ set(ReferenceLapack_SRCS ${ReferenceLapack_SRCS} reference/${filename})
90
+ endif()
91
+ endforeach()
92
+ endif()
93
+
94
+
95
+ endif()
96
+
97
+ endif()
98
+
99
+ set(EIGEN_LAPACK_TARGETS "")
100
+
101
+ add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
102
+ list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack_static)
103
+
104
+ if (EIGEN_BUILD_SHARED_LIBS)
105
+ add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
106
+ list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack)
107
+ target_link_libraries(eigen_lapack eigen_blas)
108
+ endif()
109
+
110
+ foreach(target IN LISTS EIGEN_LAPACK_TARGETS)
111
+ if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
112
+ target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
113
+ endif()
114
+ target_link_libraries(${target} Eigen3::Eigen)
115
+ add_dependencies(lapack ${target})
116
+ install(TARGETS ${target}
117
+ RUNTIME DESTINATION bin
118
+ LIBRARY DESTINATION lib
119
+ ARCHIVE DESTINATION lib)
120
+ endforeach()
121
+
122
+
123
+ get_filename_component(eigen_full_path_to_testing_lapack "./testing/" ABSOLUTE)
124
+ if(EXISTS ${eigen_full_path_to_testing_lapack})
125
+
126
+ # The following comes from lapack/TESTING/CMakeLists.txt
127
+ # Get Python
128
+ find_package(PythonInterp)
129
+ message(STATUS "Looking for Python found - ${PYTHONINTERP_FOUND}")
130
+ if (PYTHONINTERP_FOUND)
131
+ message(STATUS "Using Python version ${PYTHON_VERSION_STRING}")
132
+ endif()
133
+
134
+ set(LAPACK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
135
+ set(LAPACK_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
136
+ set(BUILD_SINGLE true)
137
+ set(BUILD_DOUBLE true)
138
+ set(BUILD_COMPLEX true)
139
+ set(BUILD_COMPLEX16E true)
140
+
141
+ if(MSVC_VERSION)
142
+ # string(REPLACE "/STACK:10000000" "/STACK:900000000000000000"
143
+ # CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
144
+ string(REGEX REPLACE "(.*)/STACK:(.*) (.*)" "\\1/STACK:900000000000000000 \\3"
145
+ CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
146
+ endif()
147
+ file(MAKE_DIRECTORY "${LAPACK_BINARY_DIR}/TESTING")
148
+ add_subdirectory(testing/MATGEN)
149
+ add_subdirectory(testing/LIN)
150
+ add_subdirectory(testing/EIG)
151
+ macro(add_lapack_test output input target)
152
+ set(TEST_INPUT "${LAPACK_SOURCE_DIR}/testing/${input}")
153
+ set(TEST_OUTPUT "${LAPACK_BINARY_DIR}/TESTING/${output}")
154
+ string(REPLACE "." "_" input_name ${input})
155
+ set(testName "${target}_${input_name}")
156
+ if(EXISTS "${TEST_INPUT}")
157
+ add_dependencies(buildtests ${target})
158
+ add_test(NAME LAPACK-${testName}
159
+ COMMAND "${CMAKE_COMMAND}"
160
+ -DTEST=$<TARGET_FILE:${target}>
161
+ -DINPUT=${TEST_INPUT}
162
+ -DOUTPUT=${TEST_OUTPUT}
163
+ -DINTDIR=${CMAKE_CFG_INTDIR}
164
+ -P "${LAPACK_SOURCE_DIR}/testing/runtest.cmake")
165
+ endif()
166
+ endmacro()
167
+
168
+ if (BUILD_SINGLE)
169
+ add_lapack_test(stest.out stest.in xlintsts)
170
+ #
171
+ # ======== SINGLE RFP LIN TESTS ========================
172
+ add_lapack_test(stest_rfp.out stest_rfp.in xlintstrfs)
173
+ #
174
+ #
175
+ # ======== SINGLE EIG TESTS ===========================
176
+ #
177
+
178
+ add_lapack_test(snep.out nep.in xeigtsts)
179
+
180
+
181
+ add_lapack_test(ssep.out sep.in xeigtsts)
182
+
183
+
184
+ add_lapack_test(ssvd.out svd.in xeigtsts)
185
+
186
+
187
+ add_lapack_test(sec.out sec.in xeigtsts)
188
+
189
+
190
+ add_lapack_test(sed.out sed.in xeigtsts)
191
+
192
+
193
+ add_lapack_test(sgg.out sgg.in xeigtsts)
194
+
195
+
196
+ add_lapack_test(sgd.out sgd.in xeigtsts)
197
+
198
+
199
+ add_lapack_test(ssb.out ssb.in xeigtsts)
200
+
201
+
202
+ add_lapack_test(ssg.out ssg.in xeigtsts)
203
+
204
+
205
+ add_lapack_test(sbal.out sbal.in xeigtsts)
206
+
207
+
208
+ add_lapack_test(sbak.out sbak.in xeigtsts)
209
+
210
+
211
+ add_lapack_test(sgbal.out sgbal.in xeigtsts)
212
+
213
+
214
+ add_lapack_test(sgbak.out sgbak.in xeigtsts)
215
+
216
+
217
+ add_lapack_test(sbb.out sbb.in xeigtsts)
218
+
219
+
220
+ add_lapack_test(sglm.out glm.in xeigtsts)
221
+
222
+
223
+ add_lapack_test(sgqr.out gqr.in xeigtsts)
224
+
225
+
226
+ add_lapack_test(sgsv.out gsv.in xeigtsts)
227
+
228
+
229
+ add_lapack_test(scsd.out csd.in xeigtsts)
230
+
231
+
232
+ add_lapack_test(slse.out lse.in xeigtsts)
233
+ endif()
234
+
235
+ if (BUILD_DOUBLE)
236
+ #
237
+ # ======== DOUBLE LIN TESTS ===========================
238
+ add_lapack_test(dtest.out dtest.in xlintstd)
239
+ #
240
+ # ======== DOUBLE RFP LIN TESTS ========================
241
+ add_lapack_test(dtest_rfp.out dtest_rfp.in xlintstrfd)
242
+ #
243
+ # ======== DOUBLE EIG TESTS ===========================
244
+
245
+ add_lapack_test(dnep.out nep.in xeigtstd)
246
+
247
+
248
+ add_lapack_test(dsep.out sep.in xeigtstd)
249
+
250
+
251
+ add_lapack_test(dsvd.out svd.in xeigtstd)
252
+
253
+
254
+ add_lapack_test(dec.out dec.in xeigtstd)
255
+
256
+
257
+ add_lapack_test(ded.out ded.in xeigtstd)
258
+
259
+
260
+ add_lapack_test(dgg.out dgg.in xeigtstd)
261
+
262
+
263
+ add_lapack_test(dgd.out dgd.in xeigtstd)
264
+
265
+
266
+ add_lapack_test(dsb.out dsb.in xeigtstd)
267
+
268
+
269
+ add_lapack_test(dsg.out dsg.in xeigtstd)
270
+
271
+
272
+ add_lapack_test(dbal.out dbal.in xeigtstd)
273
+
274
+
275
+ add_lapack_test(dbak.out dbak.in xeigtstd)
276
+
277
+
278
+ add_lapack_test(dgbal.out dgbal.in xeigtstd)
279
+
280
+
281
+ add_lapack_test(dgbak.out dgbak.in xeigtstd)
282
+
283
+
284
+ add_lapack_test(dbb.out dbb.in xeigtstd)
285
+
286
+
287
+ add_lapack_test(dglm.out glm.in xeigtstd)
288
+
289
+
290
+ add_lapack_test(dgqr.out gqr.in xeigtstd)
291
+
292
+
293
+ add_lapack_test(dgsv.out gsv.in xeigtstd)
294
+
295
+
296
+ add_lapack_test(dcsd.out csd.in xeigtstd)
297
+
298
+
299
+ add_lapack_test(dlse.out lse.in xeigtstd)
300
+ endif()
301
+
302
+ if (BUILD_COMPLEX)
303
+ add_lapack_test(ctest.out ctest.in xlintstc)
304
+ #
305
+ # ======== COMPLEX RFP LIN TESTS ========================
306
+ add_lapack_test(ctest_rfp.out ctest_rfp.in xlintstrfc)
307
+ #
308
+ # ======== COMPLEX EIG TESTS ===========================
309
+
310
+ add_lapack_test(cnep.out nep.in xeigtstc)
311
+
312
+
313
+ add_lapack_test(csep.out sep.in xeigtstc)
314
+
315
+
316
+ add_lapack_test(csvd.out svd.in xeigtstc)
317
+
318
+
319
+ add_lapack_test(cec.out cec.in xeigtstc)
320
+
321
+
322
+ add_lapack_test(ced.out ced.in xeigtstc)
323
+
324
+
325
+ add_lapack_test(cgg.out cgg.in xeigtstc)
326
+
327
+
328
+ add_lapack_test(cgd.out cgd.in xeigtstc)
329
+
330
+
331
+ add_lapack_test(csb.out csb.in xeigtstc)
332
+
333
+
334
+ add_lapack_test(csg.out csg.in xeigtstc)
335
+
336
+
337
+ add_lapack_test(cbal.out cbal.in xeigtstc)
338
+
339
+
340
+ add_lapack_test(cbak.out cbak.in xeigtstc)
341
+
342
+
343
+ add_lapack_test(cgbal.out cgbal.in xeigtstc)
344
+
345
+
346
+ add_lapack_test(cgbak.out cgbak.in xeigtstc)
347
+
348
+
349
+ add_lapack_test(cbb.out cbb.in xeigtstc)
350
+
351
+
352
+ add_lapack_test(cglm.out glm.in xeigtstc)
353
+
354
+
355
+ add_lapack_test(cgqr.out gqr.in xeigtstc)
356
+
357
+
358
+ add_lapack_test(cgsv.out gsv.in xeigtstc)
359
+
360
+
361
+ add_lapack_test(ccsd.out csd.in xeigtstc)
362
+
363
+
364
+ add_lapack_test(clse.out lse.in xeigtstc)
365
+ endif()
366
+
367
+ if (BUILD_COMPLEX16)
368
+ #
369
+ # ======== COMPLEX16 LIN TESTS ========================
370
+ add_lapack_test(ztest.out ztest.in xlintstz)
371
+ #
372
+ # ======== COMPLEX16 RFP LIN TESTS ========================
373
+ add_lapack_test(ztest_rfp.out ztest_rfp.in xlintstrfz)
374
+ #
375
+ # ======== COMPLEX16 EIG TESTS ===========================
376
+
377
+ add_lapack_test(znep.out nep.in xeigtstz)
378
+
379
+
380
+ add_lapack_test(zsep.out sep.in xeigtstz)
381
+
382
+
383
+ add_lapack_test(zsvd.out svd.in xeigtstz)
384
+
385
+
386
+ add_lapack_test(zec.out zec.in xeigtstz)
387
+
388
+
389
+ add_lapack_test(zed.out zed.in xeigtstz)
390
+
391
+
392
+ add_lapack_test(zgg.out zgg.in xeigtstz)
393
+
394
+
395
+ add_lapack_test(zgd.out zgd.in xeigtstz)
396
+
397
+
398
+ add_lapack_test(zsb.out zsb.in xeigtstz)
399
+
400
+
401
+ add_lapack_test(zsg.out zsg.in xeigtstz)
402
+
403
+
404
+ add_lapack_test(zbal.out zbal.in xeigtstz)
405
+
406
+
407
+ add_lapack_test(zbak.out zbak.in xeigtstz)
408
+
409
+
410
+ add_lapack_test(zgbal.out zgbal.in xeigtstz)
411
+
412
+
413
+ add_lapack_test(zgbak.out zgbak.in xeigtstz)
414
+
415
+
416
+ add_lapack_test(zbb.out zbb.in xeigtstz)
417
+
418
+
419
+ add_lapack_test(zglm.out glm.in xeigtstz)
420
+
421
+
422
+ add_lapack_test(zgqr.out gqr.in xeigtstz)
423
+
424
+
425
+ add_lapack_test(zgsv.out gsv.in xeigtstz)
426
+
427
+
428
+ add_lapack_test(zcsd.out csd.in xeigtstz)
429
+
430
+
431
+ add_lapack_test(zlse.out lse.in xeigtstz)
432
+ endif()
433
+
434
+
435
+ if (BUILD_SIMPLE)
436
+ if (BUILD_DOUBLE)
437
+ #
438
+ # ======== SINGLE-DOUBLE PROTO LIN TESTS ==============
439
+ add_lapack_test(dstest.out dstest.in xlintstds)
440
+ endif()
441
+ endif()
442
+
443
+
444
+ if (BUILD_COMPLEX)
445
+ if (BUILD_COMPLEX16)
446
+ #
447
+ # ======== COMPLEX-COMPLEX16 LIN TESTS ========================
448
+ add_lapack_test(zctest.out zctest.in xlintstzc)
449
+ endif()
450
+ endif()
451
+
452
+ # ==============================================================================
453
+
454
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${LAPACK_SOURCE_DIR}/testing/lapack_testing.py ${LAPACK_BINARY_DIR})
455
+ add_test(
456
+ NAME LAPACK_Test_Summary
457
+ WORKING_DIRECTORY ${LAPACK_BINARY_DIR}
458
+ COMMAND ${PYTHON_EXECUTABLE} "lapack_testing.py"
459
+ )
460
+
461
+ endif()
462
+
463
+ elseif(EIGEN_BUILD_LAPACK AND NOT EIGEN_BUILD_BLAS)
464
+ message(FATAL_ERROR "EIGEN_BUILD_LAPACK requires EIGEN_BUILD_BLAS")
465
+ endif() #EIGEN_BUILD_LAPACK
include/eigen/lapack/clarf.f ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b CLARF
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download CLARF + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clarf.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clarf.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarf.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE CLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * CHARACTER SIDE
25
+ * INTEGER INCV, LDC, M, N
26
+ * COMPLEX TAU
27
+ * ..
28
+ * .. Array Arguments ..
29
+ * COMPLEX C( LDC, * ), V( * ), WORK( * )
30
+ * ..
31
+ *
32
+ *
33
+ *> \par Purpose:
34
+ * =============
35
+ *>
36
+ *> \verbatim
37
+ *>
38
+ *> CLARF applies a complex elementary reflector H to a complex M-by-N
39
+ *> matrix C, from either the left or the right. H is represented in the
40
+ *> form
41
+ *>
42
+ *> H = I - tau * v * v**H
43
+ *>
44
+ *> where tau is a complex scalar and v is a complex vector.
45
+ *>
46
+ *> If tau = 0, then H is taken to be the unit matrix.
47
+ *>
48
+ *> To apply H**H (the conjugate transpose of H), supply conjg(tau) instead
49
+ *> tau.
50
+ *> \endverbatim
51
+ *
52
+ * Arguments:
53
+ * ==========
54
+ *
55
+ *> \param[in] SIDE
56
+ *> \verbatim
57
+ *> SIDE is CHARACTER*1
58
+ *> = 'L': form H * C
59
+ *> = 'R': form C * H
60
+ *> \endverbatim
61
+ *>
62
+ *> \param[in] M
63
+ *> \verbatim
64
+ *> M is INTEGER
65
+ *> The number of rows of the matrix C.
66
+ *> \endverbatim
67
+ *>
68
+ *> \param[in] N
69
+ *> \verbatim
70
+ *> N is INTEGER
71
+ *> The number of columns of the matrix C.
72
+ *> \endverbatim
73
+ *>
74
+ *> \param[in] V
75
+ *> \verbatim
76
+ *> V is COMPLEX array, dimension
77
+ *> (1 + (M-1)*abs(INCV)) if SIDE = 'L'
78
+ *> or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
79
+ *> The vector v in the representation of H. V is not used if
80
+ *> TAU = 0.
81
+ *> \endverbatim
82
+ *>
83
+ *> \param[in] INCV
84
+ *> \verbatim
85
+ *> INCV is INTEGER
86
+ *> The increment between elements of v. INCV <> 0.
87
+ *> \endverbatim
88
+ *>
89
+ *> \param[in] TAU
90
+ *> \verbatim
91
+ *> TAU is COMPLEX
92
+ *> The value tau in the representation of H.
93
+ *> \endverbatim
94
+ *>
95
+ *> \param[in,out] C
96
+ *> \verbatim
97
+ *> C is COMPLEX array, dimension (LDC,N)
98
+ *> On entry, the M-by-N matrix C.
99
+ *> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
100
+ *> or C * H if SIDE = 'R'.
101
+ *> \endverbatim
102
+ *>
103
+ *> \param[in] LDC
104
+ *> \verbatim
105
+ *> LDC is INTEGER
106
+ *> The leading dimension of the array C. LDC >= max(1,M).
107
+ *> \endverbatim
108
+ *>
109
+ *> \param[out] WORK
110
+ *> \verbatim
111
+ *> WORK is COMPLEX array, dimension
112
+ *> (N) if SIDE = 'L'
113
+ *> or (M) if SIDE = 'R'
114
+ *> \endverbatim
115
+ *
116
+ * Authors:
117
+ * ========
118
+ *
119
+ *> \author Univ. of Tennessee
120
+ *> \author Univ. of California Berkeley
121
+ *> \author Univ. of Colorado Denver
122
+ *> \author NAG Ltd.
123
+ *
124
+ *> \date November 2011
125
+ *
126
+ *> \ingroup complexOTHERauxiliary
127
+ *
128
+ * =====================================================================
129
+ SUBROUTINE CLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
130
+ *
131
+ * -- LAPACK auxiliary routine (version 3.4.0) --
132
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
133
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134
+ * November 2011
135
+ *
136
+ * .. Scalar Arguments ..
137
+ CHARACTER SIDE
138
+ INTEGER INCV, LDC, M, N
139
+ COMPLEX TAU
140
+ * ..
141
+ * .. Array Arguments ..
142
+ COMPLEX C( LDC, * ), V( * ), WORK( * )
143
+ * ..
144
+ *
145
+ * =====================================================================
146
+ *
147
+ * .. Parameters ..
148
+ COMPLEX ONE, ZERO
149
+ PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ),
150
+ $ ZERO = ( 0.0E+0, 0.0E+0 ) )
151
+ * ..
152
+ * .. Local Scalars ..
153
+ LOGICAL APPLYLEFT
154
+ INTEGER I, LASTV, LASTC
155
+ * ..
156
+ * .. External Subroutines ..
157
+ EXTERNAL CGEMV, CGERC
158
+ * ..
159
+ * .. External Functions ..
160
+ LOGICAL LSAME
161
+ INTEGER ILACLR, ILACLC
162
+ EXTERNAL LSAME, ILACLR, ILACLC
163
+ * ..
164
+ * .. Executable Statements ..
165
+ *
166
+ APPLYLEFT = LSAME( SIDE, 'L' )
167
+ LASTV = 0
168
+ LASTC = 0
169
+ IF( TAU.NE.ZERO ) THEN
170
+ ! Set up variables for scanning V. LASTV begins pointing to the end
171
+ ! of V.
172
+ IF( APPLYLEFT ) THEN
173
+ LASTV = M
174
+ ELSE
175
+ LASTV = N
176
+ END IF
177
+ IF( INCV.GT.0 ) THEN
178
+ I = 1 + (LASTV-1) * INCV
179
+ ELSE
180
+ I = 1
181
+ END IF
182
+ ! Look for the last non-zero row in V.
183
+ DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
184
+ LASTV = LASTV - 1
185
+ I = I - INCV
186
+ END DO
187
+ IF( APPLYLEFT ) THEN
188
+ ! Scan for the last non-zero column in C(1:lastv,:).
189
+ LASTC = ILACLC(LASTV, N, C, LDC)
190
+ ELSE
191
+ ! Scan for the last non-zero row in C(:,1:lastv).
192
+ LASTC = ILACLR(M, LASTV, C, LDC)
193
+ END IF
194
+ END IF
195
+ ! Note that lastc.eq.0 renders the BLAS operations null; no special
196
+ ! case is needed at this level.
197
+ IF( APPLYLEFT ) THEN
198
+ *
199
+ * Form H * C
200
+ *
201
+ IF( LASTV.GT.0 ) THEN
202
+ *
203
+ * w(1:lastc,1) := C(1:lastv,1:lastc)**H * v(1:lastv,1)
204
+ *
205
+ CALL CGEMV( 'Conjugate transpose', LASTV, LASTC, ONE,
206
+ $ C, LDC, V, INCV, ZERO, WORK, 1 )
207
+ *
208
+ * C(1:lastv,1:lastc) := C(...) - v(1:lastv,1) * w(1:lastc,1)**H
209
+ *
210
+ CALL CGERC( LASTV, LASTC, -TAU, V, INCV, WORK, 1, C, LDC )
211
+ END IF
212
+ ELSE
213
+ *
214
+ * Form C * H
215
+ *
216
+ IF( LASTV.GT.0 ) THEN
217
+ *
218
+ * w(1:lastc,1) := C(1:lastc,1:lastv) * v(1:lastv,1)
219
+ *
220
+ CALL CGEMV( 'No transpose', LASTC, LASTV, ONE, C, LDC,
221
+ $ V, INCV, ZERO, WORK, 1 )
222
+ *
223
+ * C(1:lastc,1:lastv) := C(...) - w(1:lastc,1) * v(1:lastv,1)**H
224
+ *
225
+ CALL CGERC( LASTC, LASTV, -TAU, WORK, 1, V, INCV, C, LDC )
226
+ END IF
227
+ END IF
228
+ RETURN
229
+ *
230
+ * End of CLARF
231
+ *
232
+ END
include/eigen/lapack/clarfb.f ADDED
@@ -0,0 +1,771 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b CLARFB
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download CLARFB + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clarfb.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clarfb.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarfb.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE CLARFB( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV,
22
+ * T, LDT, C, LDC, WORK, LDWORK )
23
+ *
24
+ * .. Scalar Arguments ..
25
+ * CHARACTER DIRECT, SIDE, STOREV, TRANS
26
+ * INTEGER K, LDC, LDT, LDV, LDWORK, M, N
27
+ * ..
28
+ * .. Array Arguments ..
29
+ * COMPLEX C( LDC, * ), T( LDT, * ), V( LDV, * ),
30
+ * $ WORK( LDWORK, * )
31
+ * ..
32
+ *
33
+ *
34
+ *> \par Purpose:
35
+ * =============
36
+ *>
37
+ *> \verbatim
38
+ *>
39
+ *> CLARFB applies a complex block reflector H or its transpose H**H to a
40
+ *> complex M-by-N matrix C, from either the left or the right.
41
+ *> \endverbatim
42
+ *
43
+ * Arguments:
44
+ * ==========
45
+ *
46
+ *> \param[in] SIDE
47
+ *> \verbatim
48
+ *> SIDE is CHARACTER*1
49
+ *> = 'L': apply H or H**H from the Left
50
+ *> = 'R': apply H or H**H from the Right
51
+ *> \endverbatim
52
+ *>
53
+ *> \param[in] TRANS
54
+ *> \verbatim
55
+ *> TRANS is CHARACTER*1
56
+ *> = 'N': apply H (No transpose)
57
+ *> = 'C': apply H**H (Conjugate transpose)
58
+ *> \endverbatim
59
+ *>
60
+ *> \param[in] DIRECT
61
+ *> \verbatim
62
+ *> DIRECT is CHARACTER*1
63
+ *> Indicates how H is formed from a product of elementary
64
+ *> reflectors
65
+ *> = 'F': H = H(1) H(2) . . . H(k) (Forward)
66
+ *> = 'B': H = H(k) . . . H(2) H(1) (Backward)
67
+ *> \endverbatim
68
+ *>
69
+ *> \param[in] STOREV
70
+ *> \verbatim
71
+ *> STOREV is CHARACTER*1
72
+ *> Indicates how the vectors which define the elementary
73
+ *> reflectors are stored:
74
+ *> = 'C': Columnwise
75
+ *> = 'R': Rowwise
76
+ *> \endverbatim
77
+ *>
78
+ *> \param[in] M
79
+ *> \verbatim
80
+ *> M is INTEGER
81
+ *> The number of rows of the matrix C.
82
+ *> \endverbatim
83
+ *>
84
+ *> \param[in] N
85
+ *> \verbatim
86
+ *> N is INTEGER
87
+ *> The number of columns of the matrix C.
88
+ *> \endverbatim
89
+ *>
90
+ *> \param[in] K
91
+ *> \verbatim
92
+ *> K is INTEGER
93
+ *> The order of the matrix T (= the number of elementary
94
+ *> reflectors whose product defines the block reflector).
95
+ *> \endverbatim
96
+ *>
97
+ *> \param[in] V
98
+ *> \verbatim
99
+ *> V is COMPLEX array, dimension
100
+ *> (LDV,K) if STOREV = 'C'
101
+ *> (LDV,M) if STOREV = 'R' and SIDE = 'L'
102
+ *> (LDV,N) if STOREV = 'R' and SIDE = 'R'
103
+ *> The matrix V. See Further Details.
104
+ *> \endverbatim
105
+ *>
106
+ *> \param[in] LDV
107
+ *> \verbatim
108
+ *> LDV is INTEGER
109
+ *> The leading dimension of the array V.
110
+ *> If STOREV = 'C' and SIDE = 'L', LDV >= max(1,M);
111
+ *> if STOREV = 'C' and SIDE = 'R', LDV >= max(1,N);
112
+ *> if STOREV = 'R', LDV >= K.
113
+ *> \endverbatim
114
+ *>
115
+ *> \param[in] T
116
+ *> \verbatim
117
+ *> T is COMPLEX array, dimension (LDT,K)
118
+ *> The triangular K-by-K matrix T in the representation of the
119
+ *> block reflector.
120
+ *> \endverbatim
121
+ *>
122
+ *> \param[in] LDT
123
+ *> \verbatim
124
+ *> LDT is INTEGER
125
+ *> The leading dimension of the array T. LDT >= K.
126
+ *> \endverbatim
127
+ *>
128
+ *> \param[in,out] C
129
+ *> \verbatim
130
+ *> C is COMPLEX array, dimension (LDC,N)
131
+ *> On entry, the M-by-N matrix C.
132
+ *> On exit, C is overwritten by H*C or H**H*C or C*H or C*H**H.
133
+ *> \endverbatim
134
+ *>
135
+ *> \param[in] LDC
136
+ *> \verbatim
137
+ *> LDC is INTEGER
138
+ *> The leading dimension of the array C. LDC >= max(1,M).
139
+ *> \endverbatim
140
+ *>
141
+ *> \param[out] WORK
142
+ *> \verbatim
143
+ *> WORK is COMPLEX array, dimension (LDWORK,K)
144
+ *> \endverbatim
145
+ *>
146
+ *> \param[in] LDWORK
147
+ *> \verbatim
148
+ *> LDWORK is INTEGER
149
+ *> The leading dimension of the array WORK.
150
+ *> If SIDE = 'L', LDWORK >= max(1,N);
151
+ *> if SIDE = 'R', LDWORK >= max(1,M).
152
+ *> \endverbatim
153
+ *
154
+ * Authors:
155
+ * ========
156
+ *
157
+ *> \author Univ. of Tennessee
158
+ *> \author Univ. of California Berkeley
159
+ *> \author Univ. of Colorado Denver
160
+ *> \author NAG Ltd.
161
+ *
162
+ *> \date November 2011
163
+ *
164
+ *> \ingroup complexOTHERauxiliary
165
+ *
166
+ *> \par Further Details:
167
+ * =====================
168
+ *>
169
+ *> \verbatim
170
+ *>
171
+ *> The shape of the matrix V and the storage of the vectors which define
172
+ *> the H(i) is best illustrated by the following example with n = 5 and
173
+ *> k = 3. The elements equal to 1 are not stored; the corresponding
174
+ *> array elements are modified but restored on exit. The rest of the
175
+ *> array is not used.
176
+ *>
177
+ *> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
178
+ *>
179
+ *> V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
180
+ *> ( v1 1 ) ( 1 v2 v2 v2 )
181
+ *> ( v1 v2 1 ) ( 1 v3 v3 )
182
+ *> ( v1 v2 v3 )
183
+ *> ( v1 v2 v3 )
184
+ *>
185
+ *> DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
186
+ *>
187
+ *> V = ( v1 v2 v3 ) V = ( v1 v1 1 )
188
+ *> ( v1 v2 v3 ) ( v2 v2 v2 1 )
189
+ *> ( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
190
+ *> ( 1 v3 )
191
+ *> ( 1 )
192
+ *> \endverbatim
193
+ *>
194
+ * =====================================================================
195
+ SUBROUTINE CLARFB( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV,
196
+ $ T, LDT, C, LDC, WORK, LDWORK )
197
+ *
198
+ * -- LAPACK auxiliary routine (version 3.4.0) --
199
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
200
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
201
+ * November 2011
202
+ *
203
+ * .. Scalar Arguments ..
204
+ CHARACTER DIRECT, SIDE, STOREV, TRANS
205
+ INTEGER K, LDC, LDT, LDV, LDWORK, M, N
206
+ * ..
207
+ * .. Array Arguments ..
208
+ COMPLEX C( LDC, * ), T( LDT, * ), V( LDV, * ),
209
+ $ WORK( LDWORK, * )
210
+ * ..
211
+ *
212
+ * =====================================================================
213
+ *
214
+ * .. Parameters ..
215
+ COMPLEX ONE
216
+ PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ) )
217
+ * ..
218
+ * .. Local Scalars ..
219
+ CHARACTER TRANST
220
+ INTEGER I, J, LASTV, LASTC
221
+ * ..
222
+ * .. External Functions ..
223
+ LOGICAL LSAME
224
+ INTEGER ILACLR, ILACLC
225
+ EXTERNAL LSAME, ILACLR, ILACLC
226
+ * ..
227
+ * .. External Subroutines ..
228
+ EXTERNAL CCOPY, CGEMM, CLACGV, CTRMM
229
+ * ..
230
+ * .. Intrinsic Functions ..
231
+ INTRINSIC CONJG
232
+ * ..
233
+ * .. Executable Statements ..
234
+ *
235
+ * Quick return if possible
236
+ *
237
+ IF( M.LE.0 .OR. N.LE.0 )
238
+ $ RETURN
239
+ *
240
+ IF( LSAME( TRANS, 'N' ) ) THEN
241
+ TRANST = 'C'
242
+ ELSE
243
+ TRANST = 'N'
244
+ END IF
245
+ *
246
+ IF( LSAME( STOREV, 'C' ) ) THEN
247
+ *
248
+ IF( LSAME( DIRECT, 'F' ) ) THEN
249
+ *
250
+ * Let V = ( V1 ) (first K rows)
251
+ * ( V2 )
252
+ * where V1 is unit lower triangular.
253
+ *
254
+ IF( LSAME( SIDE, 'L' ) ) THEN
255
+ *
256
+ * Form H * C or H**H * C where C = ( C1 )
257
+ * ( C2 )
258
+ *
259
+ LASTV = MAX( K, ILACLR( M, K, V, LDV ) )
260
+ LASTC = ILACLC( LASTV, N, C, LDC )
261
+ *
262
+ * W := C**H * V = (C1**H * V1 + C2**H * V2) (stored in WORK)
263
+ *
264
+ * W := C1**H
265
+ *
266
+ DO 10 J = 1, K
267
+ CALL CCOPY( LASTC, C( J, 1 ), LDC, WORK( 1, J ), 1 )
268
+ CALL CLACGV( LASTC, WORK( 1, J ), 1 )
269
+ 10 CONTINUE
270
+ *
271
+ * W := W * V1
272
+ *
273
+ CALL CTRMM( 'Right', 'Lower', 'No transpose', 'Unit',
274
+ $ LASTC, K, ONE, V, LDV, WORK, LDWORK )
275
+ IF( LASTV.GT.K ) THEN
276
+ *
277
+ * W := W + C2**H *V2
278
+ *
279
+ CALL CGEMM( 'Conjugate transpose', 'No transpose',
280
+ $ LASTC, K, LASTV-K, ONE, C( K+1, 1 ), LDC,
281
+ $ V( K+1, 1 ), LDV, ONE, WORK, LDWORK )
282
+ END IF
283
+ *
284
+ * W := W * T**H or W * T
285
+ *
286
+ CALL CTRMM( 'Right', 'Upper', TRANST, 'Non-unit',
287
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
288
+ *
289
+ * C := C - V * W**H
290
+ *
291
+ IF( M.GT.K ) THEN
292
+ *
293
+ * C2 := C2 - V2 * W**H
294
+ *
295
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
296
+ $ LASTV-K, LASTC, K, -ONE, V( K+1, 1 ), LDV,
297
+ $ WORK, LDWORK, ONE, C( K+1, 1 ), LDC )
298
+ END IF
299
+ *
300
+ * W := W * V1**H
301
+ *
302
+ CALL CTRMM( 'Right', 'Lower', 'Conjugate transpose',
303
+ $ 'Unit', LASTC, K, ONE, V, LDV, WORK, LDWORK )
304
+ *
305
+ * C1 := C1 - W**H
306
+ *
307
+ DO 30 J = 1, K
308
+ DO 20 I = 1, LASTC
309
+ C( J, I ) = C( J, I ) - CONJG( WORK( I, J ) )
310
+ 20 CONTINUE
311
+ 30 CONTINUE
312
+ *
313
+ ELSE IF( LSAME( SIDE, 'R' ) ) THEN
314
+ *
315
+ * Form C * H or C * H**H where C = ( C1 C2 )
316
+ *
317
+ LASTV = MAX( K, ILACLR( N, K, V, LDV ) )
318
+ LASTC = ILACLR( M, LASTV, C, LDC )
319
+ *
320
+ * W := C * V = (C1*V1 + C2*V2) (stored in WORK)
321
+ *
322
+ * W := C1
323
+ *
324
+ DO 40 J = 1, K
325
+ CALL CCOPY( LASTC, C( 1, J ), 1, WORK( 1, J ), 1 )
326
+ 40 CONTINUE
327
+ *
328
+ * W := W * V1
329
+ *
330
+ CALL CTRMM( 'Right', 'Lower', 'No transpose', 'Unit',
331
+ $ LASTC, K, ONE, V, LDV, WORK, LDWORK )
332
+ IF( LASTV.GT.K ) THEN
333
+ *
334
+ * W := W + C2 * V2
335
+ *
336
+ CALL CGEMM( 'No transpose', 'No transpose',
337
+ $ LASTC, K, LASTV-K,
338
+ $ ONE, C( 1, K+1 ), LDC, V( K+1, 1 ), LDV,
339
+ $ ONE, WORK, LDWORK )
340
+ END IF
341
+ *
342
+ * W := W * T or W * T**H
343
+ *
344
+ CALL CTRMM( 'Right', 'Upper', TRANS, 'Non-unit',
345
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
346
+ *
347
+ * C := C - W * V**H
348
+ *
349
+ IF( LASTV.GT.K ) THEN
350
+ *
351
+ * C2 := C2 - W * V2**H
352
+ *
353
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
354
+ $ LASTC, LASTV-K, K,
355
+ $ -ONE, WORK, LDWORK, V( K+1, 1 ), LDV,
356
+ $ ONE, C( 1, K+1 ), LDC )
357
+ END IF
358
+ *
359
+ * W := W * V1**H
360
+ *
361
+ CALL CTRMM( 'Right', 'Lower', 'Conjugate transpose',
362
+ $ 'Unit', LASTC, K, ONE, V, LDV, WORK, LDWORK )
363
+ *
364
+ * C1 := C1 - W
365
+ *
366
+ DO 60 J = 1, K
367
+ DO 50 I = 1, LASTC
368
+ C( I, J ) = C( I, J ) - WORK( I, J )
369
+ 50 CONTINUE
370
+ 60 CONTINUE
371
+ END IF
372
+ *
373
+ ELSE
374
+ *
375
+ * Let V = ( V1 )
376
+ * ( V2 ) (last K rows)
377
+ * where V2 is unit upper triangular.
378
+ *
379
+ IF( LSAME( SIDE, 'L' ) ) THEN
380
+ *
381
+ * Form H * C or H**H * C where C = ( C1 )
382
+ * ( C2 )
383
+ *
384
+ LASTV = MAX( K, ILACLR( M, K, V, LDV ) )
385
+ LASTC = ILACLC( LASTV, N, C, LDC )
386
+ *
387
+ * W := C**H * V = (C1**H * V1 + C2**H * V2) (stored in WORK)
388
+ *
389
+ * W := C2**H
390
+ *
391
+ DO 70 J = 1, K
392
+ CALL CCOPY( LASTC, C( LASTV-K+J, 1 ), LDC,
393
+ $ WORK( 1, J ), 1 )
394
+ CALL CLACGV( LASTC, WORK( 1, J ), 1 )
395
+ 70 CONTINUE
396
+ *
397
+ * W := W * V2
398
+ *
399
+ CALL CTRMM( 'Right', 'Upper', 'No transpose', 'Unit',
400
+ $ LASTC, K, ONE, V( LASTV-K+1, 1 ), LDV,
401
+ $ WORK, LDWORK )
402
+ IF( LASTV.GT.K ) THEN
403
+ *
404
+ * W := W + C1**H*V1
405
+ *
406
+ CALL CGEMM( 'Conjugate transpose', 'No transpose',
407
+ $ LASTC, K, LASTV-K, ONE, C, LDC, V, LDV,
408
+ $ ONE, WORK, LDWORK )
409
+ END IF
410
+ *
411
+ * W := W * T**H or W * T
412
+ *
413
+ CALL CTRMM( 'Right', 'Lower', TRANST, 'Non-unit',
414
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
415
+ *
416
+ * C := C - V * W**H
417
+ *
418
+ IF( LASTV.GT.K ) THEN
419
+ *
420
+ * C1 := C1 - V1 * W**H
421
+ *
422
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
423
+ $ LASTV-K, LASTC, K, -ONE, V, LDV, WORK, LDWORK,
424
+ $ ONE, C, LDC )
425
+ END IF
426
+ *
427
+ * W := W * V2**H
428
+ *
429
+ CALL CTRMM( 'Right', 'Upper', 'Conjugate transpose',
430
+ $ 'Unit', LASTC, K, ONE, V( LASTV-K+1, 1 ), LDV,
431
+ $ WORK, LDWORK )
432
+ *
433
+ * C2 := C2 - W**H
434
+ *
435
+ DO 90 J = 1, K
436
+ DO 80 I = 1, LASTC
437
+ C( LASTV-K+J, I ) = C( LASTV-K+J, I ) -
438
+ $ CONJG( WORK( I, J ) )
439
+ 80 CONTINUE
440
+ 90 CONTINUE
441
+ *
442
+ ELSE IF( LSAME( SIDE, 'R' ) ) THEN
443
+ *
444
+ * Form C * H or C * H**H where C = ( C1 C2 )
445
+ *
446
+ LASTV = MAX( K, ILACLR( N, K, V, LDV ) )
447
+ LASTC = ILACLR( M, LASTV, C, LDC )
448
+ *
449
+ * W := C * V = (C1*V1 + C2*V2) (stored in WORK)
450
+ *
451
+ * W := C2
452
+ *
453
+ DO 100 J = 1, K
454
+ CALL CCOPY( LASTC, C( 1, LASTV-K+J ), 1,
455
+ $ WORK( 1, J ), 1 )
456
+ 100 CONTINUE
457
+ *
458
+ * W := W * V2
459
+ *
460
+ CALL CTRMM( 'Right', 'Upper', 'No transpose', 'Unit',
461
+ $ LASTC, K, ONE, V( LASTV-K+1, 1 ), LDV,
462
+ $ WORK, LDWORK )
463
+ IF( LASTV.GT.K ) THEN
464
+ *
465
+ * W := W + C1 * V1
466
+ *
467
+ CALL CGEMM( 'No transpose', 'No transpose',
468
+ $ LASTC, K, LASTV-K,
469
+ $ ONE, C, LDC, V, LDV, ONE, WORK, LDWORK )
470
+ END IF
471
+ *
472
+ * W := W * T or W * T**H
473
+ *
474
+ CALL CTRMM( 'Right', 'Lower', TRANS, 'Non-unit',
475
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
476
+ *
477
+ * C := C - W * V**H
478
+ *
479
+ IF( LASTV.GT.K ) THEN
480
+ *
481
+ * C1 := C1 - W * V1**H
482
+ *
483
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
484
+ $ LASTC, LASTV-K, K, -ONE, WORK, LDWORK, V, LDV,
485
+ $ ONE, C, LDC )
486
+ END IF
487
+ *
488
+ * W := W * V2**H
489
+ *
490
+ CALL CTRMM( 'Right', 'Upper', 'Conjugate transpose',
491
+ $ 'Unit', LASTC, K, ONE, V( LASTV-K+1, 1 ), LDV,
492
+ $ WORK, LDWORK )
493
+ *
494
+ * C2 := C2 - W
495
+ *
496
+ DO 120 J = 1, K
497
+ DO 110 I = 1, LASTC
498
+ C( I, LASTV-K+J ) = C( I, LASTV-K+J )
499
+ $ - WORK( I, J )
500
+ 110 CONTINUE
501
+ 120 CONTINUE
502
+ END IF
503
+ END IF
504
+ *
505
+ ELSE IF( LSAME( STOREV, 'R' ) ) THEN
506
+ *
507
+ IF( LSAME( DIRECT, 'F' ) ) THEN
508
+ *
509
+ * Let V = ( V1 V2 ) (V1: first K columns)
510
+ * where V1 is unit upper triangular.
511
+ *
512
+ IF( LSAME( SIDE, 'L' ) ) THEN
513
+ *
514
+ * Form H * C or H**H * C where C = ( C1 )
515
+ * ( C2 )
516
+ *
517
+ LASTV = MAX( K, ILACLC( K, M, V, LDV ) )
518
+ LASTC = ILACLC( LASTV, N, C, LDC )
519
+ *
520
+ * W := C**H * V**H = (C1**H * V1**H + C2**H * V2**H) (stored in WORK)
521
+ *
522
+ * W := C1**H
523
+ *
524
+ DO 130 J = 1, K
525
+ CALL CCOPY( LASTC, C( J, 1 ), LDC, WORK( 1, J ), 1 )
526
+ CALL CLACGV( LASTC, WORK( 1, J ), 1 )
527
+ 130 CONTINUE
528
+ *
529
+ * W := W * V1**H
530
+ *
531
+ CALL CTRMM( 'Right', 'Upper', 'Conjugate transpose',
532
+ $ 'Unit', LASTC, K, ONE, V, LDV, WORK, LDWORK )
533
+ IF( LASTV.GT.K ) THEN
534
+ *
535
+ * W := W + C2**H*V2**H
536
+ *
537
+ CALL CGEMM( 'Conjugate transpose',
538
+ $ 'Conjugate transpose', LASTC, K, LASTV-K,
539
+ $ ONE, C( K+1, 1 ), LDC, V( 1, K+1 ), LDV,
540
+ $ ONE, WORK, LDWORK )
541
+ END IF
542
+ *
543
+ * W := W * T**H or W * T
544
+ *
545
+ CALL CTRMM( 'Right', 'Upper', TRANST, 'Non-unit',
546
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
547
+ *
548
+ * C := C - V**H * W**H
549
+ *
550
+ IF( LASTV.GT.K ) THEN
551
+ *
552
+ * C2 := C2 - V2**H * W**H
553
+ *
554
+ CALL CGEMM( 'Conjugate transpose',
555
+ $ 'Conjugate transpose', LASTV-K, LASTC, K,
556
+ $ -ONE, V( 1, K+1 ), LDV, WORK, LDWORK,
557
+ $ ONE, C( K+1, 1 ), LDC )
558
+ END IF
559
+ *
560
+ * W := W * V1
561
+ *
562
+ CALL CTRMM( 'Right', 'Upper', 'No transpose', 'Unit',
563
+ $ LASTC, K, ONE, V, LDV, WORK, LDWORK )
564
+ *
565
+ * C1 := C1 - W**H
566
+ *
567
+ DO 150 J = 1, K
568
+ DO 140 I = 1, LASTC
569
+ C( J, I ) = C( J, I ) - CONJG( WORK( I, J ) )
570
+ 140 CONTINUE
571
+ 150 CONTINUE
572
+ *
573
+ ELSE IF( LSAME( SIDE, 'R' ) ) THEN
574
+ *
575
+ * Form C * H or C * H**H where C = ( C1 C2 )
576
+ *
577
+ LASTV = MAX( K, ILACLC( K, N, V, LDV ) )
578
+ LASTC = ILACLR( M, LASTV, C, LDC )
579
+ *
580
+ * W := C * V**H = (C1*V1**H + C2*V2**H) (stored in WORK)
581
+ *
582
+ * W := C1
583
+ *
584
+ DO 160 J = 1, K
585
+ CALL CCOPY( LASTC, C( 1, J ), 1, WORK( 1, J ), 1 )
586
+ 160 CONTINUE
587
+ *
588
+ * W := W * V1**H
589
+ *
590
+ CALL CTRMM( 'Right', 'Upper', 'Conjugate transpose',
591
+ $ 'Unit', LASTC, K, ONE, V, LDV, WORK, LDWORK )
592
+ IF( LASTV.GT.K ) THEN
593
+ *
594
+ * W := W + C2 * V2**H
595
+ *
596
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
597
+ $ LASTC, K, LASTV-K, ONE, C( 1, K+1 ), LDC,
598
+ $ V( 1, K+1 ), LDV, ONE, WORK, LDWORK )
599
+ END IF
600
+ *
601
+ * W := W * T or W * T**H
602
+ *
603
+ CALL CTRMM( 'Right', 'Upper', TRANS, 'Non-unit',
604
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
605
+ *
606
+ * C := C - W * V
607
+ *
608
+ IF( LASTV.GT.K ) THEN
609
+ *
610
+ * C2 := C2 - W * V2
611
+ *
612
+ CALL CGEMM( 'No transpose', 'No transpose',
613
+ $ LASTC, LASTV-K, K,
614
+ $ -ONE, WORK, LDWORK, V( 1, K+1 ), LDV,
615
+ $ ONE, C( 1, K+1 ), LDC )
616
+ END IF
617
+ *
618
+ * W := W * V1
619
+ *
620
+ CALL CTRMM( 'Right', 'Upper', 'No transpose', 'Unit',
621
+ $ LASTC, K, ONE, V, LDV, WORK, LDWORK )
622
+ *
623
+ * C1 := C1 - W
624
+ *
625
+ DO 180 J = 1, K
626
+ DO 170 I = 1, LASTC
627
+ C( I, J ) = C( I, J ) - WORK( I, J )
628
+ 170 CONTINUE
629
+ 180 CONTINUE
630
+ *
631
+ END IF
632
+ *
633
+ ELSE
634
+ *
635
+ * Let V = ( V1 V2 ) (V2: last K columns)
636
+ * where V2 is unit lower triangular.
637
+ *
638
+ IF( LSAME( SIDE, 'L' ) ) THEN
639
+ *
640
+ * Form H * C or H**H * C where C = ( C1 )
641
+ * ( C2 )
642
+ *
643
+ LASTV = MAX( K, ILACLC( K, M, V, LDV ) )
644
+ LASTC = ILACLC( LASTV, N, C, LDC )
645
+ *
646
+ * W := C**H * V**H = (C1**H * V1**H + C2**H * V2**H) (stored in WORK)
647
+ *
648
+ * W := C2**H
649
+ *
650
+ DO 190 J = 1, K
651
+ CALL CCOPY( LASTC, C( LASTV-K+J, 1 ), LDC,
652
+ $ WORK( 1, J ), 1 )
653
+ CALL CLACGV( LASTC, WORK( 1, J ), 1 )
654
+ 190 CONTINUE
655
+ *
656
+ * W := W * V2**H
657
+ *
658
+ CALL CTRMM( 'Right', 'Lower', 'Conjugate transpose',
659
+ $ 'Unit', LASTC, K, ONE, V( 1, LASTV-K+1 ), LDV,
660
+ $ WORK, LDWORK )
661
+ IF( LASTV.GT.K ) THEN
662
+ *
663
+ * W := W + C1**H * V1**H
664
+ *
665
+ CALL CGEMM( 'Conjugate transpose',
666
+ $ 'Conjugate transpose', LASTC, K, LASTV-K,
667
+ $ ONE, C, LDC, V, LDV, ONE, WORK, LDWORK )
668
+ END IF
669
+ *
670
+ * W := W * T**H or W * T
671
+ *
672
+ CALL CTRMM( 'Right', 'Lower', TRANST, 'Non-unit',
673
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
674
+ *
675
+ * C := C - V**H * W**H
676
+ *
677
+ IF( LASTV.GT.K ) THEN
678
+ *
679
+ * C1 := C1 - V1**H * W**H
680
+ *
681
+ CALL CGEMM( 'Conjugate transpose',
682
+ $ 'Conjugate transpose', LASTV-K, LASTC, K,
683
+ $ -ONE, V, LDV, WORK, LDWORK, ONE, C, LDC )
684
+ END IF
685
+ *
686
+ * W := W * V2
687
+ *
688
+ CALL CTRMM( 'Right', 'Lower', 'No transpose', 'Unit',
689
+ $ LASTC, K, ONE, V( 1, LASTV-K+1 ), LDV,
690
+ $ WORK, LDWORK )
691
+ *
692
+ * C2 := C2 - W**H
693
+ *
694
+ DO 210 J = 1, K
695
+ DO 200 I = 1, LASTC
696
+ C( LASTV-K+J, I ) = C( LASTV-K+J, I ) -
697
+ $ CONJG( WORK( I, J ) )
698
+ 200 CONTINUE
699
+ 210 CONTINUE
700
+ *
701
+ ELSE IF( LSAME( SIDE, 'R' ) ) THEN
702
+ *
703
+ * Form C * H or C * H**H where C = ( C1 C2 )
704
+ *
705
+ LASTV = MAX( K, ILACLC( K, N, V, LDV ) )
706
+ LASTC = ILACLR( M, LASTV, C, LDC )
707
+ *
708
+ * W := C * V**H = (C1*V1**H + C2*V2**H) (stored in WORK)
709
+ *
710
+ * W := C2
711
+ *
712
+ DO 220 J = 1, K
713
+ CALL CCOPY( LASTC, C( 1, LASTV-K+J ), 1,
714
+ $ WORK( 1, J ), 1 )
715
+ 220 CONTINUE
716
+ *
717
+ * W := W * V2**H
718
+ *
719
+ CALL CTRMM( 'Right', 'Lower', 'Conjugate transpose',
720
+ $ 'Unit', LASTC, K, ONE, V( 1, LASTV-K+1 ), LDV,
721
+ $ WORK, LDWORK )
722
+ IF( LASTV.GT.K ) THEN
723
+ *
724
+ * W := W + C1 * V1**H
725
+ *
726
+ CALL CGEMM( 'No transpose', 'Conjugate transpose',
727
+ $ LASTC, K, LASTV-K, ONE, C, LDC, V, LDV, ONE,
728
+ $ WORK, LDWORK )
729
+ END IF
730
+ *
731
+ * W := W * T or W * T**H
732
+ *
733
+ CALL CTRMM( 'Right', 'Lower', TRANS, 'Non-unit',
734
+ $ LASTC, K, ONE, T, LDT, WORK, LDWORK )
735
+ *
736
+ * C := C - W * V
737
+ *
738
+ IF( LASTV.GT.K ) THEN
739
+ *
740
+ * C1 := C1 - W * V1
741
+ *
742
+ CALL CGEMM( 'No transpose', 'No transpose',
743
+ $ LASTC, LASTV-K, K, -ONE, WORK, LDWORK, V, LDV,
744
+ $ ONE, C, LDC )
745
+ END IF
746
+ *
747
+ * W := W * V2
748
+ *
749
+ CALL CTRMM( 'Right', 'Lower', 'No transpose', 'Unit',
750
+ $ LASTC, K, ONE, V( 1, LASTV-K+1 ), LDV,
751
+ $ WORK, LDWORK )
752
+ *
753
+ * C1 := C1 - W
754
+ *
755
+ DO 240 J = 1, K
756
+ DO 230 I = 1, LASTC
757
+ C( I, LASTV-K+J ) = C( I, LASTV-K+J )
758
+ $ - WORK( I, J )
759
+ 230 CONTINUE
760
+ 240 CONTINUE
761
+ *
762
+ END IF
763
+ *
764
+ END IF
765
+ END IF
766
+ *
767
+ RETURN
768
+ *
769
+ * End of CLARFB
770
+ *
771
+ END
include/eigen/lapack/clarft.f ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b CLARFT
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download CLARFT + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clarft.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clarft.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarft.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE CLARFT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * CHARACTER DIRECT, STOREV
25
+ * INTEGER K, LDT, LDV, N
26
+ * ..
27
+ * .. Array Arguments ..
28
+ * COMPLEX T( LDT, * ), TAU( * ), V( LDV, * )
29
+ * ..
30
+ *
31
+ *
32
+ *> \par Purpose:
33
+ * =============
34
+ *>
35
+ *> \verbatim
36
+ *>
37
+ *> CLARFT forms the triangular factor T of a complex block reflector H
38
+ *> of order n, which is defined as a product of k elementary reflectors.
39
+ *>
40
+ *> If DIRECT = 'F', H = H(1) H(2) . . . H(k) and T is upper triangular;
41
+ *>
42
+ *> If DIRECT = 'B', H = H(k) . . . H(2) H(1) and T is lower triangular.
43
+ *>
44
+ *> If STOREV = 'C', the vector which defines the elementary reflector
45
+ *> H(i) is stored in the i-th column of the array V, and
46
+ *>
47
+ *> H = I - V * T * V**H
48
+ *>
49
+ *> If STOREV = 'R', the vector which defines the elementary reflector
50
+ *> H(i) is stored in the i-th row of the array V, and
51
+ *>
52
+ *> H = I - V**H * T * V
53
+ *> \endverbatim
54
+ *
55
+ * Arguments:
56
+ * ==========
57
+ *
58
+ *> \param[in] DIRECT
59
+ *> \verbatim
60
+ *> DIRECT is CHARACTER*1
61
+ *> Specifies the order in which the elementary reflectors are
62
+ *> multiplied to form the block reflector:
63
+ *> = 'F': H = H(1) H(2) . . . H(k) (Forward)
64
+ *> = 'B': H = H(k) . . . H(2) H(1) (Backward)
65
+ *> \endverbatim
66
+ *>
67
+ *> \param[in] STOREV
68
+ *> \verbatim
69
+ *> STOREV is CHARACTER*1
70
+ *> Specifies how the vectors which define the elementary
71
+ *> reflectors are stored (see also Further Details):
72
+ *> = 'C': columnwise
73
+ *> = 'R': rowwise
74
+ *> \endverbatim
75
+ *>
76
+ *> \param[in] N
77
+ *> \verbatim
78
+ *> N is INTEGER
79
+ *> The order of the block reflector H. N >= 0.
80
+ *> \endverbatim
81
+ *>
82
+ *> \param[in] K
83
+ *> \verbatim
84
+ *> K is INTEGER
85
+ *> The order of the triangular factor T (= the number of
86
+ *> elementary reflectors). K >= 1.
87
+ *> \endverbatim
88
+ *>
89
+ *> \param[in] V
90
+ *> \verbatim
91
+ *> V is COMPLEX array, dimension
92
+ *> (LDV,K) if STOREV = 'C'
93
+ *> (LDV,N) if STOREV = 'R'
94
+ *> The matrix V. See further details.
95
+ *> \endverbatim
96
+ *>
97
+ *> \param[in] LDV
98
+ *> \verbatim
99
+ *> LDV is INTEGER
100
+ *> The leading dimension of the array V.
101
+ *> If STOREV = 'C', LDV >= max(1,N); if STOREV = 'R', LDV >= K.
102
+ *> \endverbatim
103
+ *>
104
+ *> \param[in] TAU
105
+ *> \verbatim
106
+ *> TAU is COMPLEX array, dimension (K)
107
+ *> TAU(i) must contain the scalar factor of the elementary
108
+ *> reflector H(i).
109
+ *> \endverbatim
110
+ *>
111
+ *> \param[out] T
112
+ *> \verbatim
113
+ *> T is COMPLEX array, dimension (LDT,K)
114
+ *> The k by k triangular factor T of the block reflector.
115
+ *> If DIRECT = 'F', T is upper triangular; if DIRECT = 'B', T is
116
+ *> lower triangular. The rest of the array is not used.
117
+ *> \endverbatim
118
+ *>
119
+ *> \param[in] LDT
120
+ *> \verbatim
121
+ *> LDT is INTEGER
122
+ *> The leading dimension of the array T. LDT >= K.
123
+ *> \endverbatim
124
+ *
125
+ * Authors:
126
+ * ========
127
+ *
128
+ *> \author Univ. of Tennessee
129
+ *> \author Univ. of California Berkeley
130
+ *> \author Univ. of Colorado Denver
131
+ *> \author NAG Ltd.
132
+ *
133
+ *> \date April 2012
134
+ *
135
+ *> \ingroup complexOTHERauxiliary
136
+ *
137
+ *> \par Further Details:
138
+ * =====================
139
+ *>
140
+ *> \verbatim
141
+ *>
142
+ *> The shape of the matrix V and the storage of the vectors which define
143
+ *> the H(i) is best illustrated by the following example with n = 5 and
144
+ *> k = 3. The elements equal to 1 are not stored.
145
+ *>
146
+ *> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
147
+ *>
148
+ *> V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
149
+ *> ( v1 1 ) ( 1 v2 v2 v2 )
150
+ *> ( v1 v2 1 ) ( 1 v3 v3 )
151
+ *> ( v1 v2 v3 )
152
+ *> ( v1 v2 v3 )
153
+ *>
154
+ *> DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
155
+ *>
156
+ *> V = ( v1 v2 v3 ) V = ( v1 v1 1 )
157
+ *> ( v1 v2 v3 ) ( v2 v2 v2 1 )
158
+ *> ( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
159
+ *> ( 1 v3 )
160
+ *> ( 1 )
161
+ *> \endverbatim
162
+ *>
163
+ * =====================================================================
164
+ SUBROUTINE CLARFT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
165
+ *
166
+ * -- LAPACK auxiliary routine (version 3.4.1) --
167
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
168
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
169
+ * April 2012
170
+ *
171
+ * .. Scalar Arguments ..
172
+ CHARACTER DIRECT, STOREV
173
+ INTEGER K, LDT, LDV, N
174
+ * ..
175
+ * .. Array Arguments ..
176
+ COMPLEX T( LDT, * ), TAU( * ), V( LDV, * )
177
+ * ..
178
+ *
179
+ * =====================================================================
180
+ *
181
+ * .. Parameters ..
182
+ COMPLEX ONE, ZERO
183
+ PARAMETER ( ONE = ( 1.0E+0, 0.0E+0 ),
184
+ $ ZERO = ( 0.0E+0, 0.0E+0 ) )
185
+ * ..
186
+ * .. Local Scalars ..
187
+ INTEGER I, J, PREVLASTV, LASTV
188
+ * ..
189
+ * .. External Subroutines ..
190
+ EXTERNAL CGEMV, CLACGV, CTRMV
191
+ * ..
192
+ * .. External Functions ..
193
+ LOGICAL LSAME
194
+ EXTERNAL LSAME
195
+ * ..
196
+ * .. Executable Statements ..
197
+ *
198
+ * Quick return if possible
199
+ *
200
+ IF( N.EQ.0 )
201
+ $ RETURN
202
+ *
203
+ IF( LSAME( DIRECT, 'F' ) ) THEN
204
+ PREVLASTV = N
205
+ DO I = 1, K
206
+ PREVLASTV = MAX( PREVLASTV, I )
207
+ IF( TAU( I ).EQ.ZERO ) THEN
208
+ *
209
+ * H(i) = I
210
+ *
211
+ DO J = 1, I
212
+ T( J, I ) = ZERO
213
+ END DO
214
+ ELSE
215
+ *
216
+ * general case
217
+ *
218
+ IF( LSAME( STOREV, 'C' ) ) THEN
219
+ * Skip any trailing zeros.
220
+ DO LASTV = N, I+1, -1
221
+ IF( V( LASTV, I ).NE.ZERO ) EXIT
222
+ END DO
223
+ DO J = 1, I-1
224
+ T( J, I ) = -TAU( I ) * CONJG( V( I , J ) )
225
+ END DO
226
+ J = MIN( LASTV, PREVLASTV )
227
+ *
228
+ * T(1:i-1,i) := - tau(i) * V(i:j,1:i-1)**H * V(i:j,i)
229
+ *
230
+ CALL CGEMV( 'Conjugate transpose', J-I, I-1,
231
+ $ -TAU( I ), V( I+1, 1 ), LDV,
232
+ $ V( I+1, I ), 1,
233
+ $ ONE, T( 1, I ), 1 )
234
+ ELSE
235
+ * Skip any trailing zeros.
236
+ DO LASTV = N, I+1, -1
237
+ IF( V( I, LASTV ).NE.ZERO ) EXIT
238
+ END DO
239
+ DO J = 1, I-1
240
+ T( J, I ) = -TAU( I ) * V( J , I )
241
+ END DO
242
+ J = MIN( LASTV, PREVLASTV )
243
+ *
244
+ * T(1:i-1,i) := - tau(i) * V(1:i-1,i:j) * V(i,i:j)**H
245
+ *
246
+ CALL CGEMM( 'N', 'C', I-1, 1, J-I, -TAU( I ),
247
+ $ V( 1, I+1 ), LDV, V( I, I+1 ), LDV,
248
+ $ ONE, T( 1, I ), LDT )
249
+ END IF
250
+ *
251
+ * T(1:i-1,i) := T(1:i-1,1:i-1) * T(1:i-1,i)
252
+ *
253
+ CALL CTRMV( 'Upper', 'No transpose', 'Non-unit', I-1, T,
254
+ $ LDT, T( 1, I ), 1 )
255
+ T( I, I ) = TAU( I )
256
+ IF( I.GT.1 ) THEN
257
+ PREVLASTV = MAX( PREVLASTV, LASTV )
258
+ ELSE
259
+ PREVLASTV = LASTV
260
+ END IF
261
+ END IF
262
+ END DO
263
+ ELSE
264
+ PREVLASTV = 1
265
+ DO I = K, 1, -1
266
+ IF( TAU( I ).EQ.ZERO ) THEN
267
+ *
268
+ * H(i) = I
269
+ *
270
+ DO J = I, K
271
+ T( J, I ) = ZERO
272
+ END DO
273
+ ELSE
274
+ *
275
+ * general case
276
+ *
277
+ IF( I.LT.K ) THEN
278
+ IF( LSAME( STOREV, 'C' ) ) THEN
279
+ * Skip any leading zeros.
280
+ DO LASTV = 1, I-1
281
+ IF( V( LASTV, I ).NE.ZERO ) EXIT
282
+ END DO
283
+ DO J = I+1, K
284
+ T( J, I ) = -TAU( I ) * CONJG( V( N-K+I , J ) )
285
+ END DO
286
+ J = MAX( LASTV, PREVLASTV )
287
+ *
288
+ * T(i+1:k,i) = -tau(i) * V(j:n-k+i,i+1:k)**H * V(j:n-k+i,i)
289
+ *
290
+ CALL CGEMV( 'Conjugate transpose', N-K+I-J, K-I,
291
+ $ -TAU( I ), V( J, I+1 ), LDV, V( J, I ),
292
+ $ 1, ONE, T( I+1, I ), 1 )
293
+ ELSE
294
+ * Skip any leading zeros.
295
+ DO LASTV = 1, I-1
296
+ IF( V( I, LASTV ).NE.ZERO ) EXIT
297
+ END DO
298
+ DO J = I+1, K
299
+ T( J, I ) = -TAU( I ) * V( J, N-K+I )
300
+ END DO
301
+ J = MAX( LASTV, PREVLASTV )
302
+ *
303
+ * T(i+1:k,i) = -tau(i) * V(i+1:k,j:n-k+i) * V(i,j:n-k+i)**H
304
+ *
305
+ CALL CGEMM( 'N', 'C', K-I, 1, N-K+I-J, -TAU( I ),
306
+ $ V( I+1, J ), LDV, V( I, J ), LDV,
307
+ $ ONE, T( I+1, I ), LDT )
308
+ END IF
309
+ *
310
+ * T(i+1:k,i) := T(i+1:k,i+1:k) * T(i+1:k,i)
311
+ *
312
+ CALL CTRMV( 'Lower', 'No transpose', 'Non-unit', K-I,
313
+ $ T( I+1, I+1 ), LDT, T( I+1, I ), 1 )
314
+ IF( I.GT.1 ) THEN
315
+ PREVLASTV = MIN( PREVLASTV, LASTV )
316
+ ELSE
317
+ PREVLASTV = LASTV
318
+ END IF
319
+ END IF
320
+ T( I, I ) = TAU( I )
321
+ END IF
322
+ END DO
323
+ END IF
324
+ RETURN
325
+ *
326
+ * End of CLARFT
327
+ *
328
+ END
include/eigen/lapack/complex_double.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009-2014 Gael Guennebaud <[email protected]>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #define SCALAR std::complex<double>
11
+ #define SCALAR_SUFFIX z
12
+ #define SCALAR_SUFFIX_UP "Z"
13
+ #define REAL_SCALAR_SUFFIX d
14
+ #define ISCOMPLEX 1
15
+
16
+ #include "cholesky.cpp"
17
+ #include "lu.cpp"
18
+ #include "svd.cpp"
include/eigen/lapack/dladiv.f ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b DLADIV
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download DLADIV + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dladiv.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dladiv.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dladiv.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE DLADIV( A, B, C, D, P, Q )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * DOUBLE PRECISION A, B, C, D, P, Q
25
+ * ..
26
+ *
27
+ *
28
+ *> \par Purpose:
29
+ * =============
30
+ *>
31
+ *> \verbatim
32
+ *>
33
+ *> DLADIV performs complex division in real arithmetic
34
+ *>
35
+ *> a + i*b
36
+ *> p + i*q = ---------
37
+ *> c + i*d
38
+ *>
39
+ *> The algorithm is due to Robert L. Smith and can be found
40
+ *> in D. Knuth, The art of Computer Programming, Vol.2, p.195
41
+ *> \endverbatim
42
+ *
43
+ * Arguments:
44
+ * ==========
45
+ *
46
+ *> \param[in] A
47
+ *> \verbatim
48
+ *> A is DOUBLE PRECISION
49
+ *> \endverbatim
50
+ *>
51
+ *> \param[in] B
52
+ *> \verbatim
53
+ *> B is DOUBLE PRECISION
54
+ *> \endverbatim
55
+ *>
56
+ *> \param[in] C
57
+ *> \verbatim
58
+ *> C is DOUBLE PRECISION
59
+ *> \endverbatim
60
+ *>
61
+ *> \param[in] D
62
+ *> \verbatim
63
+ *> D is DOUBLE PRECISION
64
+ *> The scalars a, b, c, and d in the above expression.
65
+ *> \endverbatim
66
+ *>
67
+ *> \param[out] P
68
+ *> \verbatim
69
+ *> P is DOUBLE PRECISION
70
+ *> \endverbatim
71
+ *>
72
+ *> \param[out] Q
73
+ *> \verbatim
74
+ *> Q is DOUBLE PRECISION
75
+ *> The scalars p and q in the above expression.
76
+ *> \endverbatim
77
+ *
78
+ * Authors:
79
+ * ========
80
+ *
81
+ *> \author Univ. of Tennessee
82
+ *> \author Univ. of California Berkeley
83
+ *> \author Univ. of Colorado Denver
84
+ *> \author NAG Ltd.
85
+ *
86
+ *> \date November 2011
87
+ *
88
+ *> \ingroup auxOTHERauxiliary
89
+ *
90
+ * =====================================================================
91
+ SUBROUTINE DLADIV( A, B, C, D, P, Q )
92
+ *
93
+ * -- LAPACK auxiliary routine (version 3.4.0) --
94
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
95
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
96
+ * November 2011
97
+ *
98
+ * .. Scalar Arguments ..
99
+ DOUBLE PRECISION A, B, C, D, P, Q
100
+ * ..
101
+ *
102
+ * =====================================================================
103
+ *
104
+ * .. Local Scalars ..
105
+ DOUBLE PRECISION E, F
106
+ * ..
107
+ * .. Intrinsic Functions ..
108
+ INTRINSIC ABS
109
+ * ..
110
+ * .. Executable Statements ..
111
+ *
112
+ IF( ABS( D ).LT.ABS( C ) ) THEN
113
+ E = D / C
114
+ F = C + D*E
115
+ P = ( A+B*E ) / F
116
+ Q = ( B-A*E ) / F
117
+ ELSE
118
+ E = C / D
119
+ F = D + C*E
120
+ P = ( B+A*E ) / F
121
+ Q = ( -A+B*E ) / F
122
+ END IF
123
+ *
124
+ RETURN
125
+ *
126
+ * End of DLADIV
127
+ *
128
+ END
include/eigen/lapack/dlamch.f ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b DLAMCH
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ * Definition:
9
+ * ===========
10
+ *
11
+ * DOUBLE PRECISION FUNCTION DLAMCH( CMACH )
12
+ *
13
+ *
14
+ *> \par Purpose:
15
+ * =============
16
+ *>
17
+ *> \verbatim
18
+ *>
19
+ *> DLAMCH determines double precision machine parameters.
20
+ *> \endverbatim
21
+ *
22
+ * Arguments:
23
+ * ==========
24
+ *
25
+ *> \param[in] CMACH
26
+ *> \verbatim
27
+ *> Specifies the value to be returned by DLAMCH:
28
+ *> = 'E' or 'e', DLAMCH := eps
29
+ *> = 'S' or 's , DLAMCH := sfmin
30
+ *> = 'B' or 'b', DLAMCH := base
31
+ *> = 'P' or 'p', DLAMCH := eps*base
32
+ *> = 'N' or 'n', DLAMCH := t
33
+ *> = 'R' or 'r', DLAMCH := rnd
34
+ *> = 'M' or 'm', DLAMCH := emin
35
+ *> = 'U' or 'u', DLAMCH := rmin
36
+ *> = 'L' or 'l', DLAMCH := emax
37
+ *> = 'O' or 'o', DLAMCH := rmax
38
+ *> where
39
+ *> eps = relative machine precision
40
+ *> sfmin = safe minimum, such that 1/sfmin does not overflow
41
+ *> base = base of the machine
42
+ *> prec = eps*base
43
+ *> t = number of (base) digits in the mantissa
44
+ *> rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
45
+ *> emin = minimum exponent before (gradual) underflow
46
+ *> rmin = underflow threshold - base**(emin-1)
47
+ *> emax = largest exponent before overflow
48
+ *> rmax = overflow threshold - (base**emax)*(1-eps)
49
+ *> \endverbatim
50
+ *
51
+ * Authors:
52
+ * ========
53
+ *
54
+ *> \author Univ. of Tennessee
55
+ *> \author Univ. of California Berkeley
56
+ *> \author Univ. of Colorado Denver
57
+ *> \author NAG Ltd.
58
+ *
59
+ *> \date November 2011
60
+ *
61
+ *> \ingroup auxOTHERauxiliary
62
+ *
63
+ * =====================================================================
64
+ DOUBLE PRECISION FUNCTION DLAMCH( CMACH )
65
+ *
66
+ * -- LAPACK auxiliary routine (version 3.4.0) --
67
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
68
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
69
+ * November 2011
70
+ *
71
+ * .. Scalar Arguments ..
72
+ CHARACTER CMACH
73
+ * ..
74
+ *
75
+ * =====================================================================
76
+ *
77
+ * .. Parameters ..
78
+ DOUBLE PRECISION ONE, ZERO
79
+ PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
80
+ * ..
81
+ * .. Local Scalars ..
82
+ DOUBLE PRECISION RND, EPS, SFMIN, SMALL, RMACH
83
+ * ..
84
+ * .. External Functions ..
85
+ LOGICAL LSAME
86
+ EXTERNAL LSAME
87
+ * ..
88
+ * .. Intrinsic Functions ..
89
+ INTRINSIC DIGITS, EPSILON, HUGE, MAXEXPONENT,
90
+ $ MINEXPONENT, RADIX, TINY
91
+ * ..
92
+ * .. Executable Statements ..
93
+ *
94
+ *
95
+ * Assume rounding, not chopping. Always.
96
+ *
97
+ RND = ONE
98
+ *
99
+ IF( ONE.EQ.RND ) THEN
100
+ EPS = EPSILON(ZERO) * 0.5
101
+ ELSE
102
+ EPS = EPSILON(ZERO)
103
+ END IF
104
+ *
105
+ IF( LSAME( CMACH, 'E' ) ) THEN
106
+ RMACH = EPS
107
+ ELSE IF( LSAME( CMACH, 'S' ) ) THEN
108
+ SFMIN = TINY(ZERO)
109
+ SMALL = ONE / HUGE(ZERO)
110
+ IF( SMALL.GE.SFMIN ) THEN
111
+ *
112
+ * Use SMALL plus a bit, to avoid the possibility of rounding
113
+ * causing overflow when computing 1/sfmin.
114
+ *
115
+ SFMIN = SMALL*( ONE+EPS )
116
+ END IF
117
+ RMACH = SFMIN
118
+ ELSE IF( LSAME( CMACH, 'B' ) ) THEN
119
+ RMACH = RADIX(ZERO)
120
+ ELSE IF( LSAME( CMACH, 'P' ) ) THEN
121
+ RMACH = EPS * RADIX(ZERO)
122
+ ELSE IF( LSAME( CMACH, 'N' ) ) THEN
123
+ RMACH = DIGITS(ZERO)
124
+ ELSE IF( LSAME( CMACH, 'R' ) ) THEN
125
+ RMACH = RND
126
+ ELSE IF( LSAME( CMACH, 'M' ) ) THEN
127
+ RMACH = MINEXPONENT(ZERO)
128
+ ELSE IF( LSAME( CMACH, 'U' ) ) THEN
129
+ RMACH = tiny(zero)
130
+ ELSE IF( LSAME( CMACH, 'L' ) ) THEN
131
+ RMACH = MAXEXPONENT(ZERO)
132
+ ELSE IF( LSAME( CMACH, 'O' ) ) THEN
133
+ RMACH = HUGE(ZERO)
134
+ ELSE
135
+ RMACH = ZERO
136
+ END IF
137
+ *
138
+ DLAMCH = RMACH
139
+ RETURN
140
+ *
141
+ * End of DLAMCH
142
+ *
143
+ END
144
+ ************************************************************************
145
+ *> \brief \b DLAMC3
146
+ *> \details
147
+ *> \b Purpose:
148
+ *> \verbatim
149
+ *> DLAMC3 is intended to force A and B to be stored prior to doing
150
+ *> the addition of A and B , for use in situations where optimizers
151
+ *> might hold one of these in a register.
152
+ *> \endverbatim
153
+ *> \author LAPACK is a software package provided by Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..
154
+ *> \date November 2011
155
+ *> \ingroup auxOTHERauxiliary
156
+ *>
157
+ *> \param[in] A
158
+ *> \verbatim
159
+ *> A is a DOUBLE PRECISION
160
+ *> \endverbatim
161
+ *>
162
+ *> \param[in] B
163
+ *> \verbatim
164
+ *> B is a DOUBLE PRECISION
165
+ *> The values A and B.
166
+ *> \endverbatim
167
+ *>
168
+ DOUBLE PRECISION FUNCTION DLAMC3( A, B )
169
+ *
170
+ * -- LAPACK auxiliary routine (version 3.4.0) --
171
+ * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
172
+ * November 2010
173
+ *
174
+ * .. Scalar Arguments ..
175
+ DOUBLE PRECISION A, B
176
+ * ..
177
+ * =====================================================================
178
+ *
179
+ * .. Executable Statements ..
180
+ *
181
+ DLAMC3 = A + B
182
+ *
183
+ RETURN
184
+ *
185
+ * End of DLAMC3
186
+ *
187
+ END
188
+ *
189
+ ************************************************************************
include/eigen/lapack/dlapy2.f ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b DLAPY2
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download DLAPY2 + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlapy2.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlapy2.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlapy2.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * DOUBLE PRECISION FUNCTION DLAPY2( X, Y )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * DOUBLE PRECISION X, Y
25
+ * ..
26
+ *
27
+ *
28
+ *> \par Purpose:
29
+ * =============
30
+ *>
31
+ *> \verbatim
32
+ *>
33
+ *> DLAPY2 returns sqrt(x**2+y**2), taking care not to cause unnecessary
34
+ *> overflow.
35
+ *> \endverbatim
36
+ *
37
+ * Arguments:
38
+ * ==========
39
+ *
40
+ *> \param[in] X
41
+ *> \verbatim
42
+ *> X is DOUBLE PRECISION
43
+ *> \endverbatim
44
+ *>
45
+ *> \param[in] Y
46
+ *> \verbatim
47
+ *> Y is DOUBLE PRECISION
48
+ *> X and Y specify the values x and y.
49
+ *> \endverbatim
50
+ *
51
+ * Authors:
52
+ * ========
53
+ *
54
+ *> \author Univ. of Tennessee
55
+ *> \author Univ. of California Berkeley
56
+ *> \author Univ. of Colorado Denver
57
+ *> \author NAG Ltd.
58
+ *
59
+ *> \date November 2011
60
+ *
61
+ *> \ingroup auxOTHERauxiliary
62
+ *
63
+ * =====================================================================
64
+ DOUBLE PRECISION FUNCTION DLAPY2( X, Y )
65
+ *
66
+ * -- LAPACK auxiliary routine (version 3.4.0) --
67
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
68
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
69
+ * November 2011
70
+ *
71
+ * .. Scalar Arguments ..
72
+ DOUBLE PRECISION X, Y
73
+ * ..
74
+ *
75
+ * =====================================================================
76
+ *
77
+ * .. Parameters ..
78
+ DOUBLE PRECISION ZERO
79
+ PARAMETER ( ZERO = 0.0D0 )
80
+ DOUBLE PRECISION ONE
81
+ PARAMETER ( ONE = 1.0D0 )
82
+ * ..
83
+ * .. Local Scalars ..
84
+ DOUBLE PRECISION W, XABS, YABS, Z
85
+ * ..
86
+ * .. Intrinsic Functions ..
87
+ INTRINSIC ABS, MAX, MIN, SQRT
88
+ * ..
89
+ * .. Executable Statements ..
90
+ *
91
+ XABS = ABS( X )
92
+ YABS = ABS( Y )
93
+ W = MAX( XABS, YABS )
94
+ Z = MIN( XABS, YABS )
95
+ IF( Z.EQ.ZERO ) THEN
96
+ DLAPY2 = W
97
+ ELSE
98
+ DLAPY2 = W*SQRT( ONE+( Z / W )**2 )
99
+ END IF
100
+ RETURN
101
+ *
102
+ * End of DLAPY2
103
+ *
104
+ END
include/eigen/lapack/dlarf.f ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b DLARF
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download DLARF + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlarf.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlarf.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarf.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * CHARACTER SIDE
25
+ * INTEGER INCV, LDC, M, N
26
+ * DOUBLE PRECISION TAU
27
+ * ..
28
+ * .. Array Arguments ..
29
+ * DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * )
30
+ * ..
31
+ *
32
+ *
33
+ *> \par Purpose:
34
+ * =============
35
+ *>
36
+ *> \verbatim
37
+ *>
38
+ *> DLARF applies a real elementary reflector H to a real m by n matrix
39
+ *> C, from either the left or the right. H is represented in the form
40
+ *>
41
+ *> H = I - tau * v * v**T
42
+ *>
43
+ *> where tau is a real scalar and v is a real vector.
44
+ *>
45
+ *> If tau = 0, then H is taken to be the unit matrix.
46
+ *> \endverbatim
47
+ *
48
+ * Arguments:
49
+ * ==========
50
+ *
51
+ *> \param[in] SIDE
52
+ *> \verbatim
53
+ *> SIDE is CHARACTER*1
54
+ *> = 'L': form H * C
55
+ *> = 'R': form C * H
56
+ *> \endverbatim
57
+ *>
58
+ *> \param[in] M
59
+ *> \verbatim
60
+ *> M is INTEGER
61
+ *> The number of rows of the matrix C.
62
+ *> \endverbatim
63
+ *>
64
+ *> \param[in] N
65
+ *> \verbatim
66
+ *> N is INTEGER
67
+ *> The number of columns of the matrix C.
68
+ *> \endverbatim
69
+ *>
70
+ *> \param[in] V
71
+ *> \verbatim
72
+ *> V is DOUBLE PRECISION array, dimension
73
+ *> (1 + (M-1)*abs(INCV)) if SIDE = 'L'
74
+ *> or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
75
+ *> The vector v in the representation of H. V is not used if
76
+ *> TAU = 0.
77
+ *> \endverbatim
78
+ *>
79
+ *> \param[in] INCV
80
+ *> \verbatim
81
+ *> INCV is INTEGER
82
+ *> The increment between elements of v. INCV <> 0.
83
+ *> \endverbatim
84
+ *>
85
+ *> \param[in] TAU
86
+ *> \verbatim
87
+ *> TAU is DOUBLE PRECISION
88
+ *> The value tau in the representation of H.
89
+ *> \endverbatim
90
+ *>
91
+ *> \param[in,out] C
92
+ *> \verbatim
93
+ *> C is DOUBLE PRECISION array, dimension (LDC,N)
94
+ *> On entry, the m by n matrix C.
95
+ *> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
96
+ *> or C * H if SIDE = 'R'.
97
+ *> \endverbatim
98
+ *>
99
+ *> \param[in] LDC
100
+ *> \verbatim
101
+ *> LDC is INTEGER
102
+ *> The leading dimension of the array C. LDC >= max(1,M).
103
+ *> \endverbatim
104
+ *>
105
+ *> \param[out] WORK
106
+ *> \verbatim
107
+ *> WORK is DOUBLE PRECISION array, dimension
108
+ *> (N) if SIDE = 'L'
109
+ *> or (M) if SIDE = 'R'
110
+ *> \endverbatim
111
+ *
112
+ * Authors:
113
+ * ========
114
+ *
115
+ *> \author Univ. of Tennessee
116
+ *> \author Univ. of California Berkeley
117
+ *> \author Univ. of Colorado Denver
118
+ *> \author NAG Ltd.
119
+ *
120
+ *> \date November 2011
121
+ *
122
+ *> \ingroup doubleOTHERauxiliary
123
+ *
124
+ * =====================================================================
125
+ SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
126
+ *
127
+ * -- LAPACK auxiliary routine (version 3.4.0) --
128
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
129
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130
+ * November 2011
131
+ *
132
+ * .. Scalar Arguments ..
133
+ CHARACTER SIDE
134
+ INTEGER INCV, LDC, M, N
135
+ DOUBLE PRECISION TAU
136
+ * ..
137
+ * .. Array Arguments ..
138
+ DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * )
139
+ * ..
140
+ *
141
+ * =====================================================================
142
+ *
143
+ * .. Parameters ..
144
+ DOUBLE PRECISION ONE, ZERO
145
+ PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
146
+ * ..
147
+ * .. Local Scalars ..
148
+ LOGICAL APPLYLEFT
149
+ INTEGER I, LASTV, LASTC
150
+ * ..
151
+ * .. External Subroutines ..
152
+ EXTERNAL DGEMV, DGER
153
+ * ..
154
+ * .. External Functions ..
155
+ LOGICAL LSAME
156
+ INTEGER ILADLR, ILADLC
157
+ EXTERNAL LSAME, ILADLR, ILADLC
158
+ * ..
159
+ * .. Executable Statements ..
160
+ *
161
+ APPLYLEFT = LSAME( SIDE, 'L' )
162
+ LASTV = 0
163
+ LASTC = 0
164
+ IF( TAU.NE.ZERO ) THEN
165
+ ! Set up variables for scanning V. LASTV begins pointing to the end
166
+ ! of V.
167
+ IF( APPLYLEFT ) THEN
168
+ LASTV = M
169
+ ELSE
170
+ LASTV = N
171
+ END IF
172
+ IF( INCV.GT.0 ) THEN
173
+ I = 1 + (LASTV-1) * INCV
174
+ ELSE
175
+ I = 1
176
+ END IF
177
+ ! Look for the last non-zero row in V.
178
+ DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
179
+ LASTV = LASTV - 1
180
+ I = I - INCV
181
+ END DO
182
+ IF( APPLYLEFT ) THEN
183
+ ! Scan for the last non-zero column in C(1:lastv,:).
184
+ LASTC = ILADLC(LASTV, N, C, LDC)
185
+ ELSE
186
+ ! Scan for the last non-zero row in C(:,1:lastv).
187
+ LASTC = ILADLR(M, LASTV, C, LDC)
188
+ END IF
189
+ END IF
190
+ ! Note that lastc.eq.0 renders the BLAS operations null; no special
191
+ ! case is needed at this level.
192
+ IF( APPLYLEFT ) THEN
193
+ *
194
+ * Form H * C
195
+ *
196
+ IF( LASTV.GT.0 ) THEN
197
+ *
198
+ * w(1:lastc,1) := C(1:lastv,1:lastc)**T * v(1:lastv,1)
199
+ *
200
+ CALL DGEMV( 'Transpose', LASTV, LASTC, ONE, C, LDC, V, INCV,
201
+ $ ZERO, WORK, 1 )
202
+ *
203
+ * C(1:lastv,1:lastc) := C(...) - v(1:lastv,1) * w(1:lastc,1)**T
204
+ *
205
+ CALL DGER( LASTV, LASTC, -TAU, V, INCV, WORK, 1, C, LDC )
206
+ END IF
207
+ ELSE
208
+ *
209
+ * Form C * H
210
+ *
211
+ IF( LASTV.GT.0 ) THEN
212
+ *
213
+ * w(1:lastc,1) := C(1:lastc,1:lastv) * v(1:lastv,1)
214
+ *
215
+ CALL DGEMV( 'No transpose', LASTC, LASTV, ONE, C, LDC,
216
+ $ V, INCV, ZERO, WORK, 1 )
217
+ *
218
+ * C(1:lastc,1:lastv) := C(...) - w(1:lastc,1) * v(1:lastv,1)**T
219
+ *
220
+ CALL DGER( LASTC, LASTV, -TAU, WORK, 1, V, INCV, C, LDC )
221
+ END IF
222
+ END IF
223
+ RETURN
224
+ *
225
+ * End of DLARF
226
+ *
227
+ END
include/eigen/lapack/double.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009-2014 Gael Guennebaud <[email protected]>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #define SCALAR double
11
+ #define SCALAR_SUFFIX d
12
+ #define SCALAR_SUFFIX_UP "D"
13
+ #define ISCOMPLEX 0
14
+
15
+ #include "cholesky.cpp"
16
+ #include "lu.cpp"
17
+ #include "eigenvalues.cpp"
18
+ #include "svd.cpp"
include/eigen/lapack/dsecnd_NONE.f ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b DSECND returns nothing
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ * Definition:
9
+ * ===========
10
+ *
11
+ * DOUBLE PRECISION FUNCTION DSECND( )
12
+ *
13
+ *
14
+ *> \par Purpose:
15
+ * =============
16
+ *>
17
+ *> \verbatim
18
+ *>
19
+ *> DSECND returns nothing instead of returning the user time for a process in seconds.
20
+ *> If you are using that routine, it means that neither EXTERNAL ETIME,
21
+ *> EXTERNAL ETIME_, INTERNAL ETIME, INTERNAL CPU_TIME is available on
22
+ *> your machine.
23
+ *> \endverbatim
24
+ *
25
+ * Authors:
26
+ * ========
27
+ *
28
+ *> \author Univ. of Tennessee
29
+ *> \author Univ. of California Berkeley
30
+ *> \author Univ. of Colorado Denver
31
+ *> \author NAG Ltd.
32
+ *
33
+ *> \date November 2011
34
+ *
35
+ *> \ingroup auxOTHERauxiliary
36
+ *
37
+ * =====================================================================
38
+ DOUBLE PRECISION FUNCTION DSECND( )
39
+ *
40
+ * -- LAPACK auxiliary routine (version 3.4.0) --
41
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
42
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
43
+ * November 2011
44
+ *
45
+ * =====================================================================
46
+ *
47
+ DSECND = 0.0D+0
48
+ RETURN
49
+ *
50
+ * End of DSECND
51
+ *
52
+ END
include/eigen/lapack/iladlc.f ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ILADLC
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ILADLC + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/iladlc.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/iladlc.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/iladlc.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * INTEGER FUNCTION ILADLC( M, N, A, LDA )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * INTEGER M, N, LDA
25
+ * ..
26
+ * .. Array Arguments ..
27
+ * DOUBLE PRECISION A( LDA, * )
28
+ * ..
29
+ *
30
+ *
31
+ *> \par Purpose:
32
+ * =============
33
+ *>
34
+ *> \verbatim
35
+ *>
36
+ *> ILADLC scans A for its last non-zero column.
37
+ *> \endverbatim
38
+ *
39
+ * Arguments:
40
+ * ==========
41
+ *
42
+ *> \param[in] M
43
+ *> \verbatim
44
+ *> M is INTEGER
45
+ *> The number of rows of the matrix A.
46
+ *> \endverbatim
47
+ *>
48
+ *> \param[in] N
49
+ *> \verbatim
50
+ *> N is INTEGER
51
+ *> The number of columns of the matrix A.
52
+ *> \endverbatim
53
+ *>
54
+ *> \param[in] A
55
+ *> \verbatim
56
+ *> A is DOUBLE PRECISION array, dimension (LDA,N)
57
+ *> The m by n matrix A.
58
+ *> \endverbatim
59
+ *>
60
+ *> \param[in] LDA
61
+ *> \verbatim
62
+ *> LDA is INTEGER
63
+ *> The leading dimension of the array A. LDA >= max(1,M).
64
+ *> \endverbatim
65
+ *
66
+ * Authors:
67
+ * ========
68
+ *
69
+ *> \author Univ. of Tennessee
70
+ *> \author Univ. of California Berkeley
71
+ *> \author Univ. of Colorado Denver
72
+ *> \author NAG Ltd.
73
+ *
74
+ *> \date November 2011
75
+ *
76
+ *> \ingroup auxOTHERauxiliary
77
+ *
78
+ * =====================================================================
79
+ INTEGER FUNCTION ILADLC( M, N, A, LDA )
80
+ *
81
+ * -- LAPACK auxiliary routine (version 3.4.0) --
82
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
83
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
84
+ * November 2011
85
+ *
86
+ * .. Scalar Arguments ..
87
+ INTEGER M, N, LDA
88
+ * ..
89
+ * .. Array Arguments ..
90
+ DOUBLE PRECISION A( LDA, * )
91
+ * ..
92
+ *
93
+ * =====================================================================
94
+ *
95
+ * .. Parameters ..
96
+ DOUBLE PRECISION ZERO
97
+ PARAMETER ( ZERO = 0.0D+0 )
98
+ * ..
99
+ * .. Local Scalars ..
100
+ INTEGER I
101
+ * ..
102
+ * .. Executable Statements ..
103
+ *
104
+ * Quick test for the common case where one corner is non-zero.
105
+ IF( N.EQ.0 ) THEN
106
+ ILADLC = N
107
+ ELSE IF( A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
108
+ ILADLC = N
109
+ ELSE
110
+ * Now scan each column from the end, returning with the first non-zero.
111
+ DO ILADLC = N, 1, -1
112
+ DO I = 1, M
113
+ IF( A(I, ILADLC).NE.ZERO ) RETURN
114
+ END DO
115
+ END DO
116
+ END IF
117
+ RETURN
118
+ END
include/eigen/lapack/ilaslr.f ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ILASLR
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ILASLR + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaslr.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaslr.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaslr.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * INTEGER FUNCTION ILASLR( M, N, A, LDA )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * INTEGER M, N, LDA
25
+ * ..
26
+ * .. Array Arguments ..
27
+ * REAL A( LDA, * )
28
+ * ..
29
+ *
30
+ *
31
+ *> \par Purpose:
32
+ * =============
33
+ *>
34
+ *> \verbatim
35
+ *>
36
+ *> ILASLR scans A for its last non-zero row.
37
+ *> \endverbatim
38
+ *
39
+ * Arguments:
40
+ * ==========
41
+ *
42
+ *> \param[in] M
43
+ *> \verbatim
44
+ *> M is INTEGER
45
+ *> The number of rows of the matrix A.
46
+ *> \endverbatim
47
+ *>
48
+ *> \param[in] N
49
+ *> \verbatim
50
+ *> N is INTEGER
51
+ *> The number of columns of the matrix A.
52
+ *> \endverbatim
53
+ *>
54
+ *> \param[in] A
55
+ *> \verbatim
56
+ *> A is REAL array, dimension (LDA,N)
57
+ *> The m by n matrix A.
58
+ *> \endverbatim
59
+ *>
60
+ *> \param[in] LDA
61
+ *> \verbatim
62
+ *> LDA is INTEGER
63
+ *> The leading dimension of the array A. LDA >= max(1,M).
64
+ *> \endverbatim
65
+ *
66
+ * Authors:
67
+ * ========
68
+ *
69
+ *> \author Univ. of Tennessee
70
+ *> \author Univ. of California Berkeley
71
+ *> \author Univ. of Colorado Denver
72
+ *> \author NAG Ltd.
73
+ *
74
+ *> \date April 2012
75
+ *
76
+ *> \ingroup realOTHERauxiliary
77
+ *
78
+ * =====================================================================
79
+ INTEGER FUNCTION ILASLR( M, N, A, LDA )
80
+ *
81
+ * -- LAPACK auxiliary routine (version 3.4.1) --
82
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
83
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
84
+ * April 2012
85
+ *
86
+ * .. Scalar Arguments ..
87
+ INTEGER M, N, LDA
88
+ * ..
89
+ * .. Array Arguments ..
90
+ REAL A( LDA, * )
91
+ * ..
92
+ *
93
+ * =====================================================================
94
+ *
95
+ * .. Parameters ..
96
+ REAL ZERO
97
+ PARAMETER ( ZERO = 0.0E+0 )
98
+ * ..
99
+ * .. Local Scalars ..
100
+ INTEGER I, J
101
+ * ..
102
+ * .. Executable Statements ..
103
+ *
104
+ * Quick test for the common case where one corner is non-zero.
105
+ IF( M.EQ.0 ) THEN
106
+ ILASLR = M
107
+ ELSEIF( A(M, 1).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
108
+ ILASLR = M
109
+ ELSE
110
+ * Scan up each column tracking the last zero row seen.
111
+ ILASLR = 0
112
+ DO J = 1, N
113
+ I=M
114
+ DO WHILE((A(MAX(I,1),J).EQ.ZERO).AND.(I.GE.1))
115
+ I=I-1
116
+ ENDDO
117
+ ILASLR = MAX( ILASLR, I )
118
+ END DO
119
+ END IF
120
+ RETURN
121
+ END
include/eigen/lapack/ilazlc.f ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ILAZLC
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ILAZLC + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilazlc.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilazlc.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilazlc.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * INTEGER FUNCTION ILAZLC( M, N, A, LDA )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * INTEGER M, N, LDA
25
+ * ..
26
+ * .. Array Arguments ..
27
+ * COMPLEX*16 A( LDA, * )
28
+ * ..
29
+ *
30
+ *
31
+ *> \par Purpose:
32
+ * =============
33
+ *>
34
+ *> \verbatim
35
+ *>
36
+ *> ILAZLC scans A for its last non-zero column.
37
+ *> \endverbatim
38
+ *
39
+ * Arguments:
40
+ * ==========
41
+ *
42
+ *> \param[in] M
43
+ *> \verbatim
44
+ *> M is INTEGER
45
+ *> The number of rows of the matrix A.
46
+ *> \endverbatim
47
+ *>
48
+ *> \param[in] N
49
+ *> \verbatim
50
+ *> N is INTEGER
51
+ *> The number of columns of the matrix A.
52
+ *> \endverbatim
53
+ *>
54
+ *> \param[in] A
55
+ *> \verbatim
56
+ *> A is COMPLEX*16 array, dimension (LDA,N)
57
+ *> The m by n matrix A.
58
+ *> \endverbatim
59
+ *>
60
+ *> \param[in] LDA
61
+ *> \verbatim
62
+ *> LDA is INTEGER
63
+ *> The leading dimension of the array A. LDA >= max(1,M).
64
+ *> \endverbatim
65
+ *
66
+ * Authors:
67
+ * ========
68
+ *
69
+ *> \author Univ. of Tennessee
70
+ *> \author Univ. of California Berkeley
71
+ *> \author Univ. of Colorado Denver
72
+ *> \author NAG Ltd.
73
+ *
74
+ *> \date November 2011
75
+ *
76
+ *> \ingroup complex16OTHERauxiliary
77
+ *
78
+ * =====================================================================
79
+ INTEGER FUNCTION ILAZLC( M, N, A, LDA )
80
+ *
81
+ * -- LAPACK auxiliary routine (version 3.4.0) --
82
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
83
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
84
+ * November 2011
85
+ *
86
+ * .. Scalar Arguments ..
87
+ INTEGER M, N, LDA
88
+ * ..
89
+ * .. Array Arguments ..
90
+ COMPLEX*16 A( LDA, * )
91
+ * ..
92
+ *
93
+ * =====================================================================
94
+ *
95
+ * .. Parameters ..
96
+ COMPLEX*16 ZERO
97
+ PARAMETER ( ZERO = (0.0D+0, 0.0D+0) )
98
+ * ..
99
+ * .. Local Scalars ..
100
+ INTEGER I
101
+ * ..
102
+ * .. Executable Statements ..
103
+ *
104
+ * Quick test for the common case where one corner is non-zero.
105
+ IF( N.EQ.0 ) THEN
106
+ ILAZLC = N
107
+ ELSE IF( A(1, N).NE.ZERO .OR. A(M, N).NE.ZERO ) THEN
108
+ ILAZLC = N
109
+ ELSE
110
+ * Now scan each column from the end, returning with the first non-zero.
111
+ DO ILAZLC = N, 1, -1
112
+ DO I = 1, M
113
+ IF( A(I, ILAZLC).NE.ZERO ) RETURN
114
+ END DO
115
+ END DO
116
+ END IF
117
+ RETURN
118
+ END
include/eigen/lapack/lapack_common.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2010-2014 Gael Guennebaud <[email protected]>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #ifndef EIGEN_LAPACK_COMMON_H
11
+ #define EIGEN_LAPACK_COMMON_H
12
+
13
+ #include "../blas/common.h"
14
+ #include "../Eigen/src/misc/lapack.h"
15
+
16
+ #define EIGEN_LAPACK_FUNC(FUNC,ARGLIST) \
17
+ extern "C" { int EIGEN_BLAS_FUNC(FUNC) ARGLIST; } \
18
+ int EIGEN_BLAS_FUNC(FUNC) ARGLIST
19
+
20
+ typedef Eigen::Map<Eigen::Transpositions<Eigen::Dynamic,Eigen::Dynamic,int> > PivotsType;
21
+
22
+ #if ISCOMPLEX
23
+ #define EIGEN_LAPACK_ARG_IF_COMPLEX(X) X,
24
+ #else
25
+ #define EIGEN_LAPACK_ARG_IF_COMPLEX(X)
26
+ #endif
27
+
28
+
29
+ #endif // EIGEN_LAPACK_COMMON_H
include/eigen/lapack/single.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is part of Eigen, a lightweight C++ template library
2
+ // for linear algebra.
3
+ //
4
+ // Copyright (C) 2009-2014 Gael Guennebaud <[email protected]>
5
+ //
6
+ // This Source Code Form is subject to the terms of the Mozilla
7
+ // Public License v. 2.0. If a copy of the MPL was not distributed
8
+ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+
10
+ #define SCALAR float
11
+ #define SCALAR_SUFFIX s
12
+ #define SCALAR_SUFFIX_UP "S"
13
+ #define ISCOMPLEX 0
14
+
15
+ #include "cholesky.cpp"
16
+ #include "lu.cpp"
17
+ #include "eigenvalues.cpp"
18
+ #include "svd.cpp"
include/eigen/lapack/slarfg.f ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b SLARFG
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download SLARFG + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slarfg.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slarfg.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarfg.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE SLARFG( N, ALPHA, X, INCX, TAU )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * INTEGER INCX, N
25
+ * REAL ALPHA, TAU
26
+ * ..
27
+ * .. Array Arguments ..
28
+ * REAL X( * )
29
+ * ..
30
+ *
31
+ *
32
+ *> \par Purpose:
33
+ * =============
34
+ *>
35
+ *> \verbatim
36
+ *>
37
+ *> SLARFG generates a real elementary reflector H of order n, such
38
+ *> that
39
+ *>
40
+ *> H * ( alpha ) = ( beta ), H**T * H = I.
41
+ *> ( x ) ( 0 )
42
+ *>
43
+ *> where alpha and beta are scalars, and x is an (n-1)-element real
44
+ *> vector. H is represented in the form
45
+ *>
46
+ *> H = I - tau * ( 1 ) * ( 1 v**T ) ,
47
+ *> ( v )
48
+ *>
49
+ *> where tau is a real scalar and v is a real (n-1)-element
50
+ *> vector.
51
+ *>
52
+ *> If the elements of x are all zero, then tau = 0 and H is taken to be
53
+ *> the unit matrix.
54
+ *>
55
+ *> Otherwise 1 <= tau <= 2.
56
+ *> \endverbatim
57
+ *
58
+ * Arguments:
59
+ * ==========
60
+ *
61
+ *> \param[in] N
62
+ *> \verbatim
63
+ *> N is INTEGER
64
+ *> The order of the elementary reflector.
65
+ *> \endverbatim
66
+ *>
67
+ *> \param[in,out] ALPHA
68
+ *> \verbatim
69
+ *> ALPHA is REAL
70
+ *> On entry, the value alpha.
71
+ *> On exit, it is overwritten with the value beta.
72
+ *> \endverbatim
73
+ *>
74
+ *> \param[in,out] X
75
+ *> \verbatim
76
+ *> X is REAL array, dimension
77
+ *> (1+(N-2)*abs(INCX))
78
+ *> On entry, the vector x.
79
+ *> On exit, it is overwritten with the vector v.
80
+ *> \endverbatim
81
+ *>
82
+ *> \param[in] INCX
83
+ *> \verbatim
84
+ *> INCX is INTEGER
85
+ *> The increment between elements of X. INCX > 0.
86
+ *> \endverbatim
87
+ *>
88
+ *> \param[out] TAU
89
+ *> \verbatim
90
+ *> TAU is REAL
91
+ *> The value tau.
92
+ *> \endverbatim
93
+ *
94
+ * Authors:
95
+ * ========
96
+ *
97
+ *> \author Univ. of Tennessee
98
+ *> \author Univ. of California Berkeley
99
+ *> \author Univ. of Colorado Denver
100
+ *> \author NAG Ltd.
101
+ *
102
+ *> \date November 2011
103
+ *
104
+ *> \ingroup realOTHERauxiliary
105
+ *
106
+ * =====================================================================
107
+ SUBROUTINE SLARFG( N, ALPHA, X, INCX, TAU )
108
+ *
109
+ * -- LAPACK auxiliary routine (version 3.4.0) --
110
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
111
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
112
+ * November 2011
113
+ *
114
+ * .. Scalar Arguments ..
115
+ INTEGER INCX, N
116
+ REAL ALPHA, TAU
117
+ * ..
118
+ * .. Array Arguments ..
119
+ REAL X( * )
120
+ * ..
121
+ *
122
+ * =====================================================================
123
+ *
124
+ * .. Parameters ..
125
+ REAL ONE, ZERO
126
+ PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
127
+ * ..
128
+ * .. Local Scalars ..
129
+ INTEGER J, KNT
130
+ REAL BETA, RSAFMN, SAFMIN, XNORM
131
+ * ..
132
+ * .. External Functions ..
133
+ REAL SLAMCH, SLAPY2, SNRM2
134
+ EXTERNAL SLAMCH, SLAPY2, SNRM2
135
+ * ..
136
+ * .. Intrinsic Functions ..
137
+ INTRINSIC ABS, SIGN
138
+ * ..
139
+ * .. External Subroutines ..
140
+ EXTERNAL SSCAL
141
+ * ..
142
+ * .. Executable Statements ..
143
+ *
144
+ IF( N.LE.1 ) THEN
145
+ TAU = ZERO
146
+ RETURN
147
+ END IF
148
+ *
149
+ XNORM = SNRM2( N-1, X, INCX )
150
+ *
151
+ IF( XNORM.EQ.ZERO ) THEN
152
+ *
153
+ * H = I
154
+ *
155
+ TAU = ZERO
156
+ ELSE
157
+ *
158
+ * general case
159
+ *
160
+ BETA = -SIGN( SLAPY2( ALPHA, XNORM ), ALPHA )
161
+ SAFMIN = SLAMCH( 'S' ) / SLAMCH( 'E' )
162
+ KNT = 0
163
+ IF( ABS( BETA ).LT.SAFMIN ) THEN
164
+ *
165
+ * XNORM, BETA may be inaccurate; scale X and recompute them
166
+ *
167
+ RSAFMN = ONE / SAFMIN
168
+ 10 CONTINUE
169
+ KNT = KNT + 1
170
+ CALL SSCAL( N-1, RSAFMN, X, INCX )
171
+ BETA = BETA*RSAFMN
172
+ ALPHA = ALPHA*RSAFMN
173
+ IF( ABS( BETA ).LT.SAFMIN )
174
+ $ GO TO 10
175
+ *
176
+ * New BETA is at most 1, at least SAFMIN
177
+ *
178
+ XNORM = SNRM2( N-1, X, INCX )
179
+ BETA = -SIGN( SLAPY2( ALPHA, XNORM ), ALPHA )
180
+ END IF
181
+ TAU = ( BETA-ALPHA ) / BETA
182
+ CALL SSCAL( N-1, ONE / ( ALPHA-BETA ), X, INCX )
183
+ *
184
+ * If ALPHA is subnormal, it may lose relative accuracy
185
+ *
186
+ DO 20 J = 1, KNT
187
+ BETA = BETA*SAFMIN
188
+ 20 CONTINUE
189
+ ALPHA = BETA
190
+ END IF
191
+ *
192
+ RETURN
193
+ *
194
+ * End of SLARFG
195
+ *
196
+ END
include/eigen/lapack/zladiv.f ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ZLADIV
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ZLADIV + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zladiv.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zladiv.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zladiv.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * COMPLEX*16 FUNCTION ZLADIV( X, Y )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * COMPLEX*16 X, Y
25
+ * ..
26
+ *
27
+ *
28
+ *> \par Purpose:
29
+ * =============
30
+ *>
31
+ *> \verbatim
32
+ *>
33
+ *> ZLADIV := X / Y, where X and Y are complex. The computation of X / Y
34
+ *> will not overflow on an intermediary step unless the results
35
+ *> overflows.
36
+ *> \endverbatim
37
+ *
38
+ * Arguments:
39
+ * ==========
40
+ *
41
+ *> \param[in] X
42
+ *> \verbatim
43
+ *> X is COMPLEX*16
44
+ *> \endverbatim
45
+ *>
46
+ *> \param[in] Y
47
+ *> \verbatim
48
+ *> Y is COMPLEX*16
49
+ *> The complex scalars X and Y.
50
+ *> \endverbatim
51
+ *
52
+ * Authors:
53
+ * ========
54
+ *
55
+ *> \author Univ. of Tennessee
56
+ *> \author Univ. of California Berkeley
57
+ *> \author Univ. of Colorado Denver
58
+ *> \author NAG Ltd.
59
+ *
60
+ *> \date November 2011
61
+ *
62
+ *> \ingroup complex16OTHERauxiliary
63
+ *
64
+ * =====================================================================
65
+ COMPLEX*16 FUNCTION ZLADIV( X, Y )
66
+ *
67
+ * -- LAPACK auxiliary routine (version 3.4.0) --
68
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
69
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
70
+ * November 2011
71
+ *
72
+ * .. Scalar Arguments ..
73
+ COMPLEX*16 X, Y
74
+ * ..
75
+ *
76
+ * =====================================================================
77
+ *
78
+ * .. Local Scalars ..
79
+ DOUBLE PRECISION ZI, ZR
80
+ * ..
81
+ * .. External Subroutines ..
82
+ EXTERNAL DLADIV
83
+ * ..
84
+ * .. Intrinsic Functions ..
85
+ INTRINSIC DBLE, DCMPLX, DIMAG
86
+ * ..
87
+ * .. Executable Statements ..
88
+ *
89
+ CALL DLADIV( DBLE( X ), DIMAG( X ), DBLE( Y ), DIMAG( Y ), ZR,
90
+ $ ZI )
91
+ ZLADIV = DCMPLX( ZR, ZI )
92
+ *
93
+ RETURN
94
+ *
95
+ * End of ZLADIV
96
+ *
97
+ END
include/eigen/lapack/zlarf.f ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ZLARF
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ZLARF + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlarf.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlarf.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarf.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE ZLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * CHARACTER SIDE
25
+ * INTEGER INCV, LDC, M, N
26
+ * COMPLEX*16 TAU
27
+ * ..
28
+ * .. Array Arguments ..
29
+ * COMPLEX*16 C( LDC, * ), V( * ), WORK( * )
30
+ * ..
31
+ *
32
+ *
33
+ *> \par Purpose:
34
+ * =============
35
+ *>
36
+ *> \verbatim
37
+ *>
38
+ *> ZLARF applies a complex elementary reflector H to a complex M-by-N
39
+ *> matrix C, from either the left or the right. H is represented in the
40
+ *> form
41
+ *>
42
+ *> H = I - tau * v * v**H
43
+ *>
44
+ *> where tau is a complex scalar and v is a complex vector.
45
+ *>
46
+ *> If tau = 0, then H is taken to be the unit matrix.
47
+ *>
48
+ *> To apply H**H, supply conjg(tau) instead
49
+ *> tau.
50
+ *> \endverbatim
51
+ *
52
+ * Arguments:
53
+ * ==========
54
+ *
55
+ *> \param[in] SIDE
56
+ *> \verbatim
57
+ *> SIDE is CHARACTER*1
58
+ *> = 'L': form H * C
59
+ *> = 'R': form C * H
60
+ *> \endverbatim
61
+ *>
62
+ *> \param[in] M
63
+ *> \verbatim
64
+ *> M is INTEGER
65
+ *> The number of rows of the matrix C.
66
+ *> \endverbatim
67
+ *>
68
+ *> \param[in] N
69
+ *> \verbatim
70
+ *> N is INTEGER
71
+ *> The number of columns of the matrix C.
72
+ *> \endverbatim
73
+ *>
74
+ *> \param[in] V
75
+ *> \verbatim
76
+ *> V is COMPLEX*16 array, dimension
77
+ *> (1 + (M-1)*abs(INCV)) if SIDE = 'L'
78
+ *> or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
79
+ *> The vector v in the representation of H. V is not used if
80
+ *> TAU = 0.
81
+ *> \endverbatim
82
+ *>
83
+ *> \param[in] INCV
84
+ *> \verbatim
85
+ *> INCV is INTEGER
86
+ *> The increment between elements of v. INCV <> 0.
87
+ *> \endverbatim
88
+ *>
89
+ *> \param[in] TAU
90
+ *> \verbatim
91
+ *> TAU is COMPLEX*16
92
+ *> The value tau in the representation of H.
93
+ *> \endverbatim
94
+ *>
95
+ *> \param[in,out] C
96
+ *> \verbatim
97
+ *> C is COMPLEX*16 array, dimension (LDC,N)
98
+ *> On entry, the M-by-N matrix C.
99
+ *> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
100
+ *> or C * H if SIDE = 'R'.
101
+ *> \endverbatim
102
+ *>
103
+ *> \param[in] LDC
104
+ *> \verbatim
105
+ *> LDC is INTEGER
106
+ *> The leading dimension of the array C. LDC >= max(1,M).
107
+ *> \endverbatim
108
+ *>
109
+ *> \param[out] WORK
110
+ *> \verbatim
111
+ *> WORK is COMPLEX*16 array, dimension
112
+ *> (N) if SIDE = 'L'
113
+ *> or (M) if SIDE = 'R'
114
+ *> \endverbatim
115
+ *
116
+ * Authors:
117
+ * ========
118
+ *
119
+ *> \author Univ. of Tennessee
120
+ *> \author Univ. of California Berkeley
121
+ *> \author Univ. of Colorado Denver
122
+ *> \author NAG Ltd.
123
+ *
124
+ *> \date November 2011
125
+ *
126
+ *> \ingroup complex16OTHERauxiliary
127
+ *
128
+ * =====================================================================
129
+ SUBROUTINE ZLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
130
+ *
131
+ * -- LAPACK auxiliary routine (version 3.4.0) --
132
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
133
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134
+ * November 2011
135
+ *
136
+ * .. Scalar Arguments ..
137
+ CHARACTER SIDE
138
+ INTEGER INCV, LDC, M, N
139
+ COMPLEX*16 TAU
140
+ * ..
141
+ * .. Array Arguments ..
142
+ COMPLEX*16 C( LDC, * ), V( * ), WORK( * )
143
+ * ..
144
+ *
145
+ * =====================================================================
146
+ *
147
+ * .. Parameters ..
148
+ COMPLEX*16 ONE, ZERO
149
+ PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ),
150
+ $ ZERO = ( 0.0D+0, 0.0D+0 ) )
151
+ * ..
152
+ * .. Local Scalars ..
153
+ LOGICAL APPLYLEFT
154
+ INTEGER I, LASTV, LASTC
155
+ * ..
156
+ * .. External Subroutines ..
157
+ EXTERNAL ZGEMV, ZGERC
158
+ * ..
159
+ * .. External Functions ..
160
+ LOGICAL LSAME
161
+ INTEGER ILAZLR, ILAZLC
162
+ EXTERNAL LSAME, ILAZLR, ILAZLC
163
+ * ..
164
+ * .. Executable Statements ..
165
+ *
166
+ APPLYLEFT = LSAME( SIDE, 'L' )
167
+ LASTV = 0
168
+ LASTC = 0
169
+ IF( TAU.NE.ZERO ) THEN
170
+ * Set up variables for scanning V. LASTV begins pointing to the end
171
+ * of V.
172
+ IF( APPLYLEFT ) THEN
173
+ LASTV = M
174
+ ELSE
175
+ LASTV = N
176
+ END IF
177
+ IF( INCV.GT.0 ) THEN
178
+ I = 1 + (LASTV-1) * INCV
179
+ ELSE
180
+ I = 1
181
+ END IF
182
+ * Look for the last non-zero row in V.
183
+ DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO )
184
+ LASTV = LASTV - 1
185
+ I = I - INCV
186
+ END DO
187
+ IF( APPLYLEFT ) THEN
188
+ * Scan for the last non-zero column in C(1:lastv,:).
189
+ LASTC = ILAZLC(LASTV, N, C, LDC)
190
+ ELSE
191
+ * Scan for the last non-zero row in C(:,1:lastv).
192
+ LASTC = ILAZLR(M, LASTV, C, LDC)
193
+ END IF
194
+ END IF
195
+ * Note that lastc.eq.0 renders the BLAS operations null; no special
196
+ * case is needed at this level.
197
+ IF( APPLYLEFT ) THEN
198
+ *
199
+ * Form H * C
200
+ *
201
+ IF( LASTV.GT.0 ) THEN
202
+ *
203
+ * w(1:lastc,1) := C(1:lastv,1:lastc)**H * v(1:lastv,1)
204
+ *
205
+ CALL ZGEMV( 'Conjugate transpose', LASTV, LASTC, ONE,
206
+ $ C, LDC, V, INCV, ZERO, WORK, 1 )
207
+ *
208
+ * C(1:lastv,1:lastc) := C(...) - v(1:lastv,1) * w(1:lastc,1)**H
209
+ *
210
+ CALL ZGERC( LASTV, LASTC, -TAU, V, INCV, WORK, 1, C, LDC )
211
+ END IF
212
+ ELSE
213
+ *
214
+ * Form C * H
215
+ *
216
+ IF( LASTV.GT.0 ) THEN
217
+ *
218
+ * w(1:lastc,1) := C(1:lastc,1:lastv) * v(1:lastv,1)
219
+ *
220
+ CALL ZGEMV( 'No transpose', LASTC, LASTV, ONE, C, LDC,
221
+ $ V, INCV, ZERO, WORK, 1 )
222
+ *
223
+ * C(1:lastc,1:lastv) := C(...) - w(1:lastc,1) * v(1:lastv,1)**H
224
+ *
225
+ CALL ZGERC( LASTC, LASTV, -TAU, WORK, 1, V, INCV, C, LDC )
226
+ END IF
227
+ END IF
228
+ RETURN
229
+ *
230
+ * End of ZLARF
231
+ *
232
+ END
include/eigen/lapack/zlarft.f ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *> \brief \b ZLARFT
2
+ *
3
+ * =========== DOCUMENTATION ===========
4
+ *
5
+ * Online html documentation available at
6
+ * http://www.netlib.org/lapack/explore-html/
7
+ *
8
+ *> \htmlonly
9
+ *> Download ZLARFT + dependencies
10
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlarft.f">
11
+ *> [TGZ]</a>
12
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlarft.f">
13
+ *> [ZIP]</a>
14
+ *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarft.f">
15
+ *> [TXT]</a>
16
+ *> \endhtmlonly
17
+ *
18
+ * Definition:
19
+ * ===========
20
+ *
21
+ * SUBROUTINE ZLARFT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
22
+ *
23
+ * .. Scalar Arguments ..
24
+ * CHARACTER DIRECT, STOREV
25
+ * INTEGER K, LDT, LDV, N
26
+ * ..
27
+ * .. Array Arguments ..
28
+ * COMPLEX*16 T( LDT, * ), TAU( * ), V( LDV, * )
29
+ * ..
30
+ *
31
+ *
32
+ *> \par Purpose:
33
+ * =============
34
+ *>
35
+ *> \verbatim
36
+ *>
37
+ *> ZLARFT forms the triangular factor T of a complex block reflector H
38
+ *> of order n, which is defined as a product of k elementary reflectors.
39
+ *>
40
+ *> If DIRECT = 'F', H = H(1) H(2) . . . H(k) and T is upper triangular;
41
+ *>
42
+ *> If DIRECT = 'B', H = H(k) . . . H(2) H(1) and T is lower triangular.
43
+ *>
44
+ *> If STOREV = 'C', the vector which defines the elementary reflector
45
+ *> H(i) is stored in the i-th column of the array V, and
46
+ *>
47
+ *> H = I - V * T * V**H
48
+ *>
49
+ *> If STOREV = 'R', the vector which defines the elementary reflector
50
+ *> H(i) is stored in the i-th row of the array V, and
51
+ *>
52
+ *> H = I - V**H * T * V
53
+ *> \endverbatim
54
+ *
55
+ * Arguments:
56
+ * ==========
57
+ *
58
+ *> \param[in] DIRECT
59
+ *> \verbatim
60
+ *> DIRECT is CHARACTER*1
61
+ *> Specifies the order in which the elementary reflectors are
62
+ *> multiplied to form the block reflector:
63
+ *> = 'F': H = H(1) H(2) . . . H(k) (Forward)
64
+ *> = 'B': H = H(k) . . . H(2) H(1) (Backward)
65
+ *> \endverbatim
66
+ *>
67
+ *> \param[in] STOREV
68
+ *> \verbatim
69
+ *> STOREV is CHARACTER*1
70
+ *> Specifies how the vectors which define the elementary
71
+ *> reflectors are stored (see also Further Details):
72
+ *> = 'C': columnwise
73
+ *> = 'R': rowwise
74
+ *> \endverbatim
75
+ *>
76
+ *> \param[in] N
77
+ *> \verbatim
78
+ *> N is INTEGER
79
+ *> The order of the block reflector H. N >= 0.
80
+ *> \endverbatim
81
+ *>
82
+ *> \param[in] K
83
+ *> \verbatim
84
+ *> K is INTEGER
85
+ *> The order of the triangular factor T (= the number of
86
+ *> elementary reflectors). K >= 1.
87
+ *> \endverbatim
88
+ *>
89
+ *> \param[in] V
90
+ *> \verbatim
91
+ *> V is COMPLEX*16 array, dimension
92
+ *> (LDV,K) if STOREV = 'C'
93
+ *> (LDV,N) if STOREV = 'R'
94
+ *> The matrix V. See further details.
95
+ *> \endverbatim
96
+ *>
97
+ *> \param[in] LDV
98
+ *> \verbatim
99
+ *> LDV is INTEGER
100
+ *> The leading dimension of the array V.
101
+ *> If STOREV = 'C', LDV >= max(1,N); if STOREV = 'R', LDV >= K.
102
+ *> \endverbatim
103
+ *>
104
+ *> \param[in] TAU
105
+ *> \verbatim
106
+ *> TAU is COMPLEX*16 array, dimension (K)
107
+ *> TAU(i) must contain the scalar factor of the elementary
108
+ *> reflector H(i).
109
+ *> \endverbatim
110
+ *>
111
+ *> \param[out] T
112
+ *> \verbatim
113
+ *> T is COMPLEX*16 array, dimension (LDT,K)
114
+ *> The k by k triangular factor T of the block reflector.
115
+ *> If DIRECT = 'F', T is upper triangular; if DIRECT = 'B', T is
116
+ *> lower triangular. The rest of the array is not used.
117
+ *> \endverbatim
118
+ *>
119
+ *> \param[in] LDT
120
+ *> \verbatim
121
+ *> LDT is INTEGER
122
+ *> The leading dimension of the array T. LDT >= K.
123
+ *> \endverbatim
124
+ *
125
+ * Authors:
126
+ * ========
127
+ *
128
+ *> \author Univ. of Tennessee
129
+ *> \author Univ. of California Berkeley
130
+ *> \author Univ. of Colorado Denver
131
+ *> \author NAG Ltd.
132
+ *
133
+ *> \date April 2012
134
+ *
135
+ *> \ingroup complex16OTHERauxiliary
136
+ *
137
+ *> \par Further Details:
138
+ * =====================
139
+ *>
140
+ *> \verbatim
141
+ *>
142
+ *> The shape of the matrix V and the storage of the vectors which define
143
+ *> the H(i) is best illustrated by the following example with n = 5 and
144
+ *> k = 3. The elements equal to 1 are not stored.
145
+ *>
146
+ *> DIRECT = 'F' and STOREV = 'C': DIRECT = 'F' and STOREV = 'R':
147
+ *>
148
+ *> V = ( 1 ) V = ( 1 v1 v1 v1 v1 )
149
+ *> ( v1 1 ) ( 1 v2 v2 v2 )
150
+ *> ( v1 v2 1 ) ( 1 v3 v3 )
151
+ *> ( v1 v2 v3 )
152
+ *> ( v1 v2 v3 )
153
+ *>
154
+ *> DIRECT = 'B' and STOREV = 'C': DIRECT = 'B' and STOREV = 'R':
155
+ *>
156
+ *> V = ( v1 v2 v3 ) V = ( v1 v1 1 )
157
+ *> ( v1 v2 v3 ) ( v2 v2 v2 1 )
158
+ *> ( 1 v2 v3 ) ( v3 v3 v3 v3 1 )
159
+ *> ( 1 v3 )
160
+ *> ( 1 )
161
+ *> \endverbatim
162
+ *>
163
+ * =====================================================================
164
+ SUBROUTINE ZLARFT( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
165
+ *
166
+ * -- LAPACK auxiliary routine (version 3.4.1) --
167
+ * -- LAPACK is a software package provided by Univ. of Tennessee, --
168
+ * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
169
+ * April 2012
170
+ *
171
+ * .. Scalar Arguments ..
172
+ CHARACTER DIRECT, STOREV
173
+ INTEGER K, LDT, LDV, N
174
+ * ..
175
+ * .. Array Arguments ..
176
+ COMPLEX*16 T( LDT, * ), TAU( * ), V( LDV, * )
177
+ * ..
178
+ *
179
+ * =====================================================================
180
+ *
181
+ * .. Parameters ..
182
+ COMPLEX*16 ONE, ZERO
183
+ PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ),
184
+ $ ZERO = ( 0.0D+0, 0.0D+0 ) )
185
+ * ..
186
+ * .. Local Scalars ..
187
+ INTEGER I, J, PREVLASTV, LASTV
188
+ * ..
189
+ * .. External Subroutines ..
190
+ EXTERNAL ZGEMV, ZLACGV, ZTRMV
191
+ * ..
192
+ * .. External Functions ..
193
+ LOGICAL LSAME
194
+ EXTERNAL LSAME
195
+ * ..
196
+ * .. Executable Statements ..
197
+ *
198
+ * Quick return if possible
199
+ *
200
+ IF( N.EQ.0 )
201
+ $ RETURN
202
+ *
203
+ IF( LSAME( DIRECT, 'F' ) ) THEN
204
+ PREVLASTV = N
205
+ DO I = 1, K
206
+ PREVLASTV = MAX( PREVLASTV, I )
207
+ IF( TAU( I ).EQ.ZERO ) THEN
208
+ *
209
+ * H(i) = I
210
+ *
211
+ DO J = 1, I
212
+ T( J, I ) = ZERO
213
+ END DO
214
+ ELSE
215
+ *
216
+ * general case
217
+ *
218
+ IF( LSAME( STOREV, 'C' ) ) THEN
219
+ * Skip any trailing zeros.
220
+ DO LASTV = N, I+1, -1
221
+ IF( V( LASTV, I ).NE.ZERO ) EXIT
222
+ END DO
223
+ DO J = 1, I-1
224
+ T( J, I ) = -TAU( I ) * CONJG( V( I , J ) )
225
+ END DO
226
+ J = MIN( LASTV, PREVLASTV )
227
+ *
228
+ * T(1:i-1,i) := - tau(i) * V(i:j,1:i-1)**H * V(i:j,i)
229
+ *
230
+ CALL ZGEMV( 'Conjugate transpose', J-I, I-1,
231
+ $ -TAU( I ), V( I+1, 1 ), LDV,
232
+ $ V( I+1, I ), 1, ONE, T( 1, I ), 1 )
233
+ ELSE
234
+ * Skip any trailing zeros.
235
+ DO LASTV = N, I+1, -1
236
+ IF( V( I, LASTV ).NE.ZERO ) EXIT
237
+ END DO
238
+ DO J = 1, I-1
239
+ T( J, I ) = -TAU( I ) * V( J , I )
240
+ END DO
241
+ J = MIN( LASTV, PREVLASTV )
242
+ *
243
+ * T(1:i-1,i) := - tau(i) * V(1:i-1,i:j) * V(i,i:j)**H
244
+ *
245
+ CALL ZGEMM( 'N', 'C', I-1, 1, J-I, -TAU( I ),
246
+ $ V( 1, I+1 ), LDV, V( I, I+1 ), LDV,
247
+ $ ONE, T( 1, I ), LDT )
248
+ END IF
249
+ *
250
+ * T(1:i-1,i) := T(1:i-1,1:i-1) * T(1:i-1,i)
251
+ *
252
+ CALL ZTRMV( 'Upper', 'No transpose', 'Non-unit', I-1, T,
253
+ $ LDT, T( 1, I ), 1 )
254
+ T( I, I ) = TAU( I )
255
+ IF( I.GT.1 ) THEN
256
+ PREVLASTV = MAX( PREVLASTV, LASTV )
257
+ ELSE
258
+ PREVLASTV = LASTV
259
+ END IF
260
+ END IF
261
+ END DO
262
+ ELSE
263
+ PREVLASTV = 1
264
+ DO I = K, 1, -1
265
+ IF( TAU( I ).EQ.ZERO ) THEN
266
+ *
267
+ * H(i) = I
268
+ *
269
+ DO J = I, K
270
+ T( J, I ) = ZERO
271
+ END DO
272
+ ELSE
273
+ *
274
+ * general case
275
+ *
276
+ IF( I.LT.K ) THEN
277
+ IF( LSAME( STOREV, 'C' ) ) THEN
278
+ * Skip any leading zeros.
279
+ DO LASTV = 1, I-1
280
+ IF( V( LASTV, I ).NE.ZERO ) EXIT
281
+ END DO
282
+ DO J = I+1, K
283
+ T( J, I ) = -TAU( I ) * CONJG( V( N-K+I , J ) )
284
+ END DO
285
+ J = MAX( LASTV, PREVLASTV )
286
+ *
287
+ * T(i+1:k,i) = -tau(i) * V(j:n-k+i,i+1:k)**H * V(j:n-k+i,i)
288
+ *
289
+ CALL ZGEMV( 'Conjugate transpose', N-K+I-J, K-I,
290
+ $ -TAU( I ), V( J, I+1 ), LDV, V( J, I ),
291
+ $ 1, ONE, T( I+1, I ), 1 )
292
+ ELSE
293
+ * Skip any leading zeros.
294
+ DO LASTV = 1, I-1
295
+ IF( V( I, LASTV ).NE.ZERO ) EXIT
296
+ END DO
297
+ DO J = I+1, K
298
+ T( J, I ) = -TAU( I ) * V( J, N-K+I )
299
+ END DO
300
+ J = MAX( LASTV, PREVLASTV )
301
+ *
302
+ * T(i+1:k,i) = -tau(i) * V(i+1:k,j:n-k+i) * V(i,j:n-k+i)**H
303
+ *
304
+ CALL ZGEMM( 'N', 'C', K-I, 1, N-K+I-J, -TAU( I ),
305
+ $ V( I+1, J ), LDV, V( I, J ), LDV,
306
+ $ ONE, T( I+1, I ), LDT )
307
+ END IF
308
+ *
309
+ * T(i+1:k,i) := T(i+1:k,i+1:k) * T(i+1:k,i)
310
+ *
311
+ CALL ZTRMV( 'Lower', 'No transpose', 'Non-unit', K-I,
312
+ $ T( I+1, I+1 ), LDT, T( I+1, I ), 1 )
313
+ IF( I.GT.1 ) THEN
314
+ PREVLASTV = MIN( PREVLASTV, LASTV )
315
+ ELSE
316
+ PREVLASTV = LASTV
317
+ END IF
318
+ END IF
319
+ T( I, I ) = TAU( I )
320
+ END IF
321
+ END DO
322
+ END IF
323
+ RETURN
324
+ *
325
+ * End of ZLARFT
326
+ *
327
+ END