PLaSK library
Loading...
Searching...
No Matches
plask::optical::modal::Matrix< T > Class Template Reference

General simple matrix template. More...

#include <solvers/optical/modal/matrices.hpp>

Collaboration diagram for plask::optical::modal::Matrix< T >:
[legend]

Public Types

typedefDataType
 

Public Member Functions

 Matrix ()
 
 Matrix (size_t m, size_t n)
 
 Matrix (size_t m, size_t n, T val)
 
 Matrix (const Matrix< T > &M)
 
Matrix< T > & operator= (const Matrix< T > &M)
 
 Matrix (const MatrixDiagonal< T > &M)
 
 Matrix (size_t m, size_t n, T *existing_data)
 
 Matrix (size_t m, size_t n, std::initializer_list< T > data)
 
 ~Matrix ()
 
void reset ()
 
void reset (size_t m, size_t n)
 
void reset (size_t m, size_t n, T val)
 
void reset (size_t m, size_t n, T *existing_data)
 
const T * data () const
 
T * data ()
 
const T & operator[] (size_t i) const
 
T & operator[] (size_t i)
 
const T & operator() (size_t m, size_t n) const
 
T & operator() (size_t m, size_t n)
 
size_t rows () const
 
size_t cols () const
 
Matrix< T > copy () const
 
void copyto (Matrix< T > &dst)
 
Matrix< T > & operator*= (T a)
 
Matrix< T > & operator/= (T a)
 
bool isnan () const
 Check if the matrix contains any NaN.
 
bool empty () const
 Check if the matrix has any data.
 
T * begin () const
 
T * end () const
 

Protected Member Functions

void dec_ref ()
 
void inc_ref ()
 

Protected Attributes

size_t r
 
size_t c
 
T * data_
 The data of the matrix.
 
std::atomic< int > * gc
 the reference count for the garbage collector
 

Detailed Description

template<typename T>
class plask::optical::modal::Matrix< T >

General simple matrix template.

Definition at line 32 of file matrices.hpp.

Member Typedef Documentation

◆ DataType

template<typename T >
typedef T plask::optical::modal::Matrix< T >::DataType

Definition at line 54 of file matrices.hpp.

Constructor & Destructor Documentation

◆ Matrix() [1/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( )
inline

Definition at line 56 of file matrices.hpp.

◆ Matrix() [2/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( size_t  m,
size_t  n 
)
inline

Definition at line 58 of file matrices.hpp.

◆ Matrix() [3/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( size_t  m,
size_t  n,
val 
)
inline

Definition at line 63 of file matrices.hpp.

◆ Matrix() [4/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( const Matrix< T > &  M)
inline

Definition at line 69 of file matrices.hpp.

◆ Matrix() [5/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( const MatrixDiagonal< T > &  M)
inline

Definition at line 80 of file matrices.hpp.

◆ Matrix() [6/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( size_t  m,
size_t  n,
T *  existing_data 
)
inline

Definition at line 87 of file matrices.hpp.

◆ Matrix() [7/7]

template<typename T >
plask::optical::modal::Matrix< T >::Matrix ( size_t  m,
size_t  n,
std::initializer_list< T >  data 
)
inline

Definition at line 91 of file matrices.hpp.

◆ ~Matrix()

template<typename T >
plask::optical::modal::Matrix< T >::~Matrix ( )
inline

Definition at line 96 of file matrices.hpp.

Member Function Documentation

◆ begin()

template<typename T >
T * plask::optical::modal::Matrix< T >::begin ( ) const
inline

Definition at line 191 of file matrices.hpp.

◆ cols()

template<typename T >
size_t plask::optical::modal::Matrix< T >::cols ( ) const
inline

Definition at line 155 of file matrices.hpp.

◆ copy()

template<typename T >
Matrix< T > plask::optical::modal::Matrix< T >::copy ( ) const
inline

Definition at line 157 of file matrices.hpp.

◆ copyto()

template<typename T >
void plask::optical::modal::Matrix< T >::copyto ( Matrix< T > &  dst)
inline

Definition at line 163 of file matrices.hpp.

◆ data() [1/2]

template<typename T >
T * plask::optical::modal::Matrix< T >::data ( )
inline

Definition at line 132 of file matrices.hpp.

◆ data() [2/2]

template<typename T >
const T * plask::optical::modal::Matrix< T >::data ( ) const
inline

Definition at line 131 of file matrices.hpp.

◆ dec_ref()

template<typename T >
void plask::optical::modal::Matrix< T >::dec_ref ( )
inlineprotected

Definition at line 39 of file matrices.hpp.

◆ empty()

template<typename T >
bool plask::optical::modal::Matrix< T >::empty ( ) const
inline

Check if the matrix has any data.

Definition at line 187 of file matrices.hpp.

◆ end()

template<typename T >
T * plask::optical::modal::Matrix< T >::end ( ) const
inline

Definition at line 195 of file matrices.hpp.

◆ inc_ref()

template<typename T >
void plask::optical::modal::Matrix< T >::inc_ref ( )
inlineprotected

Definition at line 48 of file matrices.hpp.

◆ isnan()

template<typename T >
bool plask::optical::modal::Matrix< T >::isnan ( ) const
inline

Check if the matrix contains any NaN.

Definition at line 179 of file matrices.hpp.

◆ operator()() [1/2]

template<typename T >
T & plask::optical::modal::Matrix< T >::operator() ( size_t  m,
size_t  n 
)
inline

Definition at line 148 of file matrices.hpp.

◆ operator()() [2/2]

template<typename T >
const T & plask::optical::modal::Matrix< T >::operator() ( size_t  m,
size_t  n 
) const
inline

Definition at line 143 of file matrices.hpp.

◆ operator*=()

template<typename T >
Matrix< T > & plask::optical::modal::Matrix< T >::operator*= ( a)
inline

Definition at line 169 of file matrices.hpp.

◆ operator/=()

template<typename T >
Matrix< T > & plask::optical::modal::Matrix< T >::operator/= ( a)
inline

Definition at line 173 of file matrices.hpp.

◆ operator=()

template<typename T >
Matrix< T > & plask::optical::modal::Matrix< T >::operator= ( const Matrix< T > &  M)
inline

Definition at line 73 of file matrices.hpp.

◆ operator[]() [1/2]

template<typename T >
T & plask::optical::modal::Matrix< T >::operator[] ( size_t  i)
inline

Definition at line 138 of file matrices.hpp.

◆ operator[]() [2/2]

template<typename T >
const T & plask::optical::modal::Matrix< T >::operator[] ( size_t  i) const
inline

Definition at line 134 of file matrices.hpp.

◆ reset() [1/4]

template<typename T >
void plask::optical::modal::Matrix< T >::reset ( )
inline

Definition at line 100 of file matrices.hpp.

◆ reset() [2/4]

template<typename T >
void plask::optical::modal::Matrix< T >::reset ( size_t  m,
size_t  n 
)
inline

Definition at line 107 of file matrices.hpp.

◆ reset() [3/4]

template<typename T >
void plask::optical::modal::Matrix< T >::reset ( size_t  m,
size_t  n,
T *  existing_data 
)
inline

Definition at line 124 of file matrices.hpp.

◆ reset() [4/4]

template<typename T >
void plask::optical::modal::Matrix< T >::reset ( size_t  m,
size_t  n,
val 
)
inline

Definition at line 115 of file matrices.hpp.

◆ rows()

template<typename T >
size_t plask::optical::modal::Matrix< T >::rows ( ) const
inline

Definition at line 154 of file matrices.hpp.

Member Data Documentation

◆ c

template<typename T >
size_t plask::optical::modal::Matrix< T >::c
protected

Definition at line 34 of file matrices.hpp.

◆ data_

template<typename T >
T* plask::optical::modal::Matrix< T >::data_
protected

The data of the matrix.

Definition at line 36 of file matrices.hpp.

◆ gc

template<typename T >
std::atomic<int>* plask::optical::modal::Matrix< T >::gc
protected

the reference count for the garbage collector

Definition at line 37 of file matrices.hpp.

◆ r

template<typename T >
size_t plask::optical::modal::Matrix< T >::r
protected

Definition at line 34 of file matrices.hpp.


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