Qucs-core
0.0.18
|
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 matrix & | operator= (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_t * | getData (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_t & | operator() (int r, int c) |
Write access operator. More... | |
Private Attributes | |
int | cols |
int | rows |
nr_complex_t * | data |
Dense complex matrix class This class defines a matrix object with its methods, operators and operations.
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.
[in] | s | number of rows or colums of square matrix |
Definition at line 117 of file matrix.cpp.
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 | ( | ) |
The function swaps the given column with each other.
[in] | c1 | source column |
[in] | c2 | destination column |
Definition at line 1561 of file matrix.cpp.
The function swaps the given rows with each other.
[in] | r1 | source row |
[in] | r2 | destination row |
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.
[in] | r | row number |
[in] | c | column number |
Why not inline and synonymous of ()
c and r const
Definition at line 194 of file matrix.cpp.
|
inline |
|
inline |
Read access operator.
[in] | r | row number (from 0 like usually in C) |
[in] | c | column number (from 0 like usually in C) |
: Why not inline
: Why not r and c not const
: Create a debug version checking out of bound (using directly assert)
|
inline |
Write access operator.
[in] | r | row number (from 0 like usually in C) |
[in] | c | column number (from 0 like usually in C) |
: Why not inline
: Why r and c not const
: Create a debug version checking out of bound (using directly assert)
Intrinsic matrix addition.
[in] | a | matrix to add |
Definition at line 243 of file matrix.cpp.
matrix qucs::matrix::operator- | ( | ) |
Unary minus.
Definition at line 270 of file matrix.cpp.
Intrinsic matrix subtraction.
[in] | a | matrix to substract |
Definition at line 283 of file matrix.cpp.
Assignment operator.
The assignment copy constructor creates a new instance based on the given matrix object.
[in] | m | object to copy |
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.
[in] | r | row number |
[in] | c | column number |
[in] | z | complex number to assign |
Why not inline and synonymous of ()
r c and z const
Definition at line 205 of file matrix.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Create a diagonal matrix from a vector.
[in] | diag | vector to write on the diagonal |
Definition at line 624 of file matrix.cpp.
Create identity matrix with specified number of rows and columns.
[in] | rs | row number |
[in] | cs | column number |
Avoid res.get*
Use memset
rs, cs are const
Definition at line 603 of file matrix.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |