Re: [eigen] aliasing system

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


Benoît Jacob wrote:
On Friday 07 September 2007 10:44:18 Andre Krause wrote:
The point of my example with rows was that if we want to determine if
rows/columns/blocks/minors overlap in memory, we're trying to do
something that can't be done at compile-time (because the arguments that
you pass to these functions is not necessary a compile-time constant).
Hence that will have a cost, and if you want to handle all cases it'll
be a big cost (you'll have to check for each entry in the matrix if
overlapping occurs at that entry).

BUT i still would insist to have that check in _DEBUG mode only at
runtime ! if it is possible without too much coding. it is very
important to be able to somehow know that my code does what i assume it
to do. and newbies and those who usually skip the FAQ and DOCs will be
faced with strange errors if they try what seems to be a naturally
equation: m=m*m.

OK, seems like a good idea. I'll try to do it.


ok, that would be really great. but please dont put any priority on it - i dont want to distract you from the main goal, a working eigen2 release!

but i have another idea:

Umm, no. The expression templates are not just an optimization, they are the central building block and the API would not be possible without them. Without expression templates there is no way that we could allow adding one row into another one by doing

matrix.xpr().row(0) += matrix.row(1).

So it's not possible to add/remove Ets depending on an ifdef.

Cheers,
Benoit

but it would be possible to add alias() inside the operator=(...) function(s) ??? so the system would always generate a temporary ? so one could cross validate one's code with and without temporaries.

something ala

operator=(const Matrix<T,d1,d2>&m)
{
	#ifdef _NO_EXPTEMPLATE_OPTIMIZE
	this->alias()=m;
	#else
	???
	#endif
}

??	



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