Re: Class Clusters
Re: Class Clusters
- Subject: Re: Class Clusters
- From: Michael Gersten <email@hidden>
- Date: Tue, 09 Jul 2002 23:20:27 -0700
>
As to your classes, I suggest you have two
>
interface classes, LCVMatrix and LCVMutableMatrix, with
>
>
-(id)longIntMultiply:(long int)scalar
>
et al
>
>
> I'm trying to create a matrix-algebra library in cocoa that will work
>
> with three data types: long ints, floats, and doubles. All of the
>
> matrix classes will have the exact same interface, with the exception
>
> of the data types passed to the methods:
>
>
>
> -(id)scalarMultiply:(long int)scalar
>
> -(id)scalarMultiply:(float)scalar
>
> -(id)scalarMultiply:(double)scalar
What's wrong with taking an NSNumber as an argument and just having
-(id) multiply: (NSNumber *) scalar
?
For that matter, why not take NSNumbers as the elements of the matrix?
Of course, when you really want to expand that, and include complex matrix algebra, you realize that there is no interface with things like 'multiply', and that as soon as you have complex multiplication, NSNumber looks lacking.
--
I am a Mac OS X-Cocoa/WOF/EOF developer, and I'm available for hire. Please contact me at michael-job @ stb.nccom.com if interested. Resume at
http://resumes.dice.com/keybounce
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.