aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/benchCholesky.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-08-09 20:06:25 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-08-09 20:06:25 +0000
commitb13148c3588c2be8805630c117cdc2b4cfb00576 (patch)
treefff72a7f4503c1b2dbfaab64db0260661707013d /bench/benchCholesky.cpp
parentd6e88f81551d5d9c1b66f4fc13d2f2211cb689ff (diff)
renamed inverseProduct => solveTriangular
Diffstat (limited to 'bench/benchCholesky.cpp')
-rw-r--r--bench/benchCholesky.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/bench/benchCholesky.cpp b/bench/benchCholesky.cpp
index dd0c7f83b..f64b61b71 100644
--- a/bench/benchCholesky.cpp
+++ b/bench/benchCholesky.cpp
@@ -18,7 +18,7 @@ using namespace Eigen;
#endif
#ifndef TRIES
-#define TRIES 4
+#define TRIES 10
#endif
typedef float Scalar;
@@ -29,6 +29,13 @@ __attribute__ ((noinline)) void benchCholesky(const MatrixType& m)
int rows = m.rows();
int cols = m.cols();
+ int cost = 0;
+ for (int j=0; j<rows; ++j)
+ {
+ int r = std::max(rows - j -1,0);
+ cost += 2*(r*j+r+j);
+ }
+
int repeats = (REPEAT*1000)/(rows*rows);
typedef typename MatrixType::Scalar Scalar;
@@ -70,7 +77,8 @@ __attribute__ ((noinline)) void benchCholesky(const MatrixType& m)
std::cout << "fixed ";
std::cout << covMat.rows() << " \t"
<< (timerNoSqrt.value() * REPEAT) / repeats << "s \t"
- << (timerSqrt.value() * REPEAT) / repeats << "s";
+ << (timerSqrt.value() * REPEAT) / repeats << "s "
+ << "(" << 1e-6 * cost*repeats/timerSqrt.value() << " MFLOPS)\n";
#ifdef BENCH_GSL
@@ -108,7 +116,7 @@ __attribute__ ((noinline)) void benchCholesky(const MatrixType& m)
int main(int argc, char* argv[])
{
- const int dynsizes[] = {/*4,6,8,12,16,24,32,49,64,67,128,129,130,131,132,*/256,257,258,259,260,512,0};
+ const int dynsizes[] = {/*4,6,8,12,16,24,32,49,64,67,128,129,130,131,132,*/256,257,258,259,260,512,900,0};
std::cout << "size no sqrt standard";
#ifdef BENCH_GSL
std::cout << " GSL (standard + double + ATLAS) ";