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

Closed 20 years ago

#281 closed enhancement (fixed)

GlobalizeSeries enhancement

Reported by: jimarin Owned by: danirus
Priority: normal Milestone:
Component: Various Version: head
Severity: minor Keywords:
Cc:

Description

Hi all,

it is proposed here the use of a global variable called GlobalizeSeries to control the
bahaviour of:

DBSeriesXXX
IncludeBDT

functions.

These functions return their series to global scope. This behaviour can be
overriden by appropiatte setting of proposed GlobalizeSeries variable.

Cheers !

jima

Change History (3)

comment:1 Changed 20 years ago by danirus

Status: newassigned

comment:2 Changed 20 years ago by danirus

Well, just after put in some code implementing the new feature, I've seen a new
error.
The next code reproduces the problem.

Real func(Real p) {

Set set = SetOfSeries(Gaussian(0,1), 1);
SerDat(set[1], y2005m7d7)

};
Real a = func(1);

Tol crashes trying to access object "set[1]". The error isn't related with
IncludeBDT, It's something about using Set variables in local scopes. I'm still
working on it. I'll keep you informed.

Cheers

comment:3 Changed 20 years ago by danirus

Resolution: fixed
Status: assignedclosed

This enhancement has been implemented.

From now on Serie Variables created under a Local Scope can be kept in the same
Local Scope using a new global Real Variable called GlobalizedSeries. for this
behavior that var must be 0.

Functions involved: DBSeries, DBSeriesColumn, DBSeriesTable, and IncludeBDT.

Two examples of code:

--- DBSeries -----------------------
-- function definition --
Real f(Real p) {

Set dbSeries = DBSeries("select * from serie", Diario, SetOfText("ser1a",

"ser2a"));

SerDat(dbSeries[1], y2005m1d1)

};
-- main program --
Set iodb = Include("/home/danirus/Tol/iodb.tol");
load ddbb parameters
GlobalizeSeries := 0; put each
serie in its own scope
Real a = f(1);
-----------------------------------------
Serie will be only in Local Scope of function f.

--- DBSeriesColumn -----------------
-- function definition --
Real f(Real p) {

Text getSer1Q = "select \"serie1\", Date, ser1 from serie where ser1!='NULL'";
Set dbSerie = DBSeriesColumn(getSer1Q, Diario);
SerDat(dbSerie[1], y2005m1d1)

};
-- main program --
Set iodb = Include("/home/danirus/Tol/iodb.tol");
load ddbb parameters
GlobalizeSeries := 0; put each
serie in its own scope
Real a = f(1);
-----------------------------------------
Serie "seri1" will be only in Local Scope of function f.

Cheers,
Daniel

Note: See TracTickets for help on using tickets.