[Dune-devel] [Dune-Commit] [Commit] dune-istl - 04a4280: [Release][BCRSMatrix] Add a more efficient interface for setting all column indices of a row
Steffen Müthing
steffen.muething at iwr.uni-heidelberg.de
Mon Dec 16 12:59:26 CET 2013
Am 16.12.2013 um 11:14 schrieb Markus Blatt:
> On Mon, Dec 16, 2013 at 10:38:26AM +0100, Steffen Müthing wrote:
> + template<typename It>
>> + void setIndices(size_type row, It begin, It end)
>> + {
>> + size_type cols = 0;
>> + size_type* col_it = r[row].getindexptr();
>> + for (; begin != end; ++begin, ++col_it, ++cols)
>> + {
>> + *col_it = *begin;
>> + }
>> + if (cols != r[row].size())
>
> Out of curiosity: Is there a special reason not to use
> void setIndices(size_type row, It begin, It end)
> if(std::copy(begin, end, col_it)) != r[row].getindexptr()+cols)
> DUNE_THROW …
Oh, you're right, I had forgotten that std::copy() returns an iterator past the end of the
target range. I've pushed an updated version.
Steffen
>
> Markus
>
> --
> Do you need more support with DUNE or HPC in general?
>
> Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
> Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
> Tel.: +49 (0) 160 97590858 Fax: +49 (0)322 1108991658
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20131216/008581b6/attachment.sig>
More information about the Dune-devel
mailing list