[PPL-devel] [GIT] ppl/ppl(ppl-0_11-branch): Replaced the algorithm used for sorting Linear_System and Bit_Matrix.
Enea Zaffanella
zaffanella at cs.unipr.it
Thu Feb 17 21:25:51 CET 2011
Module: ppl/ppl
Branch: ppl-0_11-branch
Commit: 3cdbdf41622743f9921a2ceed4f571e1ac6b7965
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=3cdbdf41622743f9921a2ceed4f571e1ac6b7965
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Thu Feb 17 21:15:28 2011 +0100
Replaced the algorithm used for sorting Linear_System and Bit_Matrix.
The new algorithm, based on STL's std::sort and std::unique, is applied
to a vector of rows' indices and implements indirect sort using function
objects for the comparisons and swap operations.
Apart from a (usually minor) decrease in the number of comparisons and
swaps perfomed, the new algorithm should be better wrt the consumption
of stack space, by getting rid of ad-hoc sort/unique functions, as well as
the special-purpose iterator class Linear_System::With_Bit_Matrix_iterator.
---
src/Bit_Matrix.cc | 26 +++--
src/Linear_System.cc | 50 ++++++----
src/Linear_System.defs.hh | 89 -----------------
src/Linear_System.inlines.hh | 144 ---------------------------
src/swapping_sort.icc | 221 +++++++++++++++++++++++-------------------
5 files changed, 172 insertions(+), 358 deletions(-)
Diff: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commitdiff;h=3cdbdf41622743f9921a2ceed4f571e1ac6b7965
More information about the PPL-devel
mailing list