/[escript]/trunk/escript/src/EscriptParams.h
ViewVC logotype

Contents of /trunk/escript/src/EscriptParams.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 3708 byte(s)
Round 1 of copyright fixes
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16 #ifndef escript_EscriptParams_H
17 #define escript_EscriptParams_H
18 #include "system_dep.h"
19 #include <boost/python/list.hpp>
20 #include "Data.h" // for the operators
21
22 namespace escript
23 {
24
25 class Data;
26 class DataLazy;
27
28 class EscriptParams
29 {
30 public:
31 ESCRIPT_DLL_API
32 EscriptParams();
33
34 ESCRIPT_DLL_API
35 int getInt(const char* name, int sentinel=0) const;
36
37 ESCRIPT_DLL_API
38 void setInt(const char* name, int value);
39
40 boost::python::list
41 listEscriptParams();
42
43 private:
44
45 // If we get more params we can replace this with a map
46 int too_many_lines;
47 int autolazy;
48 int too_many_levels;
49 // int too_many_nodes;
50 int resolve_collective;
51 int lazy_str_fmt;
52 int lapack_support;
53 int lazy_verbose;
54 int amg_disabled;
55
56 protected:
57 // This is to provide fast access for methods in Data.
58 // Its a little bit ugly, needing all those friends but I really want to
59 // limit outside access to the char* interface
60
61 int getTOO_MANY_LINES() {return too_many_lines;}
62 int getAUTOLAZY() { return autolazy;}
63 int getTOO_MANY_LEVELS() {return too_many_levels;}
64 // int getTOO_MANY_NODES() {return too_many_nodes;}
65 int getRESOLVE_COLLECTIVE() {return resolve_collective;}
66 int getLAZY_STR_FMT() {return lazy_str_fmt;}
67 int getLAZY_VERBOSE() {return lazy_verbose;}
68
69 friend class escript::Data;
70 friend class escript::DataLazy;
71 friend Data operator+(const boost::python::api::object&, const escript::Data&);
72 friend Data operator-(const boost::python::api::object&, const escript::Data&);
73 friend Data operator*(const boost::python::api::object&, const escript::Data&);
74 friend Data operator/(const boost::python::api::object&, const escript::Data&);
75 friend Data operator+(const escript::Data&, const escript::Data&);
76 friend Data operator-(const escript::Data&, const escript::Data&);
77 friend Data operator*(const escript::Data&, const escript::Data&);
78 friend Data operator/(const escript::Data&, const escript::Data&);
79 friend Data operator+(const escript::Data&, const boost::python::api::object&);
80 friend Data operator-(const escript::Data&, const boost::python::api::object&);
81 friend Data operator*(const escript::Data&, const boost::python::api::object&);
82 friend Data operator/(const escript::Data&, const boost::python::api::object&);
83 friend Data C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
84 int axis_offset, int transpose);
85 friend Data condEval(escript::Data& mask, escript::Data& trueval, escript::Data& falseval);
86 };
87
88
89 extern EscriptParams escriptParams;
90
91 /**
92 \brief Set the value of a named parameter.
93 See listEscriptParams() (showEscriptParams() in python) for available parameters.
94 */
95 ESCRIPT_DLL_API
96 void setEscriptParamInt(const char* name, int value);
97
98 /**
99 \brief get the value of a named parameter.
100 See listEscriptParams() (showEscriptParams() in python) for available parameters.
101 */
102 ESCRIPT_DLL_API
103 int getEscriptParamInt(const char* name, int sentinel=0);
104
105 /**
106 \brief describe available paramters.
107 \return a list of tuples (parameter name, value, description)
108 */
109 ESCRIPT_DLL_API
110 inline boost::python::list listEscriptParams()
111 {
112 return escriptParams.listEscriptParams();
113 }
114
115
116
117 }
118 #endif

  ViewVC Help
Powered by ViewVC 1.1.26