/[escript]/trunk/ripley/src/ripleycpp.cpp
ViewVC logotype

Contents of /trunk/ripley/src/ripleycpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4650 - (show annotations)
Wed Feb 5 04:16:01 2014 UTC (5 years, 7 months ago) by jfenwick
File size: 21971 byte(s)
Fixed a spelling error and missing virtual (not sure that one matters).
Added _untested_ 3D gaussian smoothed random data


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 #include <ripley/Brick.h>
17 #include <ripley/Rectangle.h>
18 #include <esysUtils/esysExceptionTranslator.h>
19
20 #include <boost/python.hpp>
21 #include <boost/python/module.hpp>
22 #include <boost/python/def.hpp>
23 #include <boost/python/detail/defaults_gen.hpp>
24 #include <boost/version.hpp>
25
26 using namespace boost::python;
27
28 namespace ripley {
29
30 template<typename T>
31 std::vector<T> extractPyArray(const object& obj, const std::string& name,
32 int expectedLength=0)
33 {
34 std::vector<T> result;
35 if (extract<tuple>(obj).check() || extract<list>(obj).check()) {
36 if (expectedLength==0 || len(obj)==expectedLength) {
37 for (int i=0; i<len(obj); i++) {
38 result.push_back(extract<T>(obj[i]));
39 }
40 } else {
41 std::stringstream ssError;
42 ssError << "argument '" << name << "' has wrong length";
43 std::string error(ssError.str());
44 throw RipleyException(error.c_str());
45 }
46 } else {
47 std::stringstream ssError;
48 ssError << "argument '" << name << "' must be a tuple or list";
49 std::string error(ssError.str());
50 throw RipleyException(error.c_str());
51 }
52
53 return result;
54 }
55
56 escript::Data readBinaryGrid(std::string filename, escript::FunctionSpace fs,
57 const object& pyShape, double fill, int byteOrder, int dataType,
58 const object& pyFirst, const object& pyNum, const object& pyMultiplier,
59 const object& pyReverse)
60 {
61 int dim=fs.getDim();
62 ReaderParameters params;
63
64 params.first = extractPyArray<int>(pyFirst, "first", dim);
65 params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
66 params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
67 params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
68 params.byteOrder = byteOrder;
69 params.dataType = dataType;
70 std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
71
72 const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
73 if (!dom)
74 throw RipleyException("Function space must be on a ripley domain");
75
76 escript::Data res(fill, shape, fs, true);
77 dom->readBinaryGrid(res, filename, params);
78 return res;
79 }
80
81 escript::Data readNcGrid(std::string filename, std::string varname,
82 escript::FunctionSpace fs, const object& pyShape, double fill,
83 const object& pyFirst, const object& pyNum, const object& pyMultiplier,
84 const object& pyReverse)
85 {
86 int dim=fs.getDim();
87 ReaderParameters params;
88
89 params.first = extractPyArray<int>(pyFirst, "first", dim);
90 params.numValues = extractPyArray<int>(pyNum, "numValues", dim);
91 params.multiplier = extractPyArray<int>(pyMultiplier, "multiplier", dim);
92 params.reverse = extractPyArray<int>(pyReverse, "reverse", dim);
93 std::vector<int> shape(extractPyArray<int>(pyShape, "shape"));
94
95 const RipleyDomain* dom=dynamic_cast<const RipleyDomain*>(fs.getDomain().get());
96 if (!dom)
97 throw RipleyException("Function space must be on a ripley domain");
98
99 escript::Data res(fill, shape, fs, true);
100 dom->readNcGrid(res, filename, varname, params);
101 return res;
102 }
103
104 // These wrappers are required to make the shared pointers work through the
105 // Python wrapper
106
107 // The double for n? is just to keep python happy when people need to deal with
108 // truediv
109 escript::Domain_ptr _brick(double _n0, double _n1, double _n2, const object& l0,
110 const object& l1, const object& l2, int d0, int d1, int d2,
111 const object& objpoints, const object& objtags)
112 {
113 int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1), n2=static_cast<int>(_n2);
114 double x0=0., x1=1., y0=0., y1=1., z0=0., z1=1.;
115 if (extract<tuple>(l0).check()) {
116 tuple x=extract<tuple>(l0);
117 if (len(x)==2) {
118 x0=extract<double>(x[0]);
119 x1=extract<double>(x[1]);
120 } else
121 throw RipleyException("Argument l0 must be a float or 2-tuple");
122 } else if (extract<double>(l0).check()) {
123 x1=extract<double>(l0);
124 } else
125 throw RipleyException("Argument l0 must be a float or 2-tuple");
126
127 if (extract<tuple>(l1).check()) {
128 tuple y=extract<tuple>(l1);
129 if (len(y)==2) {
130 y0=extract<double>(y[0]);
131 y1=extract<double>(y[1]);
132 } else
133 throw RipleyException("Argument l1 must be a float or 2-tuple");
134 } else if (extract<double>(l1).check()) {
135 y1=extract<double>(l1);
136 } else
137 throw RipleyException("Argument l1 must be a float or 2-tuple");
138
139 if (extract<tuple>(l2).check()) {
140 tuple z=extract<tuple>(l2);
141 if (len(z)==2) {
142 z0=extract<double>(z[0]);
143 z1=extract<double>(z[1]);
144 } else
145 throw RipleyException("Argument l2 must be a float or 2-tuple");
146 } else if (extract<double>(l2).check()) {
147 z1=extract<double>(l2);
148 } else
149 throw RipleyException("Argument l2 must be a float or 2-tuple");
150
151 boost::python::list pypoints=extract<boost::python::list>(objpoints);
152 boost::python::list pytags=extract<boost::python::list>(objtags);
153 int numpts=extract<int>(pypoints.attr("__len__")());
154 int numtags=extract<int>(pytags.attr("__len__")());
155 std::vector<double> points;
156 std::vector<int> tags;
157 tags.resize(numtags, -1);
158 for (int i=0;i<numpts;++i) {
159 boost::python::object temp=pypoints[i];
160 int l=extract<int>(temp.attr("__len__")());
161 for (int k=0;k<l;++k) {
162 points.push_back(extract<double>(temp[k]));
163 }
164 }
165 std::map<std::string, int> tagstonames;
166 int curmax=40;
167 // but which order to assign tags to names?????
168 for (int i=0;i<numtags;++i) {
169 extract<int> ex_int(pytags[i]);
170 extract<std::string> ex_str(pytags[i]);
171 if (ex_int.check()) {
172 tags[i]=ex_int();
173 if (tags[i]>= curmax) {
174 curmax=tags[i]+1;
175 }
176 } else if (ex_str.check()) {
177 std::string s=ex_str();
178 std::map<std::string, int>::iterator it=tagstonames.find(s);
179 if (it!=tagstonames.end()) {
180 // we have the tag already so look it up
181 tags[i]=it->second;
182 } else {
183 tagstonames[s]=curmax;
184 tags[i]=curmax;
185 curmax++;
186 }
187 } else {
188 throw RipleyException("Error - Unable to extract tag value.");
189 }
190 }
191 return escript::Domain_ptr(new Brick(n0,n1,n2, x0,y0,z0, x1,y1,z1, d0,d1,d2,
192 points, tags, tagstonames));
193 }
194
195 const int _q[]={0x61686969,0x746c4144,0x79616e43};
196 escript::Domain_ptr _rectangle(double _n0, double _n1, const object& l0,
197 const object& l1, int d0, int d1,
198 const object& objpoints, const object& objtags)
199 {
200 int n0=static_cast<int>(_n0), n1=static_cast<int>(_n1);
201 double x0=0., x1=1., y0=0., y1=1.;
202 if (extract<tuple>(l0).check()) {
203 tuple x=extract<tuple>(l0);
204 if (len(x)==2) {
205 x0=extract<double>(x[0]);
206 x1=extract<double>(x[1]);
207 } else
208 throw RipleyException("Argument l0 must be a float or 2-tuple");
209 } else if (extract<double>(l0).check()) {
210 x1=extract<double>(l0);
211 } else
212 throw RipleyException("Argument l0 must be a float or 2-tuple");
213
214 if (extract<tuple>(l1).check()) {
215 tuple y=extract<tuple>(l1);
216 if (len(y)==2) {
217 y0=extract<double>(y[0]);
218 y1=extract<double>(y[1]);
219 } else
220 throw RipleyException("Argument l1 must be a float or 2-tuple");
221 } else if (extract<double>(l1).check()) {
222 y1=extract<double>(l1);
223 } else
224 throw RipleyException("Argument l1 must be a float or 2-tuple");
225
226 boost::python::list pypoints=extract<boost::python::list>(objpoints);
227 boost::python::list pytags=extract<boost::python::list>(objtags);
228 int numpts=extract<int>(pypoints.attr("__len__")());
229 int numtags=extract<int>(pytags.attr("__len__")());
230 std::vector<double> points;
231 std::vector<int> tags;
232 tags.resize(numtags, -1);
233 for (int i=0;i<numpts;++i) {
234 boost::python::object temp=pypoints[i];
235 int l=extract<int>(temp.attr("__len__")());
236 for (int k=0;k<l;++k) {
237 points.push_back(extract<double>(temp[k]));
238 }
239 }
240 std::map<std::string, int> tagstonames;
241 int curmax=40;
242 // but which order to assign tags to names?????
243 for (int i=0;i<numtags;++i) {
244 extract<int> ex_int(pytags[i]);
245 extract<std::string> ex_str(pytags[i]);
246 if (ex_int.check()) {
247 tags[i]=ex_int();
248 if (tags[i]>= curmax) {
249 curmax=tags[i]+1;
250 }
251 } else if (ex_str.check()) {
252 std::string s=ex_str();
253 std::map<std::string, int>::iterator it=tagstonames.find(s);
254 if (it!=tagstonames.end()) {
255 // we have the tag already so look it up
256 tags[i]=it->second;
257 } else {
258 tagstonames[s]=curmax;
259 tags[i]=curmax;
260 curmax++;
261 }
262 } else {
263 throw RipleyException("Error - Unable to extract tag value.");
264 }
265 }
266 return escript::Domain_ptr(new Rectangle(n0,n1, x0,y0, x1,y1, d0,d1,
267 points, tags, tagstonames));
268 }
269 std::string _who(){int a[]={_q[0]^42,_q[1]^42,_q[2]^42,0};return (char*)&a[0];}
270
271 } // end of namespace ripley
272
273
274 BOOST_PYTHON_MODULE(ripleycpp)
275 {
276 // This feature was added in boost v1.34
277 #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
278 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
279 docstring_options docopt(true, true, false);
280 #endif
281
282 register_exception_translator<ripley::RipleyException>(&(esysUtils::esysExceptionTranslator));
283
284 scope().attr("__doc__") = "To use this module, please import esys.ripley";
285 scope().attr("BYTEORDER_NATIVE") = (int)ripley::BYTEORDER_NATIVE;
286 scope().attr("BYTEORDER_LITTLE_ENDIAN") = (int)ripley::BYTEORDER_LITTLE_ENDIAN;
287 scope().attr("BYTEORDER_BIG_ENDIAN") = (int)ripley::BYTEORDER_BIG_ENDIAN;
288 scope().attr("DATATYPE_INT32") = (int)ripley::DATATYPE_INT32;
289 scope().attr("DATATYPE_FLOAT32") = (int)ripley::DATATYPE_FLOAT32;
290 scope().attr("DATATYPE_FLOAT64") = (int)ripley::DATATYPE_FLOAT64;
291
292 def("Brick", ripley::_brick, (arg("n0"),arg("n1"),arg("n2"),arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0,arg("d0")=-1,arg("d1")=-1,arg("d2")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
293 "Creates a hexagonal mesh with n0 x n1 x n2 elements over the brick [0,l0] x [0,l1] x [0,l2].\n\n"
294 ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
295 ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
296 ":param n2: number of elements in direction 2\n:type n2: ``int``\n"
297 ":param l0: length of side 0 or coordinate range of side 0\n:type l0: ``float`` or ``tuple``\n"
298 ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"
299 ":param l2: length of side 2 or coordinate range of side 2\n:type l2: ``float`` or ``tuple``\n"
300 ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"
301 ":param d1: number of subdivisions in direction 1\n:type d1: ``int``\n"
302 ":param d2: number of subdivisions in direction 2\n:type d2: ``int``");
303
304 def("Rectangle", ripley::_rectangle, (arg("n0"),arg("n1"),arg("l0")=1.0,arg("l1")=1.0,arg("d0")=-1,arg("d1")=-1,arg("diracPoints")=list(),arg("diracTags")=list()),
305 "Creates a rectangular mesh with n0 x n1 elements over the rectangle [0,l0] x [0,l1].\n\n"
306 ":param n0: number of elements in direction 0\n:type n0: ``int``\n"
307 ":param n1: number of elements in direction 1\n:type n1: ``int``\n"
308 ":param l0: length of side 0 or coordinate range of side 0\n:type l0: ``float`` or ``tuple``\n"
309 ":param l1: length of side 1 or coordinate range of side 1\n:type l1: ``float`` or ``tuple``\n"
310 ":param d0: number of subdivisions in direction 0\n:type d0: ``int``\n"
311 ":param d1: number of subdivisions in direction 1\n:type d1: ``int``");
312 def("_theculprit_", ripley::_who);
313
314 def("_readBinaryGrid", &ripley::readBinaryGrid, (arg("filename"),
315 arg("functionspace"), arg("shape"), arg("fill")=0.,
316 arg("byteOrder"), arg("dataType"), arg("first"),
317 arg("numValues"), arg("multiplier"), arg("reverse")),
318 "Reads a binary Grid");
319
320 def("_readNcGrid", &ripley::readNcGrid, (arg("filename"), arg("varname"),
321 arg("functionspace"), arg("shape"), arg("fill"), arg("first"),
322 arg("numValues"), arg("multiplier"), arg("reverse")),
323 "Reads a grid from a netCDF file");
324
325 class_<ripley::RipleyDomain, bases<escript::AbstractContinuousDomain>, boost::noncopyable >
326 ("RipleyDomain", "", no_init)
327 .def("print_mesh_info", &ripley::RipleyDomain::Print_Mesh_Info, (arg("full")=false),
328 "Prints out a summary about the mesh.\n"
329 ":param full: whether to output additional data\n:type full: ``bool``")
330 .def("writeBinaryGrid", &ripley::RipleyDomain::writeBinaryGrid)
331
332 .def("dump", &ripley::RipleyDomain::dump, args("filename"),
333 "Dumps the mesh to a file with the given name.")
334 .def("getGridParameters", &ripley::RipleyDomain::getGridParameters,
335 "Returns the tuple (origin, spacing, elements) where the entries are tuples:\n"
336 "``origin``=the coordinates of the domain's global origin,\n"
337 "``spacing``=the element size (=node spacing) of the domain,\n"
338 "``elements``=the global number of elements in all dimensions\n\n"
339 ":rtype: ``tuple``")
340 .def("getDescription", &ripley::RipleyDomain::getDescription,
341 ":return: a description for this domain\n:rtype: ``string``")
342 .def("getDim", &ripley::RipleyDomain::getDim, ":rtype: ``int``")
343 .def("getDataShape", &ripley::RipleyDomain::getDataShape, args("functionSpaceCode"),
344 ":return: a pair (dps, ns) where dps=the number of data points per sample, and ns=the number of samples\n:rtype: ``tuple``")
345 .def("getNumDataPointsGlobal", &ripley::RipleyDomain::getNumDataPointsGlobal,
346 ":return: the number of data points summed across all MPI processes\n"
347 ":rtype: ``int``")
348 .def("addToSystem",&ripley::RipleyDomain::addToSystemFromPython,
349 args("mat", "rhs", "data"),
350 "adds a PDE to the system, results depend on domain\n\n"
351 ":param mat:\n:type mat: `OperatorAdapter`\n"
352 ":param rhs:\n:type rhs: `Data`\n"
353 ":param data:\ntype data: `list`")
354 .def("addPDEToSystem",&ripley::RipleyDomain::addPDEToSystem,
355 args("mat", "rhs", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
356 "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
357 ":param mat:\n:type mat: `OperatorAdapter`\n:param rhs:\n:type rhs: `Data`\n"
358 ":param A:\n:type A: `Data`\n"
359 ":param B:\n:type B: `Data`\n"
360 ":param C:\n:type C: `Data`\n"
361 ":param D:\n:type D: `Data`\n"
362 ":param X:\n:type X: `Data`\n"
363 ":param Y:\n:type Y: `Data`\n"
364 ":param d:\n:type d: `Data`\n"
365 ":param d_contact:\n:type d_contact: `Data`\n"
366 ":param y_contact:\n:type y_contact: `Data`"
367 )
368
369 .def("addPDEToRHS",&ripley::RipleyDomain::addPDEToRHS,
370 args("rhs", "X", "Y", "y", "y_contact"),
371 "adds a PDE onto the stiffness matrix mat and a rhs\n\n"
372 ":param rhs:\n:type rhs: `Data`\n"
373 ":param X:\n:type X: `Data`\n"
374 ":param Y:\n:type Y: `Data`\n"
375 ":param y:\n:type y: `Data`\n"
376 ":param y_contact:\n:type y_contact: `Data`"
377 )
378 .def("addToRHS",&ripley::RipleyDomain::addToRHSFromPython,
379 args("rhs", "data"),
380 "adds a PDE onto the stiffness matrix mat and a rhs, "
381 "results depends on domain\n\n"
382 ":param rhs:\n:type rhs: `Data`\n"
383 ":param data:\ntype data: `list`")
384 .def("setAssembler", &ripley::RipleyDomain::setAssemblerFromPython,
385 args("typename", "options"),
386 "sets the domain to use the named assembler, if supported, using"
387 "the options if provided"
388 ":param typename:\n:type typename: `string`\n"
389 ":param options:\n:type options: `list`\n")
390 .def("addPDEToTransportProblem",&ripley::RipleyDomain::addPDEToTransportProblem,
391 args( "tp", "source", "M", "A", "B", "C", "D", "X", "Y", "d", "y", "d_contact", "y_contact"),
392 ":param tp:\n:type tp: `TransportProblemAdapter`\n"
393 ":param source:\n:type source: `Data`\n"
394 ":param M:\n:type M: `Data`\n"
395 ":param A:\n:type A: `Data`\n"
396 ":param B:\n:type B: `Data`\n"
397 ":param C:\n:type C: `Data`\n"
398 ":param D:\n:type D: `Data`\n"
399 ":param X:\n:type X: `Data`\n"
400 ":param Y:\n:type Y: `Data`\n"
401 ":param d:\n:type d: `Data`\n"
402 ":param y:\n:type y: `Data`\n"
403 ":param d_contact:\n:type d_contact: `Data`\n"
404 ":param y_contact:\n:type y_contact: `Data`"
405 )
406 .def("newOperator",&ripley::RipleyDomain::newSystemMatrix,
407 args("row_blocksize", "row_functionspace", "column_blocksize", "column_functionspace", "type"),
408 "creates a SystemMatrixAdapter stiffness matrix and initializes it with zeros\n\n"
409 ":param row_blocksize:\n:type row_blocksize: ``int``\n"
410 ":param row_functionspace:\n:type row_functionspace: `FunctionSpace`\n"
411 ":param column_blocksize:\n:type column_blocksize: ``int``\n"
412 ":param column_functionspace:\n:type column_functionspace: `FunctionSpace`\n"
413 ":param type:\n:type type: ``int``"
414 )
415 .def("newTransportProblem",&ripley::RipleyDomain::newTransportProblem,
416 args("theta", "blocksize", "functionspace", "type"),
417 "creates a TransportProblemAdapter\n\n"
418 ":param theta:\n:type theta: ``float``\n"
419 ":param blocksize:\n:type blocksize: ``int``\n"
420 ":param functionspace:\n:type functionspace: `FunctionSpace`\n"
421 ":param type:\n:type type: ``int``"
422 )
423 .def("getSystemMatrixTypeId",&ripley::RipleyDomain::getSystemMatrixTypeId,
424 args("solver", "preconditioner", "package", "symmetry"),
425 ":return: the identifier of the matrix type to be used for the global stiffness matrix when a particular solver, package, preconditioner, and symmetric matrix is used.\n"
426 ":rtype: ``int``\n"
427 ":param solver:\n:type solver: ``int``\n"
428 ":param preconditioner:\n:type preconditioner: ``int``\n"
429 ":param package:\n:type package: ``int``\n"
430 ":param symmetry:\n:type symmetry: ``int``"
431 )
432 .def("getTransportTypeId",&ripley::RipleyDomain::getTransportTypeId,
433 args("solver", "preconditioner", "package", "symmetry"),
434 ":return: the identifier of the transport problem type to be used when a particular solver, preconditioner, package and symmetric matrix is used.\n"
435 ":rtype: ``int``\n"
436 ":param solver:\n:type solver: ``int``\n"
437 ":param preconditioner:\n:type preconditioner: ``int``\n"
438 ":param package:\n:type package: ``int``\n"
439 ":param symmetry:\n:type symmetry: ``int``"
440 )
441 .def("getX",&ripley::RipleyDomain::getX, ":return: locations in the FEM nodes\n\n"
442 ":rtype: `Data`")
443 .def("getNormal",&ripley::RipleyDomain::getNormal,
444 ":return: boundary normals at the quadrature point on the face elements\n"
445 ":rtype: `Data`")
446 .def("getSize",&ripley::RipleyDomain::getSize,":return: the element size\n"
447 ":rtype: `Data`")
448 .def("setTagMap",&ripley::RipleyDomain::setTagMap,args("name","tag"),
449 "Give a tag number a name.\n\n:param name: Name for the tag\n:type name: ``string``\n"
450 ":param tag: numeric id\n:type tag: ``int``\n:note: Tag names must be unique within a domain")
451 .def("getTag",&ripley::RipleyDomain::getTag,args("name"),":return: tag id for "
452 "``name``\n:rtype: ``string``")
453 .def("isValidTagName",&ripley::RipleyDomain::isValidTagName,args("name"),
454 ":return: True if ``name`` corresponds to a tag, otherwise False\n:rtype: ``bool``")
455 .def("showTagNames",&ripley::RipleyDomain::showTagNames,":return: A space separated list of tag names\n:rtype: ``string``")
456 .def("getMPISize",&ripley::RipleyDomain::getMPISize,":return: the number of processes used for this `Domain`\n:rtype: ``int``")
457 .def("getMPIRank",&ripley::RipleyDomain::getMPIRank,":return: the rank of this process\n:rtype: ``int``")
458 .def("MPIBarrier",&ripley::RipleyDomain::MPIBarrier,"Wait until all processes have reached this point")
459 .def("onMasterProcessor",&ripley::RipleyDomain::onMasterProcessor,":return: True if this code is executing on the master process\n:rtype: `bool`");
460
461 class_<ripley::Brick, bases<ripley::RipleyDomain> >("RipleyBrick", "", no_init)
462 .def("randomFill", &ripley::Brick::randomFill,":return: random data\n:rtype: `Data`\n:param seed: pass zero to use system generated seed\n:type seed: `int`\n"
463 ":param details: more info about the type of randomness\nCurrently, the only acceptable value for this tuple is ('gaussian', r, s) where r is the radius of the"
464 "guassian blur and s is the sigma parameter."
465 );
466 class_<ripley::Rectangle, bases<ripley::RipleyDomain> >("RipleyRectangle", "", no_init)
467 .def("randomFill", &ripley::Rectangle::randomFill,":return: random data\n:rtype: `Data`\n:param seed: pass zero to use system generated seed\n:type seed: `int`\n"
468 ":param details: more info about the type of randomness\nCurrently, the only acceptable value for this tuple is ('gaussian', r, s) where r is the radius of the"
469 "guassian blur and s is the sigma parameter."
470 );
471 }
472

  ViewVC Help
Powered by ViewVC 1.1.26