/usr/include/openturns/swig/ConfidenceInterval.i is in python-openturns-dev 1.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | // SWIG file ConfidenceInterval.i
// @author schueller
// @date 2012-01-02 11:44:01 +0100 (Mon, 02 Jan 2012)
%{
#include "ConfidenceInterval.hxx"
namespace OT {
template <>
struct traitsPythonType<OT::ConfidenceInterval>
{
typedef _PySequence_ Type;
};
template <>
inline
OT::ConfidenceInterval
convert<_PySequence_,OT::ConfidenceInterval>(PyObject * pyObj)
{
check<_PySequence_>( pyObj );
ScopedPyObjectPointer newPyObj(PySequence_Fast( pyObj, "" ));
if (PySequence_Fast_GET_SIZE( newPyObj.get() ) != 2)
throw InvalidArgumentException(HERE) << "Sequence passed as argument is not a pair (NumericalScalar, NumericalScalar)";
PyObject * item_0 = PySequence_Fast_GET_ITEM( newPyObj.get(), 0 );
check<_PyFloat_>( item_0 );
PyObject * item_1 = PySequence_Fast_GET_ITEM( newPyObj.get(), 1 );
check<_PyFloat_>( item_1 );
return ConfidenceInterval ( convert<_PyFloat_,NumericalScalar>( item_0 ),
convert<_PyFloat_,NumericalScalar>( item_1 ) );
}
} /* namespace OT */
%}
%include ConfidenceInterval.hxx
namespace OT{
%extend ConfidenceInterval {
ConfidenceInterval(const ConfidenceInterval & other) { return new OT::ConfidenceInterval(other); }
ConfidenceInterval(PyObject * pyObj)
{
return new OT::ConfidenceInterval( OT::convert<OT::_PySequence_,OT::ConfidenceInterval>(pyObj) );
}
}
}
|