Logo MTL4

hessian_setup(A, value)

Fills a matrix A with $ a_{ij} = factor * (i + j) $. Works only for Morton Z-order and Hybrid 2 row-major matrices.

Details: mtl::matrix::hessian_setup

hessian_setup(A,2.0);

#include <iostream>
#include <boost/numeric/mtl/mtl.hpp>

int main()
{
  const int size = 3, N = size * size;
  mtl::compressed2D<double>          A(N, N);
 
  laplacian_setup(A, size, size);
  std::cout<< "Laplacian_setup=\n" << A << "\n";
  
  diagonal_setup(A, 2.0);
  std::cout<< "diagonal_setup=\n" << A << "\n";
  
  mtl::dense2D<double>               B(N, N);   //to expensive for sparse Matrix
  hessian_setup(B, 4.0);
  std::cout<< "hessian_setup=\n" << B << "\n";
    
  return 0;
}

Return to Overview                                Table of Content                               


hessian_setup(A, value) -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine -- Gen. with rev. 7542 on 7 Apr 2011 by doxygen 1.5.9 -- © 2010 by SimuNova UG.