Debian Codegraph @

packages/stokhos/src/sacado/kokkos/vector/Teuchos_LAPACK_MP_Vector.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef _TEUCHOS_LAPACK_MP_VECTOR_HPP_
11 #define _TEUCHOS_LAPACK_MP_VECTOR_HPP_
12
13 #include "Teuchos_LAPACK.hpp"
14 #include "Teuchos_TestForException.hpp"
15 #include "Sacado_MP_Vector.hpp"
16
17 /*!
18 * \class Teuchos::LAPACK
19 * \brief Specialization for Sacado::MP::Vector< Storage<...> >
20 *
21 * Currently a shell implementation just so things that use LAPACK
22 * will compile. However each method throws a run-time error.
23 */
24 namespace Teuchos {
25
26 template<typename OrdinalType, typename Storage>
27 class LAPACK<OrdinalType, Sacado::MP::Vector<Storage> >
28 {
29 public:
30
31 typedef Sacado::MP::Vector<Storage> ScalarType;
32 typedef typename Teuchos::ScalarTraits<ScalarType>::magnitudeType MagnitudeType;
33
34 //! @name Constructors/Destructors.
35 //@{
36
37 //! Default Constructor.
38 inline LAPACK(void) {}
39
40 //! Copy Constructor.
41 inline LAPACK(const LAPACK<OrdinalType, ScalarType>& lapack) {}
42
43 //! Destructor.
44 inline virtual ~LAPACK(void) {}
45 //@}
46
47 //! @name Symmetric Positive Definite Linear System Routines.
48 //@{
49
50 //! Computes the \c L*D*L' factorization of a Hermitian/symmetric positive definite tridiagonal matrix \c A.
51 void PTTRF(const OrdinalType n, ScalarType* d, ScalarType* e, OrdinalType* info) const
52 { throw_error("PTTRF"); }
53
54 //! Solves a tridiagonal system \c A*X=B using the \L*D*L' factorization of \c A computed by PTTRF.
55 void PTTRS(const OrdinalType n, const OrdinalType nrhs, const ScalarType* d, const ScalarType* e, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
56 { throw_error("PTTRS"); }
57
58 //! Computes Cholesky factorization of a real symmetric positive definite matrix \c A.
59 void POTRF(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const
60 { throw_error("POTRF"); }
61
62 //! Solves a system of linear equations \c A*X=B, where \c A is a symmetric positive definite matrix factored by POTRF and the \c nrhs solutions are returned in \c B.
63 void POTRS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
64 { throw_error("POTRS"); }
65
66 //! Computes the inverse of a real symmetric positive definite matrix \c A using the Cholesky factorization \c A from POTRF.
67 void POTRI(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const
68 { throw_error("POTRI"); }
69
70 //! Estimates the reciprocal of the condition number (1-norm) of a real symmetric positive definite matrix \c A using the Cholesky factorization from POTRF.
71
72 void POCON(const char UPLO, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
73 { throw_error("POCON"); }
74
75 //! Computes the solution to a real system of linear equations \c A*X=B, where \c A is a symmetric positive definite matrix and the \c nrhs solutions are returned in \c B.
76 void POSV(const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
77 { throw_error("POSV"); }
78
79 //! Computes row and column scalings intended to equilibrate a symmetric positive definite matrix \c A and reduce its condition number (w.r.t. 2-norm).
80 void POEQU(const OrdinalType n, const ScalarType* A, const OrdinalType lda, MagnitudeType* S, MagnitudeType* scond, MagnitudeType* amax, OrdinalType* info) const
81 { throw_error("POEQU"); }
82
83 //! Improves the computed solution to a system of linear equations when the coefficient matrix is symmetric positive definite, and provides error bounds and backward error estimates for the solution.
84 void PORFS(const char UPLO, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
85 { throw_error("PORFS"); }
86
87 //! Uses the Cholesky factorization to compute the solution to a real system of linear equations \c A*X=B, where \c A is symmetric positive definite. System can be equilibrated by POEQU and iteratively refined by PORFS, if requested.
88 void POSVX(const char FACT, const char UPLO, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, char EQUED, ScalarType* S, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
89 { throw_error("POSVX"); }
90 //@}
91
92 //! @name General Linear System Routines.
93 //@{
94
95 //! Solves an over/underdetermined real \c m by \c n linear system \c A using QR or LQ factorization of A.
96 void GELS(const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
97 { throw_error("GELS"); }
98
99 /// \brief Use the SVD to solve a possibly rank-deficient linear least-squares problem.
100 ///
101 /// GELSS uses the singular value decomposition (SVD) to compute
102 /// the minimum-norm solution to a possibly rank-deficient linear
103 /// least-squares problem. The problem may be under- or
104 /// overdetermined.
105 ///
106 /// LAPACK's _GELSS routines take different arguments, depending
107 /// on whether they are for real or complex arithmetic. This is
108 /// because _GELSS imitates the interface of LAPACK's SVD routine.
109 /// LAPACK's SVD routine takes an additional RWORK workspace array
110 /// argument for COMPLEX*8 (CGELSS) and COMPLEX*16 (ZGELSS).
111 /// LAPACK's real SVD routines (SGELSS and DGELSS) do not take the
112 /// RWORK argument.
113 ///
114 /// This class had already exposed GELSS for ScalarType = float
115 /// and double that does <i>not</i> include an RWORK argument.
116 /// Backwards compatibility requirements prevent us from simply
117 /// changing that interface. We could provide a different
118 /// interface for LAPACK specializations with ScalarType =
119 /// std::complex<T>, but that would make the GELSS interface not
120 /// generic at compile time. This would make using GELSS in
121 /// generic code harder (for example, you would need to specialize
122 /// code that <i>uses</i> GELSS on a Boolean, which specifies
123 /// whether ScalarType is complex).
124 ///
125 /// We fix this problem by providing an overloaded generic GELSS
126 /// interface that does take an RWORK argument. This does not
127 /// change the existing interface, but provides the additional
128 /// capability to solve complex-valued least-squares problems.
129 /// The RWORK argument is ignored when ScalarType is real, and may
130 /// therefore be set to NULL in that case.
131 ///
132 void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* S, const MagnitudeType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const
133 { throw_error("GELSS"); }
134
135 //! Legacy GELSS interface for real-valued ScalarType.
136 void GELSS(const OrdinalType m, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* S, const ScalarType rcond, OrdinalType* rank, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
137 { throw_error("GELSS"); }
138
139 //! Solves the linear equality-constrained least squares (LSE) problem where \c A is an \c m by \c n matrix,\c B is a \c p by \c n matrix \c C is a given \c m-vector, and D is a given \c p-vector.
140 void GGLSE(const OrdinalType m, const OrdinalType n, const OrdinalType p, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* C, ScalarType* D, ScalarType* X, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
141 { throw_error("GGLSE"); }
142
143 //! Computes a QR factorization of a general \c m by \c n matrix \c A.
144 void GEQRF( const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
145 { throw_error("GEQRF"); }
146
147 //! Computes an LU factorization of a general \c m by \c n matrix \c A using partial pivoting with row interchanges.
148 void GETRF(const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const
149 { throw_error("GETRF"); }
150
151 //! Solves a system of linear equations \c A*X=B or \c A'*X=B with a general \c n by \c n matrix \c A using the LU factorization computed by GETRF.
152 void GETRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
153 { throw_error("GETRS"); }
154
155 //! Multiplies the \c m by \c n matrix \c A by the real scalar \c cto/cfrom.
156 void LASCL(const char TYPE, const OrdinalType kl, const OrdinalType ku, const MagnitudeType cfrom, const MagnitudeType cto, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* info) const
157 { throw_error("LASCL"); }
158
159 //! Computes a QR factorization with column pivoting of a matrix \c A: A*P = Q*R using Level 3 BLAS
160 void
161 GEQP3(const OrdinalType m,
162 const OrdinalType n, ScalarType* A,
163 const OrdinalType lda,
164 OrdinalType *jpvt,
165 ScalarType* TAU,
166 ScalarType* WORK,
167 const OrdinalType lwork,
168 MagnitudeType* RWORK,
169 OrdinalType* info ) const
170 { throw_error("GEQP3"); }
171
172 //! Apply a series of row interchanges to the matrix A.
173 void
174 LASWP (const OrdinalType N,
175 ScalarType A[],
176 const OrdinalType LDA,
177 const OrdinalType K1,
178 const OrdinalType K2,
179 const OrdinalType IPIV[],
180 const OrdinalType INCX) const
181 { throw_error("LASWP"); }
182
183 //! Computes an LU factorization of a general banded \c m by \c n matrix \c A using partial pivoting with row interchanges.
184 void GBTRF(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, OrdinalType* info) const
185 { throw_error("GBTRF"); }
186
187 //! Solves a system of linear equations \c A*X=B or \c A'*X=B with a general banded \c n by \c n matrix \c A using the LU factorization computed by GBTRF.
188 void GBTRS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
189 { throw_error("GBTRS"); }
190
191 //! Computes an LU factorization of a \c n by \c n tridiagonal matrix \c A using partial pivoting with row interchanges.
192 void GTTRF(const OrdinalType n, ScalarType* dl, ScalarType* d, ScalarType* du, ScalarType* du2, OrdinalType* IPIV, OrdinalType* info) const
193 { throw_error("GTTRF"); }
194
195 //! Solves a system of linear equations \c A*X=B or \c A'*X=B or \c A^H*X=B with a tridiagonal matrix \c A using the LU factorization computed by GTTRF.
196 void GTTRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* dl, const ScalarType* d, const ScalarType* du, const ScalarType* du2, const OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
197 { throw_error("GTTRS"); }
198
199 //! Computes the inverse of a matrix \c A using the LU factorization computed by GETRF.
200 void GETRI(const OrdinalType n, ScalarType* A, const OrdinalType lda, const OrdinalType* IPIV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
201 { throw_error("GETRI"); }
202
203 /// \brief Robustly solve a possibly singular triangular linear system.
204 ///
205 /// \note This routine is slower than the BLAS' TRSM, but can
206 /// detect possible singularity of A.
207 void
208 LATRS (const char UPLO,
209 const char TRANS,
210 const char DIAG,
211 const char NORMIN,
212 const OrdinalType N,
213 ScalarType* A,
214 const OrdinalType LDA,
215 ScalarType* X,
216 MagnitudeType* SCALE,
217 MagnitudeType* CNORM,
218 OrdinalType* INFO) const
219 { throw_error("LATRS"); }
220
221 //! Estimates the reciprocal of the condition number of a general real matrix \c A, in either the 1-norm or the infinity-norm, using the LU factorization computed by GETRF.
222 void GECON(const char NORM, const OrdinalType n, const ScalarType* A, const OrdinalType lda, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
223 { throw_error("GECON"); }
224
225 //! Estimates the reciprocal of the condition number of a general banded real matrix \c A, in either the 1-norm or the infinity-norm, using the LU factorization computed by GETRF.
226 void GBCON(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, const ScalarType anorm, ScalarType* rcond, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
227 { throw_error("GBCON"); }
228
229 //! Returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of an \c n by \c n band matrix \c A, with \c kl sub-diagonals and \c ku super-diagonals.
230 typename ScalarTraits<ScalarType>::magnitudeType LANGB(const char NORM, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* WORK) const
231 { throw_error("LANGB"); return MagnitudeType(0); }
232
233 //! Computes the solution to a real system of linear equations \c A*X=B, where \c A is factored through GETRF and the \c nrhs solutions are computed through GETRS.
234 void GESV(const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, OrdinalType* IPIV, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
235 { throw_error("GESV"); }
236
237 //! Computes row and column scalings intended to equilibrate an \c m by \c n matrix \c A and reduce its condition number.
238 void GEEQU(const OrdinalType m, const OrdinalType n, const ScalarType* A, const OrdinalType lda, MagnitudeType* R, MagnitudeType* C, MagnitudeType* rowcond, MagnitudeType* colcond, MagnitudeType* amax, OrdinalType* info) const
239 { throw_error("GEEQU"); }
240
241 //! Improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. Use after GETRF/GETRS.
242 void GERFS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, MagnitudeType* FERR, MagnitudeType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
243 { throw_error("GERFS"); }
244
245 //! Computes row and column scalings intended to equilibrate an \c m by \c n banded matrix \c A and reduce its condition number.
246 void GBEQU(const OrdinalType m, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const ScalarType* A, const OrdinalType lda, MagnitudeType* R, MagnitudeType* C, MagnitudeType* rowcond, MagnitudeType* colcond, MagnitudeType* amax, OrdinalType* info) const
247 { throw_error("GBEQU"); }
248
249 //! Improves the computed solution to a banded system of linear equations and provides error bounds and backward error estimates for the solution. Use after GBTRF/GBTRS.
250 void GBRFS(const char TRANS, const OrdinalType n, const OrdinalType kl, const OrdinalType ku, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, const ScalarType* AF, const OrdinalType ldaf, const OrdinalType* IPIV, const ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
251 { throw_error("GBRFS"); }
252
253 //! Uses the LU factorization to compute the solution to a real system of linear equations \c A*X=B, returning error bounds on the solution and a condition estimate.
254 void GESVX(const char FACT, const char TRANS, const OrdinalType n, const OrdinalType nrhs, ScalarType* A, const OrdinalType lda, ScalarType* AF, const OrdinalType ldaf, OrdinalType* IPIV, char EQUED, ScalarType* R, ScalarType* C, ScalarType* B, const OrdinalType ldb, ScalarType* X, const OrdinalType ldx, ScalarType* rcond, ScalarType* FERR, ScalarType* BERR, ScalarType* WORK, OrdinalType* IWORK, OrdinalType* info) const
255 { throw_error("GESVX"); }
256
257 /*! \brief Reduces a real symmetric matrix \c A to tridiagonal form by orthogonal similarity transformations.
258 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
259 */
260 void SYTRD(const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* D, ScalarType* E, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
261 { throw_error("SYTRD"); }
262
263 //! Reduces a real general matrix \c A to upper Hessenberg form by orthogonal similarity transformations.
264 void GEHRD(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
265 { throw_error("GEHRD"); }
266
267 //! Solves a triangular linear system of the form \c A*X=B or \c A**T*X=B, where \c A is a triangular matrix.
268 void TRTRS(const char UPLO, const char TRANS, const char DIAG, const OrdinalType n, const OrdinalType nrhs, const ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, OrdinalType* info) const
269 { throw_error("TRTRS"); }
270
271 //! Computes the inverse of an upper or lower triangular matrix \c A.
272 void TRTRI(const char UPLO, const char DIAG, const OrdinalType n, const ScalarType* A, const OrdinalType lda, OrdinalType* info) const
273 { throw_error("TRTRI"); }
274 //@}
275
276 //! @name Symmetric Eigenproblem Routines
277 //@{
278 /*! \brief Computes the eigenvalues and, optionally, eigenvectors of a symmetric \c n by \c n matrix \c A in packed storage.
279 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
280 */
281 void SPEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* AP, ScalarType* W, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const
282 { throw_error("SPEV"); }
283
284 /*! \brief Computes all the eigenvalues and, optionally, eigenvectors of a symmetric \c n by \c n matrix A.
285 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
286 */
287 void SYEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
288 { throw_error("SYEV"); }
289
290 /*! \brief Computes all the eigenvalues and, optionally, eigenvectors of a symmetric \c n by \c n matrix pencil \c {A,B}, where \c A is symmetric and \c B is symmetric positive-definite.
291 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
292 */
293 void SYGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, ScalarType* W, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
294 { throw_error("SYGV"); }
295
296 /*! \brief Computes all the eigenvalues and, optionally, eigenvectors of a Hermitian \c n by \c n matrix A.
297 \note This method will call SYEV when ScalarType is \c float or \c double.
298 */
299 void HEEV(const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const
300 { throw_error("HEEV"); }
301
302 /*! \brief Computes all the eigenvalues and, optionally, eigenvectors of a generalized Hermitian-definite \c n by \c n matrix pencil \c {A,B}, where \c A is Hermitian and \c B is Hermitian positive-definite.
303 \note This method will call SYGV when ScalarType is \c float or \c double.
304 */
305 void HEGV(const OrdinalType itype, const char JOBZ, const char UPLO, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* W, ScalarType* WORK, const OrdinalType lwork, MagnitudeType *RWORK, OrdinalType* info) const
306 { throw_error("HEGV"); }
307
308 //! Computes the eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal \c n by \c n matrix \c A using implicit QL/QR. The eigenvectors can only be computed if \c A was reduced to tridiagonal form by SYTRD.
309 void STEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const
310 { throw_error("STEQR"); }
311 //@}
312
313 //! Computes the eigenvalues and, optionally, eigenvectors of a symmetric positive-definite tridiagonal \c n by \c n matrix \c A using BDSQR, after factoring the matrix with PTTRF.
314 void PTEQR(const char COMPZ, const OrdinalType n, ScalarType* D, ScalarType* E, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, OrdinalType* info) const
315 { throw_error("PTEQR"); }
316 //@}
317
318 //! @name Non-Hermitian Eigenproblem Routines
319 //@{
320 //! Computes the eigenvalues of a real upper Hessenberg matrix \c H and, optionally, the matrices \c T and \c Z from the Schur decomposition, where T is an upper quasi-triangular matrix and Z contains the Schur vectors.
321 void HSEQR(const char JOB, const char COMPZ, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* H, const OrdinalType ldh, ScalarType* WR, ScalarType* WI, ScalarType* Z, const OrdinalType ldz, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
322 { throw_error("HSEQR"); }
323
324 /*! Computes for an \c n by \c n nonsymmetric matrix \c A, the eigenvalues, the Schur form \c T, and, optionally, the matrix of Schur vectors \c Z. When \c ScalarType is \c float or \c double, the real Schur form is computed.
325 \note (This is the version used for \c float and \c double, where \c select requires two arguments to represent a complex eigenvalue.)
326 */
327 void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*, ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* WR, ScalarType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, OrdinalType* BWORK, OrdinalType* info) const
328 { throw_error("GEES"); }
329
330 /*! Computes for an \c n by \c n nonsymmetric matrix \c A, the eigenvalues, the Schur form \c T, and, optionally, the matrix of Schur vectors \c Z. When \c ScalarType is \c float or \c double, the real Schur form is computed.
331 \note (This is the version used for \c std::complex<float> and \c std::complex<double>, where \c select requires one arguments to represent a complex eigenvalue.)
332 */
333 void GEES(const char JOBVS, const char SORT, OrdinalType (*ptr2func)(ScalarType*), const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, ScalarType* W, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const
334 { throw_error("GEES"); }
335
336 /*! Computes for an \c n by \c n nonsymmetric matrix \c A, the eigenvalues, the Schur form \c T, and, optionally, the matrix of Schur vectors \c Z. When \c ScalarType is \c float or \c double, the real Schur form is computed.
337 \note (This is the version used for any \c ScalarType, when the user doesn't want to enable the sorting functionality.)
338 */
339 void GEES(const char JOBVS, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType* sdim, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VS, const OrdinalType ldvs, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* BWORK, OrdinalType* info) const
340 { throw_error("GEES"); }
341
342 /// \brief Computes for an \c n by \c n real nonsymmetric matrix \c A, the eigenvalues and, optionally, the left and/or right eigenvectors.
343 ///
344 /// Real and imaginary parts of the eigenvalues are returned in
345 /// separate arrays, WR for real and WI for complex. The RWORK
346 /// array is only referenced if ScalarType is complex.
347 void GEEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* WR, MagnitudeType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const
348 { throw_error("GEEV"); }
349
350 /*! Computes for an \c n by \c n real nonsymmetric matrix \c A, the eigenvalues and, optionally, the left and/or right eigenvectors.
351 Optionally, it can compute a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors.
352 \note (This is the function is only defined for \c ScalarType = \c float or \c double.)
353 */
354 void GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* WR, ScalarType* WI, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* SCALE, MagnitudeType* abnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* info) const
355 { throw_error("GEEVX"); }
356
357 /*! Computes for a pair of \c n by \c n nonsymmetric matrices (\c A,\c B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
358 Optionally, it can compute a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors.
359 \note (This is the function is only defined for \c ScalarType = \c float or \c double.)
360 */
361 void GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const OrdinalType n, ScalarType* A, const OrdinalType lda, ScalarType* B, const OrdinalType ldb, MagnitudeType* ALPHAR, MagnitudeType* ALPHAI, ScalarType* BETA, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, OrdinalType* ilo, OrdinalType* ihi, MagnitudeType* lscale, MagnitudeType* rscale, MagnitudeType* abnrm, MagnitudeType* bbnrm, MagnitudeType* RCONDE, MagnitudeType* RCONDV, ScalarType* WORK, const OrdinalType lwork, OrdinalType* IWORK, OrdinalType* BWORK, OrdinalType* info) const
362 { throw_error("GGEVX"); }
363
364 /*! Computes for a pair of \c n by \c n nonsymmetric matrices (\c A,\c B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
365 \note (This is the function is only defined for \c ScalarType = \c float or \c double.)
366 */
367 void GGEV(const char JOBVL, const char JOBVR, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, ScalarType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *info) const
368 { throw_error("GGEV"); }
369
370
371 /*! Reorders the real Schur factorization of a real matrix so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix \c T, and the leading columns of \c Q form an orthonormal basis of the corresponding right invariant subspace.
372 \note (This function is only defined for \c ScalarType = \c float or \c double.)
373 */
374 void TRSEN(const char JOB, const char COMPQ, const OrdinalType *SELECT, const OrdinalType n, ScalarType *T, const OrdinalType ldt, ScalarType *Q, const OrdinalType ldq, MagnitudeType *WR, MagnitudeType *WI, OrdinalType *M, ScalarType *S, MagnitudeType *SEP, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const
375 { throw_error("TRSEN"); }
376
377
378 /*! Reorders the generalized real Schur decomposition of a real matrix pair (\c A, \c B), so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix \c A and the upper triangular \c B.
379 \note (This function is only defined for \c ScalarType = \c float or \c double.)
380 */
381 void TGSEN(const OrdinalType ijob, const OrdinalType wantq, const OrdinalType wantz, const OrdinalType *SELECT, const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *Q, const OrdinalType ldq, ScalarType *Z, const OrdinalType ldz, OrdinalType *M, MagnitudeType *PL, MagnitudeType *PR, MagnitudeType *DIF, ScalarType *WORK, const OrdinalType lwork, OrdinalType *IWORK, const OrdinalType liwork, OrdinalType *info ) const
382 { throw_error("TGSEN"); }
383
384
385 /*! Computes for a pair of \c n by \c n nonsymmetric matrices (\c A,\c B) the generalized eigenvalues, the generalized real Schur form (\c S,\c T), optionally, the left and/or right matrices of Schur vectors.
386 \note (This is the function is only defined for \c ScalarType = \c float or \c double.)
387 */
388 void GGES(const char JOBVL, const char JOBVR, const char SORT, OrdinalType (*ptr2func)(ScalarType *, ScalarType *, ScalarType *), const OrdinalType n, ScalarType *A, const OrdinalType lda, ScalarType *B, const OrdinalType ldb, OrdinalType *sdim, MagnitudeType *ALPHAR, MagnitudeType *ALPHAI, MagnitudeType *BETA, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, ScalarType *WORK, const OrdinalType lwork, OrdinalType *BWORK, OrdinalType *info ) const
389 { throw_error("GGES"); }
390
391 //@}
392
393
394 //! @name Singular Value Decompositon Routines
395 //@{
396 //! Computes the singular values (and optionally, vectors) of a real matrix \c A.
397 void GESVD(const char JOBU, const char JOBVT, const OrdinalType m, const OrdinalType n, ScalarType* A, const OrdinalType lda, MagnitudeType* S, ScalarType* U, const OrdinalType ldu, ScalarType* V, const OrdinalType ldv, ScalarType* WORK, const OrdinalType lwork, MagnitudeType* RWORK, OrdinalType* info) const
398 { throw_error("GESVD"); }
399 //@}
400
401
402 //! @name Orthogonal matrix routines
403 //@{
404
405 /// Apply Householder reflectors (real case).
406 ///
407 /// Overwrite the general real \c m by \c n matrix \c C with the
408 /// product of \c Q and \c C, whiere Q is the product of \c k
409 /// elementary (Householder) reflectors as returned by \c GEQRF.
410 ///
411 /// \note This method is not defined when ScalarType is complex.
412 /// Call \c UNMQR in that case. ("OR" stands for "orthogonal";
413 /// "UN" stands for "unitary.")
414 void ORMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
415 { throw_error("ORMQR"); }
416
417 /// \brief Apply Householder reflectors (complex case).
418 ///
419 /// Overwrite the general complex \c m by \c n matrix \c C with
420 /// the product of \c Q and \c C, where Q is the product of \c k
421 /// elementary (Householder) reflectors as returned by \c GEQRF.
422 ///
423 /// \note This method will call \c ORMQR when ScalarType is real.
424 /// (Unitary real matrices are orthogonal.)
425 void UNMQR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
426 { throw_error("UNMQR"); }
427
428 /// \brief Compute explicit Q factor from QR factorization (GEQRF) (real case).
429 ///
430 /// Generate the \c m by \c n matrix Q with orthonormal columns
431 /// corresponding to the first \c n columns of a product of \c k
432 /// elementary reflectors of order \c m, as returned by \c GEQRF.
433 ///
434 /// \note This method is not defined when ScalarType is complex.
435 /// Call \c UNGQR in that case. ("OR" stands for "orthogonal";
436 /// "UN" stands for "unitary.")
437 void ORGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
438 { throw_error("ORGQR"); }
439
440 /// \brief Compute explicit QR factor from QR factorization (GEQRF) (complex case).
441 ///
442 /// Generate the \c m by \c n matrix Q with orthonormal columns
443 /// corresponding tothe first \c n columns of a product of \c k
444 /// elementary reflectors of order \c m, as returned by \c GEQRF.
445 ///
446 /// \note This method will call \c ORGQR when ScalarType is real.
447 /// (Unitary real matrices are orthogonal.)
448 void UNGQR(const OrdinalType m, const OrdinalType n, const OrdinalType k, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
449 { throw_error("UNGQR"); }
450
451 /*! \brief Generates a real orthogonal matrix \c Q which is the product of \c ihi-ilo elementary reflectors of order \c n, as returned by GEHRD. On return \c Q is stored in \c A.
452 \note This method is not defined when ScalarType is complex.
453 */
454 void ORGHR(const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
455 { throw_error("ORGHR"); }
456
457 /*! \brief Overwrites the general real \c m by \c n matrix \c C with the product of \c C and \c Q, which is a product of \c ihi-ilo elementary reflectors, as returned by GEHRD.
458 \note This method is not defined when ScalarType is complex.
459 */
460 void ORMHR(const char SIDE, const char TRANS, const OrdinalType m, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const ScalarType* A, const OrdinalType lda, const ScalarType* TAU, ScalarType* C, const OrdinalType ldc, ScalarType* WORK, const OrdinalType lwork, OrdinalType* info) const
461 { throw_error("ORMHR"); }
462 //@}
463
464 //! @name Triangular Matrix Routines
465 //@{
466
467 /*! Computes some or all of the right and/or left eigenvectors of an upper triangular matrix \c T. If ScalarType is \c float or \c double, then the matrix is quasi-triangular and arugments \c RWORK is ignored.
468 */
469 void TREVC(const char SIDE, const char HOWMNY, OrdinalType* select, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, OrdinalType* info) const
470 { throw_error("TREVC"); }
471
472 /*! Computes some or all of the right and/or left eigenvectors of an upper triangular matrix \c T. If ScalarType is \c float or \c double, then the matrix is quasi-triangular and arugments \c RWORK is ignored.
473 \note (This is the version used for any \c ScalarType, when the user doesn't want to enable the selecting functionality, with HOWMNY='A'.)
474 */
475 void TREVC(const char SIDE, const OrdinalType n, const ScalarType* T, const OrdinalType ldt, ScalarType* VL, const OrdinalType ldvl, ScalarType* VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType* m, ScalarType* WORK, MagnitudeType* RWORK, OrdinalType* info) const
476 { throw_error("TREVC"); }
477
478 /*! Reorders the Schur factorization of a matrix \c T via unitary similarity transformations so that the diagonal element of \c T with row index \c ifst is moved to row \c ilst. If \c ScalarType is \c float or \c double, then \c T should be in real Schur form and the operation affects the diagonal block referenced by \c ifst.
479 \note This method will ignore the WORK vector when ScalarType is \c std::complex<float> or \c std::complex<double>.
480 */
481 void TREXC(const char COMPQ, const OrdinalType n, ScalarType* T, const OrdinalType ldt, ScalarType* Q, const OrdinalType ldq, OrdinalType ifst, OrdinalType ilst, ScalarType* WORK, OrdinalType* info) const
482 { throw_error("TREXC"); }
483
484 /*! Computes some or all of the right and/or left eigenvectors of a pair of real matrices ( \c S, \c P ), where \c S is a quasi-triangular matrix and \c P is upper triangular.
485 \note This method is only defined for \c ScalarType = \c float or \c double.
486 */
487 void TGEVC(const char SIDE, const char HOWMNY, const OrdinalType *SELECT, const OrdinalType n, ScalarType *S, const OrdinalType lds, ScalarType *P, const OrdinalType ldp, ScalarType *VL, const OrdinalType ldvl, ScalarType *VR, const OrdinalType ldvr, const OrdinalType mm, OrdinalType *M, ScalarType *WORK, OrdinalType *info) const
488 { throw_error("TGEVC"); }
489
490
491 //@}
492
493 //! @name Rotation/Reflection generators
494 //@{
495
496 //! Gnerates a plane rotation that zeros out the second component of the input vector.
497 void LARTG( const ScalarType f, const ScalarType g, MagnitudeType* c, ScalarType* s, ScalarType* r ) const
498 { throw_error("LARTG"); }
499
500 //! Generates an elementary reflector of order \c n that zeros out the last \c n-1 components of the input vector.
501 void LARFG( const OrdinalType n, ScalarType* alpha, ScalarType* x, const OrdinalType incx, ScalarType* tau ) const
502 { throw_error("LARFG"); }
503
504 //@}
505
506 //! @name Matrix Balancing Routines
507 //@{
508
509 //! Balances a general matrix A, through similarity transformations to make the rows and columns as close in norm as possible.
510 void GEBAL(const char JOBZ, const OrdinalType n, ScalarType* A, const OrdinalType lda, OrdinalType ilo, OrdinalType ihi, MagnitudeType* scale, OrdinalType* info) const
511 { throw_error("GEBAL"); }
512
513 //! Forms the left or right eigenvectors of a general matrix that has been balanced by GEBAL by backward transformation of the computed eigenvectors \c V.
514 void GEBAK(const char JOBZ, const char SIDE, const OrdinalType n, const OrdinalType ilo, const OrdinalType ihi, const MagnitudeType* scale , const OrdinalType m, ScalarType* V, const OrdinalType ldv, OrdinalType* info) const
515 { throw_error("GEBAK"); }
516
517 //@}
518
519 //! @name Random number generators
520 //@{
521 //! Returns a random number from a uniform or normal distribution.
522 ScalarType LARND( const OrdinalType idist, OrdinalType* seed ) const
523 { throw_error("LARND"); return ScalarType(0); }
524
525 //! Returns a vector of random numbers from a chosen distribution.
526 void LARNV( const OrdinalType idist, OrdinalType* seed, const OrdinalType n, ScalarType* v ) const
527 { throw_error("LARNV"); }
528 //@}
529
530 //! @name Machine Characteristics Routines.
531 //@{
532 /*! \brief Determines machine parameters for floating point characteristics.
533 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
534 */
535 ScalarType LAMCH(const char CMACH) const
536 { throw_error("LAMCH"); return ScalarType(0); }
537
538 /*! \brief Chooses problem-dependent parameters for the local environment.
539 \note This method should give parameters for good, but not optimal, performance on many currently
540 available computers.
541 */
542 OrdinalType ILAENV( const OrdinalType ispec, const std::string& NAME, const std::string& OPTS, const OrdinalType N1 = -1, const OrdinalType N2 = -1, const OrdinalType N3 = -1, const OrdinalType N4 = -1 ) const
543 { throw_error("ILAENV"); return OrdinalType(0); }
544 //@}
545
546 //! @name Miscellaneous Utilities.
547 //@{
548 /*! \brief Computes x^2 + y^2 safely, to avoid overflow.
549 \note This method is not defined when the ScalarType is \c std::complex<float> or \c std::complex<double>.
550 */
551 ScalarType LAPY2(const ScalarType x, const ScalarType y) const
552 { throw_error("LAPY2"); return ScalarType(0); }
553 //@}
554
555 private:
556
557 void throw_error(const char *func) const {
558 TEUCHOS_TEST_FOR_EXCEPTION(
559 true, std::logic_error,
560 func << ": Not implemented for Sacado::MP::Vector scalar type!");
561 }
562
563 };
564
565 } // namespace Teuchos
566
567 #endif // _TEUCHOS_LAPACK__MP_VECTOR_HPP_