add ger and lu with partial pivoting in BTL

This commit is contained in:
Gael Guennebaud
2009-08-04 11:30:33 +02:00
parent 4bec101470
commit c2a92e92a6
23 changed files with 340 additions and 86 deletions

View File

@@ -23,7 +23,7 @@
// minimal time for each measurement
#define REAL_TYPE float
// minimal time for each measurement
#define MIN_TIME 1.0
#define MIN_TIME 0.5
// nb of point on bench curves
#define NB_POINT 100
// min vector size for axpy bench
@@ -33,7 +33,7 @@
// min matrix size for matrix vector product bench
#define MIN_MV 5
// max matrix size for matrix vector product bench
#define MAX_MV 2048
#define MAX_MV 3000
// min matrix size for matrix matrix product bench
#define MIN_MM 5
// max matrix size for matrix matrix product bench
@@ -41,13 +41,13 @@
// min matrix size for LU bench
#define MIN_LU 5
// max matrix size for LU bench
#define MAX_LU 2048
#define MAX_LU 3000
// max size for tiny vector and matrix
#define TINY_MV_MAX_SIZE 16
// default nb_sample for x86 timer
#define DEFAULT_NB_SAMPLE 1000
// how many times we run a single bench (keep the best perf)
#define NB_TRIES 3
#define NB_TRIES 5
#endif

View File

@@ -32,7 +32,6 @@ double simple_function(int index_i, int index_j)
double pseudo_random(int index)
{
// INFOS("random="<<(std::rand()/double(RAND_MAX)));
return std::rand()/double(RAND_MAX);
}

View File

@@ -41,13 +41,24 @@ BTL_DONT_INLINE void init_row(Vector & X, int size, int row){
// [] operator for setting rows
template<double init_function(int,int),class Vector>
BTL_DONT_INLINE void init_matrix(Vector & A, int size){
A.resize(size);
for (int row=0; row<A.size() ; row++){
init_row<init_function>(A[row],size,row);
}
}
template<double init_function(int,int),class Matrix>
BTL_DONT_INLINE void init_matrix_symm(Matrix& A, int size){
A.resize(size);
for (int row=0; row<A.size() ; row++)
A[row].resize(size);
for (int row=0; row<A.size() ; row++){
A[row][row] = init_function(row,row);
for (int col=0; col<row ; col++){
double x = init_function(row,col);
A[row][col] = A[col][row] = x;
}
}
}
#endif

View File

@@ -47,7 +47,6 @@ public:
time_action = time_calculate(action);
while (time_action < MIN_TIME)
{
//Action action(size);
_nb_calc *= 2;
action.initialize();
time_action = time_calculate(action);
@@ -65,7 +64,7 @@ public:
time_action = time_action / (double(_nb_calc));
// check
if (BtlConfig::Instance.checkResults)
if (BtlConfig::Instance.checkResults && size<128)
{
action.initialize();
action.calculate();