Function 'equals' in matrix_assign.hpp

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Function 'equals' in matrix_assign.hpp

Shangtong Zhang
Hello,

I’m trying to contribute to toeplitz matrix, here is my prototype

However I have a problem.
When I execute code 
matrix<int> m_new(m)
where m is a toeplitz matrix, it will raise exception.
When matrix_assign is executed, it calls ‘equals' in matrix_assign.hpp
However the parameter epsilon is 0, norm_inf (e1 - e2 ) < 0 will never succeed.
So it will return false and raise exception.
Same things happen even m is a banded matrix.
Why is it ‘<' rather than '<= '? Is it by design?

Thanks,

Shangtong Zhang,
Senior Student,
School of Computer Science,
Fudan University, PRC.


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Function 'equals' in matrix_assign.hpp

Nasos Iliopoulos
It is not by design, it is just that originally it was developed with floating point arithmetic in mind. Please change it to <= in the branch and we will propagate it. Make a separate commit just for this so we keep track of the change in case something goes  bad. Also run all the tests before submitting a pull request. If you don't plan to sumbit a pull request please create a new issue so that we deal with it.

-Nasos

On 03/04/2016 12:46 AM, Shangtong Zhang wrote:
Hello,

I’m trying to contribute to toeplitz matrix, here is my prototype

However I have a problem.
When I execute code 
matrix<int> m_new(m)
where m is a toeplitz matrix, it will raise exception.
When matrix_assign is executed, it calls ‘equals' in matrix_assign.hpp
However the parameter epsilon is 0, norm_inf (e1 - e2 ) < 0 will never succeed.
So it will return false and raise exception.
Same things happen even m is a banded matrix.
Why is it ‘<' rather than '<= '? Is it by design?

Thanks,

Shangtong Zhang,
Senior Student,
School of Computer Science,
Fudan University, PRC.



_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]


_______________________________________________
ublas mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/ublas
Sent to: [hidden email]