[eigen] Problem using Boost's zip_iterator on Eigen column vectors |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Problem using Boost's zip_iterator on Eigen column vectors
- From: Kip Warner <kip@xxxxxxxxxxxxxx>
- Date: Sat, 29 Jun 2024 21:27:31 -0700
- Autocrypt: addr=kip@xxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata=mQINBFxjY5gBEAC4Nha/uxd8y2iFeV0yGgP1jtAtblxLnM/Tg+LRiMXW8Bj3neCXW1+Ud nOTa6tXTpTBqS943eDnCZdG0KoiOonxMe+4yuctb6vzWK1zwVEtUakG2VKyPnF4lZgkb12CFiKfnw jX9mNgUyyB7adpH0wdWd3010Y0WdH33hXr7FvF18ubQcGIvu2686yuwnWGGhe9diE3vLKd8SIv9oc oySND1QLZABpvVbO6uwJqfd8/Mz2dCIKGKaXhhSZx6KETn2QnZ3yC0UOMjlXwvrw+HRMJ3IPlkEKA CbKx3toxa6A0ip/k/MrQv8QmPH2X7FOfrD3LxBz3q/egK2PXjsL1Grqi1Mh8dJlD7Wo0GkXClHoeE J35bquYMcUK355Au1qxiyKBFUf+Ccy8Ey+rMYOmui85mogBuvoBb0PRYp6FX0+iieU0F9UV1RQSRy IFvez+TmEIajduTcnGOZ1qhf+08sNyAjsUjE/ALrH9avmKPv+Dn55luFpvVF4R1kTGms0iruNAhgA K7zhqNHkBBOdv+gzbGehiRs/14D9x3ZcTS3APaLNdNUBlqvcwC5R8N5jsrF0m+ObvLOrCqfN1H6aP x9On0KUxMI/Wow3IlzT2YnGtWjjhMryd1XYOKXO6ElWW536JVhfM7qzU9JHMKpLFJtVkEGlER92AO fM8zNAkbBKewwARAQABtB9LaXAgV2FybmVyIDxraXBAdGhldmVydGlnby5jb20+iQJOBBMBCgA4Fi EEewUp3GyZl/sCA+vKBz6+UgJErg4FAlxjY5gCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgk QBz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DG Q/HU8HDZkR+RQIsjG1Qv+FFMCWleHvxeBG/bg7ED5pYpQiGnA3RZ/C4KmvPg+5crJFLc=
- Disposition-notification-to: kip@xxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thevertigo.com; s=gm1; t=1719721653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type:autocrypt:autocrypt; bh=UrlCexA2+MgnGdoAHGkrycbBvoLZD28VA4POmHlJ3mQ=; b=kIX8vLxz0JjRYpXJeKwPhj2Ju0Cuxdi2bZmkVL/AK1FLwp3ncFowBRgZpZpoctFUEBYUU2 P9XmFra+SKEX3wepXf3DZWBAZznkmArYxxZihVN5DleqcSXhJ+B+xvivNyImOrSQQJVRzA YriCLrdP6Z6UU8lk5GY5nXfQWE/9VKtDrKEXwWiRhK60QAxl6z+fairLRwK+uKGQSqLh51 2exQ35UaMrGYwSHOU5QYqdEOLntiQayLTYBRergtWyNSPVSfwg0d1W8zVez2gQ1330c9A/ XcNwYoCr+FhKhRpTbxHioLRxadxUNUR7irAR9t9Qc5RZqQkzI3pBMRXnjyiLnQ==
Hello list,
I noticed today a problem in Boost's zip_iterator traversing well
beyond the end of a pair of equal dimension Eigen column vectors.
I've prepared a minimal below:
#include <iostream>
#include <Eigen/Core>
#include <boost/iterator/zip_iterator.hpp>
using namespace std;
int main()
{
using ColumnVectorType = Eigen::Matrix<float, 32, 1>;
ColumnVectorType FirstVector = ColumnVectorType::Zero();
ColumnVectorType SecondVector = ColumnVectorType::Zero();
const auto ZipperStart = boost::make_zip_iterator(
boost::make_tuple(
std::cbegin(FirstVector),
std::cbegin(SecondVector)));
// End...
const auto ZipperEnd = boost::make_zip_iterator(
boost::make_tuple(
std::cend(FirstVector),
std::cend(SecondVector)));
int index = 0;
for(auto Iterator = ZipperStart; ZipperStart != ZipperEnd; ++Iterator)
{
std::cout << "Iteration: " << index << std::endl;
++index;
}
return 0;
}
Running the above via Godbolt results in iterating the body of the loop
thousands of times when I expected only 32.
https://godbolt.org/z/fKG77s1ds
I then modified the above code to get rid of the second column vector
and the zip_iterator to iterate via the normal STL interface over the
single column vector. It executes as expected only 32 times.
This is probably just a problem with my usage, but I just wanted to let
the list know in case this is a bug.
--
Kip Warner
OpenPGP signed/encrypted mail preferred
https://www.thevertigo.com
Attachment:
signature.asc
Description: This is a digitally signed message part