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 argc, char* argv[])
{
    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 -- Generated on 19 May 2009 by Doxygen 1.5.5 -- Copyright 2007 by the Trustees of Indiana University.