Re: [eigen] Bug with cwiseMin / cwiseMax |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Bug with cwiseMin / cwiseMax*From*: Mathieu Dutour <mathieu.dutour@xxxxxxxxx>*Date*: Mon, 6 Jul 2015 20:08:16 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hLVayTxEE6uzTUkuQk7XZhvFyVJiLJKB6tXEX1fUhEE=; b=Fn55M9aozJp7C+29wO/yeAF1M0uZCu2OgUUe47nQ1VgFQUc8M8kJm3pIHWfx8ujJrS KSBkCZ/OFNbbJhQN7sm7R+UlVEiKOmyF5Z6s/IyfSeOrOlEDfUYfXNuY4FF4nIZVcnXH kiv7S/oX+Ot+jeYj6kUuvYkFCjckNlWrA+fJX5mn02nk/R7VhgmJ81NzDdJB7E/uWA4U MzRRjBbzeuNZ1DpcozX1R3m9A+IQTHP8q9KTYXgGkIJxWP7ts/XrlanNfO46fRV6Lgwn VFcYT3Qo11eQvTK4p7gHGd/PCpbopOBaXQKAPY+swSlr9VN+FfvHTLvzHq44fJbE0kvQ Gmrg==

Hi Christof,

thanks for information. It is a little unexpected.

What are the rules for having a term in end result

as well as in input.

For example the doc/AsciiQuickReference.txt

has following line;

A += F; // illegal in Eigen. In Matlab A = A+F is allowed

So, from this line it would seem that A = A + F is illegal in Eigen

and logically M1 = M1.cwiseMax(M2) as well.

What is the rule for this kind of problems?

Mathieu

On Mon, Jul 6, 2015 at 5:23 PM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Am 06.07.2015 um 17:16 schrieb Mathieu Dutour:

void PrintMatrix(MyMatrix<double> const& eMat)

Instead of that method, you can write:

std::cerr << eMat;

M1.cwiseMax(M2);

This method does not change anything, but returns a new matrix (technically, a matrix _expression_). You can assign this to a new matrix or to either of M1/M2:

M1 = M1.cwiseMax(M2);

Or you can directly print it:

std::cerr << M1.cwiseMax(M2);

Or use it in other expressions:

MyMatrix<double> M3 = M1.cwiseMin(M2) * M1.cwiseMax(M2);

Christoph

--

----------------------------------------------

Dipl.-Inf., Dipl.-Math. Christoph Hertzberg

Cartesium 0.049

Universität Bremen

Enrique-Schmidt-Straße 5

28359 Bremen

Tel: +49 (421) 218-64252

----------------------------------------------

**Follow-Ups**:**Re: [eigen] Bug with cwiseMin / cwiseMax***From:*Christoph Hertzberg

**References**:**[eigen] Bug with cwiseMin / cwiseMax***From:*Mathieu Dutour

**Re: [eigen] Bug with cwiseMin / cwiseMax***From:*Christoph Hertzberg

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Bug with cwiseMin / cwiseMax** - Next by Date:
**Re: [eigen] Bug with cwiseMin / cwiseMax** - Previous by thread:
**Re: [eigen] Bug with cwiseMin / cwiseMax** - Next by thread:
**Re: [eigen] Bug with cwiseMin / cwiseMax**

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