Re: [eigen] A piece of code that has me confused

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


On Wed, Jul 20, 2011 at 2:20 PM, Christoph Hertzberg
<chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On 20.07.2011 21:05, Douglas Bates wrote:
>>
>> In the file unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h the
>> method _solve uses the template keyword in a way I have not seen
>> before:
>>
>>
>>          if(m_matrix.nonZeros()>0) // otherwise L==I
>>              m_matrix.template
>> triangularView<UnitLower>().solveInPlace(dest);
>>
>> Can anyone point me to documentation on that usage?
>
> Short answer: Since the compiler does not know the actual type of m_matrix,
> it can't be sure whether triangularView is a member variable or a templated
> function, by using template it is told that it is the latter.

> Here is a pretty good answer to that question:

> http://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-template-and-typename-on-dependent-names

> HTH
> Christoph

It certainly does help.  Thank you.



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