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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2199 - (hide annotations)
Thu Jan 8 06:10:52 2009 UTC (10 years, 9 months ago) by jfenwick
File MIME type: text/plain
File size: 3161 byte(s)
Misc fixes:
Added some svn:ignore properties for output files that were cluttering things up.

Lazy fixes:
Fixed shape calculations for TRACE and TRANSPOSE for rank>2.
Adjusted unit test accordingly.

As a Temporary change to DataC.cpp to test for lazy data in DataC's expanded check.
This is wrong but would only affect people using lazy data.
The proper fix will come when the numarray removal code moves over from the branch.

Made tensor product AUTOLAZY capable.
Fixed some bugs resolving tensor products (incorrect offsets in buffers).
Macro'd some stray couts.

- It appears that AUTOLAZY now passes all unit tests.
- It will not be _really_ safe for general use until I can add COW. 
- (Everything's better with COW)
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 2142 #include <boost/python/list.hpp>
18 trankine 2154 #include "Data.h" // for the operators
19 jfenwick 1897
20     namespace escript
21     {
22    
23 jfenwick 2146 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 2146
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 2146 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 jfenwick 2199 friend escript::Data escript::C_GeneralTensorProduct(escript::Data& arg_0, escript::Data& arg_1,
65     int axis_offset, int transpose);
66 jfenwick 2146
67 jfenwick 1897 };
68    
69    
70     extern EscriptParams escriptParams;
71    
72 jfenwick 2142 /**
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 2142 /**
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 2142 /**
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