Boost logo

Boost Users :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-11-15 05:40:20


On Friday 15 November 2002 08:56, Olaf Petzold wrote:
> Hi,
>
> I can't get the following snipped from the doc examples to work:
>
> #include <iostream>
> #include <boost/numeric/ublas/vector.hpp>
> #include <boost/numeric/ublas/io.hpp>
>
> int main () {
>
> using namespace boost::numeric::ublas;
>
> vector<double> v1 (3), v2 (3);
>
> for (int i = 0; i < std::min (v1.size (), v2.size ()); ++ i)
>
> v1 (i) = v2 (i) = i;
>
> std::cout << outer_prod (v1, v2) << std::endl;
>
> }
>
> ublas_cross.cc: In function `int main()':
> ublas_cross.cc:17: `outer_prod' undeclared (first use this function)
> ublas_cross.cc:17: (Each undeclared identifier is reported only once for
> each function it appears in.)
>
> What's wrong here?

Just add
#include <boost/numeric/ublas/matrix.hpp>

The outer_prod is in matrix_expression.hpp which gets included by matrix.hpp.

toon


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net