Hi all,
I'm working on a project using uBlas. I'm using dense vector and dense matrix, the dimensions of these structures are very big.
So, I was thinking about the opportunity to modify some algorithms of uBlas using multi-thread programming.

I've tried to do this using openMP. Below, you find my first attempt.

This is a piece of the original code in vector_assign.hpp

    // Explicitly indexing
    template<template <class T1, class T2> class F, class V, class E>
    // BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
    void indexing_vector_assign (V &v, const vector_expression<E> &e) {
        typedef F<typename V::reference, typename E::value_type> functor_type;
        typedef typename V::size_type size_type;
        size_type size (BOOST_UBLAS_SAME (v.size (), e ().size ()));
#ifndef BOOST_UBLAS_USE_DUFF_DEVICE
        for (size_type i = 0; i < size; ++ i)
            functor_type::apply (v (i), e () (i));
#else
        size_type i (0);
        DD (size, 2, r, (functor_type::apply (v (i), e () (i)), ++ i));
#endif
    }

And I modified the inner for in this way:

   int i;   
   #pragma omp parallel private(i) shared(v, e)
   {
      #pragma omp for
      for (i = 0; i < size; ++ i)
         functor_type::apply (v (i), e () (i));
   }

I tried the code and it run. 
Yes I know that it's better if I use the clause schedule in the pragma for, but the real question is: do you think that this code is enough general? Can I extend it with the operations? 

Thank you in advance
  Mirko

---
Ad maiora semper.