Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  Copyright (c) 2011, Intel Corporation. All rights reserved.
0003 
0004  Redistribution and use in source and binary forms, with or without modification,
0005  are permitted provided that the following conditions are met:
0006 
0007  * Redistributions of source code must retain the above copyright notice, this
0008    list of conditions and the following disclaimer.
0009  * Redistributions in binary form must reproduce the above copyright notice,
0010    this list of conditions and the following disclaimer in the documentation
0011    and/or other materials provided with the distribution.
0012  * Neither the name of Intel Corporation nor the names of its contributors may
0013    be used to endorse or promote products derived from this software without
0014    specific prior written permission.
0015 
0016  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
0017  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0018  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0019  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
0020  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0021  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0022  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
0023  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0024  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0025  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0026 
0027  ********************************************************************************
0028  *   Content : Eigen bindings to LAPACKe
0029  *    Real Schur needed to real unsymmetrical eigenvalues/eigenvectors.
0030  ********************************************************************************
0031 */
0032 
0033 #ifndef EIGEN_REAL_SCHUR_LAPACKE_H
0034 #define EIGEN_REAL_SCHUR_LAPACKE_H
0035 
0036 namespace Eigen { 
0037 
0038 /** \internal Specialization for the data types supported by LAPACKe */
0039 
0040 #define EIGEN_LAPACKE_SCHUR_REAL(EIGTYPE, LAPACKE_TYPE, LAPACKE_PREFIX, LAPACKE_PREFIX_U, EIGCOLROW, LAPACKE_COLROW) \
0041 template<> template<typename InputType> inline \
0042 RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
0043 RealSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const EigenBase<InputType>& matrix, bool computeU) \
0044 { \
0045   eigen_assert(matrix.cols() == matrix.rows()); \
0046 \
0047   lapack_int n = internal::convert_index<lapack_int>(matrix.cols()), sdim, info; \
0048   lapack_int matrix_order = LAPACKE_COLROW; \
0049   char jobvs, sort='N'; \
0050   LAPACK_##LAPACKE_PREFIX_U##_SELECT2 select = 0; \
0051   jobvs = (computeU) ? 'V' : 'N'; \
0052   m_matU.resize(n, n); \
0053   lapack_int ldvs  = internal::convert_index<lapack_int>(m_matU.outerStride()); \
0054   m_matT = matrix; \
0055   lapack_int lda = internal::convert_index<lapack_int>(m_matT.outerStride()); \
0056   Matrix<EIGTYPE, Dynamic, Dynamic> wr, wi; \
0057   wr.resize(n, 1); wi.resize(n, 1); \
0058   info = LAPACKE_##LAPACKE_PREFIX##gees( matrix_order, jobvs, sort, select, n, (LAPACKE_TYPE*)m_matT.data(), lda, &sdim, (LAPACKE_TYPE*)wr.data(), (LAPACKE_TYPE*)wi.data(), (LAPACKE_TYPE*)m_matU.data(), ldvs ); \
0059   if(info == 0) \
0060     m_info = Success; \
0061   else \
0062     m_info = NoConvergence; \
0063 \
0064   m_isInitialized = true; \
0065   m_matUisUptodate = computeU; \
0066   return *this; \
0067 \
0068 }
0069 
0070 EIGEN_LAPACKE_SCHUR_REAL(double,   double, d, D, ColMajor, LAPACK_COL_MAJOR)
0071 EIGEN_LAPACKE_SCHUR_REAL(float,    float,  s, S, ColMajor, LAPACK_COL_MAJOR)
0072 EIGEN_LAPACKE_SCHUR_REAL(double,   double, d, D, RowMajor, LAPACK_ROW_MAJOR)
0073 EIGEN_LAPACKE_SCHUR_REAL(float,    float,  s, S, RowMajor, LAPACK_ROW_MAJOR)
0074 
0075 } // end namespace Eigen
0076 
0077 #endif // EIGEN_REAL_SCHUR_LAPACKE_H