| 1 |
/****************************************************************************** |
| 2 |
|
| 3 |
This source file is part of the Avogadro project. |
| 4 |
|
| 5 |
Copyright (C) 2010 Eric C. Brown |
| 6 |
|
| 7 |
This source code is released under the New BSD License, (the "License"). |
| 8 |
|
| 9 |
Unless required by applicable law or agreed to in writing, software |
| 10 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
See the License for the specific language governing permissions and |
| 13 |
limitations under the License. |
| 14 |
|
| 15 |
******************************************************************************/ |
| 16 |
|
| 17 |
#ifndef QTAIMMATHUTILITIES_H |
| 18 |
#define QTAIMMATHUTILITIES_H |
| 19 |
|
| 20 |
#include <QtGlobal> |
| 21 |
|
| 22 |
#include <Eigen/Core> |
| 23 |
|
| 24 |
using namespace Eigen; |
| 25 |
|
| 26 |
namespace Avogadro::QtPlugins::QTAIMMathUtilities { |
| 27 |
|
| 28 |
Matrix<qreal, 3, 1> eigenvaluesOfASymmetricThreeByThreeMatrix( |
| 29 |
const Matrix<qreal, 3, 3>& A); |
| 30 |
Matrix<qreal, 3, 3> eigenvectorsOfASymmetricThreeByThreeMatrix( |
| 31 |
const Matrix<qreal, 3, 3>& A); |
| 32 |
Matrix<qreal, 4, 1> eigenvaluesOfASymmetricFourByFourMatrix( |
| 33 |
const Matrix<qreal, 4, 4>& A); |
| 34 |
Matrix<qreal, 4, 4> eigenvectorsOfASymmetricFourByFourMatrix( |
| 35 |
const Matrix<qreal, 4, 4>& A); |
| 36 |
|
| 37 |
qint64 signOfARealNumber(qreal x); |
| 38 |
qint64 signatureOfASymmetricThreeByThreeMatrix(const Matrix<qreal, 3, 3>& A); |
| 39 |
qreal ellipticityOfASymmetricThreeByThreeMatrix(const Matrix<qreal, 3, 3>& A); |
| 40 |
|
| 41 |
qreal distance(const Matrix<qreal, 3, 1>& a, const Matrix<qreal, 3, 1>& b); |
| 42 |
|
| 43 |
Matrix<qreal, 3, 1> sphericalToCartesian(const Matrix<qreal, 3, 1>& rtp, |
| 44 |
const Matrix<qreal, 3, 1>& x0y0z0); |
| 45 |
Matrix<qreal, 3, 1> sphericalToCartesian(const Matrix<qreal, 3, 1>& rtp); |
| 46 |
|
| 47 |
Matrix<qreal, 3, 1> cartesianToSpherical(const Matrix<qreal, 3, 1>& xyz, |
| 48 |
const Matrix<qreal, 3, 1>& x0y0z0); |
| 49 |
Matrix<qreal, 3, 1> cartesianToSpherical(const Matrix<qreal, 3, 1>& xyz); |
| 50 |
|
| 51 |
// Cerjan-Miller-Baker-Popelier Methods |
| 52 |
|
| 53 |
// A small number to prevent divide by zero in CMBP routines |
| 54 |
#define SMALL 1.e-10 |
| 55 |
|
| 56 |
Matrix<qreal, 3, 1> minusThreeSignatureLocatorGradient( |
| 57 |
const Matrix<qreal, 3, 1>& g, const Matrix<qreal, 3, 3>& H); |
| 58 |
Matrix<qreal, 3, 1> minusOneSignatureLocatorGradient( |
| 59 |
const Matrix<qreal, 3, 1>& g, const Matrix<qreal, 3, 3>& H); |
| 60 |
Matrix<qreal, 3, 1> plusOneSignatureLocatorGradient( |
| 61 |
const Matrix<qreal, 3, 1>& g, const Matrix<qreal, 3, 3>& H); |
| 62 |
Matrix<qreal, 3, 1> plusThreeSignatureLocatorGradient( |
| 63 |
const Matrix<qreal, 3, 1>& g, const Matrix<qreal, 3, 3>& H); |
| 64 |
|
| 65 |
} // namespace Avogadro::QtPlugins::QTAIMMathUtilities |
| 66 |
|
| 67 |
#endif // QTAIMMATHUTILITIES_H |