RE: [eigen] Question regarding an operation |

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

*To*: "eigen@xxxxxxxxxxxxxxxxxxx" <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: RE: [eigen] Question regarding an operation*From*: Trevor Irons <tirons@xxxxxxxxxxxx>*Date*: Mon, 24 Aug 2015 21:56:14 +0000*Accept-language*: en-US*Thread-index*: AQHQ3rVW0KmJo0t1WkuVXf19b6ZNjZ4brcofgABoAwD//5vJnQ==*Thread-topic*: [eigen] Question regarding an operation

Ah, I didn't look closely enough, you are not writing to an Eigen type. So
float beta = (exp).array().sqrt()(0);
should work. or
float beta = std::sqrt( exp(0) )
sorry.
/*************************************************
* Trevor P. Irons, PhD
* Mobile: +1 720.635.8218
* EM Modelling API: http://lemmasoftware.org
*************************************************/
From: Nuno Marques [n.marques21@xxxxxxxxxxx]Sent: Monday, August 24, 2015 3:53 PMTo: eigen@xxxxxxxxxxxxxxxxxxxSubject: RE: [eigen] Question regarding an operationHi Trevor,
Thanks for the feedback.
Your suggestion issues a problem:
error: cannot convert 'const SqrtReturnType {aka const Eigen::CwiseUnaryOp<Eigen::internal::scalar_sqrt_op<float>, const Eigen::ArrayWrapper<const Eigen::Product<Eigen::Matrix<float,
2, 1>, Eigen::Product<Eigen::Matrix<float,
2, 2>, Eigen::Matrix<float,
2, 1>,
0>, 0> > >}' to 'float' in initialization
float beta = (r * (S_I * r)).array().sqrt();
^
compilation terminated due to -Wfatal-errors.
Any idea?
---
+351 912 090 991
Azambuja | Portugal
As the creation appears, the path is driven in the conscious
feeling of madness and happiness, which returns, in multiple ways, to what we achieve in greatness...Follow me in:
This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the
entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message
and any files attached without copying them in any way.From: tirons@xxxxxxxxxxxx To: eigen@xxxxxxxxxxxxxxxxxxx Subject: RE: [eigen] Question regarding an operation Date: Mon, 24 Aug 2015 21:43:10 +0000 You need to read up about array's to understand this:
As long as your algebra is correct,
float beta = (r*(S_I*R)).array().sqrt();
should work.
/*************************************************
* Trevor P. Irons, PhD
* Mobile: +1 720.635.8218
* EM Modelling API: http://lemmasoftware.org
*************************************************/
From: Nuno Marques [n.marques21@xxxxxxxxxxx]Sent: Monday, August 24, 2015 3:39 PMTo: eigen@xxxxxxxxxxxxxxxxxxxSubject: [eigen] Question regarding an operationHello there,
I want to question the community regarding the following:
Matrix<float,
n_y, n_x> C;
Vector2f r = y - C * _x;
Matrix<float,
n_y, n_y> S_I = (C * _P * C.transpose() + R).inverse();
I want to compute,
float beta =
sqrt(r * (S_I * r));
... but I'm not being able to. Can anyone suggest a solution to this? I tried many combinations, but without luck.
Thanks in advance! Best regards,
---
+351 912 090 991
Azambuja | Portugal
Follow me in:
This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the
entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message
and any files attached without copying them in any way. |

**Follow-Ups**:**RE: [eigen] Question regarding an operation***From:*Nuno Marques

**References**:**[eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**Re: [eigen] Compiling errors in Nuttx environment***From:*Christoph Hertzberg

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**Re: [eigen] Compiling errors in Nuttx environment***From:*Christoph Hertzberg

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**Re: [eigen] Compiling errors in Nuttx environment***From:*Christoph Hertzberg

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**Re: [eigen] Compiling errors in Nuttx environment***From:*Christoph Hertzberg

**RE: [eigen] Compiling errors in Nuttx environment***From:*Nuno Marques

**[eigen] Question regarding an operation***From:*Nuno Marques

**RE: [eigen] Question regarding an operation***From:*Trevor Irons

**RE: [eigen] Question regarding an operation***From:*Nuno Marques

**Messages sorted by:**[ date | thread ]- Prev by Date:
**RE: [eigen] Question regarding an operation** - Next by Date:
**RE: [eigen] Question regarding an operation** - Previous by thread:
**RE: [eigen] Question regarding an operation** - Next by thread:
**RE: [eigen] Question regarding an operation**

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