Re: [eigen] documentation |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] documentation*From*: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>*Date*: Sun, 23 Nov 2014 23:16:54 +0100

On 22.11.2014 09:26, Mathieu Dutour wrote:

Q1: How to write a function that returns a matrix? the following code does not compile: Eigen::Matrix<double> HilbertMatrix(int const& n)

^-------------------^

Eigen::Matrix<double,Dynamic,Dynamic> or (in this case) simply Eigen::MatrixXd

{ Eigen::Matrix<double,Dynamic,Dynamic> eMat(n, n); for (int i=0; i<n; i++) for (int j=0; j<n; j++) eMat[i][j]=double(1)/(double(i+j+1));

^----^ This does not work. To access element (i,j) use eMat(i,j).

return eMat; } Q2: What is the list of individual operations? I imagine inverses function should be different between a floating point type and an exact number theoretic type. How can I acces exact inverse functions?

Here is a list of most operations: http://eigen.tuxfamily.org/dox/AsciiQuickReference.txt This page has a bit more information: http://eigen.tuxfamily.org/dox/group__QuickRefPage.html

http://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen

Q3: For the number theoretic operations, the technique is to do Gauss rows and columns operations. I understand Gauss elimination is out of consideration for floating point operations. But for number theory this is what is

needed. Can we have access to operation like Ci <----- >Ci - a Cj ?

C.row(i) -= a* C.row(j);

C.row(1) = C.col(0); // Possible aliasing effects!

Q4: I sometimes need higher dimensional containers. I wrote one inspired by "MyMatrix". Is there something similar in Eigen? I guess no, just asking.

There is the (unsupported) Tensor module in the dev-branch: http://eigen.tuxfamily.org/dox-devel/unsupported/group__CXX11__Tensor__Module.html

Q5: There are many examples of use eigen in the code but they are all more or less of the same kind. a) Could we get examples that use template parameters? double and float are fine but that is not what all there is

Look here on how to use custom types: http://eigen.tuxfamily.org/dox/TopicCustomizingEigen.html#title2

b) Could we get examples with variable matrix size?

c) Could we get use of copy constructors and assignment operators?

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] documentation***From:*Mathieu Dutour

**References**:**Re: [eigen] documentation***From:*Mathieu Dutour

**Re: [eigen] documentation***From:*Christoph Hertzberg

**Re: [eigen] documentation***From:*Gael Guennebaud

**Re: [eigen] documentation***From:*Mathieu Dutour

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

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