C ++中的线性预警 [英] Linear Alegebra in C++
问题描述
大家好,
我正在寻找一个快速,高效(调整速度,而不是大小)和
成熟的C ++代码来做一些数值与...合作。我查看了
模板数值工具包,oonumerics.org网页声称是
lapack ++的继承者。但从表面上看,似乎没有lapack ++的所有功能,更不用说成为其继承者了。在
另一方面,它可能会更快。我还没检查过。 Lapack ++是
应该是ublas的包装器。 TNT似乎没有任何东西可以用ublas做b $ b。它经常没有更新。还有一个
cpplapack正在独立于lapack ++开发。
我的问题是TNT的速度有多快。它比其他包快吗?如果
您选择了一个套餐,您会选择哪个套餐?
谢谢,
RS
Hi all,
I am looking for a fast, efficient (tuned for speed, not size) and
mature C++ code to do some numerical work with. I have looked at the
Template Numerical Toolkit, which the oonumerics.org web page claims is
a successor to lapack++. But on the surface it doesn''t seem to have all
the functionalities of lapack++, let alone being its successor. On the
other hand, it may be faster. I haven''t checked that yet. Lapack++ is
supposed to be a wrapper for ublas. TNT doesn''t seem to have anything to
do with ublas. It hasn''t been updated that often. There is also a
cpplapack that is being developed independently of lapack++.
My question is how fast is TNT. Is it faster than the other packages? If
you were to chose one package, which one would you chose?
Thanks,
RS
推荐答案
RS写道:
RS wrote:
我正在寻找快速,高效(调整速度,而不是尺寸)和
成熟的C ++代码做一些数值工作。我查看了
模板数值工具包,oonumerics.org网页声称是
lapack ++的继承者。但从表面上看,似乎没有lapack ++的所有功能,更不用说成为其继承者了。在
另一方面,它可能会更快。我还没检查过。 Lapack ++是
应该是ublas的包装器。 TNT似乎没有任何东西可以用ublas做b $ b。它经常没有更新。还有一个
cpplapack正在独立于lapack ++开发。
我的问题是TNT的速度有多快。它比其他包快吗?如果你要选择一个包裹,你会选择哪一个?
I am looking for a fast, efficient (tuned for speed, not size) and
mature C++ code to do some numerical work with. I have looked at the
Template Numerical Toolkit, which the oonumerics.org web page claims is
a successor to lapack++. But on the surface it doesn''t seem to have all
the functionalities of lapack++, let alone being its successor. On the
other hand, it may be faster. I haven''t checked that yet. Lapack++ is
supposed to be a wrapper for ublas. TNT doesn''t seem to have anything to
do with ublas. It hasn''t been updated that often. There is also a
cpplapack that is being developed independently of lapack++.
My question is how fast is TNT. Is it faster than the other packages? If
you were to chose one package, which one would you chose?
我在这里没有帮助,你可能会在其他地方得到更好的答案。这个
组专注于C ++语言,而不是第三方库
(参见 http://www.parashift.com/c++-faq-lit....html#faq- 5.9)。
对不起。
干杯! --M
I''m no help here, and you''ll likely get better answers elsewhere. This
group focuses on the C++ language proper, not third-party libraries
(see http://www.parashift.com/c++-faq-lit....html#faq-5.9).
Sorry.
Cheers! --M
你知道如何用C ++编写二次方程吗?
Do you know how to write the quadratic equation in C++?
sonhado ... @ gmail.com写道:
sonhado...@gmail.com wrote:
你知道如何用C ++编写二次方程吗?
Do you know how to write the quadratic equation in C++?
是的。一种方法是:
float qe(const float a,const float b,const float c)
{
const float discriminant = b * b - 4.0 * a * c;
if(discriminant< 0)
{
cout<< 根是虚构的。 <<结束;
}
其他
{
const float denom = 2 * a;
cout<< 根是: << (-b +判别)/ denom
<< , << (-b-discriminant)/ denom
<<结束;
}
}
干杯! --M
Yes. One way would be:
float qe( const float a, const float b, const float c )
{
const float discriminant = b*b - 4.0*a*c;
if( discriminant < 0 )
{
cout << "Roots are imaginary." << endl;
}
else
{
const float denom = 2*a;
cout << "Roots are: " << (-b+discriminant) / denom
<< ", " << (-b-discriminant) / denom
<< endl;
}
}
Cheers! --M
这篇关于C ++中的线性预警的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!