- Works the same in Explorer (tested only on 6.0) and Netscape (tested only on Netscape 7.0 and Mozilla 1.3.1), but does not work in Opera (6.01) ***************************************************************************** */ if (document.images) { // tests for image support trilinos_title_normal = new Image(310, 55); trilinos_title_normal.src = "../../../packages/common/webroot_common/trilinos_title_normal.png"; trilinos_title_over = new Image(310, 55); trilinos_title_over.src = "../../../packages/common/webroot_common/trilinos_title_over.png"; sandia_normal = new Image(180, 29); sandia_normal.src = "../../../packages/common/webroot_common/sandia_normal.png"; sandia_over = new Image(180, 29); sandia_over.src = "../../../packages/common/webroot_common/sandia_over.png"; trilinos_normal = new Image(183, 100); trilinos_normal.src = "../../../packages/common/webroot_common/trilinos_normal.png"; trilinos_over = new Image(183, 100); trilinos_over.src = "../../../packages/common/webroot_common/trilinos_over.png"; } // if (document.images) //-->
|
PyTrilinos.TeuchosThe Teuchos package provides a large variety of tools and utilities, many of which are already supported in python by independent, standard library modules. Currently, the only class supported in the python module is Teuchos::ParameterList, which is used by several Trilinos packages for communicating arbitrary-type parameters between users and packages. Typically, the Teuchos module is invisible to the user. The ParameterList class is analagous to the python dictionary (with the restriction that the dictionary keys must be strings), and python programmers can provide a python dictionary where a ParameterList is expected. Teuchos is imported by the package that uses the ParameterLists and converts between dictionaries and ParameterLists automatically. The user can create a Teuchos.ParameterList directly, using the constructor, set and sublist methods, if he so chooses, and methods that accept ParameterLists will work as expected. It is really just a question of verbosity and elegance that argues in favor of using a python dictionary. Starting with Trillinos version 7.0.4, the ParameterList class can accept a python dictionary as a constructor. In versions 7.0.3 and earlier, methods that return a ParameterList in C++ will return a special class in python: a PyDictParameterList. This class inherits from ParameterList, but adds several methods and operators so that it behaves like a python dictionary. A PyDictParameterList can also be constructed and provided to methods that accept a ParameterList if the user so chooses. In versions 7.0.4 and later, the PyDictParameterList class has been eliminated in favor of expanded functionality for the python version of ParameterList. In addition to the constructor that accepts a python dictionary, several methods and operators have been added to the ParameterList class so that it behaves somewhat like a dictionary. C++ ParameterLists are designed to support parameters of arbitrary type. The python implementation supports a subset of types a priori :
The C++ ParameterList class supports begin() and end() methods for iterating over the parameters. These methods are disabled in the python implementation. The python version of ParameterList (version 7.0.4 and later), however, does provide all of the python dictionary iterator methods: __iter__(), iteritems(), iterkeys() and itervalues(). (In earlier versions, this functionality is assigned to the PyDictParameterList class.) ParameterListThe ParameterList class is augmented to "play nice" and behave somewhat like a python dictionary. Here are the following differences between the C++ and python implementations:
The following python dictionary methods and operators are added to the python implementation of the ParameterList class:
Note that the C++ implementation of the ParameterList class does not support parameter deletion. Therefore, python dictionary methods that delete items, such as pop or __delitem__, have not been added to the ParameterList class. |
|
|||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||