Bugzilla – Attachment 426 Details for
Bug 756
M.log().exp() != M for random 3x3 double matrix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
Sample code to reproduce the issue
main.cpp (text/plain), 1.03 KB, created by
Hauke Heibel
on 2014-03-10 13:45:36 UTC
(
hide
)
Description:
Sample code to reproduce the issue
Filename:
MIME Type:
Creator:
Hauke Heibel
Created:
2014-03-10 13:45:36 UTC
Size:
1.03 KB
patch
obsolete
>#include <unsupported/Eigen/MatrixFunctions> > >#include <iostream> > >using namespace Eigen; > >Matrix3d interp(const Matrix3d& M, const Matrix3d& N, double s) >{ > return ((1-s) * M.log() + s * N.log()).exp(); >} > >int main(int argc, char* argv[]) >{ > const double precision = 1e-5; > > // first test - usually fails > Matrix3d M = Matrix3d::Random(); > bool is_approx = M.isApprox(M.log().exp(), 1e-5); > > std::cout << "M.log().exp() == M evaluates to " << std::boolalpha << is_approx << std::endl << std::endl;; > std::cout << " M = " << M << std::endl << std::endl; > std::cout << " M.log().exp() = " << M.log().exp() << std::endl << std::endl; > > // second test - always passed (is s!=1 && s!=0) > Matrix3d N = Matrix3d::Random(); > const double s = internal::random(0.0, 1.0); > Matrix3d I = interp(M, N, s); > Matrix3d J = interp(N, M, 1-s); > bool is_approx_interp = I.isApprox(J, precision); > std::cout << "interp(M,N,s) == interp(N,M,1-s) evaluates to " << std::boolalpha << is_approx_interp << std::endl; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 756
: 426