#include <iostream>
#include <fstream>
#include <math.h>
#include <complex>
#include <sstream>
#include <string>
#include <vector>
#include <limits>
#include <ctime>
#include <tbci/matrix.h>
#include <tbci/vector.h>
Go to the source code of this file.
Classes | |
struct | cmplx |
Functions | |
template<typename T> | |
std::string | to_str (T t) |
template<typename T> | |
string | to_str (T *V, int dim1) |
template<typename T> | |
string | to_str (T **M, int dim1, int dim2=-1) |
template<typename T> | |
T | str2number (std::string s) |
std::vector< string > | strsplit (string str, string delim=" ") |
std::vector< string > | readFile (string filename) |
int | delta (int i, int j) |
string | timestamp (void) |
template<typename T> | |
TBCI::Matrix< T > | readMatrix (string filename) |
template<typename T> | |
TBCI::Vector< T > | readVector (string filename) |
template<typename T> | |
T | min (TBCI::Matrix< T > M) |
returns the minimum value of a matrix | |
template<typename T> | |
T | max (TBCI::Matrix< T > M) |
returns the maximum value of a matrix | |
template<typename T> | |
TBCI::Matrix< T > | invert (TBCI::Matrix< T > M) |
returns the inverse of the input matrix | |
template<typename T> | |
TBCI::Matrix< T > | multFrontBack (TBCI::Matrix< T > M, TBCI::Vector< T > v) |
returns a matrix with R(i,j)=M(i,j)*v(i)*v(j) | |
template<typename T> | |
TBCI::Matrix< T > | multFront (TBCI::Matrix< T > M, TBCI::Vector< T > v) |
returns Matrix with R(i,j)=M(i,j)*v(i) | |
template<typename T> | |
TBCI::Matrix< T > | real (TBCI::Matrix< complex< T > > M) |
template<typename T> | |
TBCI::Matrix< T > | imag (TBCI::Matrix< complex< T > > M) |
template<typename T> | |
TBCI::Matrix< T > | arg (TBCI::Matrix< complex< T > > M) |
template<typename T> | |
TBCI::Matrix< T > | abs (TBCI::Matrix< complex< T > > M) |
template<typename T> | |
TBCI::Matrix< T > | norm (TBCI::Matrix< complex< T > > M) |
template<typename T> | |
T ** | Allocate2DArray (int nRows, int nCols) |
template<typename T> | |
void | Free2DArray (T **Array, int nRows) |
template<typename T> | |
T *** | Allocate3DArray (int n1, int n2, int n3) |
template<typename T> | |
void | Free3DArray (T ***Array) |
void | zgetri_ (int *, cmplx *, int *, int *, cmplx *, int *, int *) |
void | zgetrf_ (int *, int *, cmplx *, int *, int *, int *) |
template<typename T> | |
void | inv_c (T **lhsMat, T **inv, int dim) |
Variables | |
const complex< double > | I = complex<double>(0,1.) |
TBCI::Matrix<T> abs | ( | TBCI::Matrix< complex< T > > | M | ) | [inline] |
Definition at line 324 of file tools.h.
Referenced by Grating2D::calcEfficiencyR(), Grating2D::calcEfficiencyT(), Grating1D::calcIncid(), and Grating1D::calcIntField().
T** Allocate2DArray | ( | int | nRows, | |
int | nCols | |||
) | [inline] |
T*** Allocate3DArray | ( | int | n1, | |
int | n2, | |||
int | n3 | |||
) | [inline] |
TBCI::Matrix<T> arg | ( | TBCI::Matrix< complex< T > > | M | ) | [inline] |
void Free2DArray | ( | T ** | Array, | |
int | nRows | |||
) | [inline] |
void Free3DArray | ( | T *** | Array | ) | [inline] |
TBCI::Matrix<T> imag | ( | TBCI::Matrix< complex< T > > | M | ) | [inline] |
Definition at line 296 of file tools.h.
Referenced by Grating2D::calcAlphaBetaGamma(), Grating1D::calcTransEmb(), Grating1D::findEfficiencyS(), Grating1D::findEfficiencyT(), inv_c(), Grating1D::setLhsMatTE(), Grating1D::setLhsMatTM(), GratingLayer2D::solveEigMat(), GratingLayer1D::solveEigMat(), Grating1D::solveEquations(), GratingLayer2D::solveHomogeneous(), and Grating2D::writeParameters().
void inv_c | ( | T ** | lhsMat, | |
T ** | inv, | |||
int | dim | |||
) | [inline] |
TBCI::Matrix< T > invert | ( | TBCI::Matrix< T > | M | ) | [inline] |
returns the inverse of the input matrix
The plan is to choose the best/fastest method (lu_decomp sometimes does not work). Hopefully it is possible to implement the errorhandler to use gaussj a fallback method if lu_decomp falls over.
Definition at line 235 of file tools.h.
Referenced by Grating2D::calcBoundaryW(), GratingLayer2D::calcBTEpsilon(), GratingLayer2D::calcEpsilon(), GratingLayer2D::calcTBEpsilon(), Grating2D::setSMatrix(), GratingLayer2D::solveEigMat(), and GratingLayer2D::solveHomogeneous().
T max | ( | TBCI::Matrix< T > | M | ) | [inline] |
T min | ( | TBCI::Matrix< T > | M | ) | [inline] |
returns the minimum value of a matrix
Definition at line 201 of file tools.h.
References max().
Referenced by max(), and timestamp().
TBCI::Matrix< T > multFront | ( | TBCI::Matrix< T > | M, | |
TBCI::Vector< T > | v | |||
) | [inline] |
returns Matrix with R(i,j)=M(i,j)*v(i)
Definition at line 265 of file tools.h.
Referenced by Grating2D::setSMatrix().
TBCI::Matrix< T > multFrontBack | ( | TBCI::Matrix< T > | M, | |
TBCI::Vector< T > | v | |||
) | [inline] |
returns a matrix with R(i,j)=M(i,j)*v(i)*v(j)
M | input matrix | |
v | diagonal of the Matrix to be multiplied on both sides of M a matrix with elements M(i,j)*v(i)*v(j) ! |
Definition at line 251 of file tools.h.
Referenced by Grating2D::setSMatrix().
TBCI::Matrix<T> norm | ( | TBCI::Matrix< complex< T > > | M | ) | [inline] |
Definition at line 338 of file tools.h.
Referenced by Grating2D::calcEfficiencyR(), Grating2D::calcEfficiencyT(), Grating1D::calcEmbField(), Grating1D::calcExtField(), GratingLayer1D::calcSMatrix(), GratingLayer1D::createEigMat(), Grating1D::findEfficiencyS(), Grating1D::findEfficiencyT(), Grating2D::setIncid(), and Grating2D::writeField().
std::vector<string> readFile | ( | string | filename | ) | [inline] |
TBCI::Matrix< T > readMatrix | ( | string | filename | ) | [inline] |
TBCI::Vector< T > readVector | ( | string | filename | ) | [inline] |
TBCI::Matrix<T> real | ( | TBCI::Matrix< complex< T > > | M | ) | [inline] |
Definition at line 282 of file tools.h.
Referenced by Grating2D::calcAlphaBetaGamma(), Grating1D::calcTransEmb(), Grating1D::findEfficiencyS(), Grating1D::findEfficiencyT(), Grating1D::importMaterials(), inv_c(), GratingLayer2D::setLambda(), Grating2D::setLambda(), Grating1D::setLhsMatTE(), Grating1D::setLhsMatTM(), GratingLayer2D::setN1(), Grating2D::setN1(), Grating2D::setN3(), GratingLayer2D::setParameters(), GratingLayer2D::solveEigMat(), GratingLayer1D::solveEigMat(), Grating1D::solveEquations(), GratingLayer2D::solveHomogeneous(), to_str(), Grating2D::writeParameters(), and Grating1D::writeParameters().
std::vector<string> strsplit | ( | string | str, | |
string | delim = " " | |||
) | [inline] |
string to_str | ( | T ** | M, | |
int | dim1, | |||
int | dim2 = -1 | |||
) | [inline] |
string to_str | ( | T * | V, | |
int | dim1 | |||
) | [inline] |
std::string to_str | ( | T | t | ) | [inline] |
const complex<double> I = complex<double>(0,1.) |
Definition at line 25 of file tools.h.
Referenced by GratingLayer2D::calcBTEpsilon(), GratingLayer2D::calcEpsilon(), GratingLayer2D::calcTBEpsilon(), Grating2D::calcTransField(), and Grating2D::setSMatrix().