examples/mpi/mba.hpp
inline double Bspline(size_t k, double t) {
    assert(0 <= t && t < 1);
    assert(k < 4);

    switch (k) {
        case 0:
            return (t * (t * (-t + 3) - 3) + 1) / 6;
        case 1:
            return (t * t * (3 * t - 6) + 4) / 6;
        case 2:
            return (t * (t * (-3 * t + 3) + 3) + 1) / 6;
        case 3:
            return t * t * t / 6;
        default:
            return 0;
    }
}
// Value of k-th B-Spline basic function at t.
Value of k-th B-Spline basic function at t.
Value of k - th B - Spline basic function at t .
inline double Bspline(size_t k, double t) {
    assert(0 <= t && t < 1);
    assert(k < 4);
    switch (k) {
        case 0:
            return (t * (t * (-t + 3) - 3) + 1) / 6;
        case 1:
            return (t * t * (3 * t - 6) + 4) / 6;
        case 2:
            return (t * (t * (-3 * t + 3) + 3) + 1) / 6;
        case 3:
            return t * t * t / 6;
        default:
            return 0;
    }
}
inline double Bspline ( size_t k , double t ) { assert ( 0 <= t && t < 1 ) ; assert ( k < 4 ) ; switch ( k ) { case 0 : return ( t * ( t * ( - t + 3 ) - 3 ) + 1 ) / 6 ; case 1 : return ( t * t * ( 3 * t - 6 ) + 4 ) / 6 ; case 2 : return ( t * ( t * ( -3 * t + 3 ) + 3 ) + 1 ) / 6 ; case 3 : return t * t * t / 6 ; default : return 0 ; } }
Value of k-th B-Spline basic function at t.
Value of k - th B - Spline basic function at t .