Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMatrix1S.hh
Go to the documentation of this file.
1 #ifndef __JMATRIX1S__
2 #define __JMATRIX1S__
3 
4 #include <cmath>
5 #include <algorithm>
6 
7 #include "JMath/JMatrix1D.hh"
8 #include "JLang/JException.hh"
9 
10 
11 /**
12  * \author mdejong
13  */
14 
15 namespace JMATH {}
16 namespace JPP { using namespace JMATH; }
17 
18 namespace JMATH {
19 
21 
22 
23  /**
24  * 1 x 1 symmetric matrix
25  */
26  class JMatrix1S :
27  public JMatrix1D
28  {
29  public:
30  /**
31  * Default constructor.
32  */
34  JMatrix1D()
35  {}
36 
37 
38  /**
39  * Contructor.
40  *
41  * \param A matrix
42  */
43  JMatrix1S(const JMatrix1D& A) :
44  JMatrix1D(A)
45  {}
46 
47 
48  /**
49  * Contructor.
50  *
51  * \param __a00 (0,0)
52  */
53  JMatrix1S(const double __a00) :
54  JMatrix1D(__a00)
55  {}
56 
57 
58  /**
59  * Invert matrix
60  */
61  void invert()
62  {
63  if (a00 == 0) {
64  throw JDivisionByZero("LDU decomposition zero pivot");
65  }
66 
67  a00 = 1.0 / a00;
68  }
69  };
70 }
71 
72 #endif
JMatrix1S()
Default constructor.
Definition: JMatrix1S.hh:33
Exceptions.
JMatrix1S(const JMatrix1D &A)
Contructor.
Definition: JMatrix1S.hh:43
JMatrix1S(const double __a00)
Contructor.
Definition: JMatrix1S.hh:53
1 x 1 matrix
Definition: JMatrix1D.hh:32
Exception for division by zero.
Definition: JException.hh:270
void invert()
Invert matrix.
Definition: JMatrix1S.hh:61
1 x 1 symmetric matrix
Definition: JMatrix1S.hh:26
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A