Classes | |
class | complex |
Complex data type that can be used from the application. More... | |
Functions for Lapack++ complex number type | |
typedef std::ios | ios_base |
template<typename _Tp> | |
_Tp | abs (const complex< _Tp > &) |
template<typename _Tp> | |
_Tp | arg (const complex< _Tp > &) |
template<typename _Tp> | |
_Tp | norm (const complex< _Tp > &) |
template<typename _Tp> | |
complex< _Tp > | operator+ (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator+ (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
complex< _Tp > | operator+ (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator- (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator- (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
complex< _Tp > | operator- (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator * (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator * (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
complex< _Tp > | operator * (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator/ (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator/ (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
complex< _Tp > | operator/ (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
complex< _Tp > | operator+ (const complex< _Tp > &__x) |
template<typename _Tp> | |
complex< _Tp > | operator- (const complex< _Tp > &__x) |
template<typename _Tp> | |
bool | operator== (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
bool | operator== (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
bool | operator== (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
bool | operator!= (const complex< _Tp > &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
bool | operator!= (const complex< _Tp > &__x, const _Tp &__y) |
template<typename _Tp> | |
bool | operator!= (const _Tp &__x, const complex< _Tp > &__y) |
template<typename _Tp> | |
std::istream & | operator>> (std::istream &__is, complex< _Tp > &__x) |
template<typename _Tp> | |
std::ostream & | operator<< (std::ostream &__os, const complex< _Tp > &__x) |
template<typename _Tp> | |
_Tp | real (const complex< _Tp > &__z) |
template<typename _Tp> | |
_Tp | imag (const complex< _Tp > &__z) |
Matrix Predicates | |
template<class matT> | |
bool | is_zero (const matT &mat) |
template<class matT> | |
bool | equal (const matT &mat1, const matT &mat2) |
Create elementary matrices | |
template<class matT> | |
void | zeros (matT &mat, int N, int M=0) |
template<class matT> | |
void | ones (matT &mat, int N, int M=0) |
template<class matT> | |
void | eye (matT &mat, int N, int M=0) |
template<class matT> | |
void | rand (matT &A, typename matT::value_type low=0, typename matT::value_type high=1) |
template<class matT> | |
void | int_rand (matT &A, typename matT::value_type low=0, typename matT::value_type high=1) |
template<class matT> | |
void | from_diag (matT &mat, const matT &vect) |
Constructors for elementary and special matrices | |
template<class matT> | |
matT | zeros (int N, int M=0) |
template<class matT> | |
matT | ones (int N, int M=0) |
template<class matT> | |
matT | eye (int N, int M=0) |
template<class matT> | |
matT | rand (int N, int M, typename matT::value_type low=0, typename matT::value_type high=1) |
template<class matT> | |
matT | int_rand (int N, int M, typename matT::value_type low=0, typename matT::value_type high=1) |
template<class matT> | |
matT | from_diag (const matT &vect) |
template<class destT, class srcT> | |
destT | convert_mat (const srcT &src) |
template<class matT> | |
matT | linspace (typename matT::value_type start, typename matT::value_type end, int nr_points) |
template<class matT> | |
matT | repmat (const matT &A, int M, int N) |
Calculate some matrix measures | |
template<class matT> | |
matT::value_type | trace (const matT &mat) |
template<class matT> | |
matT | diag (const matT &mat) |
Typedefs | |
typedef LaGenMatComplex | cmat |
typedef LaGenMatDouble | mat |
typedef LaGenMatFloat | fmat |
typedef LaGenMatInt | imat |
typedef LaGenMatLongInt | limat |
This namespace defines the complex data type that can be used from the application, and also various matrix template functions.
This namespace defines the complex data type that is used for passing scalars in and out of LAPACK++. It is a copy of the std::complex<double>
and it includes automatic conversion from and to std::complex<double>
. Additionally it includes automatic conversion from and to the internal FORTRAN type COMPLEX, which is why this class is needed to pass complex values into Lapack++.
This file has been heavily copied from the Standard C++ Library header <complex
>. See the explanations at la::complex for the reasons.
typedef LaGenMatComplex la::cmat |
The matrix data type containing complex values of type doublecomplex
.
typedef LaGenMatDouble la::mat |
The basic matrix data type containing double values.
typedef LaGenMatFloat la::fmat |
The matrix data type containing (single-precision) float
values.
typedef LaGenMatInt la::imat |
The matrix data type containing int
values.
typedef LaGenMatLongInt la::limat |
The matrix data type containing long
int
values.
typedef std::ios la::ios_base |
bool la::is_zero | ( | const matT & | mat | ) |
Returns true if this is an all-zero matrix. (New in lapackpp-2.4.4)
bool la::equal | ( | const matT & | mat1, | |
const matT & | mat2 | |||
) |
Returns true if both matrices are exactly equal. (New in lapackpp-2.4.4)
void la::zeros | ( | matT & | mat, | |
int | N, | |||
int | M = 0 | |||
) |
Sets the given matrix M
to an all-zero matrix of dimension NxN
, if M
is not given, or NxM
if M
is given. (New in lapackpp-2.4.4)
void la::ones | ( | matT & | mat, | |
int | N, | |||
int | M = 0 | |||
) |
Sets the given matrix M
to an all-one matrix of dimension NxN
, if M
is not given, or NxM
if M
is given. (New in lapackpp-2.4.4)
void la::eye | ( | matT & | mat, | |
int | N, | |||
int | M = 0 | |||
) |
Sets the given matrix M
to an identity matrix (a diagonal of ones and all other elements zeros) of square dimension NxN
, if M
is not given, or of rectangular dimension NxM
if M
is given. (New in lapackpp-2.4.4)
void la::rand | ( | matT & | A, | |
typename matT::value_type | low = 0 , |
|||
typename matT::value_type | high = 1 | |||
) |
Fills the given matrix A
with pseudo-random values. The values are uniformly distributed in the interval (0,1) or, if specified,
(low,high).
Note: Since this uses the system's rand()
call, the randomness of the values might be questionable -- don't use this if you need really strong random numbers.
void la::int_rand | ( | matT & | A, | |
typename matT::value_type | low = 0 , |
|||
typename matT::value_type | high = 1 | |||
) |
Fills the given matrix A
with pseudo-random values, where the value type of the matrix is an integer type. The values are uniformly distributed in the interval [0,1] or, if specified,
(low,high), in both cases including the interval edges.
Note: Since this uses the system's rand()
call, the randomness of the values might be questionable -- don't use this if you need really strong random numbers.
void la::from_diag | ( | matT & | mat, | |
const matT & | vect | |||
) |
Sets the given matrix mat
to a diagonal matrix with the given vector vect
on the diagonal and zeros elsewhere. The matrix mat
is allowed to be non-square, only the length of the diagonal has to fit to the vector's length. The vector vect
is allowed to be either a row vector (dimension 1xN) or a column vector (dimension Nx1). (New in lapackpp-2.4.4)
matT la::zeros | ( | int | N, | |
int | M = 0 | |||
) |
Returns a newly allocated all-zero matrix of dimension NxN
, if M
is not given, or NxM
if M
is given. (New in lapackpp-2.4.4)
matT la::ones | ( | int | N, | |
int | M = 0 | |||
) |
Returns a newly allocated all-one matrix of dimension NxN
, if M
is not given, or NxM
if M
is given. (New in lapackpp-2.4.4)
matT la::eye | ( | int | N, | |
int | M = 0 | |||
) |
Returns a newly allocated identity matrix of dimension NxN
, if M
is not given, or a rectangular matrix NxM
if M
is given. (New in lapackpp-2.4.4)
matT la::rand | ( | int | N, | |
int | M, | |||
typename matT::value_type | low = 0 , |
|||
typename matT::value_type | high = 1 | |||
) |
Returns a newly allocated matrix of dimension NxM
with pseudo-random values. The values are uniformly distributed in the interval (0,1) or, if specified,
(low,high). (New in lapackpp-2.4.5)
Note: Since this uses the system's rand()
call, the randomness of the values might be questionable -- don't use this if you need really strong random numbers.
matT la::int_rand | ( | int | N, | |
int | M, | |||
typename matT::value_type | low = 0 , |
|||
typename matT::value_type | high = 1 | |||
) |
Returns a newly allocated matrix of dimension NxM
with pseudo-random values, where the matrix element type is an integer type. The values are uniformly distributed in the interval [0,1] or, if specified,
(low,high), in both cases including the interval edges. (New in lapackpp-2.4.5)
Note: Since this uses the system's rand()
call, the randomness of the values might be questionable -- don't use this if you need really strong random numbers.
matT la::from_diag | ( | const matT & | vect | ) |
Returns a newly allocated diagonal matrix of dimension NxN
that has the vector vect
of length N
on the diagonal. The vector vect
is allowed to be either a row vector (dimension 1xN) or a column vector (dimension Nx1). (New in lapackpp-2.4.5)
destT la::convert_mat | ( | const srcT & | src | ) |
Returns a newly allocated matrix of type destT
, containing the element-by-element converted values of the matrix src
which was of type srcT
.
The template argument destT
must be specified; the template argument srcT
is deduced automatically. To convert a LaGenMatDouble into a LaGenMatInt:
LaGenMatDouble foo(5, 6); LaGenMatInt bar(la::convert_to<LaGenMatInt>(foo));
Note: This conversion should even work from and to various matrices of the IT++ library, http://itpp.sourceforge.net (New in lapackpp-2.4.5.)
matT la::linspace | ( | typename matT::value_type | start, | |
typename matT::value_type | end, | |||
int | nr_points | |||
) |
Returns a newly allocated linarly spaced column vector with nr_points
elements, between and including start
and end
. (New in lapackpp-2.4.5.)
matT la::repmat | ( | const matT & | A, | |
int | M, | |||
int | N | |||
) |
Returns a newly allocated large matrix that consists of M-by-N
copies of the given matrix A
. (New in lapackpp-2.4.5.)
matT::value_type la::trace | ( | const matT & | mat | ) |
Returns the trace, i.e. the sum of all diagonal elements of the matrix. The matrix mat
does not have to be square. (New in lapackpp-2.4.4)
matT la::diag | ( | const matT & | mat | ) |
Returns a newly allocated column vector of dimension Nx1
that contains the diagonal of the given matrix mat
. (New in lapackpp-2.4.5)
_Tp la::abs | ( | const complex< _Tp > & | ) |
_Tp la::arg | ( | const complex< _Tp > & | ) |
_Tp la::norm | ( | const complex< _Tp > & | ) |
complex<_Tp> la::operator+ | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator+ | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
complex<_Tp> la::operator+ | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator- | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator- | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
complex<_Tp> la::operator- | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator * | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator * | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
complex<_Tp> la::operator * | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator/ | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator/ | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
complex<_Tp> la::operator/ | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
complex<_Tp> la::operator+ | ( | const complex< _Tp > & | __x | ) | [inline] |
complex<_Tp> la::operator- | ( | const complex< _Tp > & | __x | ) | [inline] |
bool la::operator== | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
bool la::operator== | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
bool la::operator== | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
bool la::operator!= | ( | const complex< _Tp > & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
bool la::operator!= | ( | const complex< _Tp > & | __x, | |
const _Tp & | __y | |||
) | [inline] |
bool la::operator!= | ( | const _Tp & | __x, | |
const complex< _Tp > & | __y | |||
) | [inline] |
std::istream& la::operator>> | ( | std::istream & | __is, | |
complex< _Tp > & | __x | |||
) |
std::ostream& la::operator<< | ( | std::ostream & | __os, | |
const complex< _Tp > & | __x | |||
) |
_Tp la::real | ( | const complex< _Tp > & | __z | ) | [inline] |
_Tp la::imag | ( | const complex< _Tp > & | __z | ) | [inline] |