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

Closed 18 years ago

#458 closed defect (fixed)

fail to resolve overloaded built-in operator

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: highest Milestone:
Component: Kernel Version: 1.1.4
Severity: major Keywords:
Cc:

Description

The following code fail to use Gaussian for Matrix type:

Matrix B1(Matrix m) {Matrix m+Gaussian(Rows(m),Columns(m),0,1)};
Matrix B1(Rand(2,2,0,1));

<E>
ERROR: [1] no ha sido posible convertir de Real hacia TimeSet para el objeto $tmp$'</E>
<E>
ERROR: [2] Argumentos err&#65533;neos para Serie Gaussian (Real nu, Real sigma [, TimeSet fechado])</E>
<E>
ERROR: [3] Argumentos err&#65533;neos para Matrix + mat1 + mat2 {Matrix mat1, Anything mat2}</E>
<E>
ERROR: [4] Fallo en la funci&#65533;n "B1"</E>

The invocation of Gaussian is within the context of a Matrix expression so I expect the same behavior as the following rewritten code:

Matrix B1(Matrix m) {Matrix m + (Matrix Gaussian(Rows(m),Columns(m),0,1))};
Matrix B1(Rand(2,2,0,1));

regards,

Change History (3)

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

Owner: changed from danirus to Víctor de Buen Remiro

Sorry by delay and thanks for report it

comment:2 Changed 18 years ago by Víctor de Buen Remiro

Status: newassigned

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

Resolution: fixed
Status: assignedclosed

Bug has been fixed in CVS

At file oprimp.cpp, in BStandardOperator::Evaluate, before of function block code evaluation, it must be set the last grammar as function returning type to avoid problems with grammar order when evaluating objetcs of type Anything.

Else different compilers or linkers or changes anywhere along de source code can cause a different order of grammars initialization.

To avoid this problem in other places it's possible to sort BGrammar::instances_ in a previously defined standard order.

A new test has been added to check this behaviour
http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000458

Note: See TracTickets for help on using tickets.