Re: [eigen] A piece of code that has me confused |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] A piece of code that has me confused
- From: Douglas Bates <bates@xxxxxxxxxxxxx>
- Date: Wed, 20 Jul 2011 14:47:18 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=eHnFdELjsPXK1GX1TCxevhLqlwJZPwNgDTPfjQb3CEU=; b=C5fm8WZH+Jyt0yuZvjHAiw2NQJ2GM1VIVXIEslLyC8Ka6AY7otCnUOCk8HRGivITT6 85YqDARgTLtd5RjqOVWdSo/tKgx/xvLdUXZGbkpjNDpm4hafnqZ8ov5OPTL+VNJKBvoK CPZBUtsA2DmgALAXQYbMgcHd4SSyzIRJgq2v8=
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.