Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-08-12 12:46:04


AMDG

Ed wrote:
> #include <boost/numeric/ublas/matrix.hpp>
> #include <boost/numeric/ublas/io.hpp>
> using namespace boost::numeric::ublas;
>
> matrix<MyObject> m_MyObjects(nRows, nCols);
>
> I have a ublas matrix of objects as declared above... Is there a way
> within the Boost lib (i.e. something I don't have to write much custom
> code to use) that I can use to sort the matrix by a value of one
> of the data members of MyObject? For example

std::sort(m_MyObjects.data().begin(), m_MyObjects.data().end(),
/appropriate predicate/);

In Christ,
Steven Watanabe


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