mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Complete rework of global math functions and NumTraits.
* Now completely generic so all standard integer types (like char...) are supported. ** add unit test for that (integer_types). * NumTraits does no longer inherit numeric_limits * All math functions are now templated * Better guard (static asserts) against using certain math functions on integer types.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define EIGEN2_SUPPORT
|
||||
#define EIGEN_NO_STATIC_ASSERT
|
||||
#include "main.h"
|
||||
#include <functional>
|
||||
|
||||
@@ -109,7 +110,7 @@ template<typename MatrixType> void cwiseops(const MatrixType& m)
|
||||
VERIFY_IS_APPROX(m3, m1.cwise() * m2);
|
||||
|
||||
VERIFY_IS_APPROX(mones, m2.cwise()/m2);
|
||||
if(NumTraits<Scalar>::HasFloatingPoint)
|
||||
if(!NumTraits<Scalar>::IsInteger)
|
||||
{
|
||||
VERIFY_IS_APPROX(m1.cwise() / m2, m1.cwise() * (m2.cwise().inverse()));
|
||||
m3 = m1.cwise().abs().cwise().sqrt();
|
||||
|
||||
Reference in New Issue
Block a user