Logo MTL4

Matrix Norms

Norms on matrices can be computed in the same fashion as on vectors:

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

int main(int, char**)
{
    using namespace mtl;
    
    const unsigned n= 10;
    dense2D<float, matrix::parameters<col_major> > B(n, n);

    matrix::hessian_setup(B, 1.0);
    
    std::cout << "one_norm(B) is " << one_norm(B)<< "\n";
    std::cout << "infinity_norm(B) is " << infinity_norm(B)<< "\n";
    std::cout << "frobenius_norm(B) is " << frobenius_norm(B)<< "\n";
    
    return 0;
}

The norms are defined as:

Return to Vector Norms                                Table of Content                                Proceed to Vector Reductions


Matrix Norms -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine -- Gen. with rev. 7542 on 7 Apr 2011 by doxygen 1.5.9 -- © 2010 by SimuNova UG.