b311480e |
1 | // Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
0797d9d3 |
15 | //#ifndef OCCT_DEBUG |
7fd59977 |
16 | #define No_Standard_RangeError |
17 | #define No_Standard_OutOfRange |
18 | #define No_Standard_DimensionError |
19 | //#endif |
20 | |
21 | #include <math_Jacobi.ixx> |
22 | |
23 | #include <math_Recipes.hxx> |
24 | #include <math_NotSquare.hxx> |
25 | |
b311480e |
26 | math_Jacobi::math_Jacobi(const math_Matrix& A) : AA(1, A.RowNumber(), |
7fd59977 |
27 | 1, A.RowNumber()), |
28 | EigenValues(1, A.RowNumber()), |
29 | EigenVectors(1, A.RowNumber(), |
30 | 1, A.RowNumber()) { |
31 | |
32 | math_NotSquare_Raise_if(A.RowNumber() != A.ColNumber(), " "); |
33 | |
34 | AA = A; |
35 | Standard_Integer Error = Jacobi(AA, EigenValues, EigenVectors, NbRotations); |
36 | if(!Error) { |
37 | Done = Standard_True; |
38 | } |
39 | else { |
40 | Done = Standard_False; |
41 | } |
42 | } |
43 | |
44 | void math_Jacobi::Dump(Standard_OStream& o) const { |
45 | |
46 | o <<"math_Jacobi "; |
47 | if (Done) { |
48 | o << " Status = Done \n"; |
49 | o << " The eigenvalues vector is: " << EigenValues << endl; |
50 | } |
51 | else { |
52 | o << "Status = not Done \n"; |
53 | } |
54 | } |
55 | |
56 | |
57 | |