Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-07 Thread Sébastien Brisard

 +1 to add both of these, though I would suggest one of the following
 pairs of names:
 0) negate, invert
 1) opposite, reciprocal
 2) additiveInverse, multiplicativeInverse

 Probably 2) is clearest, but a bit long.  I am fine with any of them.

 Phil

Hi,
I've created MATH-686 which relates to this proposal. However looking
at what's already implemented in the CM library, I found that the best
(unsatisfactory) option would be negate()/reciprocal() -- see the
ticket. Native english speakers will probably not like that! Are we
really that unhappy with this?
Sébastien

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-07 Thread Phil Steitz




On Oct 7, 2011, at 6:07 AM, Sébastien Brisard sebastien.bris...@m4x.org wrote:

 
 +1 to add both of these, though I would suggest one of the following
 pairs of names:
 0) negate, invert
 1) opposite, reciprocal
 2) additiveInverse, multiplicativeInverse
 
 Probably 2) is clearest, but a bit long.  I am fine with any of them.
 
 Phil
 
 Hi,
 I've created MATH-686 which relates to this proposal. However looking
 at what's already implemented in the CM library, I found that the best
 (unsatisfactory) option would be negate()/reciprocal() -- see the
 ticket. Native english speakers will probably not like that! Are we
 really that unhappy with this?

Not worth a long argument, but the reciprocal of a fraction is not exactly the 
same concept as multiplicative inverse in a field.  I would be happier about 
living with that inconsistency than adding another noun/verb inconsistency in 
the same class.

Phil

 Sébastien
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-07 Thread Sébastien Brisard

 Not worth a long argument, but the reciprocal of a fraction is not exactly 
 the same concept as multiplicative inverse in a field.  I would be happier 
 about living with that inconsistency than adding another noun/verb 
 inconsistency in the same class.

 Phil

Just for my own interest: if I understand correctly, reciprocal is
specific to fractions? Is that correct.
I'm not sure I understood your last point. Do you suggest we keep
what's already there: negate()/reciprocal()?
Thanks for these clarifications,
Sébastien

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-07 Thread Phil Steitz




On Oct 7, 2011, at 7:43 AM, Sébastien Brisard sebastien.bris...@m4x.org wrote:

 
 Not worth a long argument, but the reciprocal of a fraction is not exactly 
 the same concept as multiplicative inverse in a field.  I would be happier 
 about living with that inconsistency than adding another noun/verb 
 inconsistency in the same class.
 
 Phil
 
 Just for my own interest: if I understand correctly, reciprocal is
 specific to fractions? Is that correct.

Yes.

 I'm not sure I understood your last point. Do you suggest we keep
 what's already there: negate()/reciprocal()?

Yes, because reciprocate (the natural verb) makes no sense and reciprocal 
is a standard term for the result.


 Thanks for these clarifications,
 Sébastien
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org
 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-04 Thread Luc Maisonobe

Le 04/10/2011 05:22, Sébastien Brisard a écrit :

Good morning everyone,
I would like to add the above mentioned methods to FieldElement. This
would avoid awkward commands such as
x.getField().getZero().substract(x) (for x.opposite())
and
x.getField().getOne().divide(x) (for x.invert()).
It's not essential, but I think it would be useful. Besides, I don't
think it would bloat the interface, since opposite and inverse are
mathematical notions which are intrinsic to fields.
What do you think?


+0 from me.

Luc


Best regards,
Sébastien

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-04 Thread Mikkel Meyer Andersen
2011/10/4 Luc Maisonobe luc.maison...@free.fr:
 Le 04/10/2011 05:22, Sébastien Brisard a écrit :

 Good morning everyone,
 I would like to add the above mentioned methods to FieldElement. This
 would avoid awkward commands such as
 x.getField().getZero().substract(x) (for x.opposite())
 and
 x.getField().getOne().divide(x) (for x.invert()).
 It's not essential, but I think it would be useful. Besides, I don't
 think it would bloat the interface, since opposite and inverse are
 mathematical notions which are intrinsic to fields.
 What do you think?

 +0 from me.

 Luc

 Best regards,
 Sébastien

+0, too.

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-04 Thread Phil Steitz
On 10/3/11 8:22 PM, Sébastien Brisard wrote:
 Good morning everyone,
 I would like to add the above mentioned methods to FieldElement. This
 would avoid awkward commands such as
 x.getField().getZero().substract(x) (for x.opposite())
 and
 x.getField().getOne().divide(x) (for x.invert()).
 It's not essential, but I think it would be useful. Besides, I don't
 think it would bloat the interface, since opposite and inverse are
 mathematical notions which are intrinsic to fields.
 What do you think?

+1 to add both of these, though I would suggest one of the following
pairs of names:
0) negate, invert
1) opposite, reciprocal
2) additiveInverse, multiplicativeInverse

Probably 2) is clearest, but a bit long.  I am fine with any of them.

Phil
 Best regards,
 Sébastien

 -
 To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
 For additional commands, e-mail: dev-h...@commons.apache.org




-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-04 Thread Sébastien Brisard

 +1 to add both of these, though I would suggest one of the following
 pairs of names:
 0) negate, invert
 1) opposite, reciprocal
 2) additiveInverse, multiplicativeInverse

 Probably 2) is clearest, but a bit long.  I am fine with any of them.

 Phil

I do think these two features might prove useful. There are
workarounds, but they tend to verbose code.
As for the options you suggest, Phil, I agree my proposition was
probably not the best. We must be careful with consistency, because
some classes already implement those methods (Complex has a method
negate()). I will look into it, and open a JIRA ticket.

Sébastien

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[math] Add methods opposite() and inverse() to o.a.c.m.FieldElement

2011-10-03 Thread Sébastien Brisard
Good morning everyone,
I would like to add the above mentioned methods to FieldElement. This
would avoid awkward commands such as
x.getField().getZero().substract(x) (for x.opposite())
and
x.getField().getOne().divide(x) (for x.invert()).
It's not essential, but I think it would be useful. Besides, I don't
think it would bloat the interface, since opposite and inverse are
mathematical notions which are intrinsic to fields.
What do you think?
Best regards,
Sébastien

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org