Re: [Boost-bugs] [Boost C++ Libraries] #4034: better vector/matrix assignment (or initialization)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4034: better vector/matrix assignment (or initialization)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-10 10:41:45

#4034: better vector/matrix assignment (or initialization)
 Reporter: guwi17 | Owner: guwi17
     Type: Patches | Status: new
Milestone: To Be Determined | Component: uBLAS
  Version: Boost 1.42.0 | Severity: Optimization
 Keywords: assigment |

Comment(by cassioliandre@…):

 Hi guys, I found the overall discussion very stimulating.

 Using uBlas can be quite annoying for the lack of such assignement
 operators that in my experience (i'm working on the optimization and fem
 simulation field).

 I was wondering if it not might be the case to take a look to the
 Boost::Assign library and see if it can be extended and adapted to work
 with uBlas. For naive assignament it already provides operator+= and
 similar that could be useful to simply fill vectors. For a matrix, a
 machinery similar to the one in place for map could be used.

 In this way uBlas could be used more freely besides for instance a
 std::vector, for which Boost::Assign already works.

 For what concern how to rule the access if by rows or columns, I suggest
 to possibilities:

  * do not allow free access but force user to specify the column or row
 access explicitly, as for instance as
  boost::numeric::ublas::matrix<double> m(10,10);
  m += row(2, a_vector_of_values ), row(1, another_list_of_values);

  * an std::stream modificator like syntax might be used:
  boost::numeric::ublas::matrix<double> m(10,10);
  m << row(1)<< 0, 1, 2,3<< row(2)<< 4,5,6,7;

 Best Regards, Andrea

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC