21 #ifndef BLITZ_INTERFACE_HH 22 #define BLITZ_INTERFACE_HH 24 #include <blitz/blitz.h> 25 #include <blitz/array.h> 26 #include <blitz/vector-et.h> 27 #include <blitz/vecwhere.h> 28 #include <blitz/matrix.h> 31 BZ_USING_NAMESPACE(blitz)
48 static inline std::string
name() {
return "blitz"; }
55 A.resize(A_stl[0].
size(),A_stl.size());
56 for (
int j=0;
j<A_stl.size() ;
j++){
57 for (
int i=0;
i<A_stl[
j].size() ;
i++){
64 B.resize(B_stl.size());
65 for (
int i=0;
i<B_stl.size() ;
i++){
71 for (
int i=0;
i<B_stl.size() ;
i++){
78 for (
int j=0;
j<
N;
j++){
90 X =
sum(
A(i,k) *
B(k,j), k);
93 static inline void ata_product(
const gene_matrix &
A, gene_matrix &
X,
int N)
98 X =
sum(
A(k,i) *
A(k,j), k);
106 X =
sum(
A(i,k) *
A(j,k), k);
113 X =
sum(
A(i,j)*
B(j),j);
116 static inline void atv_product(gene_matrix &
A, gene_vector &
B, gene_vector &
X,
int N)
120 X =
sum(
A(j,i) *
B(j),j);
123 static inline void axpy(
const real coef,
const gene_vector &
X, gene_vector &
Y,
int N)
126 Y =
Y(i) + coef *
X(i);
130 static inline void copy_matrix(
const gene_matrix & source, gene_matrix & cible,
int N){
140 static inline void copy_vector(
const gene_vector & source, gene_vector & cible,
int N){
blitz::Array< real, 2 > gene_matrix
static void matrix_matrix_product(const gene_matrix &A, const gene_matrix &B, gene_matrix &X, int N)
static void aat_product(const gene_matrix &A, gene_matrix &X, int N)
static void copy_matrix(const gene_matrix &source, gene_matrix &cible, int N)
static void vector_to_stl(gene_vector &B, stl_vector &B_stl)
static void matrix_to_stl(gene_matrix &A, stl_matrix &A_stl)
Matrix< SCALARA, Dynamic, Dynamic > A
static void copy_vector(const gene_vector &source, gene_vector &cible, int N)
Matrix< SCALARB, Dynamic, Dynamic > B
static void free_vector(gene_vector &B)
static void ata_product(const gene_matrix &A, gene_matrix &X, int N)
static void atv_product(gene_matrix &A, gene_vector &B, gene_vector &X, int N)
static void matrix_vector_product(gene_matrix &A, gene_vector &B, gene_vector &X, int N)
static void axpy(const real coef, const gene_vector &X, gene_vector &Y, int N)
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
static std::string name()
static void matrix_from_stl(gene_matrix &A, stl_matrix &A_stl)
std::vector< stl_vector > stl_matrix
static void vector_from_stl(gene_vector &B, stl_vector &B_stl)
std::vector< real > stl_vector
static void free_matrix(gene_matrix &A, int N)
blitz::Array< real, 1 > gene_vector