mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* merge
* remove a ctor in QuaternionBase as it gives a strange error with GCC 4.4.2.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// for linear algebra.
|
||||
//
|
||||
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
|
||||
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
// Copyright (C) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
||||
//
|
||||
// Eigen is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
@@ -27,7 +27,7 @@
|
||||
#define EIGEN_BENCH_TIMER_H
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
@@ -41,6 +41,11 @@ namespace Eigen
|
||||
{
|
||||
|
||||
/** Elapsed time timer keeping the best try.
|
||||
*
|
||||
* On POSIX platforms we use clock_gettime with CLOCK_PROCESS_CPUTIME_ID.
|
||||
* On Windows we use QueryPerformanceCounter
|
||||
*
|
||||
* Important: on linux, you must link with -lrt
|
||||
*/
|
||||
class BenchTimer
|
||||
{
|
||||
@@ -83,10 +88,9 @@ public:
|
||||
QueryPerformanceCounter(&query_ticks);
|
||||
return query_ticks.QuadPart/m_frequency;
|
||||
#else
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
gettimeofday(&tv, &tz);
|
||||
return (double)tv.tv_sec + 1.e-6 * (double)tv.tv_usec;
|
||||
timespec ts;
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
|
||||
return double(ts.tv_sec) + 1e-9 * double(ts.tv_nsec);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -178,13 +178,13 @@ using namespace Eigen;
|
||||
void bench_eigengemm(MyMatrix& mc, const MyMatrix& ma, const MyMatrix& mb, int nbloops)
|
||||
{
|
||||
for (uint j=0 ; j<nbloops ; ++j)
|
||||
mc += (ma * mb).lazy();
|
||||
mc.noalias() += ma * mb;
|
||||
}
|
||||
|
||||
void bench_eigengemm_normal(MyMatrix& mc, const MyMatrix& ma, const MyMatrix& mb, int nbloops)
|
||||
{
|
||||
for (uint j=0 ; j<nbloops ; ++j)
|
||||
mc += Product<MyMatrix,MyMatrix,NormalProduct>(ma,mb).lazy();
|
||||
mc.noalias() += GeneralProduct<MyMatrix,MyMatrix,UnrolledProduct>(ma,mb);
|
||||
}
|
||||
|
||||
#define MYVERIFY(A,M) if (!(A)) { \
|
||||
|
||||
@@ -22,13 +22,10 @@
|
||||
// License and a copy of the GNU General Public License along with
|
||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <bench/BenchUtil.h>
|
||||
#include <complex>
|
||||
#include <vector>
|
||||
#include <Eigen/Core>
|
||||
#include <bench/BenchTimer.h>
|
||||
#ifdef USE_FFTW
|
||||
#include <fftw3.h>
|
||||
#endif
|
||||
|
||||
#include <unsupported/Eigen/FFT>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user