Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
JMATH::JMatrix1S Class Reference

1 x 1 symmetric matrix More...

#include <JMatrix1S.hh>

Inheritance diagram for JMATH::JMatrix1S:
JMATH::JMatrix1D JMATH::JMath< JMatrix1D > JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JMatrix1S ()
 Default constructor. More...
 
 JMatrix1S (const JMatrix1D &A)
 Contructor. More...
 
 JMatrix1S (const double __a00)
 Contructor. More...
 
void invert ()
 Invert matrix. More...
 
JMatrix1DsetIdentity ()
 Set to identity matrix. More...
 
void set (const JMatrix1D &A)
 Set matrix. More...
 
JMatrix1Dreset ()
 Set matrix to the null matrix. More...
 
JMatrix1Dtranspose ()
 Transpose. More...
 
JMatrix1Dnegate ()
 Negate matrix. More...
 
JMatrix1Dadd (const JMatrix1D &A)
 Matrix addition. More...
 
JMatrix1Dsub (const JMatrix1D &A)
 Matrix subtraction. More...
 
JMatrix1Dmul (const double factor)
 Scale matrix. More...
 
JMatrix1Dmul (const JMatrix1D &A, const JMatrix1D &B)
 Matrix multiplication. More...
 
JMatrix1Dmul (const JNullType &object)
 Multiply with object. More...
 
JMatrix1Ddiv (const double factor)
 Scale matrix. More...
 
bool equals (const JMatrix1D &A, const double eps=std::numeric_limits< double >::min()) const
 Equality. More...
 
bool isIdentity (const double eps=std::numeric_limits< double >::min()) const
 Test identity. More...
 
double getDeterminant () const
 Get determinant of matrix. More...
 
void transform (double &__x) const
 Transform. More...
 

Static Public Member Functions

static const JMatrix1DgetInstance ()
 Get reference to unique instance of this class object. More...
 
static const JMatrix1DgetIdentity ()
 Get reference to unique instance of this class object. More...
 

Public Attributes

double a00
 

Detailed Description

1 x 1 symmetric matrix

Definition at line 26 of file JMatrix1S.hh.

Constructor & Destructor Documentation

JMATH::JMatrix1S::JMatrix1S ( )
inline

Default constructor.

Definition at line 33 of file JMatrix1S.hh.

33  :
34  JMatrix1D()
35  {}
JMatrix1D()
Default constructor.
Definition: JMatrix1D.hh:44
JMATH::JMatrix1S::JMatrix1S ( const JMatrix1D A)
inline

Contructor.

Parameters
Amatrix

Definition at line 43 of file JMatrix1S.hh.

43  :
44  JMatrix1D(A)
45  {}
JMatrix1D()
Default constructor.
Definition: JMatrix1D.hh:44
JMATH::JMatrix1S::JMatrix1S ( const double  __a00)
inline

Contructor.

Parameters
__a00(0,0)

Definition at line 53 of file JMatrix1S.hh.

53  :
54  JMatrix1D(__a00)
55  {}
JMatrix1D()
Default constructor.
Definition: JMatrix1D.hh:44

Member Function Documentation

void JMATH::JMatrix1S::invert ( )
inline

Invert matrix.

Definition at line 61 of file JMatrix1S.hh.

62  {
63  if (a00 == 0) {
64  throw JDivisionByZero("LDU decomposition zero pivot");
65  }
66 
67  a00 = 1.0 / a00;
68  }
static const JMatrix1D& JMATH::JMatrix1D::getInstance ( )
inlinestaticinherited

Get reference to unique instance of this class object.

Returns
zero matrix

Definition at line 64 of file JMatrix1D.hh.

65  {
66  static JMatrix1D matrix;
67 
68  return matrix;
69  }
1 x 1 matrix
Definition: JMatrix1D.hh:32
JMatrix1D& JMATH::JMatrix1D::setIdentity ( )
inlineinherited

Set to identity matrix.

Returns
this matrix

Definition at line 77 of file JMatrix1D.hh.

78  {
79  a00 = 1.0;
80 
81  return *this;
82  }
static const JMatrix1D& JMATH::JMatrix1D::getIdentity ( )
inlinestaticinherited

Get reference to unique instance of this class object.

Returns
identity matrix

Definition at line 90 of file JMatrix1D.hh.

91  {
92  static JMatrix1D matrix(JMatrix1D().setIdentity());
93 
94  return matrix;
95  }
JMatrix1D()
Default constructor.
Definition: JMatrix1D.hh:44
1 x 1 matrix
Definition: JMatrix1D.hh:32
JMatrix1D & setIdentity()
Set to identity matrix.
Definition: JMatrix1D.hh:77
void JMATH::JMatrix1D::set ( const JMatrix1D A)
inlineinherited

Set matrix.

Parameters
Amatrix

Definition at line 103 of file JMatrix1D.hh.

104  {
105  static_cast<JMatrix1D&>(*this) = A;
106  }
1 x 1 matrix
Definition: JMatrix1D.hh:32
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
JMatrix1D& JMATH::JMatrix1D::reset ( )
inlineinherited

Set matrix to the null matrix.

Returns
this matrix

Definition at line 114 of file JMatrix1D.hh.

115  {
116  *this = JMatrix1D();
117 
118  return *this;
119  }
JMatrix1D()
Default constructor.
Definition: JMatrix1D.hh:44
JMatrix1D& JMATH::JMatrix1D::transpose ( )
inlineinherited

Transpose.

Returns
this matrix

Definition at line 127 of file JMatrix1D.hh.

128  {
129  return *this;
130  }
JMatrix1D& JMATH::JMatrix1D::negate ( )
inlineinherited

Negate matrix.

Returns
-this matrix

Definition at line 138 of file JMatrix1D.hh.

139  {
140  a00 = -a00;
141 
142  return *this;
143  }
JMatrix1D& JMATH::JMatrix1D::add ( const JMatrix1D A)
inlineinherited

Matrix addition.

Parameters
Amatrix
Returns
this matrix + A

Definition at line 152 of file JMatrix1D.hh.

153  {
154  a00 += A.a00;
155 
156  return *this;
157  }
JMatrix1D& JMATH::JMatrix1D::sub ( const JMatrix1D A)
inlineinherited

Matrix subtraction.

Parameters
Amatrix
Returns
this matrix - A

Definition at line 166 of file JMatrix1D.hh.

167  {
168  a00 -= A.a00;
169 
170  return *this;
171  }
JMatrix1D& JMATH::JMatrix1D::mul ( const double  factor)
inlineinherited

Scale matrix.

Parameters
factorfactor
Returns
this matrix * factor

Definition at line 180 of file JMatrix1D.hh.

181  {
182  a00 *= factor;
183 
184  return *this;
185  }
JMatrix1D& JMATH::JMatrix1D::mul ( const JMatrix1D A,
const JMatrix1D B 
)
inlineinherited

Matrix multiplication.

Parameters
Amatrix
Bmatrix
Returns
this matrix

Definition at line 209 of file JMatrix1D.hh.

211  {
212  a00 = A.a00 * B.a00;
213 
214  return *this;
215  }
JMatrix1D & JMATH::JMath< JMatrix1D , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JMatrix1D& JMATH::JMatrix1D::div ( const double  factor)
inlineinherited

Scale matrix.

Parameters
factorfactor
Returns
this matrix / factor

Definition at line 194 of file JMatrix1D.hh.

195  {
196  a00 /= factor;
197 
198  return *this;
199  }
bool JMATH::JMatrix1D::equals ( const JMatrix1D A,
const double  eps = std::numeric_limits<double>::min() 
) const
inlineinherited

Equality.

Parameters
Amatrix
epsnumerical precision
Returns
true if matrices identical; else false

Definition at line 225 of file JMatrix1D.hh.

227  {
228  return (fabs(a00 - A.a00) <= eps);
229  }
bool JMATH::JMatrix1D::isIdentity ( const double  eps = std::numeric_limits<double>::min()) const
inlineinherited

Test identity.

Parameters
epsnumerical precision
Returns
true if identity matrix; else false

Definition at line 238 of file JMatrix1D.hh.

239  {
240  return equals(getIdentity(), eps);
241  }
static const JMatrix1D & getIdentity()
Get reference to unique instance of this class object.
Definition: JMatrix1D.hh:90
bool equals(const JMatrix1D &A, const double eps=std::numeric_limits< double >::min()) const
Equality.
Definition: JMatrix1D.hh:225
double JMATH::JMatrix1D::getDeterminant ( ) const
inlineinherited

Get determinant of matrix.

Returns
determinant of matrix

Definition at line 249 of file JMatrix1D.hh.

250  {
251  return a00;
252  }
void JMATH::JMatrix1D::transform ( double &  __x) const
inlineinherited

Transform.

Parameters
__xx value

Definition at line 260 of file JMatrix1D.hh.

261  {
262  __x = a00 * __x;
263  }

Member Data Documentation

double JMATH::JMatrix1D::a00
inherited

Definition at line 315 of file JMatrix1D.hh.


The documentation for this class was generated from the following file: