commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MATH-863) new Quaternion class added in complex package
Date Fri, 21 Sep 2012 08:26:08 GMT

    [ https://issues.apache.org/jira/browse/MATH-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460348#comment-13460348
] 

Sébastien Brisard commented on MATH-863:
----------------------------------------

{quote}
Let's wait for Juliens's tests and adjust the javadoc accordingly.
We may end up having some classes supporting non-commutative fields and other requiring commutative
fields and just state that in the doc, or we may add a CommutativeField marker interface which
would extend Field, or we could add a isCommutative method in the Field interface and check
that were needed. I'm not sure the Java typing mechanism is sufficient, so either simple documentation
or runtime checks may be helpful.
{quote}

These are all safe suggestions from my point of view. I have to say I always find it difficult
to predict what's going to happen with generics, but maybe we could define a {{NonCommutativeFieldElement}},
move all methods from {{FieldElement}} to {{NonCommutativeFieldElement}}, and have {{FieldElement}}
extend {{NonCommutativeFieldElement}}. This way, all classes that operate on field elements
would by default not operate on non-commutative field elements. After careful check, if appropriate,
we could change the signature
{{class A<T extends FieldElement<T>>}} to {{class A<T extends NonCommutativeFieldElement<T>>}}.
Again, I'm not sure that would work.

Otherwise, the {{isCommutative()}} method should be invoked in the constructor of {{class
A}}.
                
> new Quaternion class added in complex package
> ---------------------------------------------
>
>                 Key: MATH-863
>                 URL: https://issues.apache.org/jira/browse/MATH-863
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.1
>            Reporter: Julien Anxionnat
>         Attachments: quaternion_adjustments.patch, quaternion.patch, quaternion_v2.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> This patch provides a new class for the mathematical object "Quaternion" in the complex
package.
> This quaternion is considered as a mathematical object (the Hamilton's hypercomplex number).
> Note that it's not a rotation quaternion which has to be a quaternion of norm one. Although
this feature could be used for a getter in the Rotation class.
> This patch provides also some improvements in Precision class : a "double comparison
epsilon" and a method to compute relative comparison.
> (Please, note that's it's my first contribution, and I apologize in advance for my mistakes…)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message