Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | Friends
qucs::matrix Class Reference

Dense complex matrix class This class defines a matrix object with its methods, operators and operations. More...

#include <matrix.h>

Public Member Functions

 matrix ()
 Create an empty matrix. More...
 
 matrix (int)
 Creates a square matrix. More...
 
 matrix (int, int)
 
 matrix (const matrix &)
 
const matrixoperator= (const matrix &)
 Assignment operator. More...
 
 ~matrix ()
 
nr_complex_t get (int, int)
 Returns the matrix element at the given row and column. More...
 
void set (int, int, nr_complex_t)
 Sets the matrix element at the given row and column. More...
 
int getCols (void)
 
int getRows (void)
 
nr_complex_tgetData (void)
 
void print (void)
 
void exchangeRows (int, int)
 The function swaps the given rows with each other. More...
 
void exchangeCols (int, int)
 The function swaps the given column with each other. More...
 
matrix operator- ()
 Unary minus. More...
 
matrix operator+= (matrix)
 Intrinsic matrix addition. More...
 
matrix operator-= (matrix)
 Intrinsic matrix subtraction. More...
 
nr_complex_t operator() (int r, int c) const
 Read access operator. More...
 
nr_complex_toperator() (int r, int c)
 Write access operator. More...
 

Private Attributes

int cols
 
int rows
 
nr_complex_tdata
 

Friends

matrix operator+ (matrix, matrix)
 
matrix operator+ (nr_complex_t, matrix)
 
matrix operator+ (matrix, nr_complex_t)
 
matrix operator+ (nr_double_t, matrix)
 
matrix operator+ (matrix, nr_double_t)
 
matrix operator- (matrix, matrix)
 
matrix operator- (nr_complex_t, matrix)
 
matrix operator- (matrix, nr_complex_t)
 
matrix operator- (nr_double_t, matrix)
 
matrix operator- (matrix, nr_double_t)
 
matrix operator/ (matrix, nr_complex_t)
 
matrix operator/ (matrix, nr_double_t)
 
matrix operator* (nr_complex_t, matrix)
 
matrix operator* (matrix, nr_complex_t)
 
matrix operator* (nr_double_t, matrix)
 
matrix operator* (matrix, nr_double_t)
 
matrix operator* (matrix, matrix)
 
matrix transpose (matrix)
 
matrix conj (matrix)
 
matrix abs (matrix)
 
matrix dB (matrix)
 
matrix arg (matrix)
 
matrix adjoint (matrix)
 
matrix real (matrix)
 
matrix imag (matrix)
 
matrix sqr (matrix)
 
matrix eye (int, int)
 Create identity matrix with specified number of rows and columns. More...
 
matrix diagonal (qucs::vector)
 Create a diagonal matrix from a vector. More...
 
matrix pow (matrix, int)
 
nr_complex_t cofactor (matrix, int, int)
 
nr_complex_t detLaplace (matrix)
 
nr_complex_t detGauss (matrix)
 
nr_complex_t det (matrix)
 
matrix inverseLaplace (matrix)
 
matrix inverseGaussJordan (matrix)
 
matrix inverse (matrix)
 
matrix stos (matrix, nr_complex_t, nr_complex_t)
 
matrix stos (matrix, nr_double_t, nr_double_t)
 
matrix stos (matrix, qucs::vector, nr_complex_t)
 
matrix stos (matrix, nr_complex_t, qucs::vector)
 
matrix stos (matrix, qucs::vector, qucs::vector)
 
matrix stoz (matrix, nr_complex_t)
 
matrix stoz (matrix, qucs::vector)
 
matrix ztos (matrix, nr_complex_t)
 
matrix ztos (matrix, qucs::vector)
 
matrix ztoy (matrix)
 
matrix stoy (matrix, nr_complex_t)
 
matrix stoy (matrix, qucs::vector)
 
matrix ytos (matrix, nr_complex_t)
 
matrix ytos (matrix, qucs::vector)
 
matrix ytoz (matrix)
 
matrix stoa (matrix, nr_complex_t, nr_complex_t)
 
matrix atos (matrix, nr_complex_t, nr_complex_t)
 
matrix stoh (matrix, nr_complex_t, nr_complex_t)
 
matrix htos (matrix, nr_complex_t, nr_complex_t)
 
matrix stog (matrix, nr_complex_t, nr_complex_t)
 
matrix gtos (matrix, nr_complex_t, nr_complex_t)
 
matrix cytocs (matrix, matrix)
 
matrix cztocs (matrix, matrix)
 
matrix cztocy (matrix, matrix)
 
matrix cstocy (matrix, matrix)
 
matrix cytocz (matrix, matrix)
 
matrix cstocz (matrix, matrix)
 
matrix twoport (matrix, char, char)
 
nr_double_t rollet (matrix)
 
nr_double_t b1 (matrix)
 

Detailed Description

Dense complex matrix class This class defines a matrix object with its methods, operators and operations.

Definition at line 92 of file matrix.h.

Constructor & Destructor Documentation

qucs::matrix::matrix ( )

Create an empty matrix.

Constructor creates an unnamed instance of the matrix class.

Definition at line 104 of file matrix.cpp.

qucs::matrix::matrix ( int  s)

Creates a square matrix.

Constructor creates an unnamed instance of the matrix class with a certain number of rows and columns. Particularly creates a square matrix.

Parameters
[in]snumber of rows or colums of square matrix
Todo:
Why not s const?

Definition at line 117 of file matrix.cpp.

qucs::matrix::matrix ( int  r,
int  c 
)

Definition at line 131 of file matrix.cpp.

qucs::matrix::matrix ( const matrix m)

Definition at line 143 of file matrix.cpp.

qucs::matrix::~matrix ( )

Destructor

Destructor deletes a matrix object.

Definition at line 184 of file matrix.cpp.

Member Function Documentation

void qucs::matrix::exchangeCols ( int  c1,
int  c2 
)

The function swaps the given column with each other.

Parameters
[in]c1source column
[in]c2destination column
Note
assert not out of bound r1 and r2
Todo:
c1 and c2 const

Definition at line 1561 of file matrix.cpp.

void qucs::matrix::exchangeRows ( int  r1,
int  r2 
)

The function swaps the given rows with each other.

Parameters
[in]r1source row
[in]r2destination row
Note
assert not out of bound r1 and r2
Todo:
r1 and r2 const

Definition at line 1543 of file matrix.cpp.

nr_complex_t qucs::matrix::get ( int  r,
int  c 
)

Returns the matrix element at the given row and column.

Parameters
[in]rrow number
[in]ccolumn number
Todo:

Why not inline and synonymous of ()

c and r const

Definition at line 194 of file matrix.cpp.

int qucs::matrix::getCols ( void  )
inline

Definition at line 103 of file matrix.h.

nr_complex_t* qucs::matrix::getData ( void  )
inline

Definition at line 105 of file matrix.h.

int qucs::matrix::getRows ( void  )
inline

Definition at line 104 of file matrix.h.

nr_complex_t qucs::matrix::operator() ( int  r,
int  c 
) const
inline

Read access operator.

Parameters
[in]rrow number (from 0 like usually in C)
[in]ccolumn number (from 0 like usually in C)
Returns
Cell in the row r and column c
Todo:

: Why not inline

: Why not r and c not const

: Create a debug version checking out of bound (using directly assert)

Definition at line 194 of file matrix.h.

nr_complex_t& qucs::matrix::operator() ( int  r,
int  c 
)
inline

Write access operator.

Parameters
[in]rrow number (from 0 like usually in C)
[in]ccolumn number (from 0 like usually in C)
Returns
Reference to cell in the row r and column c
Todo:

: Why not inline

: Why r and c not const

: Create a debug version checking out of bound (using directly assert)

Definition at line 203 of file matrix.h.

matrix qucs::matrix::operator+= ( matrix  a)

Intrinsic matrix addition.

Parameters
[in]amatrix to add
Note
assert same size
Todo:
a is const

Definition at line 243 of file matrix.cpp.

matrix qucs::matrix::operator- ( )

Unary minus.

Definition at line 270 of file matrix.cpp.

matrix qucs::matrix::operator-= ( matrix  a)

Intrinsic matrix subtraction.

Parameters
[in]amatrix to substract
Note
assert same size

Definition at line 283 of file matrix.cpp.

const matrix & qucs::matrix::operator= ( const matrix m)

Assignment operator.

The assignment copy constructor creates a new instance based on the given matrix object.

Parameters
[in]mobject to copy
Returns
assigned object
Note
m = m is safe

Definition at line 164 of file matrix.cpp.

void qucs::matrix::print ( void  )
void qucs::matrix::set ( int  r,
int  c,
nr_complex_t  z 
)

Sets the matrix element at the given row and column.

Parameters
[in]rrow number
[in]ccolumn number
[in]zcomplex number to assign
Todo:

Why not inline and synonymous of ()

r c and z const

Definition at line 205 of file matrix.cpp.

Friends And Related Function Documentation

matrix abs ( matrix  )
friend
matrix adjoint ( matrix  )
friend
matrix arg ( matrix  )
friend
matrix atos ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
nr_double_t b1 ( matrix  )
friend
nr_complex_t cofactor ( matrix  ,
int  ,
int   
)
friend
matrix conj ( matrix  )
friend
matrix cstocy ( matrix  ,
matrix   
)
friend
matrix cstocz ( matrix  ,
matrix   
)
friend
matrix cytocs ( matrix  ,
matrix   
)
friend
matrix cytocz ( matrix  ,
matrix   
)
friend
matrix cztocs ( matrix  ,
matrix   
)
friend
matrix cztocy ( matrix  ,
matrix   
)
friend
matrix dB ( matrix  )
friend
nr_complex_t det ( matrix  )
friend
nr_complex_t detGauss ( matrix  )
friend
nr_complex_t detLaplace ( matrix  )
friend
matrix diagonal ( qucs::vector  diag)
friend

Create a diagonal matrix from a vector.

Parameters
[in]diagvector to write on the diagonal
Todo:
diag is const

Definition at line 624 of file matrix.cpp.

matrix eye ( int  ,
int   
)
friend

Create identity matrix with specified number of rows and columns.

Parameters
[in]rsrow number
[in]cscolumn number
Todo:

Avoid res.get*

Use memset

rs, cs are const

Definition at line 603 of file matrix.cpp.

matrix gtos ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix htos ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix imag ( matrix  )
friend
matrix inverse ( matrix  )
friend
matrix inverseGaussJordan ( matrix  )
friend
matrix inverseLaplace ( matrix  )
friend
matrix operator* ( nr_complex_t  ,
matrix   
)
friend
matrix operator* ( matrix  ,
nr_complex_t   
)
friend
matrix operator* ( nr_double_t  ,
matrix   
)
friend
matrix operator* ( matrix  ,
nr_double_t   
)
friend
matrix operator* ( matrix  ,
matrix   
)
friend
matrix operator+ ( matrix  ,
matrix   
)
friend
matrix operator+ ( nr_complex_t  ,
matrix   
)
friend
matrix operator+ ( matrix  ,
nr_complex_t   
)
friend
matrix operator+ ( nr_double_t  ,
matrix   
)
friend
matrix operator+ ( matrix  ,
nr_double_t   
)
friend
matrix operator- ( matrix  ,
matrix   
)
friend
matrix operator- ( nr_complex_t  ,
matrix   
)
friend
matrix operator- ( matrix  ,
nr_complex_t   
)
friend
matrix operator- ( nr_double_t  ,
matrix   
)
friend
matrix operator- ( matrix  ,
nr_double_t   
)
friend
matrix operator/ ( matrix  ,
nr_complex_t   
)
friend
matrix operator/ ( matrix  ,
nr_double_t   
)
friend
matrix pow ( matrix  ,
int   
)
friend
matrix real ( matrix  )
friend
nr_double_t rollet ( matrix  )
friend
matrix sqr ( matrix  )
friend
matrix stoa ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix stog ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix stoh ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix stos ( matrix  ,
nr_complex_t  ,
nr_complex_t   
)
friend
matrix stos ( matrix  ,
nr_double_t  ,
nr_double_t   
)
friend
matrix stos ( matrix  ,
qucs::vector  ,
nr_complex_t   
)
friend
matrix stos ( matrix  ,
nr_complex_t  ,
qucs::vector   
)
friend
matrix stos ( matrix  ,
qucs::vector  ,
qucs::vector   
)
friend
matrix stoy ( matrix  ,
nr_complex_t   
)
friend
matrix stoy ( matrix  ,
qucs::vector   
)
friend
matrix stoz ( matrix  ,
nr_complex_t   
)
friend
matrix stoz ( matrix  ,
qucs::vector   
)
friend
matrix transpose ( matrix  )
friend
matrix twoport ( matrix  ,
char  ,
char   
)
friend
matrix ytos ( matrix  ,
nr_complex_t   
)
friend
matrix ytos ( matrix  ,
qucs::vector   
)
friend
matrix ytoz ( matrix  )
friend
matrix ztos ( matrix  ,
nr_complex_t   
)
friend
matrix ztos ( matrix  ,
qucs::vector   
)
friend
matrix ztoy ( matrix  )
friend

Field Documentation

int qucs::matrix::cols
private

Number of colunms

Definition at line 207 of file matrix.h.

nr_complex_t* qucs::matrix::data
private

Matrix data

Definition at line 211 of file matrix.h.

int qucs::matrix::rows
private

Number of rows

Definition at line 209 of file matrix.h.


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