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.

What is new in Tol-1.1.3

  • New user function to generate a markov chain for a truncated multivariate normal, the truncation region given by a set of linear constraints Bx <=
    1. The functions are:

GibbsConstrainedMNormal -- to obtain the whole chain.

RandConstrainedMNormal -- to obtain only the last sample in the chain.

  • User function RandIChisq now accept a scale parameter in order to simulate a scaled inversed chi-squared.
  • New Tol feature: User Functions Overloading.

Now Tol let us create more than one function with the same name, but returning different data types. What does this new feature mean?

We can write code like this below:

Real func (Real param) { param }; Text func (Text param) { param }; Real a = func(12); Text b = func("It Works!");

After execute it, both variables, "Real a" and "Text b", has their own respective values. In both of these sentences, Tol can get the Type involved in the operation, reading the Left-side sentence. But sometimes, when we give a User Function as an argument for another function, Tol can not recognise which is the Tol Type associated with the overloaded function we need. In those cases Tol returns the first function encountered.

Next example shows that particular case:

_ Set getNameSP(Text vorname, Text name) { SetOfAnything(vorname, name) }; Set getNameUK(Text vorname, Text name) { SetOfAnything(name, vorname) }; Text getNameSP(Text vorname, Text name) { vorname + " " + name }; Text getNameUK(Text vorname, Text name) { name + ", " + vorname }; Text names(Text vorname, Text name, Code fun) { fun(vorname, name) };

Text aText = names("Peter", "Jackson", Text getNameSP);

There are 5 functions. Two of them called "getNameSP" returning a Set and a Text. Other two more called "getNameUK" returning also a Set and a Text. And the last of them called "names" and returning a Text. This last one receive a Code as one of their arguments. Then function "names" is called using "Text getNameSP" as its 3th argument. If this argument was given without a particular type, Tol will try to get the first function created that was called "getNameSP", that would be "Set getNameSP" function.

Other example of use of this new feature is the possibility to create a User Function with the same name as a Built-In function:

_ Set DensCauchy(Set s)

{ Set EvalSet(s, Real (Real e) { DensCauchy(e) }) };

Set sIn = SetOfReal(1,2,3,4); Set sOut = DensCauchy(sIn);

DensCauchy is a Built-In Real Type function, but in this example we have created a User Function called also DensCauchy. We can create a new User Function called as other one, always that the new one returns something different than the old one.

  • MakeGlobal changes.

MakeGlobal function let us export more than one local variable to the global scope, and in every place of the local code. Until now we can export only one local variable and it must be related with the result returned. Now we can execute code like this: _ Real func(Real param) {

Real locvar1 = 10; MakeGloba(locvar1); exporting to global scope Real locvar2 = 20; exporting to global scope MakeGlobal(locvar2); param

}; Real x = 1; Real y = func(x); Real a = locvar1; now, after func call, locvar1 is global Real b = locvar2; now, after func call, locvar2 is global

  • Dynamic Scope avaliable at compile time.

Like many common languages, Tol uses a Lexical implementation of the Scope. But at the beginning, Tol had another implementation: a Dynamic Scope, meaning that a code like this:

_ Real r = 4; Real fun(Real q) {q+r}; Real b = { Real r = 1; fun(8) };

Assigns 9 to variable "b".

A Dynamic Scope means that each time Tol needs a variable, looks for it into the calls stack. To enable Dynamic Scope you must compile Tol with --enable-DS (under Linux/Unix) or defining a macro called USE_DYNSCOPE in compile time.

  • External compilation of TOL DB Access using --enable-dbdrivers

New configure option --enable-dbdrivers force Tol to be compiled with support for direct access to databases. In order to acomplish this we can specify several configure command line options. If you don't give such options, configure looks for the sources and libraries that needs to build Tol properly with DB Direct Access Support. Check INSTALL file to know which options command line options are related with this new feature.

  • Fixed bugs: 165, 171, 184, 191, 192, 194, 197, 199, 205, 214, 215, 216, 218, 219, 223, 225, 226, 227, 229, 230, 233, 237, 240, 246, 247, 249
Last modified 16 years ago Last modified on Feb 25, 2009, 10:51:06 AM