Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Classes | |
class | AttrGetter |
struct | BinaryWrapper |
class | Cast |
class | Constant |
class | Exception |
class | ExceptionRaiser |
class | ExpressionTree |
class | ExpressionTree< R(Args...)> |
class | ExpressionTree< R(const std::vector< T > &)> |
class | ExpressionTreeBase |
class | ExpressionTreeBuilder |
class | Function |
class | FunctionFactory |
class | FunctionFactory< R(Args...)> |
class | GILLocker |
class | GILReleaser |
class | GraphvizGenerator |
struct | Identity |
struct | makeBinaryFunctionHelper |
struct | makeBinaryFunctionHelper< R(T, T)> |
struct | makeFunctionHelper |
struct | makeFunctionHelper< R(Args...)> |
struct | makeFunctionHelper< R(const Context &, Args...)> |
class | Node |
class | NodeBase |
struct | NodeCast |
struct | NodeCast< double > |
struct | NodeCast< int64_t > |
struct | NodeConverter |
class | Placeholder |
class | Placeholder< AttributeSet > |
class | PythonCall |
class | RecoverableError |
struct | RegisterNode |
class | SaveThread |
class | TextReprVisitor |
struct | UnaryWrapper |
class | UnrecoverableError |
struct | VariantToPython |
class | Visitor |
Typedefs | |
template<typename T > | |
using | Pow = BinaryWrapper< T, T, std::pow > |
Wraps the power function. | |
template<typename T > | |
using | Abs = UnaryWrapper< T, T, std::abs > |
Wraps the abs function. | |
template<typename T > | |
using | Round = UnaryWrapper< T, T, std::round > |
Wraps the round function. | |
template<typename T > | |
using | Exp = UnaryWrapper< T, T, std::exp > |
Wraps the exponential function. | |
template<typename T > | |
using | Exp2 = UnaryWrapper< T, T, std::exp2 > |
Wraps the exponential, base 2, function. | |
template<typename T > | |
using | Log = UnaryWrapper< T, T, std::log > |
Wraps the log function. | |
template<typename T > | |
using | Log2 = UnaryWrapper< T, T, std::log2 > |
Wraps the log, base 2, function. | |
template<typename T > | |
using | Log10 = UnaryWrapper< T, T, std::log10 > |
Wraps the log, base 10, function. | |
template<typename T > | |
using | Sqrt = UnaryWrapper< T, T, std::sqrt > |
Wraps the square root function. | |
template<typename T > | |
using | Sin = UnaryWrapper< T, T, std::sin > |
Wraps the sin function. | |
template<typename T > | |
using | Cos = UnaryWrapper< T, T, std::cos > |
Wraps the cos function. | |
template<typename T > | |
using | Tan = UnaryWrapper< T, T, std::tan > |
Wraps the tan function. | |
template<typename T > | |
using | ArcSin = UnaryWrapper< T, T, std::asin > |
Wraps the arcsin function. | |
template<typename T > | |
using | ArcCos = UnaryWrapper< T, T, std::acos > |
Wraps the arcos function. | |
template<typename T > | |
using | ArcTan = UnaryWrapper< T, T, std::atan > |
Wraps the arctan function. | |
template<typename T > | |
using | Sinh = UnaryWrapper< T, T, std::sinh > |
Wraps the hyperbolic sin function. | |
template<typename T > | |
using | Cosh = UnaryWrapper< T, T, std::cosh > |
Wraps the hyperbolic cos function. | |
template<typename T > | |
using | Tanh = UnaryWrapper< T, T, std::tanh > |
Wraps the hyperbolic tan function. | |
template<typename T > | |
using | ArcSinh = UnaryWrapper< T, T, std::asinh > |
Wraps the hyperbolic arcsin function. | |
template<typename T > | |
using | ArcCosh = UnaryWrapper< T, T, std::acosh > |
Wraps the hyperbolic arccos function. | |
template<typename T > | |
using | ArcTanh = UnaryWrapper< T, T, std::atanh > |
Wraps the hyperbolic arctan function. | |
template<typename T > | |
using | ArcTan2 = BinaryWrapper< T, T, std::atan2 > |
Wraps atan2. | |
template<typename T > | |
using | Fmod = BinaryWrapper< T, T, std::fmod > |
Wraps fmod. | |
using | Attribute = boost::variant< bool, int64_t, double > |
using | AttributeSet = std::map< std::string, Attribute > |
using | Value = boost::variant< bool, int64_t, double, AttributeSet > |
using | Arguments = std::vector< Value > |
using | Context = std::map< std::string, boost::any > |
Functions | |
template<typename Signature > | |
static boost::python::object | makeFunction (const std::string &repr, std::function< Signature > functor) |
template<typename Signature > | |
static boost::python::object | makeBinaryFunction (const std::string &repr, std::function< Signature > functor, bool reversed=false) |
template<typename To , typename From > | |
static bool | createCastNode (boost::python::object &object, void *storage) |
boost::python::numpy::ndarray | table2numpy (const Euclid::Table::Table &table) |
static std::string | escape (const std::string &str) |
py::object | attributeSetGetter (const AttributeSet &attr_set, const std::string &name) |
void | RegisterAttributeSet () |
static PyObject * | createExceptionClass (const std::string &name) |
void | translateRecoverable (const RecoverableError &e) |
void | translateUnrecoverable (const UnrecoverableError &e) |
BOOST_PYTHON_MODULE (pyston) | |
Variables | |
thread_local Context | sharedContext |
static size_t | s_lock_count = 0 |
PyObject * | pyRecoverableError = nullptr |
PyObject * | pyUnrecoverableError = nullptr |
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2012-2022 Euclid Science Ground Segment
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
using Pyston::Abs = typedef UnaryWrapper<T, T, std::abs> |
Wraps the abs function.
Definition at line 78 of file Functors.h.
using Pyston::ArcCos = typedef UnaryWrapper<T, T, std::acos> |
Wraps the arcos function.
Definition at line 126 of file Functors.h.
using Pyston::ArcCosh = typedef UnaryWrapper<T, T, std::acosh> |
Wraps the hyperbolic arccos function.
Definition at line 150 of file Functors.h.
using Pyston::ArcSin = typedef UnaryWrapper<T, T, std::asin> |
Wraps the arcsin function.
Definition at line 122 of file Functors.h.
using Pyston::ArcSinh = typedef UnaryWrapper<T, T, std::asinh> |
Wraps the hyperbolic arcsin function.
Definition at line 146 of file Functors.h.
using Pyston::ArcTan = typedef UnaryWrapper<T, T, std::atan> |
Wraps the arctan function.
Definition at line 130 of file Functors.h.
using Pyston::ArcTan2 = typedef BinaryWrapper<T,T, std::atan2> |
Wraps atan2.
Definition at line 158 of file Functors.h.
using Pyston::ArcTanh = typedef UnaryWrapper<T, T, std::atanh> |
Wraps the hyperbolic arctan function.
Definition at line 154 of file Functors.h.
using Pyston::Arguments = typedef std::vector<Value> |
using Pyston::Attribute = typedef boost::variant<bool, int64_t, double> |
using Pyston::AttributeSet = typedef std::map<std::string, Attribute> |
using Pyston::Context = typedef std::map<std::string, boost::any> |
using Pyston::Cos = typedef UnaryWrapper<T, T, std::cos> |
Wraps the cos function.
Definition at line 114 of file Functors.h.
using Pyston::Cosh = typedef UnaryWrapper<T, T, std::cosh> |
Wraps the hyperbolic cos function.
Definition at line 138 of file Functors.h.
using Pyston::Exp = typedef UnaryWrapper<T, T, std::exp> |
Wraps the exponential function.
Definition at line 86 of file Functors.h.
using Pyston::Exp2 = typedef UnaryWrapper<T, T, std::exp2> |
Wraps the exponential, base 2, function.
Definition at line 90 of file Functors.h.
using Pyston::Fmod = typedef BinaryWrapper<T, T, std::fmod> |
Wraps fmod.
Definition at line 162 of file Functors.h.
using Pyston::Log = typedef UnaryWrapper<T, T, std::log> |
Wraps the log function.
Definition at line 94 of file Functors.h.
using Pyston::Log10 = typedef UnaryWrapper<T, T, std::log10> |
Wraps the log, base 10, function.
Definition at line 102 of file Functors.h.
using Pyston::Log2 = typedef UnaryWrapper<T, T, std::log2> |
Wraps the log, base 2, function.
Definition at line 98 of file Functors.h.
using Pyston::Pow = typedef BinaryWrapper<T, T, std::pow> |
Wraps the power function.
Definition at line 74 of file Functors.h.
using Pyston::Round = typedef UnaryWrapper<T, T, std::round> |
Wraps the round function.
Definition at line 82 of file Functors.h.
using Pyston::Sin = typedef UnaryWrapper<T, T, std::sin> |
Wraps the sin function.
Definition at line 110 of file Functors.h.
using Pyston::Sinh = typedef UnaryWrapper<T, T, std::sinh> |
Wraps the hyperbolic sin function.
Definition at line 134 of file Functors.h.
using Pyston::Sqrt = typedef UnaryWrapper<T, T, std::sqrt> |
Wraps the square root function.
Definition at line 106 of file Functors.h.
using Pyston::Tan = typedef UnaryWrapper<T, T, std::tan> |
Wraps the tan function.
Definition at line 118 of file Functors.h.
using Pyston::Tanh = typedef UnaryWrapper<T, T, std::tanh> |
Wraps the hyperbolic tan function.
Definition at line 142 of file Functors.h.
using Pyston::Value = typedef boost::variant<bool, int64_t, double, AttributeSet> |
Can hold any values a Placeholder may require
py::object Pyston::attributeSetGetter | ( | const AttributeSet & | attr_set, |
const std::string & | name | ||
) |
Definition at line 224 of file Module.cpp.
References std::map< K, T >::end(), and std::map< K, T >::find().
Referenced by RegisterAttributeSet().
Pyston::BOOST_PYTHON_MODULE | ( | pyston | ) |
Definition at line 280 of file Module.cpp.
References createExceptionClass(), Pyston::RegisterNode< T >::Do(), pyRecoverableError, pyUnrecoverableError, RegisterAttributeSet(), translateRecoverable(), and translateUnrecoverable().
|
static |
Create a new Cast Node from a Node of some other type (i.e. bool => float)
From | Original type |
object | Python object |
storage | Memory area, handled by boost::python, where to store the new object |
Definition at line 39 of file NodeConverter.h.
|
static |
Create a new exception on the Python side
Used by Recoverable and Unrecoverable errors, which can not be directly exposed, since they do not (and can not due to boost::python API limitations) inherit from Python's Exception
Definition at line 256 of file Module.cpp.
References std::string::c_str().
Referenced by BOOST_PYTHON_MODULE().
|
static |
Definition at line 24 of file GraphvizGenerator.cpp.
Referenced by Pyston::GraphvizGenerator::enter(), and Pyston::GraphvizGenerator::GraphvizGenerator().
|
static |
Special case that allows to create calls to binary functions, supporting the reversal or arguments if needed, which is the case for methods like rmul, rpow and similar The functor can only receive parameters of the same type. Any required casting will be done by NodeConverter
Signature | Signature of the functor that receives two parameters of the same type |
repr | Literal representation of the node, for pretty-printing |
functor | Functor to insert |
Definition at line 124 of file Helpers.h.
Referenced by Pyston::RegisterNode< T >::defCastOperations(), Pyston::RegisterNode< T >::general(), Pyston::RegisterNode< T >::specialized(), and Pyston::RegisterNode< T >::specialized().
|
static |
boost::python seems to have some trouble attaching functors as methods to python objects, so it requires some massaging in order to figure out the signature, keep the reference alive, etc. Since the code is a bit convolved, we isolate it here to make it easier to use
Signature | Signature of the functor |
repr | Literal representation of the node, for pretty-printing |
functor | Functor to insert |
Definition at line 104 of file Helpers.h.
Referenced by Pyston::RegisterNode< T >::general(), Pyston::RegisterNode< T >::specialized(), and Pyston::RegisterNode< T >::specialized().
void Pyston::RegisterAttributeSet | ( | ) |
Register the attribute set placeholder
Definition at line 235 of file Module.cpp.
References attributeSetGetter().
Referenced by BOOST_PYTHON_MODULE().
boost::python::numpy::ndarray Pyston::table2numpy | ( | const Euclid::Table::Table & | table | ) |
Transform an Euclid::Table::Table into a numpy structured array
Definition at line 218 of file Table2Numpy.cpp.
References Euclid::Table::Table::getColumnInfo(), and Euclid::Table::Table::size().
void Pyston::translateRecoverable | ( | const RecoverableError & | e | ) |
Translate C++ recoverable exception to its Python counterpart
Definition at line 269 of file Module.cpp.
References pyRecoverableError.
Referenced by BOOST_PYTHON_MODULE().
void Pyston::translateUnrecoverable | ( | const UnrecoverableError & | e | ) |
Translate C++ unrecoverable exception to its Python counterpart
Definition at line 276 of file Module.cpp.
References pyUnrecoverableError.
Referenced by BOOST_PYTHON_MODULE().
PyObject* Pyston::pyRecoverableError = nullptr |
Definition at line 61 of file Module.cpp.
Referenced by BOOST_PYTHON_MODULE(), and translateRecoverable().
PyObject* Pyston::pyUnrecoverableError = nullptr |
Definition at line 62 of file Module.cpp.
Referenced by BOOST_PYTHON_MODULE(), and translateUnrecoverable().
|
static |
Definition at line 23 of file GIL.cpp.
Referenced by Pyston::GILLocker::getLockCount(), Pyston::GILLocker::GILLocker(), and Pyston::GILReleaser::~GILReleaser().
thread_local Context Pyston::sharedContext |
This context is used globally (per thread) to pass a context whenever the original python snippet could not be compiled. Basically, it is stored on this global just before jumping into python, and passed to the registered function that has need for it.
Definition at line 22 of file SharedContext.cpp.
Referenced by Pyston::PythonCall< T >::eval().