Add more operators to FieldElement<T>
------------------------------------- Key: MATH-569 URL: https://issues.apache.org/jira/browse/MATH-569 Project: Commons Math Issue Type: Improvement Affects Versions: 3.0 Reporter: Arne Plöse Priority: Minor it would be nice to have some additional operators in FieldElement i.e. T negate(); T pow(T x); T sqrt(); maybe the double variant i.e. T pow(double x); as well. This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030834#comment-13030834 ] Luc Maisonobe commented on MATH-569: ------------------------------------ This is possible only for negate() in the FieldElement<T> interface. Not all fields support sqrt or pow. A typical example is Fraction, the square root of a fraction may not be a fraction for example. This is exactly this limitation that explains while only LU decomposition is implemented for fields and not other decomposition algorithms. One possibility would be to add an ExtendedFieldElement<T> interface that would add these methods for the fields that support it (Complex, Dfp ...). Then, we could add new decomposition algorithms that would work on these extended fields (but still not on simpler fields like fraction. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030849#comment-13030849 ] Phil Steitz commented on MATH-569: ---------------------------------- negate() is OK, could be added wlog. Regarding the others, note that a) real fields are not going to be closed under sqrt() (so Dfp, for example, can't support this) and b) pow(.,.) requires some significant extra-algebraic structure to be meaningful. If you want all of this structure, then what you are really looking for is an algebraically closed field with exp - i.e. Complex. So the natural thing to do is to extract a ComplexFieldElement interface, assuming this is really needed. What exactly are the use cases served by this? To make it easier to implement decomposition algorithms for both real and complex fields? They can't rely on sqrt() if applied to real fields. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031070#comment-13031070 ] Arne Plöse commented on MATH-569: --------------------------------- Ok i try to build a small DSP library, where i need to create some digital filters. Having the octave code for this, they make use of complex vectors to calculate the parameters of the filter. There are several possibilities to solve this problem: 1. Create an own Complex vector | matrix and copy code around... 2. extend FieldVector and ArrayFieldVector; problem all methods return a real ArrayFieldVector so I must recreate my ComplexVector every time. 3. add missing operators to FieldElement and Fieldvector and implementing classes. What is the point to simply throw a NotSupportedException if an operation is not supported? > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031308#comment-13031308 ] Luc Maisonobe commented on MATH-569: ------------------------------------ Option 1 is clearly only a last resort solution? Option 2 seems linked to MATH-571, so let's decide there how we solve it. Option 3 could be done with an extended interface but in this case it would not solve your problem, as you would need also an ExtendedFieldVector and all the rest, so we would be back to options 1 or 2. Option 4 (using only one level of interface and using NotSupportedException) is possible but seems awkward. So I would say choose option 2 if we can solve MATH-571, and choose option 4 if we cannot. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031315#comment-13031315 ] Phil Steitz commented on MATH-569: ---------------------------------- Looks to me like what is needed here is just ComplexFieldElement. Before solving this or MATH-571 using some "Extended" field interface that does not really define a field, I would like to understand what the use case beyond Complex is. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082178#comment-13082178 ] Phil Steitz commented on MATH-569: ---------------------------------- I recommend WONT_FIX here. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13082505#comment-13082505 ] Luc Maisonobe commented on MATH-569: ------------------------------------ OK for WONT_FIX for both this issue and MATH-571 > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by ASF GitHub Bot (Jira)
[ https://issues.apache.org/jira/browse/MATH-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luc Maisonobe resolved MATH-569. -------------------------------- Resolution: Won't Fix Setting to Won't Fix as per comments above. > Add more operators to FieldElement<T> > ------------------------------------- > > Key: MATH-569 > URL: https://issues.apache.org/jira/browse/MATH-569 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Arne Plöse > Priority: Minor > > it would be nice to have some additional operators in FieldElement i.e. > T negate(); > T pow(T x); > T sqrt(); > maybe the double variant i.e. > T pow(double x); > as well. > This would be affect FieldVector | Matrix, BigReal, ... as well. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |