22 #ifndef linear_algebrad_h 23 #define linear_algebrad_h 25 #include "square_matrix.h" 27 #include "row_vector.h" 28 #include "diagonal_matrix.h" 29 #include "symmetric_matrix.h" 30 #include "band_matrix.h" 41 FMATVEC_EXPORT
int svd(Matrix<General, Ref, Ref, double> &A, Matrix<General, Ref, Ref, double> &S, SquareMatrix<Ref, double> &U, SquareMatrix<Ref, double> &VT,
int Rueckgabe);
49 FMATVEC_EXPORT Vector<Ref, std::complex<double>>
eigval(
const SquareMatrix<Ref, double> &A);
59 FMATVEC_EXPORT
int eigvec(
const SquareMatrix<Ref, double> &A, SquareMatrix<Ref, std::complex<double>> &V, Vector<Ref, std::complex<double>> &w);
71 FMATVEC_EXPORT
int eigvec(
const Matrix<Symmetric, Ref, Ref, double> &A,
const Matrix<Symmetric, Ref, Ref, double> &B, SquareMatrix<Ref, double> &eigenvectors, Vector<Ref, double> &eigenvalues);
79 FMATVEC_EXPORT Vector<Ref, double>
eigval(
const Matrix<Symmetric, Ref, Ref, double> &A);
92 FMATVEC_EXPORT Vector<Ref, double>
eigvalSel(
const Matrix<Symmetric, Ref, Ref, double> &A,
int il,
int iu,
double abstol = 0);
126 FMATVEC_EXPORT Matrix<General, Ref, Ref, double>
slvLU(
const SquareMatrix<Ref, double> &A,
const Matrix<General, Ref, Ref, double> &X);
127 FMATVEC_EXPORT Matrix<General, Var, Var, double>
slvLU(
const SquareMatrix<Var, double> &A,
const Matrix<General, Var, Var, double> &X,
int & info);
138 FMATVEC_EXPORT Vector<Ref, double>
slvLU(
const SquareMatrix<Ref, double> &A,
const Vector<Ref, double> &x);
150 FMATVEC_EXPORT Vector<Ref, double>
slvLU(
const SquareMatrix<Ref, double> &A,
const Vector<Ref, double> &x,
int & info);
151 FMATVEC_EXPORT Vector<Var, double>
slvLU(
const SquareMatrix<Var, double> &A,
const Vector<Var, double> &x,
int & info);
163 FMATVEC_EXPORT Matrix<General, Ref, Ref, double>
slvLUFac(
const SquareMatrix<Ref, double> &A,
const Matrix<General, Ref, Ref, double> &X,
const Vector<Ref, int> &ipiv);
164 FMATVEC_EXPORT Matrix<General, Var, Var, double>
slvLUFac(
const SquareMatrix<Var, double> &A,
const Matrix<General, Var, Var, double> &X,
const Vector<Var, int> &ipiv);
176 FMATVEC_EXPORT Vector<Ref, double>
slvLUFac(
const SquareMatrix<Ref, double> &A,
const Vector<Ref, double> &x,
const Vector<Ref, int> &ipiv);
177 FMATVEC_EXPORT Vector<Var, double>
slvLUFac(
const SquareMatrix<Var, double> &A,
const Vector<Var, double> &x,
const Vector<Var, int> &ipiv);
188 FMATVEC_EXPORT Matrix<General, Ref, Ref, double>
slvLL(
const Matrix<Symmetric, Ref, Ref, double> &A,
const Matrix<General, Ref, Ref, double> &X);
199 FMATVEC_EXPORT Vector<Ref, double>
slvLL(
const Matrix<Symmetric, Ref, Ref, double> &A,
const Vector<Ref, double> &x);
210 FMATVEC_EXPORT Matrix<General, Ref, Ref, double>
slvQR(
const SquareMatrix<Ref, double> &A,
const Matrix<General, Ref, Ref, double> &X);
221 FMATVEC_EXPORT Vector<Ref, double>
slvQR(
const SquareMatrix<Ref, double> &A,
const Vector<Ref, double> &x);
230 FMATVEC_EXPORT SquareMatrix<Ref, double>
inv(
const SquareMatrix<Ref, double> &A);
239 FMATVEC_EXPORT Matrix<Symmetric, Ref, Ref, double>
inv(
const Matrix<Symmetric, Ref, Ref, double> &A);
248 FMATVEC_EXPORT Matrix<Diagonal, Ref, Ref, double>
inv(
const Matrix<Diagonal, Ref, Ref, double> &A);
258 FMATVEC_EXPORT Matrix<General, Ref, Ref, double>
facLU(
const Matrix<General, Ref, Ref, double> &A, Vector<Ref, int> &ipiv);
268 FMATVEC_EXPORT SquareMatrix<Ref, double>
facLU(
const SquareMatrix<Ref, double> &A, Vector<Ref, int> &ipiv);
270 FMATVEC_EXPORT SquareMatrix<Var, double>
facLU(
const SquareMatrix<Var, double> &A, Vector<Var, int> &ipiv);
283 FMATVEC_EXPORT
int facLU(
double *A,
int pivot[],
int n);
292 FMATVEC_EXPORT Matrix<Symmetric, Ref, Ref, double>
facLL(
const Matrix<Symmetric, Ref, Ref, double> &A);
300 FMATVEC_EXPORT
double nrm1(
const Vector<Ref, double> &x);
308 FMATVEC_EXPORT
double nrm2(
const Vector<Ref, double> &x);
316 FMATVEC_EXPORT
double nrmInf(
const Vector<Ref, double> &x);
325 FMATVEC_EXPORT
double nrm1(
const Matrix<General, Ref, Ref, double> &A);
333 FMATVEC_EXPORT
double nrm2(
const Matrix<General, Ref, Ref, double> &A);
342 FMATVEC_EXPORT
double nrmInf(
const Matrix<General, Ref, Ref, double> &A);
351 FMATVEC_EXPORT
double nrmInf(
const Matrix<Symmetric, Ref, Ref, double> &A);
359 FMATVEC_EXPORT
double nrmFro(
const Matrix<General, Ref, Ref, double> &A);
367 FMATVEC_EXPORT
double rho(
const SquareMatrix<Ref, double> &A);
375 FMATVEC_EXPORT
double rho(
const Matrix<Symmetric, Ref, Ref, double> &A);
377 FMATVEC_EXPORT Vector<Ref, double> slvLLFac(
const Matrix<Symmetric, Ref, Ref, double> &A,
const Vector<Ref, double> &x);
379 FMATVEC_EXPORT Matrix<General, Ref, Ref, double> slvLLFac(
const Matrix<Symmetric, Ref, Ref, double> &A,
const Matrix<General, Ref, Ref, double> &X);
381 FMATVEC_EXPORT Matrix<General, Ref, Ref, double> slvLS(
const Matrix<General, Ref, Ref, double> &A,
const Matrix<General, Ref, Ref, double> &B,
double rcond = -1);
383 FMATVEC_EXPORT Vector<Ref, double> slvLS(
const Matrix<General, Ref, Ref, double> &A,
const Vector<Ref, double> &b,
double rcond = -1);
416 info =
facLU(LU(), ipiv, size);
int svd(Matrix< General, Ref, Ref, double > &A, Matrix< General, Ref, Ref, double > &S, SquareMatrix< Ref, double > &U, SquareMatrix< Ref, double > &VT, int Rueckgabe)
Definition: linear_algebra_double.cc:725
Matrix< Symmetric, Ref, Ref, double > facLL(const Matrix< Symmetric, Ref, Ref, double > &A)
LL decomposition.
Definition: linear_algebra_double.cc:505
int eigvec(const SquareMatrix< Ref, double > &A, SquareMatrix< Ref, std::complex< double >> &V, Vector< Ref, std::complex< double >> &w)
Eigenvectors and Eigenvalues.
Definition: linear_algebra_double.cc:661
double nrm1(const Vector< Ref, double > &x)
1-norm
Definition: linear_algebra_double.cc:524
Vector< Ref, double > eigvalSel(const Matrix< Symmetric, Ref, Ref, double > &A, int il, int iu, double abstol)
Eigenvalues.
Definition: linear_algebra_double.cc:766
Vector< Ref, std::complex< double > > slvLU(const SquareMatrix< Ref, std::complex< double >> &A, const Vector< Ref, std::complex< double >> &x)
System of linear equations.
Definition: linear_algebra_complex.cc:51
Matrix< General, Ref, Ref, double > facLU(const Matrix< General, Ref, Ref, double > &A, Vector< Ref, int > &ipiv)
LU decomposition.
Definition: linear_algebra_double.cc:391
Matrix< General, Ref, Ref, double > slvQR(const SquareMatrix< Ref, double > &A, const Matrix< General, Ref, Ref, double > &X)
Systems of linear equations.
Definition: linear_algebra_double.cc:147
Namespace fmatvec.
Definition: _memory.cc:28
int Doolittle_LU_with_Pivoting_Solve(double *A, double B[], const int pivot[], double x[], int n)
solve linear system with LU decomposed matrix
Definition: linear_algebra_double.cc:166
Matrix< General, Ref, Ref, double > slvLUFac(const SquareMatrix< Ref, double > &A, const Matrix< General, Ref, Ref, double > &X, const Vector< Ref, int > &ipiv)
Systems of linear equations.
Definition: linear_algebra_double.cc:101
Vector< Ref, std::complex< double > > eigval(const SquareMatrix< Ref, double > &A)
Eigenvalues.
Definition: linear_algebra_double.cc:641
SquareMatrix< Ref, double > inv(const SquareMatrix< Ref, double > &A)
Inverse.
Definition: linear_algebra_double.cc:332
double nrmFro(const Matrix< General, Ref, Ref, double > &A)
Frobenius-norm.
Definition: linear_algebra_double.cc:838
Vector< Ref, double > slvLL(const Matrix< Symmetric, Ref, Ref, double > &A, const Vector< Ref, double > &x)
System of linear equations.
Definition: linear_algebra_double.cc:549
double rho(const SquareMatrix< Ref, double > &A)
Spectral radius.
Definition: linear_algebra_double.cc:786