再请教Re: 请教大家c++ array# Computation - 科学计算
x*u
1 楼
首先谢谢大家的回帖,受益良多。
在下还有一件极幼稚的事情不明,还望大家帮忙解释解释。
不知道大家用过MTL(The Matrix Template
Library)没有。当我使用MTL里面的Matrix时,发现运行速度降低。于是我做了一个比较
,
发现MTL array的执行效率,低于c++ array。对于我使用的这个算例,竟有四倍之差!
*************************
the dimension is 301*301
using c++ dynamic array...
using SOR ...
the relax factor = 1.8
time in the solver(sec): 44.91
interations 11669 ~~~~
Norm of error < 0.000159678
*****************
the dimension is 301*301
using MTL array...
using SOR ...
the relax factor = 1.8
time in the solver(sec):
在下还有一件极幼稚的事情不明,还望大家帮忙解释解释。
不知道大家用过MTL(The Matrix Template
Library)没有。当我使用MTL里面的Matrix时,发现运行速度降低。于是我做了一个比较
,
发现MTL array的执行效率,低于c++ array。对于我使用的这个算例,竟有四倍之差!
*************************
the dimension is 301*301
using c++ dynamic array...
using SOR ...
the relax factor = 1.8
time in the solver(sec): 44.91
interations 11669 ~~~~
Norm of error < 0.000159678
*****************
the dimension is 301*301
using MTL array...
using SOR ...
the relax factor = 1.8
time in the solver(sec):