triangle_view<Matrix, int Uplo> [MTL Home] Programmers Guide
  Contents | Index |  Search 


Category:containers,generators Component type:type
Description
A helper class for creating a triangle view into an existing dense or sparse matrix. For sparse matrices, the matrix must already have elements in the appropriate triangular portion of the matrix. This just provides the proper triangular matrix interface.
Example
In banded_view_test.cc:
template <class Matrix>
void print_banded_views(Matrix& A)
{
  using namespace mtl;
  band_view<RowMatrix>::type B(2, 1, A);
}
int main(int argc, char* argv[])
{
  using namespace mtl;
  int M, N;
  if (argc < 2) {
    M = 10;
    N = 10;
  } else {
    M = atoi(argv[1]);
    N = atoi(argv[2]);
  }
  typedef matrix<double>::type Matrix;
  Matrix A(M, N);
  print_banded_views(A);
  return 0;
}

Definition
matrix.h
Template Parameters

ParameterDescriptionDefault
MatrixThe type of the Matrix to be viewed, must be dense 
UploWhether to view the upper or lower triangle of the matrix 
Model of
Members
Member Where defined Description
Sparsity    
enum { Sparsity_id = Sparsity::id }    
type   The generated type
New members
Notes
See also

[MTL Home] Copyright © 1998,1999 University of Notre Dame. All Rights Reserved.