2 x 2 matrix  
 More...
#include <JMatrix2D.hh>
2 x 2 matrix 
Definition at line 32 of file JMath/JMatrix2D.hh.
 
◆ JMatrix2D() [1/2]
  
  
      
        
          | JMATH::JMatrix2D::JMatrix2D  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JMatrix2D() [2/2]
  
  
      
        
          | JMATH::JMatrix2D::JMatrix2D  | 
          ( | 
          const double |           __a00,  | 
         
        
           | 
           | 
          const double |           __a01,  | 
         
        
           | 
           | 
          const double |           __a10,  | 
         
        
           | 
           | 
          const double |           __a11 ) | 
         
       
   | 
  
inline   | 
  
 
Contructor. 
- Parameters
 - 
  
    | __a00 | (0,0)  | 
    | __a01 | (0,1)  | 
    | __a10 | (1,0)  | 
    | __a11 | (1,1)  | 
  
   
Definition at line 58 of file JMath/JMatrix2D.hh.
 
 
◆ getInstance()
  
  
      
        
          | static const JMatrix2D & JMATH::JMatrix2D::getInstance  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get reference to unique instance of this class object. 
- Returns
 - zero matrix 
 
Definition at line 70 of file JMath/JMatrix2D.hh.
   71    {
   73 
   74      return matrix;
   75    }
JMatrix2D()
Default constructor.
 
 
 
 
◆ setIdentity()
  
  
      
        
          | JMatrix2D & JMATH::JMatrix2D::setIdentity  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Set to identity matrix. 
- Returns
 - this matrix 
 
Definition at line 83 of file JMath/JMatrix2D.hh.
   84    {
   87 
   88      return *this;
   89    }
 
 
 
◆ getIdentity()
  
  
      
        
          | static const JMatrix2D & JMATH::JMatrix2D::getIdentity  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get reference to unique instance of this class object. 
- Returns
 - identity matrix 
 
Definition at line 97 of file JMath/JMatrix2D.hh.
   98    {
  100 
  101      return matrix;
  102    }
JMatrix2D & setIdentity()
Set to identity matrix.
 
 
 
 
◆ set()
  
  
      
        
          | void JMATH::JMatrix2D::set  | 
          ( | 
          const JMatrix2D & |           A | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ reset()
Set matrix to the null matrix. 
- Returns
 - this matrix 
 
Definition at line 121 of file JMath/JMatrix2D.hh.
  122    {
  124      
  125      return *this;
  126    }
 
 
 
◆ transpose()
Transpose. 
- Returns
 - this matrix 
 
Definition at line 134 of file JMath/JMatrix2D.hh.
  135    {
  136      using std::swap;
  137 
  139      
  140      return *this;
  141    }
 
 
 
◆ negate()
Negate matrix. 
- Returns
 - -this matrix 
 
Definition at line 149 of file JMath/JMatrix2D.hh.
  150    {
  153 
  154      return *this;
  155    }
 
 
 
◆ add()
Matrix addition. 
- Parameters
 - 
  
  
 
- Returns
 - this matrix + A 
 
Definition at line 164 of file JMath/JMatrix2D.hh.
  165    {
  166      a00 += A.a00;  
a01 += A.a01;
 
  167      a10 += A.a10;  
a11 += A.a11;
 
  168 
  169      return *this;
  170    }
 
 
 
◆ sub()
Matrix subtraction. 
- Parameters
 - 
  
  
 
- Returns
 - this matrix - A 
 
Definition at line 179 of file JMath/JMatrix2D.hh.
  180    {
  181      a00 -= A.a00;  
a01 -= A.a01;
 
  182      a10 -= A.a10;  
a11 -= A.a11;
 
  183 
  184      return *this;
  185    }
 
 
 
◆ mul() [1/3]
  
  
      
        
          | JMatrix2D & JMATH::JMatrix2D::mul  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale matrix. 
- Parameters
 - 
  
  
 
- Returns
 - this matrix * factor 
 
Definition at line 194 of file JMath/JMatrix2D.hh.
  195    {
  196      a00 *= factor; 
a01 *= factor;
 
  197      a10 *= factor; 
a11 *= factor;
 
  198 
  199      return *this;
  200    }
 
 
 
◆ div()
  
  
      
        
          | JMatrix2D & JMATH::JMatrix2D::div  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale matrix. 
- Parameters
 - 
  
  
 
- Returns
 - this matrix / factor 
 
Definition at line 209 of file JMath/JMatrix2D.hh.
  210    {
  211      a00 /= factor; 
a01 /= factor;
 
  212      a10 /= factor; 
a11 /= factor;
 
  213 
  214      return *this;
  215    }
 
 
 
◆ mul() [2/3]
Matrix multiplication. 
- Parameters
 - 
  
  
 
- Returns
 - this matrix 
 
Definition at line 225 of file JMath/JMatrix2D.hh.
  227    {
  228      a00 = A.a00 * B.a00  +  A.a01 * B.a10;
 
  229      a01 = A.a00 * B.a01  +  A.a01 * B.a11;
 
  230      
  231      a10 = A.a10 * B.a00  +  A.a11 * B.a10;
 
  232      a11 = A.a10 * B.a01  +  A.a11 * B.a11;
 
  233      
  234      return *this;
  235    }
 
 
 
◆ equals()
  
  
      
        
          | bool JMATH::JMatrix2D::equals  | 
          ( | 
          const JMatrix2D & |           A,  | 
         
        
           | 
           | 
          const double |           eps = std::numeric_limits<double>::min() ) const | 
         
       
   | 
  
inline   | 
  
 
Equality. 
- Parameters
 - 
  
    | A | matrix  | 
    | eps | numerical precision  | 
  
   
- Returns
 - true if matrices identical; else false 
 
Definition at line 245 of file JMath/JMatrix2D.hh.
  247    {
  248      return (fabs(
a00 - A.a00) <= eps  &&
 
  249              fabs(
a01 - A.a01) <= eps  &&
 
  250              fabs(
a10 - A.a10) <= eps  &&
 
  251              fabs(
a11 - A.a11) <= eps);
 
  252    }
 
 
 
◆ isIdentity()
  
  
      
        
          | bool JMATH::JMatrix2D::isIdentity  | 
          ( | 
          const double |           eps = std::numeric_limits<double>::min() | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test identity. 
- Parameters
 - 
  
  
 
- Returns
 - true if identity matrix; else false 
 
Definition at line 261 of file JMath/JMatrix2D.hh.
  262    {
  264    }
static const JMatrix2D & getIdentity()
Get reference to unique instance of this class object.
 
bool equals(const JMatrix2D &A, const double eps=std::numeric_limits< double >::min()) const
Equality.
 
 
 
 
◆ getDeterminant()
  
  
      
        
          | double JMATH::JMatrix2D::getDeterminant  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get determinant of matrix. 
- Returns
 - determinant of matrix 
 
Definition at line 272 of file JMath/JMatrix2D.hh.
 
 
◆ transform()
  
  
      
        
          | void JMATH::JMatrix2D::transform  | 
          ( | 
          double & |           __x,  | 
         
        
           | 
           | 
          double & |           __y ) const | 
         
       
   | 
  
inline   | 
  
 
Transform. 
- Parameters
 - 
  
  
 
Definition at line 284 of file JMath/JMatrix2D.hh.
  285    {
  286      const double x = 
a00 * __x  +  
a01 * __y;
 
  287      const double y = 
a10 * __x  +  
a11 * __y;
 
  288 
  291    }
 
 
 
◆ mul() [3/3]
Multiply with object. 
- Parameters
 - 
  
  
 
- Returns
 - result object 
 
Definition at line 354 of file JMath.hh.
  355    {
  356      return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
  357    }
 
 
 
◆ operator>>
Read matrix from input. 
- Parameters
 - 
  
  
 
- Returns
 - reader 
 
Definition at line 301 of file JMath/JMatrix2D.hh.
  302    {
  303      in >> matrix.a00;  in >> matrix.a01;
  304      in >> matrix.a10;  in >> matrix.a11;
  305 
  306      return in;
  307    }
 
 
 
◆ operator<< [1/2]
Write matrix to output. 
- Parameters
 - 
  
  
 
- Returns
 - writer 
 
Definition at line 317 of file JMath/JMatrix2D.hh.
  318    {
  319      out << matrix.a00;  out << matrix.a01;
  320      out << matrix.a10;  out << matrix.a11;
  321 
  322      return out;
  323    }
 
 
 
◆ operator<< [2/2]
  
  
      
        
          | std::ostream & operator<<  | 
          ( | 
          std::ostream & |           out,  | 
         
        
           | 
           | 
          const JMatrix2D & |           A ) | 
         
       
   | 
  
friend   | 
  
 
Print ASCII formatted output. 
- Parameters
 - 
  
  
 
- Returns
 - output stream 
 
Definition at line 333 of file JMath/JMatrix2D.hh.
  334    {
  336 
  338 
  339      out << format << A.a00 << ' ' << format << A.a01 << endl;
  340      out << format << A.a10 << ' ' << format << A.a11 << endl;
  341 
  342      return out;
  343    }
JFormat_t & getFormat()
Get format for given type.
 
 
 
 
◆ a00
      
        
          | double JMATH::JMatrix2D::a00 | 
        
      
 
 
◆ a01
      
        
          | double JMATH::JMatrix2D::a01 | 
        
      
 
 
◆ a10
      
        
          | double JMATH::JMatrix2D::a10 | 
        
      
 
 
◆ a11
      
        
          | double JMATH::JMatrix2D::a11 | 
        
      
 
 
The documentation for this class was generated from the following file: