Basic NxN matrix.  
 More...
#include <JMatrixND.hh>
Basic NxN matrix. 
Definition at line 38 of file JMatrixND.hh.
 
  
  
      
        
          | JMATH::JMatrixND_t::JMatrixND_t  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
Definition at line 44 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
size_t __m
capacity of matrix 
 
 
 
 
  
  
      
        
          | JMATH::JMatrixND_t::JMatrixND_t  | 
          ( | 
          const JMatrixND_t &  | 
          A | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Copy constructor. 
- Parameters
 - 
  
  
 
Definition at line 56 of file JMatrixND.hh.
void set(const JMatrixND_t &A)
Set matrix. 
 
JMatrixND_t()
Default constructor. 
 
 
 
 
Move constructor. 
- Parameters
 - 
  
  
 
Definition at line 68 of file JMatrixND.hh.
JMatrixND_t()
Default constructor. 
 
void swap(JMatrixND_t &A)
Swap matrices. 
 
 
 
 
  
  
      
        
          | JMATH::JMatrixND_t::~JMatrixND_t  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Destructor. 
Definition at line 78 of file JMatrixND.hh.
void clear()
Clear memory. 
 
 
 
 
  
  
      
        
          | void JMATH::JMatrixND_t::clear  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Clear memory. 
Definition at line 87 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
size_t __m
capacity of matrix 
 
 
 
 
  
  
      
        
          | void JMATH::JMatrixND_t::resize  | 
          ( | 
          const size_t  | 
          size | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Resize matrix. 
Note that this method does not maintain data in the matrix.
- Parameters
 - 
  
  
 
Definition at line 106 of file JMatrixND.hh.
  120             THROW(JNewException, 
"JMatrixND::resize(" << 
size << 
"): Memory allocation failure.");
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
size_t size() const 
Get dimension of matrix. 
 
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
size_t __m
capacity of matrix 
 
 
 
 
Set matrix. 
- Parameters
 - 
  
  
 
Definition at line 134 of file JMatrixND.hh.
size_t size() const 
Get dimension of matrix. 
 
void resize(const size_t size)
Resize matrix. 
 
const double * data() const 
Get pointer to data. 
 
 
 
 
Swap matrices. 
- Parameters
 - 
  
  
 
Definition at line 147 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
void swap(JMatrixND_t &A)
Swap matrices. 
 
size_t __m
capacity of matrix 
 
 
 
 
Transpose. 
- Returns
 - this matrix 
 
Definition at line 162 of file JMatrixND.hh.
  166       for (
size_t row = 0; row != this->
size(); ++row) {
 
  167         for (
size_t col = 0; col != row; ++col) {
 
  168           swap((*
this)(row,col), (*
this)(col,row));
 
size_t size() const 
Get dimension of matrix. 
 
void swap(JMatrixND_t &A)
Swap matrices. 
 
 
 
 
  
  
      
        
          | size_t JMATH::JMatrixND_t::size  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get dimension of matrix. 
- Returns
 - dimension 
 
Definition at line 181 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
 
 
 
  
  
      
        
          | size_t JMATH::JMatrixND_t::capacity  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get capacity of dimension. 
- Returns
 - capacity 
 
Definition at line 192 of file JMatrixND.hh.
size_t __m
capacity of matrix 
 
 
 
 
  
  
      
        
          | bool JMATH::JMatrixND_t::empty  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Check emptyness. 
- Returns
 - true if empty; else false 
 
Definition at line 203 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
 
 
 
  
  
      
        
          | const double* JMATH::JMatrixND_t::data  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get pointer to data. 
- Returns
 - pointer to data. 
 
Definition at line 214 of file JMatrixND.hh.
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | double* JMATH::JMatrixND_t::data  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get pointer to data. 
- Returns
 - pointer to data. 
 
Definition at line 225 of file JMatrixND.hh.
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | const double* JMATH::JMatrixND_t::operator[]  | 
          ( | 
          size_t  | 
          row | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get row data. 
- Parameters
 - 
  
  
 
- Returns
 - pointer to row data 
 
Definition at line 237 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | double* JMATH::JMatrixND_t::operator[]  | 
          ( | 
          size_t  | 
          row | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get row data. 
- Parameters
 - 
  
  
 
- Returns
 - pointer to row data 
 
Definition at line 249 of file JMatrixND.hh.
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | double JMATH::JMatrixND_t::operator()  | 
          ( | 
          const size_t  | 
          row,  | 
         
        
           | 
           | 
          const size_t  | 
          col  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inline   | 
  
 
Get matrix element. 
- Parameters
 - 
  
    | row | row number  | 
    | col | column number  | 
  
   
- Returns
 - matrix element at (row,col) 
 
Definition at line 262 of file JMatrixND.hh.
  264       return *(
__p + row*
__n + col);
 
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | double& JMATH::JMatrixND_t::operator()  | 
          ( | 
          const size_t  | 
          row,  | 
         
        
           | 
           | 
          const size_t  | 
          col  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Get matrix element. 
- Parameters
 - 
  
    | row | row number  | 
    | col | column number  | 
  
   
- Returns
 - matrix element at (row,col) 
 
Definition at line 275 of file JMatrixND.hh.
  277       return *(
__p + row*
__n + col);
 
size_t __n
dimension of matrix 
 
double * __p
pointer to data 
 
 
 
 
  
  
      
        
          | double JMATH::JMatrixND_t::at  | 
          ( | 
          size_t  | 
          row,  | 
         
        
           | 
           | 
          size_t  | 
          col  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inline   | 
  
 
Get matrix element. 
- Parameters
 - 
  
    | row | row number  | 
    | col | column number  | 
  
   
- Returns
 - matrix element at (row,col) 
 
Definition at line 288 of file JMatrixND.hh.
  290       if (row >= this->
size() ||
 
  291           col >= this->
size()) {
 
  292         THROW(JIndexOutOfRange, 
"JMatrixND::at(" << row << 
"," << col << 
"): index out of range.");
 
  295       return (*
this)(row, col);
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
size_t size() const 
Get dimension of matrix. 
 
 
 
 
  
  
      
        
          | double& JMATH::JMatrixND_t::at  | 
          ( | 
          size_t  | 
          row,  | 
         
        
           | 
           | 
          size_t  | 
          col  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
Get matrix element. 
- Parameters
 - 
  
    | row | row number  | 
    | col | column number  | 
  
   
- Returns
 - matrix element at (row,col) 
 
Definition at line 306 of file JMatrixND.hh.
  308       if (row >= this->
size() ||
 
  309           col >= this->
size()) {
 
  310         THROW(JIndexOutOfRange, 
"JMatrixND::at(" << row << 
"," << col << 
"): index out of range.");
 
  313       return (*
this)(row, col);
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
size_t size() const 
Get dimension of matrix. 
 
 
 
 
Get unique instance of template class. 
- Returns
 - object 
 
Definition at line 27 of file JSingleton.hh.
 
 
  
  
      
        
          | double* JMATH::JMatrixND_t::__p | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | size_t JMATH::JMatrixND_t::__n | 
         
       
   | 
  
protected   | 
  
 
 
  
  
      
        
          | size_t JMATH::JMatrixND_t::__m | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this struct was generated from the following file: