#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 )
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
Component: | Various → Kernel |
---|---|
Description: | modified (diff) |
Milestone: | → Mantainance |
Status: | new → accepted |
comment:2 Changed 14 years ago by
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:4 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
comment:5 Changed 14 years ago by
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, ...]);
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"