Re: [eigen] Scalar operation |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Scalar operation*From*: Chen-Pang He <jdh8@xxxxxxxxxxxxxx>*Date*: Tue, 10 Feb 2015 01:00:58 +0800*Organization*: Integration by me

在 2015 二月 9 週一 13:22:08，Christoph Hertzberg 寫道: > Am 09.02.2015 um 09:53 schrieb Matwey V. Kornilov: > > Hi, > > > > What is the recommended way to perform Y = a * X + b ? where a and b are > > scalars and X is Matrix or Vector. Now I use unaryExpr, but think that > > it is odd. > > I'm afraid, I don't understand your question. Why not just write > Y = a * X + b; Addition between a matrix and a scalar is invalid. I'd write Y.array() = a * X.array() + b; Cheers, Chen-Pang

**Follow-Ups**:**Re: [eigen] Scalar operation***From:*Christoph Hertzberg

**References**:**[eigen] Scalar operation***From:*Matwey V. Kornilov

**Re: [eigen] Scalar operation***From:*Christoph Hertzberg

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Scalar operation** - Next by Date:
**Re: [eigen] Scalar operation** - Previous by thread:
**Re: [eigen] Scalar operation** - Next by thread:
**Re: [eigen] Scalar operation**

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