OONumerics User : |
From: chicomecoatl_at_[hidden]
Date: 2007-10-04 06:32:22
Hello every one,
I have developed libraries for PDEs solution using Finite Volume(FV) and Radial
Basis Functions(RBF) Methods. Because both methods are philosophically
different, my needs are different for each one. In the FV library I used Blitz++
to manage 1D, 2D and 3D arrays, while in the RBF I decided to use uBlas because
I need some linear algebra operations.
Now I wonder if there is an easy way to interchange between these two libraries
or some other like MTL or FLENS, just to test for efficiency.
For example, suppose I have the next simple code using uBlas:
#include <boost/numeric/ublas/matrix.hpp>
using namespace boost::numeric::ublas;
typedef matrix<float, column_major> Matrix;
Matrix A(N,N);
for(int j = 0; j < A.size2(); ++j)
for(int i = 0; i < A.size1(); ++i)
A(i,j) = i * j;
To do se same in Blitz++ I can do (for example):
#include <blitz/array.h>
using namespace blitz;
typedef Array<float, 2> Matrix;
Matrix A(N,N, ColumnMajorArray<2>());
for(int j = 0; j < A.ubound(secondDim); ++j)
for(int i = 0; i < A.ubound(firstDim); ++i)
A(i,j) = i * j;
Is there a way to wrap the arrays type definitions and the function names to use
both libraries in the same code, like in:
Matrix A(N,N);
for(int j = 0; j < A.cols(); ++j)
for(int i = 0; i < A.rows(); ++i)
A(i,j) = i * j;
Thanks a lot.
Luis M. de la Cruz
UNAM
-------------------------------------------------
www.correo.unam.mx
UNAMonos Comunicándonos