(requires Analytica 4.2.3 or later)
SipDecode( xml, resultIndex, localIndexName, useDll )
Decodes an xml-encoded Stochastic Information Packet (SIP), which is a compressed textual encoding of a vector of numbers, usually denoting a stochastic sampling of an uncertainty quantity. SIPs are introduced and described in the following article:
- Sam Savage, Stefan Scholtes and Daniel Zweidler (Feb 2006), "Probability Management - Part 1", OR/MS Today 33:1.
- The DISTTM 1.0 Distribution String] xml text.
- (Optional) An existing index that to be used to index the result. Defaults to Run.
- (Optional) A name to be used for a local index when you desire the function to create a local index to index the result.
- (optional) boolean value, see below.
It is an error to specify both «resultIndex» and «localIndexName» -- you must specify at most one. If both are omitted, the result is indexed by Run.
If the «resultIndex» is longer than the encoded sample, the final entries are padded with Null values. If the «resultIndex» is shorter than the encoded sample, the sample is truncated at the index length.
If you specify a «localIndexName» (textual identifier) but not a «resultIndex», the function will create a local index with a length matching the number of data in the encoded xml, having the indicated name.
Using an External DLL
This function, and SipEncode, can be used without the use of any external DLL. However, Analytica's built-in compression implementation can be replaced by one implemented in an external DLL. The hook is here to allow researchers within Sam Savage's research group to utilize their own implementation, or to change the implementation or encoding standard should the need arise.
To use an external DLL, you must set a registry setting to point to the DLL file. To do this, run regedit.exe and navigate to the following hive:
- HKCU/Software/Lumina Decision Systems/Analytica/4.2 (if using Analytica 32-bit)
- HKCU/Software/Lumina Decision Systems/Analytica/4.2x64 (if using Analytica 64-bit)
If used with ADE, replace the above hive path with the "HKLM/.../ADE/4.2" hive.
Then use New String Value to create a value named Sip.dll and specify a complete file path to the DLL file as the value. If you are using Analytica 32-bit, you must use a 32-bit DLL, likewise, if you are using Analytica 64-bit, your DLL must be compiled as 64-bit. The DLL must export a function with the following prototype, which is then called by this function:
void __stdcall ExpandDst(wchar_t* xmlInput, double** sampleValues, int* size)
If you have a DLL configured as described here, SipDecode will call the exported function
ExpandDst to perform the decoding by default. You can force the use of Analytica's built-in implementation by specifying the «useDll» parameter as false. If a DLL is not configured, the specified DLL file not found, or the DLL found does not export a function named
ExpandDst, the «useDll» parameter is ignored and Analytica's built-in implementation is always used. When the DLL function is used, errors involving mal-formed xml are not reported, and the result returned may contain arbitrary (garbage) values.