Go to the documentation of this file.
32 for (int _j=0; _j<NBTRIES; ++_j) { \
34 for (int _k=0; _k<REPEAT; ++_k) { \
64 cs* cs_sorted_multiply(
const cs*
a,
const cs*
b)
68 cs*
A = cs_transpose(
a, 1);
69 cs*
B = cs_transpose(
b, 1);
70 cs*
D = cs_multiply(
B,
A);
74 cs*
C = cs_transpose (
D, 1) ;
83 cs* cs_sorted_multiply2(
const cs*
a,
const cs*
b)
85 cs*
D = cs_multiply(
a,
b);
86 cs*
E = cs_transpose(
D,1);
88 cs*
C = cs_transpose(
E,1);
96 int main(
int argc,
char *argv[])
107 for (
int nnzPerCol =
NNZPERCOL; nnzPerCol>1; nnzPerCol/=1.1)
118 std::cout <<
"Eigen Dense\t" << nnzPerCol <<
"%\n";
125 for (
int k=0; k<
REPEAT; ++k)
128 std::cout <<
" a * b:\t" <<
timer.
value() << endl;
132 for (
int k=0; k<
REPEAT; ++k)
135 std::cout <<
" a' * b:\t" <<
timer.
value() << endl;
139 for (
int k=0; k<
REPEAT; ++k)
140 m3 =
m1.transpose() *
m2.transpose();
142 std::cout <<
" a' * b':\t" <<
timer.
value() << endl;
146 for (
int k=0; k<
REPEAT; ++k)
149 std::cout <<
" a * b':\t" <<
timer.
value() << endl;
155 std::cout <<
"Eigen sparse\t" << sm1.nonZeros()/(
float(sm1.rows())*
float(sm1.cols()))*100 <<
"% * "
156 << sm2.nonZeros()/(
float(sm2.rows())*
float(sm2.cols()))*100 <<
"%\n";
158 BENCH(sm3 = sm1 * sm2; )
159 std::cout <<
" a * b:\t" <<
timer.
value() << endl;
227 std::cout <<
"CSparse \t" << nnzPerCol <<
"%\n";
229 eiToCSparse(sm1,
m1);
230 eiToCSparse(sm2,
m2);
234 m3 = cs_sorted_multiply(
m1,
m2);
237 std::cerr <<
"cs_multiply failed\n";
244 std::cout <<
" a * b:\t" <<
timer.
value() << endl;
253 std::cout <<
"ublas\t" << nnzPerCol <<
"%\n";
259 std::cout <<
" a * b:\t" <<
timer.
value() << endl;
266 std::cout <<
"GMM++ sparse\t" << nnzPerCol <<
"%\n";
273 std::cout <<
" a * b:\t" <<
timer.
value() << endl;
297 std::cout <<
"MTL4\t" << nnzPerCol <<
"%\n";
303 std::cout <<
" a * b:\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)
int main(int argc, char *argv[])
void eiToMtl(const EigenSparseMatrix &src, MtlSparse &dst)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
double value(int TIMER=CPU_TIMER) const
gmm::col_matrix< gmm::wsvector< Scalar > > GmmDynSparse
void eiToUblas(const EigenSparseMatrix &src, UBlasSparse &dst)
static const DiscreteKey m3(M(3), 2)
Matrix< Scalar, Dynamic, Dynamic > C
gmm::csc_matrix< Scalar > GmmSparse
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
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