Re: [eigen] Eigen::RandomSetter leads to assertion failure |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen::RandomSetter leads to assertion failure
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 18 May 2009 17:30:51 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=yzXs2VVMjNkfJlS6SsnhSTtgu7Q4zNTBRrf5VCE/tuk=; b=BHPRjIesV6Mo4efQfJHg0YYLdPZE7jPccRmjOLDRoZCAt4agFGBIuPLZvz5M2SJpBW 6u41KCydVYQKtQWHlDlMfUKnUvKoIsX5rBhfIxRpgK0ZmGhkeCWxVBoGHYVXkbz6UmjO UbyMwh3NqL05cNphoWpntimG8s1UlvFC88MlY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FaOGIKM9roDNhdRCkDOFB2QAcPSkfmJbZ8dtH7DCpWY2SL0lCUsPX77Kusl4w4Wk8A QFq6WRix1l1fjq/2ukIG45M/j34aC1T9zqU3o/7zfKrpmYZWzeYkVRx//mhkWEKrR5D/ 4rms4mgMCx96K/6o/4ZENVsjweGUMUHz0GIW0=
bug fixed
gael
On Fri, May 15, 2009 at 10:04 AM, Moritz Lenz
<mlenz@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> in trunk this piece of code (which I believed worked earlier, before Gael
> re-worked the sparse filling code) gives:
>
> t: /home/mlenz/tmp/eigen2-git/Eigen/src/Sparse/SparseMatrix.h:193: void
> Eigen::SparseMatrix<_Scalar, _Flags>::startVec(int) [with _Scalar = int, int
> _Flags = 1]: Assertion `m_outerIndex[outer]==int(m_data.size()) && "you must
> call startVec on each inner vec"' failed.
> Aborted
>
>
> #include <iostream>
> #include <complex>
> #include <Eigen/Core>
> #include <Eigen/Sparse>
> #include <stdlib.h>
> using namespace std;
>
> using namespace Eigen;
>
> typedef Eigen::SparseMatrix< int , Eigen::RowMajor> esm;
> typedef Eigen::RandomSetter< esm > ers;
>
> int main(int argc, char** argv) {
> srand(1);
> esm a(100, 100);
> {
> ers s(a);
> for (int x = 0; x < 100; x++) {
> for (int y = 0; y < 100; y++) {
> if (rand() < RAND_MAX / 2)
> s(x, y) = 3;
> }
> }
> }
> }
> // vim: ts=4 sw=4 expandtab
>
>
> Cheers,
> Moritz
>
>
>