Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline TheWizEd  
#1 Posted : 13 July 2010 23:16:47(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

Was thanked: 19 time(s) in 13 post(s)
Typically the functions min and max return the minumum or maximum value of a list of operands. For example

x:=max(1.1,2.2,3.3,-5.5) would return 3.3 and like wise for minimum.

The SMath functions min and max return the minimum or maximum value of a matrix.

To accomplish this in SMath requires a lot of if ... else statements.

Can this be implemented in SMath and make the min and max functions mmin and mmax for matrix operations?
Ed
Offline TheWizEd  
#2 Posted : 14 July 2010 17:01:45(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

Was thanked: 19 time(s) in 13 post(s)
Or I realized, the function can check to see if the parameter passed is a matrix or vector, then do what it currently does. If its a list of operands, return the min or max of the list of values.
Ed
Offline Andrey Ivashov  
#3 Posted : 14 July 2010 18:37:06(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,639
Man
Russian Federation

Was thanked: 2011 time(s) in 679 post(s)
TheWizEd wrote:
Or I realized, the function can check to see if the parameter passed is a matrix or vector, then do what it currently does. If its a list of operands, return the min or max of the list of values.

Yes, this is optimal way how it should work. I'll try to find a time to improve min(..) and max(..) functions later.

Regards.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.