42 #include <Base/Common/W32Compat.hh>
50 #define F77_DGESV dgesv_
51 #define F77_DGELS dgels_
52 #define F77_DSYEV dsyev_
55 #define F77_DGEEV dgeev_
57 #define F77_DGESVD dgesvd_
64 void F77_DGESV(cfi_ N, cfi_ nrhs, fda_ A, cfi_ lda,
65 fia_ ipiv, fda_ b, cfi_ ldb, fi_ info);
69 void F77_DGELS(cfch_ trans, cfi_ M,
70 cfi_ N, cfi_ nrhs, fda_ A, cfi_ lda, fda_ B, cfi_ ldb, fda_ work,
71 cfi_ lwork, fi_ info);
75 void F77_DSYEV( cfch_ jobz, cfch_ uplo, cfi_ N, fda_ A, cfi_ lda,
76 fda_ W, fda_ work, cfi_ lwork, fi_ info);
80 void F77_DGEEV(cfch_ jobvl, cfch_ jobvr, cfi_ N, fda_ A, cfi_ lda,
81 fda_ wr, fda_ wi, fda_ vl, cfi_ ldvl, fda_ vr,
82 cfi_ ldvr, fda_ work, cfi_ lwork, fi_ info);
114 void F77_DGESVD( cfch_ JOBU,
138 const Fortran_integer one=1;
145 Fortran_integer info = 0;
147 F77_DGESV(&N, &one, &Tmp(1,1), &M, &index(1), &x(1), &M, &info);
159 const Fortran_integer one=1;
165 Fortran_integer info = 0;
168 Fortran_integer lwork = 5 * (M+N);
171 F77_DGELS(&transp, &M, &N, &one, &Tmp(1,1), &M, &x(1), &M, &work(1),
192 Fortran_integer worksize = 3*N;
193 Fortran_integer info = 0;
197 F77_DSYEV(&jobz, &uplo, &N, &Tmp(1,1), &N, eigvals.
begin(), work.
begin(),
223 Fortran_integer one = 1;
225 Fortran_integer worksize = 5*N;
226 Fortran_integer info = 0;
237 F77_DGEEV(&jobvl, &jobvr, &N, &Tmp(1,1), &N, &(wr(1)),
238 &(wi(1)), &(vl(1,1)), &one, &(vr(1,1)), &one,
239 &(work(1)), &worksize, &info);
241 return (info==0 ? 0: 1);
262 Fortran_integer ldvl = N;
263 Fortran_integer ldvr = N;
268 Fortran_integer worksize = 5*N;
269 Fortran_integer info = 0;
273 ret_EigenValuesRealPart.
newsize(N);
274 ret_EigenValuesImagPart.
newsize(N);
281 F77_DGEEV(&jobvl, &jobvr, &N, &Tmp(1,1), &N, &(ret_EigenValuesRealPart(1)),
282 &(ret_EigenValuesImagPart(1)),
283 &(eigenVectsLeft(1,1)), &ldvl,
284 &(eigenVectsRight(1,1)), &ldvr,
285 &(work(1)), &worksize, &info);
288 eigenVecMatrixR = eigenVectsRight;
290 return (info==0 ? 0: 1);
320 Fortran_integer lda = M;
321 Fortran_integer ldu = M;
322 Fortran_integer ldvt = N;
325 Fortran_integer worksize = 6 * (M > N ? M : N) ;
327 Fortran_integer info = 0;
372 return (info==0 ? 0: 1);
BIAS::Vector< double > Lapack_LLS_QR_linear_solve(const BIAS::Matrix< double > &A, const BIAS::Vector< double > &b, int &res)
linear least squares solves |Ax-b|=min res=0 on success, anything else rudimentary tested (woelk) ...
int singular_value_decomposition_general_rectangular_matrix_solve(const Fortran_Matrix< double > &A, Vector< double > &ret_S, Fortran_Matrix< double > &ret_U, Fortran_Matrix< double > &ret_VT)
solve general eigenproblem.
int eigenvalue_solve(const Fortran_Matrix< double > &A, Vector< double > &wr, Vector< double > &wi)
BIAS::Vector< double > Lapack_LU_linear_solve(const BIAS::Matrix< double > &A, const BIAS::Vector< double > &b)
solve linear equations using LU factorization
int eigenproblem_special_quadratic_matrix_solve(const Fortran_Matrix< double > &A, Vector< double > &ret_EigenValuesRealPart, Vector< double > &ret_EigenValuesImagPart, Fortran_Matrix< double > &eigenVecMatrixR)
solve general eigenproblem for a general quadratix (n x n) matrix.
Vector< T > & newsize(Subscript N)
Subscript num_cols() const
BIAS::Vector< double > Upper_symmetric_eigenvalue_solve(const BIAS::Matrix< double > &A)
Solve symmetric eigenvalue problem (eigenvalues only)
Subscript num_rows() const