[Dune] Fwd: Re: another little c++ question that bugs me

Aleksejs Fomins aleksejs.fomins at lspr.ch
Wed Aug 13 12:21:43 CEST 2014


Thank you, I will correct it and keep it in mind.


I have another question, if possible.

I need to use Dune::DynamicMatrix< K >, because I require a matrix whose
dimensions are determined at runtime.

However neither the template parameter nor the constructor require any
information about the dimensions of the matrix. How do I specify the
dimension?

Regards,
Aleksejs


On 08/13/2014 12:16 PM, Christian Engwer wrote:
> One further comment:
> 
>>>> 		rez += pow(x1[i] - x2[i],2);
> 
> std::pow is rather slow as it can deal with any exponent, also
> negative and real. In your case it is better to use
>    (x1[i] - x2[i]) * (x1[i] - x2[i])
> 
> 
> Christian
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20140813/86e7d24c/attachment.sig>


More information about the Dune mailing list