CircularProduct.cpp 610 Bytes
Newer Older
Elouan Wauquier's avatar
Elouan Wauquier committed
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
#include "CircularProduct.hpp"

namespace fl {

    std::string CircularProduct::className() const {
        return "CircularProduct";
    }

    Complexity CircularProduct::complexity() const {
        return Complexity().arithmetic(1);
    }

    scalar CircularProduct::compute(scalar a, scalar b) const {
        a = 1 - a;
        b = 1 - b;
        return std::max(scalar(0.0), 1 - sqrt(a * a + b * b));
    }

    CircularProduct* CircularProduct::clone() const {
        return new CircularProduct(*this);
    }

    TNorm* CircularProduct::constructor() {
        return new CircularProduct;
    }

}