10 std::map<std::string,Array<float,1,8,DontAlign|RowMajor> >
results;
14 template<
typename Solver,
typename MatrixType>
17 if(A.rows()!=A.cols())
18 solver.compute(A.transpose()*A);
23 template<
typename Solver,
typename MatrixType>
29 template<
typename Scalar,
int Size>
39 BenchTimer t_llt, t_ldlt, t_lu, t_fplu, t_qr, t_cpqr, t_cod, t_fpqr, t_jsvd, t_bdcsvd;
67 if(
size*rows<=10000000)
70 BENCH(t_jsvd, tries, rep, jsvd.compute(A,svd_opt));
72 BENCH(t_bdcsvd, tries, rep,
bdcsvd.compute(A,svd_opt));
75 results[
"LDLT"][
id] = t_ldlt.
best();
76 results[
"PartialPivLU"][
id] = t_lu.
best();
77 results[
"FullPivLU"][
id] = t_fplu.
best();
78 results[
"HouseholderQR"][
id] = t_qr.
best();
79 results[
"ColPivHouseholderQR"][
id] = t_cpqr.
best();
80 results[
"CompleteOrthogonalDecomposition"][
id] = t_cod.
best();
81 results[
"FullPivHouseholderQR"][
id] = t_fpqr.
best();
82 results[
"JacobiSVD"][
id] = t_jsvd.
best();
83 results[
"BDCSVD"][
id] = t_bdcsvd.
best();
91 labels.push_back(
"PartialPivLU");
92 labels.push_back(
"FullPivLU");
93 labels.push_back(
"HouseholderQR");
94 labels.push_back(
"ColPivHouseholderQR");
95 labels.push_back(
"CompleteOrthogonalDecomposition");
96 labels.push_back(
"FullPivHouseholderQR");
97 labels.push_back(
"JacobiSVD");
98 labels.push_back(
"BDCSVD");
104 sizes.push_back(Array2i(small,small));
105 sizes.push_back(Array2i(100,100));
106 sizes.push_back(Array2i(1000,1000));
107 sizes.push_back(Array2i(4000,4000));
108 sizes.push_back(Array2i(10000,small));
109 sizes.push_back(Array2i(10000,100));
110 sizes.push_back(Array2i(10000,1000));
111 sizes.push_back(Array2i(10000,4000));
115 for(
int k=0; k<
sizes.size(); ++k)
117 cout <<
sizes[k](0) <<
"x" <<
sizes[k](1) <<
"...\n";
118 bench<float,Dynamic>(k,
sizes[k](0),
sizes[k](1));
122 cout <<
"solver/size";
124 for(
int k=0; k<
sizes.size(); ++k)
126 std::stringstream
ss;
128 cout.width(10); cout << ss.str(); cout <<
" ";
135 cout.width(32); cout <<
labels[
i]; cout <<
" ";
137 for(
int k=0; k<
sizes.size(); ++k)
140 if(r(k)>=1e6) cout <<
"-";
148 cout <<
"<table class=\"manual\">" << endl;
149 cout <<
"<tr><th>solver/size</th>" << endl;
150 for(
int k=0; k<
sizes.size(); ++k)
151 cout <<
" <th>" <<
sizes[k](0) <<
"x" <<
sizes[k](1) <<
"</th>";
152 cout <<
"</tr>" << endl;
156 if(
i%2==1) cout <<
" class=\"alt\"";
157 cout <<
"><td>" <<
labels[
i] <<
"</td>";
159 for(
int k=0; k<
sizes.size(); ++k)
161 if(r(k)>=1e6) cout <<
"<td>-</td>";
164 cout <<
"<td>" << r(k);
168 cout <<
" <sup><a href=\"#note_ls\">*</a></sup>";
172 cout <<
"</tr>" << endl;
174 cout <<
"</table>" << endl;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Robust Cholesky decomposition of a matrix with pivoting.
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Q id(Eigen::AngleAxisd(0, Q_z_axis))
std::vector< std::string > labels
std::vector< Array2i > sizes
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
void bench(int id, int rows, int size=Size)
LU decomposition of a matrix with partial pivoting, and related features.
Namespace containing all symbols from the Eigen library.
BiCGSTAB< SparseMatrix< double > > solver
Complete orthogonal decomposition (COD) of a matrix.
EIGEN_DONT_INLINE void compute_norm_equation(Solver &solver, const MatrixType &A)
HouseholderQR< MatrixXf > qr(A)
#define EIGEN_DONT_INLINE
void bdcsvd(const MatrixType &a=MatrixType(), bool pickrandom=true)
EIGEN_DEVICE_FUNC const RoundReturnType round() const
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Matrix< Scalar, Dynamic, Dynamic > Mat
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
static std::stringstream ss
class Bidiagonal Divide and Conquer SVD
double best(int TIMER=CPU_TIMER) const
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
LU decomposition of a matrix with complete pivoting, and related features.
std::map< std::string, Array< float, 1, 8, DontAlign|RowMajor > > results
Householder QR decomposition of a matrix.
Two-sided Jacobi SVD decomposition of a rectangular matrix.
#define BENCH(TIMER, TRIES, REP, CODE)
EIGEN_DONT_INLINE void compute(Solver &solver, const MatrixType &A)
The matrix class, also used for vectors and row-vectors.
Derived & setRandom(Index size)