|
29 | 29 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30 | 30 | # POSSIBILITY OF SUCH DAMAGE. |
31 | 31 |
|
| 32 | + |
32 | 33 | cdef class Function1D: |
33 | 34 | cdef double evaluate(self, double x) except? -1e999 |
34 | 35 |
|
@@ -57,6 +58,34 @@ cdef class ModuloFunction1D(Function1D): |
57 | 58 | cdef Function1D _function1, _function2 |
58 | 59 |
|
59 | 60 |
|
| 61 | +cdef class AbsFunction1D(Function1D): |
| 62 | + cdef Function1D _function |
| 63 | + |
| 64 | + |
| 65 | +cdef class EqualsFunction1D(Function1D): |
| 66 | + cdef Function1D _function1, _function2 |
| 67 | + |
| 68 | + |
| 69 | +cdef class NotEqualsFunction1D(Function1D): |
| 70 | + cdef Function1D _function1, _function2 |
| 71 | + |
| 72 | + |
| 73 | +cdef class LessThanFunction1D(Function1D): |
| 74 | + cdef Function1D _function1, _function2 |
| 75 | + |
| 76 | + |
| 77 | +cdef class GreaterThanFunction1D(Function1D): |
| 78 | + cdef Function1D _function1, _function2 |
| 79 | + |
| 80 | + |
| 81 | +cdef class LessEqualsFunction1D(Function1D): |
| 82 | + cdef Function1D _function1, _function2 |
| 83 | + |
| 84 | + |
| 85 | +cdef class GreaterEqualsFunction1D(Function1D): |
| 86 | + cdef Function1D _function1, _function2 |
| 87 | + |
| 88 | + |
60 | 89 | cdef class AddScalar1D(Function1D): |
61 | 90 | cdef double _value |
62 | 91 | cdef Function1D _function |
@@ -95,3 +124,43 @@ cdef class PowScalarFunction1D(Function1D): |
95 | 124 | cdef class PowFunctionScalar1D(Function1D): |
96 | 125 | cdef double _value |
97 | 126 | cdef Function1D _function |
| 127 | + |
| 128 | + |
| 129 | +cdef class EqualsScalar1D(Function1D): |
| 130 | + cdef double _value |
| 131 | + cdef Function1D _function |
| 132 | + |
| 133 | + |
| 134 | +cdef class NotEqualsScalar1D(Function1D): |
| 135 | + cdef double _value |
| 136 | + cdef Function1D _function |
| 137 | + |
| 138 | + |
| 139 | +cdef class LessThanScalar1D(Function1D): |
| 140 | + cdef double _value |
| 141 | + cdef Function1D _function |
| 142 | + |
| 143 | + |
| 144 | +cdef class GreaterThanScalar1D(Function1D): |
| 145 | + cdef double _value |
| 146 | + cdef Function1D _function |
| 147 | + |
| 148 | + |
| 149 | +cdef class LessEqualsScalar1D(Function1D): |
| 150 | + cdef double _value |
| 151 | + cdef Function1D _function |
| 152 | + |
| 153 | + |
| 154 | +cdef class GreaterEqualsScalar1D(Function1D): |
| 155 | + cdef double _value |
| 156 | + cdef Function1D _function |
| 157 | + |
| 158 | + |
| 159 | +cdef inline bint is_callable(object f): |
| 160 | + """ |
| 161 | + Tests if an object is a python callable or function object. |
| 162 | +
|
| 163 | + :param object f: Object to test. |
| 164 | + :return: True if callable, False otherwise. |
| 165 | + """ |
| 166 | + return isinstance(f, Function1D) or callable(f) |
0 commit comments