Boost logo

Ublas :

From: Alion Sci (alionsci_at_[hidden])
Date: 2006-09-14 10:27:57


What headers do I need? I thought I had that taken care of but apparently
not. Here is my full code, it doesn't do anything yet because it is just
test code. Once I figure this problem out then I can update my real project.
Thanks.

 #include <cstdlib>
#include <iostream>
#include </home/jstoup/boost_1_33_1/boost/numeric/ublas/vector.hpp>
*using* *namespace* boost::numeric ;*using* *namespace* std ;
int main()
{
        ublas::vector<double> rvect1(10) ;
        *for* ( int n=0 ; n < rvect1.size() ; ++n )
        {
                int y = rand() % 10;
                rvect1(n) = (double) (n*y+1) ;
        }

        ublas::vector<double> rvect2 = 3*rvect1 ;
        ublas::vector<double> rvect3(10);

        rvect1 = 2*rvect1;
        rvect2 = cbrt(rvect2);
        rvect3 = rvect1 + rvect2;

        cout << "========================================================================================="
<< endl;
        cout << "rvect1 = " << rvect1 << endl;
        cout << "rvect2 = " << rvect2 << endl;
        cout << "rvect3 = " << rvect3 << endl;
        cout << "========================================================================================="
<< endl;

        *return* 0;
}