Go to the documentation of this file.
21 #define MINDENSITY 0.0004
30 for (int _j=0; _j<NBTRIES; ++_j) { \
32 for (int _k=0; _k<REPEAT; ++_k) { \
38 cs* cs_sorted_multiply(
const cs*
a,
const cs*
b)
40 cs*
A = cs_transpose (
a, 1) ;
41 cs*
B = cs_transpose (
b, 1) ;
42 cs*
D = cs_multiply (
B,
A) ;
46 cs*
C = cs_transpose (
D, 1) ;
52 int main(
int argc,
char *argv[])
71 std::cout <<
"Eigen Dense\t" <<
density*100 <<
"%\n";
77 for (
int k=0; k<
REPEAT; ++k)
84 for (
int k=0; k<
REPEAT; ++k)
87 std::cout <<
" a' * v:\t" <<
timer.
best() << endl;
95 BENCH(
asm(
"#myc");
v2 = sm1 *
v1;
asm(
"#myd");)
99 BENCH( {
asm(
"#mya");
v2 = sm1.transpose() *
v1;
asm(
"#myb"); })
118 std::cout <<
"GMM++ sparse\t" <<
density*100 <<
"%\n";
123 std::vector<Scalar> gmmV1(
cols), gmmV2(
cols);
127 BENCH(
asm(
"#myx"); gmm::mult(
m1, gmmV1, gmmV2);
asm(
"#myy"); )
128 std::cout <<
" a * v:\t" <<
timer.
value() << endl;
130 BENCH( gmm::mult(gmm::transposed(
m1), gmmV1, gmmV2); )
131 std::cout <<
" a' * v:\t" <<
timer.
value() << endl;
137 std::cout <<
"ublas sparse\t" <<
density*100 <<
"%\n";
141 boost::numeric::ublas::vector<Scalar> uv1, uv2;
150 std::cout <<
" a * v:\t" <<
timer.
value() << endl;
160 std::cout <<
"MTL4\t" <<
density*100 <<
"%\n";
163 mtl::dense_vector<Scalar> mtlV1(
cols, 1.0);
164 mtl::dense_vector<Scalar> mtlV2(
cols, 1.0);
168 for (
int k=0; k<
REPEAT; ++k)
171 std::cout <<
" a * v:\t" <<
timer.
value() << endl;
175 for (
int k=0; k<
REPEAT; ++k)
178 std::cout <<
" a' * v:\t" <<
timer.
value() << endl;
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
mtl::compressed2D< Scalar, mtl::matrix::parameters< mtl::tag::col_major > > MtlSparse
void eiToDense(const EigenSparseMatrix &src, DenseMatrix &dst)
void eiToMtl(const EigenSparseMatrix &src, MtlSparse &dst)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
double value(int TIMER=CPU_TIMER) const
void eiToUblasVec(const EigenType &src, UblasType &dst)
int main(int argc, char *argv[])
void eiToUblas(const EigenSparseMatrix &src, UBlasSparse &dst)
A matrix or vector expression mapping an existing array of data.
Matrix< Scalar, Dynamic, 1 > DenseVector
Matrix< Scalar, Dynamic, Dynamic > C
gmm::csc_matrix< Scalar > GmmSparse
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
double best(int TIMER=CPU_TIMER) const
void eiToGmm(const EigenSparseMatrix &src, GmmSparse &dst)
boost::numeric::ublas::compressed_matrix< Scalar, boost::numeric::ublas::column_major > UBlasSparse
EIGEN_DONT_INLINE void prod(const Lhs &a, const Rhs &b, Res &c)
void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix &dst)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:24