/[escript]/branches/arrexp_2137_win_merge/escript/src/EscriptParams.h
ViewVC logotype

Annotation of /branches/arrexp_2137_win_merge/escript/src/EscriptParams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2219 - (hide annotations)
Wed Jan 14 04:31:34 2009 UTC (10 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 3161 byte(s)
Merging changes from trunk 2098:2218
1 jfenwick 1897
2     /*******************************************************
3     *
4     * Copyright (c) 2003-2008 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13    
14     #ifndef escript_EscriptParams_H
15     #define escript_EscriptParams_H
16     #include "system_dep.h"
17 jfenwick 2219 #include <boost/python/list.hpp>
18     #include "Data.h" // for the operators
19 jfenwick 1897
20     namespace escript
21     {
22    
23 jfenwick 2219 class Data;
24    
25 jfenwick 1897 class EscriptParams
26     {
27     public:
28     ESCRIPT_DLL_API
29     EscriptParams();
30    
31     ESCRIPT_DLL_API
32     int getInt(const char* name, int sentinel=0) const;
33    
34     ESCRIPT_DLL_API
35     void setInt(const char* name, int value);
36 jfenwick 2219
37 jfenwick 1897 private:
38    
39     // If we get more params we can replace this with a map
40     int too_many_lines;
41 jfenwick 2219 int autolazy;
42    
43     protected:
44     // This is to provide fast access for methods in Data.
45     // Its a little bit ugly, needing all those friends but I really want to
46     // limit outside access to the char* interface
47    
48     int getTOO_MANY_LINES() {return too_many_lines;}
49     int getAUTOLAZY() { return autolazy;}
50    
51     friend class escript::Data;
52     friend escript::Data escript::operator+(const boost::python::api::object&, const escript::Data&);
53     friend escript::Data escript::operator-(const boost::python::api::object&, const escript::Data&);
54     friend escript::Data escript::operator*(const boost::python::api::object&, const escript::Data&);
55     friend escript::Data escript::operator/(const boost::python::api::object&, const escript::Data&);
56     friend escript::Data escript::operator+(const escript::Data&, const escript::Data&);
57     friend escript::Data escript::operator-(const escript::Data&, const escript::Data&);
58     friend escript::Data escript::operator*(const escript::Data&, const escript::Data&);
59     friend escript::Data escript::operator/(const escript::Data&, const escript::Data&);
60     friend escript::Data escript::operator+(const escript::Data&, const boost::python::api::object&);
61     friend escript::Data escript::operator-(const escript::Data&, const boost::python::api::object&);
62     friend escript::Data escript::operator*(const escript::Data&, const boost::python::api::object&);
63     friend escript::Data escript::operator/(const escript::Data&, const boost::python::api::object&);
64     friend escript::Data escript::C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
65     int axis_offset, int transpose);
66    
67 jfenwick 1897 };
68    
69    
70     extern EscriptParams escriptParams;
71    
72 jfenwick 2219 /**
73     \brief Set the value of a named parameter.
74     See listEscriptParams() (showEscriptParams() in python) for available parameters.
75     */
76 jfenwick 1897 ESCRIPT_DLL_API
77     void setEscriptParamInt(const char* name, int value);
78    
79 jfenwick 2219 /**
80     \brief get the value of a named parameter.
81     See listEscriptParams() (showEscriptParams() in python) for available parameters.
82     */
83 jfenwick 1897 ESCRIPT_DLL_API
84     int getEscriptParamInt(const char* name, int sentinel=0);
85    
86 jfenwick 2219 /**
87     \brief describe available paramters.
88     \return a list of tuples (parameter name, description)
89     */
90     ESCRIPT_DLL_API
91     boost::python::list listEscriptParams();
92    
93 jfenwick 1897 }
94     #endif

  ViewVC Help
Powered by ViewVC 1.1.26