Re: [eigen] [FAQ] how to have an initialized static Matrix |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] [FAQ] how to have an initialized static Matrix*From*: Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>*Date*: Thu, 21 Mar 2013 11:54:52 +0100

On 03/21/2013 11:44:14 AM, Christoph Hertzberg wrote:

On 21.03.2013 11:36, Christoph Hertzberg wrote:On 21.03.2013 10:30, Helmut Jarausch wrote:unfortunately, Eigen's elegant initialization is an expression.Is there an "elegant" solution for this ugly code (within afunction)static double _C[6] = { 1.0 / 5, 3.0 / 10, 4.0 / 5, 8.0 / 9, 1.0, 1.0 };static const Eigen::Map<Eigen::Matrix<double,6,1>,0>C((double*)_C);I found another very hacked solution. It requires that the datalayout of Matrix will not change (especially, no extra fields will beintroduced):EIGEN_ALIGN16static const double C3_data[] = {1.0/5, 3.0/10, 4.0/5, 8.0/9, 1.0,1.0};static const Vec6d& C3 = reinterpret_cast<const Vec6d&>(*C3_data);

column ordering for efficiency. Helmut.

**Follow-Ups**:**Re: [eigen] [FAQ] how to have an initialized static Matrix***From:*Christoph Hertzberg

**References**:**[eigen] [FAQ] how to have an initialized static Matrix***From:*Helmut Jarausch

**Re: [eigen] [FAQ] how to have an initialized static Matrix***From:*Christoph Hertzberg

**Re: [eigen] [FAQ] how to have an initialized static Matrix***From:*Christoph Hertzberg

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] [FAQ] how to have an initialized static Matrix** - Next by Date:
**Re: [eigen] [FAQ] how to have an initialized static Matrix** - Previous by thread:
**Re: [eigen] [FAQ] how to have an initialized static Matrix** - Next by thread:
**Re: [eigen] [FAQ] how to have an initialized static Matrix**

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