| 1 | = What is new in Tol-1.1.3 = |
| 2 | |
| 3 | * New user function to generate a markov chain for a truncated multivariate |
| 4 | normal, the truncation region given by a set of linear constraints Bx <= |
| 5 | b. The functions are: |
| 6 | |
| 7 | GibbsConstrainedMNormal -- to obtain the whole chain. |
| 8 | |
| 9 | RandConstrainedMNormal -- to obtain only the last sample in the |
| 10 | chain. |
| 11 | |
| 12 | * User function RandIChisq now accept a scale parameter in order to simulate |
| 13 | a scaled inversed chi-squared. |
| 14 | |
| 15 | * New Tol feature: User Functions Overloading. |
| 16 | |
| 17 | Now Tol let us create more than one function with the same name, but |
| 18 | returning different data types. What does this new feature mean? |
| 19 | |
| 20 | We can write code like this below: |
| 21 | ____________________________ |
| 22 | Real func (Real param) { param }; |
| 23 | Text func (Text param) { param }; |
| 24 | Real a = func(12); |
| 25 | Text b = func("It Works!"); |
| 26 | |
| 27 | After execute it, both variables, "Real a" and "Text b", has their own |
| 28 | respective values. In both of these sentences, Tol can get the Type involved |
| 29 | in the operation, reading the Left-side sentence. But sometimes, when we |
| 30 | give a User Function as an argument for another function, Tol can not |
| 31 | recognise which is the Tol Type associated with the overloaded function we |
| 32 | need. In those cases Tol returns the first function encountered. |
| 33 | |
| 34 | Next example shows that particular case: |
| 35 | _______________________________________________________________________ |
| 36 | Set getNameSP(Text vorname, Text name) { SetOfAnything(vorname, name) }; |
| 37 | Set getNameUK(Text vorname, Text name) { SetOfAnything(name, vorname) }; |
| 38 | Text getNameSP(Text vorname, Text name) { vorname + " " + name }; |
| 39 | Text getNameUK(Text vorname, Text name) { name + ", " + vorname }; |
| 40 | Text names(Text vorname, Text name, Code fun) { fun(vorname, name) }; |
| 41 | |
| 42 | Text aText = names("Peter", "Jackson", Text getNameSP); |
| 43 | |
| 44 | There are 5 functions. Two of them called "getNameSP" returning a Set and a |
| 45 | Text. Other two more called "getNameUK" returning also a Set and a |
| 46 | Text. And the last of them called "names" and returning a Text. This last |
| 47 | one receive a Code as one of their arguments. |
| 48 | Then function "names" is called using "Text getNameSP" as its 3th |
| 49 | argument. If this argument was given without a particular type, Tol will |
| 50 | try to get the first function created that was called "getNameSP", that |
| 51 | would be "Set getNameSP" function. |
| 52 | |
| 53 | Other example of use of this new feature is the possibility to create a |
| 54 | User Function with the same name as a Built-In function: |
| 55 | |
| 56 | _____________________________________________________ |
| 57 | Set DensCauchy(Set s) |
| 58 | { Set EvalSet(s, Real (Real e) { DensCauchy(e) }) }; |
| 59 | |
| 60 | Set sIn = SetOfReal(1,2,3,4); |
| 61 | Set sOut = DensCauchy(sIn); |
| 62 | |
| 63 | DensCauchy is a Built-In Real Type function, but in this example we have |
| 64 | created a User Function called also DensCauchy. We can create a new User |
| 65 | Function called as other one, always that the new one returns something |
| 66 | different than the old one. |
| 67 | |
| 68 | * MakeGlobal changes. |
| 69 | |
| 70 | MakeGlobal function let us export more than one local variable to the |
| 71 | global scope, and in every place of the local code. Until now we can export |
| 72 | only one local variable and it must be related with the result |
| 73 | returned. Now we can execute code like this: |
| 74 | _______________________ |
| 75 | Real func(Real param) { |
| 76 | Real locvar1 = 10; |
| 77 | MakeGloba(locvar1); // exporting to global scope |
| 78 | Real locvar2 = 20; // exporting to global scope |
| 79 | MakeGlobal(locvar2); |
| 80 | param |
| 81 | }; |
| 82 | Real x = 1; |
| 83 | Real y = func(x); |
| 84 | Real a = locvar1; // now, after func call, locvar1 is global |
| 85 | Real b = locvar2; // now, after func call, locvar2 is global |
| 86 | |
| 87 | * Dynamic Scope avaliable at compile time. |
| 88 | |
| 89 | Like many common languages, Tol uses a Lexical implementation of the |
| 90 | Scope. But at the beginning, Tol had another implementation: a Dynamic |
| 91 | Scope, meaning that a code like this: |
| 92 | _______________________________ |
| 93 | Real r = 4; |
| 94 | Real fun(Real q) {q+r}; |
| 95 | Real b = { Real r = 1; fun(8) }; |
| 96 | |
| 97 | Assigns 9 to variable "b". |
| 98 | |
| 99 | A Dynamic Scope means that each time Tol needs a variable, looks for it |
| 100 | into the calls stack. |
| 101 | To enable Dynamic Scope you must compile Tol with --enable-DS (under |
| 102 | Linux/Unix) or defining a macro called __USE_DYNSCOPE__ in compile time. |
| 103 | |
| 104 | * External compilation of TOL DB Access using --enable-dbdrivers |
| 105 | |
| 106 | New configure option --enable-dbdrivers force Tol to be compiled with |
| 107 | support for direct access to databases. In order to acomplish this we can |
| 108 | specify several configure command line options. If you don't give such |
| 109 | options, configure looks for the sources and libraries that needs to build |
| 110 | Tol properly with DB Direct Access Support. |
| 111 | Check INSTALL file to know which options command line options are related |
| 112 | with this new feature. |
| 113 | |
| 114 | * Fixed bugs: 165, 171, 184, 191, 192, 194, 197, 199, 205, 214, 215, 216, |
| 115 | 218, 219, 223, 225, 226, 227, 229, 230, 233, 237, 240, 246, 247, 249 |