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 9 years ago

Last modified 9 years ago

#1873 accepted defect

Concatenar matrices virtuales sin filas o columnas

Reported by: Pedro Gea Owned by: Víctor de Buen Remiro
Priority: normal Milestone: Mantainance
Component: Kernel Version: 3.1
Severity: critical Keywords:
Cc:

Description

Se encuentran valores inesperados al concatenar matrices virtuales sin filas o columnas.

Los operadores | y << no funcionan bien con VMatrix cuando el número de filas o columnas es cero respectivamente.

Ejemplo:

VMatrix va = Zeros(10, 2) | Zeros(10, 0);
Real VRows(va);    //-> 10
Real VColumns(va); //-> 2

VMatrix vb = Zeros(0, 2) | Zeros(0, 5);
Real VRows(vb);    //-> 0
Real VColumns(vb); //-> 0!!! (7)

VMatrix vc = Zeros(2, 10) << Zeros(0, 10);
Real VRows(vc);    //-> 2
Real VColumns(vc); //-> 10

VMatrix vd = Zeros(2, 0) << Zeros(5, 0);
Real VRows(vd);    //-> 0!!! (7)
Real VColumns(vd); //-> 0

Las matrices vb y vd no se han construido correctamente.

Esto sin embargo sí funciona bien con las matrices comunes:

Matrix a = Zeros(10, 2) | Zeros(10, 0);
Real Rows(a);    //-> 10
Real Columns(a); //-> 2

Matrix b = Zeros(0, 2) | Zeros(0, 5);
Real Rows(b);    //-> 0
Real Columns(b); //-> 7

Matrix c = Zeros(2, 10) << Zeros(0, 10);
Real Rows(c);    //-> 2
Real Columns(c); //-> 10

Matrix d = Zeros(2, 0) << Zeros(5, 0);
Real Rows(d);    //-> 7
Real Columns(d); //-> 0

Change History (1)

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

Status: newaccepted
Note: See TracTickets for help on using tickets.