1 /*! 2 * \file include/FSES/syevv3.hxx 3 * \brief 4 * \author Joachim Kopp/Thomas Helfer 5 * \date 02 janv. 2017 6 * \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights 7 * reserved. 8 * This project is publicly released under either the GNU GPL Licence 9 * or the CECILL-A licence. A copy of thoses licences are delivered 10 * with the sources of TFEL. CEA or EDF may also distribute this 11 * project under specific licensing conditions. 12 * 13 * ---------------------------------------------------------------------------- 14 * This file has been introduced in TFEL with the courtesy of Joachim Kopp. 15 * 16 * Original licence 17 * 18 * Numerical diagonalization of 3x3 matrcies 19 * Copyright (C) 2006 Joachim Kopp 20 * 21 * This library is free software; you can redistribute it and/or 22 * modify it under the terms of the GNU Lesser General Public 23 * License as published by the Free Software Foundation; either 24 * version 2.1 of the License, or (at your option) any later version. 25 * 26 * This library is distributed in the hope that it will be useful, 27 * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 29 * Lesser General Public License for more details. 30 * 31 * You should have received a copy of the GNU Lesser General Public 32 * License along with this library; if not, write to the Free Software 33 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 34 */ 35 36 #ifndef LIB_FSES_SYEVV3_HXX 37 #define LIB_FSES_SYEVV3_HXX 38 39 namespace fses { 40 41 // ---------------------------------------------------------------------------- 42 // Calculates the eigenvalues and normalized eigenvectors of a symmetric 3x3 43 // matrix A using Cardano's method for the eigenvalues and an analytical 44 // method based on vector cross products for the eigenvectors. 45 // Only the diagonal and upper triangular parts of A need to contain meaningful 46 // values. However, all of A may be used as temporary storage and may hence be 47 // destroyed. 48 // ---------------------------------------------------------------------------- 49 // Parameters: 50 // Q: Storage buffer for eigenvectors 51 // w: Storage buffer for eigenvalues 52 // A: The symmetric input matrix 53 // ---------------------------------------------------------------------------- 54 // Return value: 55 // 0: Success 56 // -1: Error 57 // ---------------------------------------------------------------------------- 58 // Dependencies: 59 // syevc3() 60 // ---------------------------------------------------------------------------- 61 // Version history: 62 // v1.1 (12 Mar 2012): Removed access to lower triangualr part of A 63 // (according to the documentation, only the upper triangular part needs 64 // to be filled) 65 // v1.0: First released version 66 // ---------------------------------------------------------------------------- 67 template<typename MatrixType, typename VectorType,typename MatrixType2> 68 int syevv3(MatrixType&,VectorType&,MatrixType2&); 69 70 } // end of namespace fses 71 72 #include"FSES/syevv3.ixx" 73 74 #endif /* LIB_FSES_SYEVV3_HXX */ 75