Logo MTL4

min(v)

returns smallest entry of vector v.

Details: mtl::vector::min

For example:

// File: vector_min_max.cpp

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

int main(int, char**)
{
    using mtl::max;

    mtl::dense_vector<double>         v(100);

    for (unsigned i= 0; i < size(v); i++)
        v[i]= double(i+1) * pow(-1.0, int(i)); // Amb. in MSVC

    std::cout << "max(v) is " << max(v)<< "\n";
    
    std::cout << "min(v) is " <<  min(v)<< "\n";
    
    std::cout << "max<6>(v) is " <<  max<6>(v)<< "\n";

    return 0;
}

Return to Overview                                Table of Content                               


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