New in Version 0.4.174
Released 13 Jun 2011
-
Functions and classes are now contained in a
MEDDLYnamespace. -
Top-level functions named
MEDDLY_functionhave been renamed asfunction.
For example,MEDDLY_createDomain()can now be called asMEDDLY::createDomain(), or ascreateDomain()inside ausing namespace MEDDLYblock. - There is a single, centralized
errorclass. All methods that previously returnederror
now returnvoid, and any errors are passed back to the user usingthrow. For example, the old code fragmentdomain::error e = dom->createVariablesBottomUp(vars, N); if (e != domain::SUCCESS) { fprintf(stderr, "Error: %s\n", domain::getErrorCodeName(e)); exit(1); }now becomes
try { dom->createVariablesBottomUp(vars, N); } catch (MEDDLY::error e) { fprintf(stderr, "Error: %s\n", e.getName()); exit(1); } - The library must be initialized before use.
(Most operations will fail and throw an appropriate error, otherwise.)
This can be done via
MEDDLY::initialize();which uses default settings. To use different settings:
MEDDLY::settings s; // change members of s here; // the constructor will fill everything with default values so // it is only necessary to specify the non-default values. MEDDLY::initialize(s); -
compute_manager::setHashTablePolicy()has been removed, as this functionality is now provided using the appropriate settings during library initialization. - Library memory may be released using
MEDDLY::cleanup();Most operations will fail and throw an appropriate error after
cleanup()is called. If desired, the library may be initialized again.