Re: [eigen] update |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] update*From*: Benoît Jacob <jacob@xxxxxxxxxxxxxxx>*Date*: Thu, 27 Sep 2007 08:58:06 +0200

First of all: I forgot to mention, but thought it was obvious, that this is all committed, so you can check it out at /branches/work/eigen2 as usual. With only 714 lines of code it _can't_ be that difficult to get acquainted with! On Wednesday 26 September 2007 21:11:54 Schleimer, Ben wrote: > Wow, nice. Thats a pretty huge drop. Nice job. I guess we'll have plenty of > design wiggle room for implementing specific optimizations... Yes, and first and foremost, we must now unroll loops. I'll look into this soon, probably using template metaprograms. By the way, if anyone feels he can help with that, that's welcome! > > template<typename T, typename U> f(EigenBase<T,U>& m); > Very nice. Can you give a quick example of f? Ok, I made an example, see attached file. > Wow, how did you achieve this black magic? Seems extremely cool though. Each type has static const int members RowsAtCompileTime and ColsAtCompileTime, initialized in the body of the class. Here's as an example the MatrixProduct class: static const int RowsAtCompileTime = Lhs::RowsAtCompileTime, ColsAtCompileTime = Rhs::ColsAtCompileTime; Ultimately, this is set in the Matrix class to be the template parameters _Rows and _Cols of Matrix. In case of dynamic-size, this equals the DynamicSize enum constant, which is -1. Well, I can only encourage you to check out the source code :) > Well if eval is applicable to all eigen expressions, then I don't see why > it shouldn't be in the Eigen2 namespace and be done with it. It seems > reasonable for it to be general, especially if it used for different > expressions. OK. Cheers, Benoit

#include<All> using namespace std; using namespace Eigen; template<typename Scalar, typename Derived> void foo(const EigenBase<Scalar, Derived>& m) { cout << "Here's m:" << endl << m << endl; } template<typename Scalar, typename Derived> ScalarProduct<Derived> twice(const EigenBase<Scalar, Derived>& m) { // note that the static_cast here will soon be unnecessary // but currently it is required. return static_cast<Scalar>(2) * m; } int main(int argc, char**argv) { Matrix2d m; m(0,0)= 1; m(1,0)= 2; m(0,1)= 3; m(1,1)= 4; foo(m); foo(twice(m)); return 0; }

**Attachment:
signature.asc**

**References**:**Re: [eigen] update***From:*Schleimer, Ben

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] update** - Next by Date:
**[eigen] need help optimizing with __restrict__ and such** - Previous by thread:
**Re: [eigen] update** - Next by thread:
**[eigen] need help optimizing with __restrict__ and such**

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