From michael.haupt at oracle.com  Mon Jul 14 18:17:33 2014
From: michael.haupt at oracle.com (Michael Haupt)
Date: Mon, 14 Jul 2014 18:17:33 +0200
Subject: [Rd] cummax / cummin for complex numbers
In-Reply-To: <53C3F4B4.6040405@ucdavis.edu>
References: <9591F061-56E7-4FA6-9A84-AED2C3B56F32@oracle.com>
	<loom.20140714T170807-611@post.gmane.org>
	<53C3F4B4.6040405@ucdavis.edu>
Message-ID: <F800FA34-28B2-4ED7-8926-17F7C2491808@oracle.com>

.. spot on. :-)

Apologies for not having been more "pointy" about the problem - this just confirms it *is* kind of subtle. :-)

Best,

Michael

Am 14.07.2014 um 17:18 schrieb Duncan Temple Lang <dtemplelang at ucdavis.edu>:

> I believe Michael's point is that the error messages
> are incorrect - referring to cunmax when cunmin was called
> and vice verse.
> 
> D.
> 
> On 7/14/14, 8:14 AM, Ben Bolker wrote:
>> Michael Haupt <michael.haupt <at> oracle.com> writes:
>> 
>>> 
>>> Dear all,
>>> 
>>> in R 3.1.0, this is happening:
>>> 
>>>> cummin(c(1+1i,2-3i,4+5i))
>>> Error in cummin(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 
>>>  'cummax' not defined for complex numbers
>>>> cummax(c(1+1i,2-3i,4+5i))
>>> Error in cummax(c(1 + (0+1i), 2 - (0+3i), 4 + (0+5i))) : 
>>>  'cummin' not defined for complex numbers
>>> 
>>> It may be fixed in R-devel, but I thought I'd mention it to make sure ...
>>> 
>>> Best,
>>> 
>>> Michael
>> 
>>  Well, it is documented in the development version:
>> 
>>   x: a numeric or complex (not ?cummin? or ?cummax?) object, or an
>>          object that can be coerced to one of these.
>> 
>> I imagine the problem is in coming up with a good, consistent definition
>> of the min/max for complex numbers: would you prefer min/max modulus,
>> phase, real part, imaginary part ... ? max()/min() aren't even defined
>> for complex numbers in R ...

-- 
Dr. Michael Haupt
Principal Member of Technical Staff
Phone: +49 331 200 7277, Fax: +49 331 200 7561
Oracle Labs
Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14, 14467 Potsdam, Germany



[Rd] cummax / cummin for complex numbers
Michael Haupt