Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can*From*: ztdepyahoo <ztdepyahoo@xxxxxxxxx>*Date*: Tue, 8 Sep 2020 15:10:02 +0800*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-transfer-encoding; bh=ftLmzpT8xmXh4dd/KSDDeXy4ADVksqiiF/oqOoEvfaE=; b=kGpFlNZ3UKAyrkzFxiiD2eKGAF68PBG5FqpxHKt/TO4h2tYk+ZOwMto/fxvoKsYbY/ J9NgUid3yGwaEDAlg6q4xP/9oePC2K7sQofGoHtNIw9MrwO2l7IvUZTCdWOhrCUnmYNT 39PvH50jRM5/PmoA11GjnHEhp6pU/WGdSMkoJj+LhW2+6wzgJhqlb0MeTLd+9ikqhusw 7ZBnVsSUCaVmDeEXZIujVx2MTBgFnT5ry1OwnUrGCInk14o0K8xCVW0tXattNS+ewzDj +796TlKdrfZFxdoVCq8pMTCaR5CEKx7t3teGM4FJI+z7YVG60r8ot/IvpwIFnnh1/Nhk elAQ==

On 9/8/2020 08:04，Adrien Escande<adrien.escande@xxxxxxxxx> wrote：

I was able to confirm the results of Eigen in Matlab using a simple x = A.lu().solve(b); (your matrix has a condition number of about 200, so we're good on the numerical issue front).My best guess is that you have I/O problems. Did you confirm that the matrix you are using in Eigen is the matrix you intend to use? In particular: are you using the full precision of the file, and, most importantly, did you pay attention to the fact Eigen's matrices are column major (while reading your file sequentially is akin to having row major data) ?AdrienOn Tue, Sep 8, 2020 at 8:32 AM ztdepyahoo <ztdepyahoo@xxxxxxxxx> wrote:Thanks I solve it withI have a exact solution of "cos(6*Pi*x)*cos(6*Pi*y)", so i can obtain the absolute error. the order of error from Armadillo is "-14", while Eigen's error has an order of "1". I also tried other methods "fullPivLu()", "householderQr()", the situation doesn't change.But if i compute the relative error with Eigen's " double relative_error = (A*x - b).norm() / b.norm()", the relative_error is very small. I am confused by this situations.

On 9/8/2020 07:18，Adrien Escande<adrien.escande@xxxxxxxxx> wrote：Hi there,could you be more precise: how did you try to solve your problem with Eigen? How do you know/check that the problem is not solved correctly ?Best regards,Adrien EscandeOn Tue, Sep 8, 2020 at 12:55 AM ztdepyahoo <ztdepyahoo@xxxxxxxxx> wrote:Dear sir:The matrix is generated from the spectral method of a simple heat diffusion problems, the dimension is 841.Attachment please find the a and rhs output from Armadillo.I am wandering why eigen's dense linear sover cann't solve it correctly.Regards

**References**:**[eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can***From:*ztdepyahoo

**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can***From:*Adrien Escande

**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can***From:*ztdepyahoo

**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can***From:*Adrien Escande

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can** - Next by Date:
**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can** - Previous by thread:
**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can** - Next by thread:
**Re: [eigen] help: eigen cann't solve this simple ax correctly, but Armadillo c++ can**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |