close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1073 closed enhancement (fixed)

Handling Matrix and Real objets

Reported by: Alfredo Torre Owned by: Víctor de Buen Remiro
Priority: high Milestone: Mantainance
Component: Kernel Version: 2.0.1
Severity: major Keywords: Matrix, Real, Boolean functions, LT, GE, EQ
Cc: imendez@…, irobles@…

Description (last modified by Víctor de Buen Remiro)

Hi,
It would be really helpful if Boolean functions (such as LT, GE, EQ...) would allow Matrix and Real objects together as it is allowed to mix Series and Real objects.

Thanks in advance.

Change History (6)

comment:1 Changed 14 years ago by Víctor de Buen Remiro

Component: VariousKernel
Description: modified (diff)
Milestone: Mantainance
Status: newaccepted

I'll try, but it is not a trivial question.

What I usually do is create an Matrix (or Serie) called "Zero" with the proper dimensions (or timing information), and then use expressions such as "Zero+3" instead of "3"

comment:2 Changed 14 years ago by Alfredo Torre

Thanks for the tip.

I hope you can find the way to allow this! We usually do this with Series... what we are doing is create functions such as

Matrix Mat_EQ(Matrix m, Real r)
{

Matrix m1 = RSum(m-m, 1);
EQ(m, RProd(m1, r))

};

comment:3 Changed 14 years ago by Víctor de Buen Remiro

(In [3250]) Refs #1073

comment:4 Changed 14 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: acceptedclosed

(In [3251]) Fixes #1073

comment:5 Changed 14 years ago by Víctor de Buen Remiro

Las funciones lógicas y de comparación, tanto de Matrix como de VMatrix, admiten desde ahora argumentos de tipo Real a partir del segundo de ellos. El primero tiene que seguir siendo Matrix (o VMatrix) como hasta ahora.

Estas son las nuevas declaraciones de las funciones modificadas para el tipo Matrix

Matrix IfMat(Matrix condition, {Matrix|Real} A, {Matrix|Real} B);
Matrix And(Matrix A [, {Matrix|Real} B, ...]);
Matrix Or(Matrix A [, {Matrix|Real} B, ...]);
Matrix Min(Matrix A [, {Matrix|Real} B, ...]);
Matrix Max(Matrix A [, {Matrix|Real} B, ...]);
Matrix Min(Matrix A [, {Matrix|Real} B, ...]);
Matrix EQ(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);
Matrix NE(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);
Matrix LT(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);
Matrix GT(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);
Matrix LE(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);
Matrix GE(Matrix M1, {Matrix|Real} M2 [, {Matrix|Real} M3, ...]);

Estas son las nuevas declaraciones de las funciones modificadas para el tipo VMatrix

VMatrix IfVMat(VMatrix condition, {VMatrix|Real} A, {VMatrix|Real} B);
VMatrix And(VMatrix A [, {VMatrix|Real} B, ...]);
VMatrix Or(VMatrix A [, {VMatrix|Real} B, ...]);
VMatrix Min(VMatrix A [, {VMatrix|Real} B, ...]);
VMatrix Max(VMatrix A [, {VMatrix|Real} B, ...]);
VMatrix Min(VMatrix A [, {VMatrix|Real} B, ...]);
VMatrix EQ(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);
VMatrix NE(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);
VMatrix LT(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);
VMatrix GT(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);
VMatrix LE(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);
VMatrix GE(VMatrix M1, {VMatrix|Real} M2 [, {VMatrix|Real} M3, ...]);

comment:6 Changed 14 years ago by Víctor de Buen Remiro

(In [3567]) Refs #1073
Min and Max functions of Matrix didn't show error handling with real arguments but were not working fine.

Note: See TracTickets for help on using tickets.