Classes | |
| class | Array1D |
| class | Array2D |
| class | Array3D |
| class | Fortran_Array1D |
| class | Fortran_Array2D |
| class | Fortran_Array3D |
| class | i_refvec |
| class | Matrix |
| class | Sparse_Matrix |
| class | Sparse_Vector_Element |
| class | Sparse_Vector |
| class | Stopwatch |
| class | Vector |
Typedefs | |
| typedef TNT_SUBSCRIPT_TYPE | Subscript |
Functions | |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Array1D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Array1D< T > &A) |
| template<class T > | |
| Array1D< T > | operator+ (const Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > | operator- (const Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > | operator* (const Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > | operator/ (const Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > & | operator+= (Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > & | operator-= (Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > & | operator*= (Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| Array1D< T > & | operator/= (Array1D< T > &A, const Array1D< T > &B) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Array2D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Array2D< T > &A) |
| template<class T > | |
| Array2D< T > | operator+ (const Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > | operator- (const Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > | operator* (const Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > | operator/ (const Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > & | operator+= (Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > & | operator-= (Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > & | operator*= (Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > & | operator/= (Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| Array2D< T > | matmult (const Array2D< T > &A, const Array2D< T > &B) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Array3D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Array3D< T > &A) |
| template<class T > | |
| Array3D< T > | operator+ (const Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > | operator- (const Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > | operator* (const Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > | operator/ (const Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > & | operator+= (Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > & | operator-= (Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > & | operator*= (Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| Array3D< T > & | operator/= (Array3D< T > &A, const Array3D< T > &B) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Fortran_Array1D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Fortran_Array1D< T > &A) |
| template<class T > | |
| Fortran_Array1D< T > | operator+ (const Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > | operator- (const Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > | operator* (const Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > | operator/ (const Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > & | operator+= (Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > & | operator-= (Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > & | operator*= (Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| Fortran_Array1D< T > & | operator/= (Fortran_Array1D< T > &A, const Fortran_Array1D< T > &B) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Fortran_Array2D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Fortran_Array2D< T > &A) |
| template<class T > | |
| Fortran_Array2D< T > | operator+ (const Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > | operator- (const Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > | operator* (const Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > | operator/ (const Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > & | operator+= (Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > & | operator-= (Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > & | operator*= (Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| Fortran_Array2D< T > & | operator/= (Fortran_Array2D< T > &A, const Fortran_Array2D< T > &B) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Fortran_Array3D< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Fortran_Array3D< T > &A) |
| template<class T > | |
| Fortran_Array3D< T > | operator+ (const Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > | operator- (const Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > | operator* (const Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > | operator/ (const Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > & | operator+= (Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > & | operator-= (Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > & | operator*= (Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| template<class T > | |
| Fortran_Array3D< T > & | operator/= (Fortran_Array3D< T > &A, const Fortran_Array3D< T > &B) |
| Fortran_Array2D< double > | Lapack_LinearSolve (const Fortran_Array2D< double > &A, const Fortran_Array2D< double > &B) |
| template<class Real > | |
| Real | hypot (const Real &a, const Real &b) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Matrix< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Matrix< T > &A) |
| template<class T > | |
| Matrix< T > & | mult (Matrix< T > &C, const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | mult (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | operator* (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Vector< T > | mult (const Matrix< T > &A, const Vector< T > &b) |
| template<class T > | |
| Vector< T > | operator* (const Matrix< T > &A, const Vector< T > &b) |
| template<class T > | |
| Matrix< T > | mult (const T &s, const Matrix< T > &A) |
| template<class T > | |
| Matrix< T > | mult (const Matrix< T > &A, const T &s) |
| template<class T > | |
| Matrix< T > | mult_eq (const T &s, Matrix< T > &A) |
| template<class T > | |
| Matrix< T > | mult_eq (Matrix< T > &A, const T &a) |
| template<class T > | |
| Matrix< T > | transpose_mult (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Vector< T > | transpose_mult (const Matrix< T > &A, const Vector< T > &b) |
| template<class T > | |
| Matrix< T > | add (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | operator+ (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > & | add_eq (Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | operator+= (Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | minus (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | operator- (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > | mult_element (const Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| Matrix< T > & | mult_element_eq (Matrix< T > &A, const Matrix< T > &B) |
| template<class T > | |
| double | norm (const Matrix< T > &A) |
| template<class T > | |
| Matrix< T > | transpose (const Matrix< T > &A) |
| template<class T > | |
| Vector< T > | upper_triangular_solve (const Matrix< T > &A, const Vector< T > &b) |
| template<class T > | |
| Vector< T > | lower_triangular_solve (const Matrix< T > &A, const Vector< T > &b) |
| template<class T > | |
| Vector< T > | operator* (const Sparse_Matrix< T > &S, const Vector< T > &x) |
| template<class T > | |
| double | norm (const Sparse_Matrix< T > &S) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Sparse_Matrix< T > &A) |
| template<class T > | |
| T | dot_product (const Sparse_Vector< T > &s, const Vector< T > &x) |
| template<class T > | |
| T | dot_product (const Vector< T > &x, const Sparse_Vector< T > &s) |
| template<class T > | |
| T | operator* (const Vector< T > &x, const Sparse_Vector< T > &s) |
| template<class T > | |
| T | operator* (const Sparse_Vector< T > &s, const Vector< T > &x) |
| template<class T > | |
| double | norm (const Sparse_Vector< T > &s) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Sparse_Vector< T > &A) |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const Vector< T > &A) |
| template<class T > | |
| std::istream & | operator>> (std::istream &s, Vector< T > &A) |
| template<class T > | |
| Vector< T > | operator+ (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| Vector< T > | operator+= (Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| Vector< T > | operator- (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| Vector< T > | operator-= (Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| Vector< T > | elementwise_mult (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| double | norm (const Vector< T > &A) |
| template<class T > | |
| T | dot_prod (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| T | dot_product (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| T | operator* (const Vector< T > &A, const Vector< T > &B) |
| template<class T > | |
| Vector< T > | operator* (const T &a, const Vector< T > &A) |
| template<class T > | |
| Vector< T > | operator* (const Vector< T > &A, const T &a) |
C-Lapack is a translation of the LAPACK Fortran code into C. This package contains methods for solving linear systems of equations and eigenvalue problems.
Lapack_LinearSolve() calls one of the C-Lapack drivers to solve the equation AX = B, where A and B are given. The function returns X as the solution.
To compile and link this file, you NEED the C-Lapack library installed. See http://www.netlib.org/clapack/ for details. In particular, your link needs to include LAPACK library, as well as the BLAS library, TMGLIB and libF77.a library of F2C.
| Matrix<T> TNT::add | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix addition: compute A + B
| A | matrix of size M x N. | |
| B | matrix of size M x N. | |
| the | sum A+B. |
| Matrix<T>& TNT::add_eq | ( | Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix addition, in place : compute A = A + B.
| A | matrix of size M x N. | |
| B | matrix of size M x N. | |
| the | sum A+B. |
| Real TNT::hypot | ( | const Real & | a, | |
| const Real & | b | |||
| ) | [inline] |
| Vector<T> TNT::lower_triangular_solve | ( | const Matrix< T > & | A, | |
| const Vector< T > & | b | |||
| ) | [inline] |
Solve the triangular system A_L *x=b, where A_L is the lower triangular portion (including the diagonal) of A.
| A | a square matrix of size N x N. | |
| b | the right-hand-side (solution vector) of size N. |
| Array2D<T> TNT::matmult | ( | const Array2D< T > & | A, | |
| const Array2D< T > & | B | |||
| ) | [inline] |
Matrix Multiply: compute C = A*B, where C[i][j] is the dot-product of row i of A and column j of B.
| A | an (m x n) array | |
| B | an (n x k) array |
| Matrix<T> TNT::minus | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix subtraction : compute A - B.
| A | matrix of size M x N. | |
| B | matrix of size M x N. |
| Matrix<T> TNT::mult | ( | const Matrix< T > & | A, | |
| const T & | s | |||
| ) | [inline] |
| Matrix<T> TNT::mult | ( | const T & | s, | |
| const Matrix< T > & | A | |||
| ) | [inline] |
| Vector<T> TNT::mult | ( | const Matrix< T > & | A, | |
| const Vector< T > & | b | |||
| ) | [inline] |
Matrix/vector multiplication: compute A * b.
| A | matrix: left side operand (number of columns of A, must match the number of elements in b.) | |
| b | vector: right side operand. |
| Matrix<T> TNT::mult | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix/matrix multiplication: compute A * B.
| A | matrix: left side operand (size M x N). | |
| B | matrix: right side operand (size N x K). |
| Matrix<T>& TNT::mult | ( | Matrix< T > & | C, | |
| const Matrix< T > & | A, | |||
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix-Matrix multiplication: C = A * B.
This is an optimizied (trinary) version of matrix multiply, where the destination matrix has already been allocated.
| A | matrix of size M x N. | |
| B | matrix of size N x K. | |
| C | the result A*B, of size M x K. |
| Matrix<T> TNT::mult_element | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix element-by-elment multiplication: for each (i,j) compute A(i,j) * B(i,j).
| A | matrix of size M x N. | |
| B | matrix of size M x N. |
| Matrix<T>& TNT::mult_element_eq | ( | Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix element-by-elment multiplication, in place: for each (i,j) compute A(i,j) = A(i,j) * B(i,j).
| A | matrix of size M x N. | |
| B | matrix of size M x N. |
| Matrix<T> TNT::mult_eq | ( | const T & | s, | |
| Matrix< T > & | A | |||
| ) | [inline] |
| double TNT::norm | ( | const Matrix< T > & | A | ) | [inline] |
Compute Frobenius norm of matrix. This is the square root of the sum of squares of each matrix entry, i.e.
$$ \sqrt{ \sum_{i=1}{N} \sum_{j=1}{N} A_{i,j}^{2} } $$.
.
| A | the matrix to compute its Frobeinus norm. |
| Vector<T> TNT::operator* | ( | const Matrix< T > & | A, | |
| const Vector< T > & | b | |||
| ) | [inline] |
Matrix/vector multiplication: compute A * b.
| A | matrix: left side operand (number of columns of A, must match the number of elements in b.) | |
| b | vector: right side operand. |
| Matrix<T> TNT::operator* | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix/matrix multiplication: compute A * B.
| A | matrix: left side operand (size M x N). | |
| B | matrix: right side operand (size N x K). |
| Matrix<T> TNT::operator+ | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix addition: compute A + B.
NOTE: this is shorthand notation for add(A,B).
| A | matrix of size M x N. | |
| B | matrix of size M x N. | |
| the | sum A+B. |
| Matrix<T> TNT::operator+= | ( | Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix addition, in place: compute A = A + B.
NOTE: this is shorthand notation for add_eq(A,B).
| A | matrix of size M x N. | |
| B | matrix of size M x N. |
| Matrix<T> TNT::operator- | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix subtraction : compute A - B.
This is shorthand notation for minus(A,B).
| A | matrix of size M x N. | |
| B | matrix of size M x N. |
| std::ostream& TNT::operator<< | ( | std::ostream & | s, | |
| const Fortran_Array1D< T > & | A | |||
| ) | [inline] |
Write an array to a character outstream. Output format is one that can be read back in via the in-stream operator: one integer denoting the array dimension (n), followed by n elements, one per line.
| std::istream& TNT::operator>> | ( | std::istream & | s, | |
| Fortran_Array1D< T > & | A | |||
| ) | [inline] |
Read an array from a character stream. Input format is one integer, denoting the dimension (n), followed by n whitespace-separated elments. Newlines are ignored
Note: the array being read into references new memory storage. If the intent is to fill an existing conformant array, use cin >> B; A.inject(B) ); instead or read the elements in one-a-time by hand.
| s | the charater to read from (typically std::in) | |
| A | the array to read into. |
| Matrix<T> TNT::transpose | ( | const Matrix< T > & | A | ) | [inline] |
Matrix tranpose: return a new matrix B, where B(i,j) is A(j,i).
| A | matrix MxN |
| Vector<T> TNT::transpose_mult | ( | const Matrix< T > & | A, | |
| const Vector< T > & | b | |||
| ) | [inline] |
| Matrix<T> TNT::transpose_mult | ( | const Matrix< T > & | A, | |
| const Matrix< T > & | B | |||
| ) | [inline] |
Matrix-Matrix tranpose multiplication, i.e. compute tranpose(A)*B.
NOTE: this is more efficient than computing the tranpose(A) explicitly, and then multiplying, as the tranpose of A is never really constructed.
| A | matrix: size M x N. | |
| B | matrix: size M x K. |
| Vector<T> TNT::upper_triangular_solve | ( | const Matrix< T > & | A, | |
| const Vector< T > & | b | |||
| ) | [inline] |
Solve the triangular system A_u *x=b, where A_u is the upper triangular portion (including the diagonal) of A.
| A | a square matrix of size N x N. | |
| b | the right-hand-side (solution vector) of size N. |
1.5.9