Main Page | Namespace List | Data Structures | File List | Namespace Members | Data Fields | Globals

mul_bench.cpp File Reference

#include <iostream>
#include <iomanip>
#include <boost/numeric/ublas/duff.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/operation_blocked.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/timer.hpp>

Go to the source code of this file.

Namespaces

namespace  std

Defines

#define mul(a, b, m)
#define mul2(xtype)
#define mul3(xtype)
#define mulset(xtype, atype, btype)

Typedefs

typedef ublas::matrix< double,
ublas::column_major > 
CT
typedef ublas::matrix< double,
ublas::row_major > 
RT

Functions

void initmatrix (ublas::matrix< double > &A)
void initmatrix (ublas::matrix< double, ublas::column_major > &A)
template<class M> void zeromatrix (M &X)
void test2 (const size_t size)
int main (int argc, char *argv[])


Define Documentation

#define mul a,
b,
 ) 
 

Value:

{ \
  initmatrix(A); \
  initmatrix(B); \
  t.restart(); \
  for (size_t a=0;a<size;a++) \
   for (size_t b=0;b<size;b++) \
    size_t m = 0; \
    DD (size, 4, e, ((X(r,c) += A(r,k)*B(k,c)), ++m) ); \
  time = t.elapsed(); \
  cout << setw(8) << time << flush; \
}

Definition at line 34 of file mul_bench.cpp.

#define mul2 xtype   ) 
 

Value:

{ \
  zeromatrix(X); \
  initmatrix(A); \
  initmatrix(B); \
  t.restart(); \
  X.plus_assign(prod(A,B)); \
  time = t.elapsed(); \
  cout << setw(8) << time << flush; \
  cerr << equals(X,prod(A,B)) << endl; \
}

Definition at line 47 of file mul_bench.cpp.

#define mul3 xtype   ) 
 

Value:

{ \
  zeromatrix(X); \
  initmatrix(A); \
  initmatrix(B); \
  t.restart(); \
  X.plus_assign(ublas::block_prod<xtype>(A,B,64)); \
  time = t.elapsed(); \
  cout << setw(8) << time << flush; \
  cerr << equals(X,prod(A,B)) << endl; \
}

Definition at line 59 of file mul_bench.cpp.

#define mulset xtype,
atype,
btype   ) 
 

Value:

{ \
 xtype X(size,size); \
 atype A(size,size); \
 btype B(size,size); \
 mul2(xtype); \
 mul3(xtype); \
 mul(r,k,c); \
 mul(r,c,k); \
 mul(k,r,c); \
 mul(k,c,r); \
 mul(c,r,k); \
 mul(c,k,r); \
 cout << endl; \
}

Definition at line 71 of file mul_bench.cpp.

Referenced by test(), and test2().


Typedef Documentation

typedef ublas::matrix<double,ublas::column_major> CT
 

Definition at line 31 of file mul_bench.cpp.

Referenced by test(), and test2().

typedef ublas::matrix<double,ublas::row_major> RT
 

Definition at line 32 of file mul_bench.cpp.

Referenced by test(), and test2().


Function Documentation

void initmatrix ublas::matrix< double, ublas::column_major > &  A  ) 
 

Definition at line 19 of file mul_bench.cpp.

void initmatrix ublas::matrix< double > &  A  ) 
 

Definition at line 14 of file mul_bench.cpp.

int main int  argc,
char *  argv[]
 

Definition at line 103 of file mul_bench.cpp.

References test2().

void test2 const size_t  size  ) 
 

Definition at line 87 of file mul_bench.cpp.

References CT, mulset, and RT.

Referenced by main().

template<class M>
void zeromatrix M &  X  ) 
 

Definition at line 26 of file mul_bench.cpp.


Generated on Wed Oct 1 14:41:00 2003 for Sample Code by doxygen 1.3.2