#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 putanowr <putanowr@foo>
#
# Distributed under terms of the MIT license.

"""
Define integrand as scalar function in R.
"""

class Integrand:
    def __init__(self, expression):
        self.expression = expression

    def evaluate(self, x):
        return eval(self.expression)

    def __call__(self, x):
        return self.evaluate(x)


if __name__ == '__main__':
    f = Integrand("x**2")
    z = f(4)
    print("Integrand value %f" % z,)

