CubicHermiteSpline.kt

1
package com.github.sanity.pav.spline
2
3
/**
4
 * Created by ian on 12/7/16.
5
 */
6 6 1. getM1 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getM1 → SURVIVED
2. getM2 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getM2 → SURVIVED
3. getX1 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getX1 → SURVIVED
4. getX2 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getX2 → SURVIVED
5. getY1 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getY1 → SURVIVED
6. getY2 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getY2 → SURVIVED
class CubicHermiteSpline(val x1: Double, val y1: Double, val m1: Double, val x2: Double, val y2: Double, val m2: Double) {
7
8
    fun interpolate(x: Double): Double {
9 3 1. interpolate : Replaced double subtraction with addition → KILLED
2. interpolate : Replaced double subtraction with addition → KILLED
3. interpolate : Replaced double division with multiplication → KILLED
        val t = (x - x1) / (x2 - x1)
10
        val pk = y1
11
        val pk1 = y2
12
        val xk = x1
13
        val xk1 = x2
14 1 1. interpolate : Replaced double multiplication with division → KILLED
        val t1 = h00(t) * pk
15 3 1. interpolate : Replaced double subtraction with addition → KILLED
2. interpolate : Replaced double multiplication with division → KILLED
3. interpolate : Replaced double multiplication with division → KILLED
        val t2 = h10(t) * (xk1 - xk) * m1
16 1 1. interpolate : Replaced double multiplication with division → KILLED
        val t3 = h01(t) * pk1
17 3 1. interpolate : Replaced double subtraction with addition → KILLED
2. interpolate : Replaced double multiplication with division → KILLED
3. interpolate : Replaced double multiplication with division → KILLED
        val t4 = h11(t) * (xk1 - xk) * m2
18 1 1. interpolate : Replaced double addition with subtraction → KILLED
        return t1 +
19 1 1. interpolate : Replaced double addition with subtraction → KILLED
                t2 +
20 2 1. interpolate : Replaced double addition with subtraction → KILLED
2. interpolate : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::interpolate → KILLED
                t3 +
21
                t4
22
    }
23
24 5 1. h00 : Replaced double multiplication with division → KILLED
2. h00 : Replaced double multiplication with division → KILLED
3. h00 : Replaced double subtraction with addition → KILLED
4. h00 : Replaced double addition with subtraction → KILLED
5. h00 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h00 → KILLED
    private fun h00(t: Double) = 2.0 * (t pow 3) - 3.0 * (t pow 2) + 1.0
25 4 1. h10 : Replaced double multiplication with division → KILLED
2. h10 : Replaced double subtraction with addition → KILLED
3. h10 : Replaced double addition with subtraction → KILLED
4. h10 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h10 → KILLED
    private fun h10(t: Double) = (t pow 3) - 2.0 * (t pow 2) + t
26 4 1. h01 : Replaced double multiplication with division → KILLED
2. h01 : Replaced double multiplication with division → KILLED
3. h01 : Replaced double addition with subtraction → KILLED
4. h01 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h01 → KILLED
    private fun h01(t: Double) = -2.0 * (t pow 3) + 3.0 * (t pow 2)
27 2 1. h11 : Replaced double subtraction with addition → KILLED
2. h11 : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h11 → KILLED
    private fun h11(t: Double) = (t pow 3) - (t pow 2)
28
29 1 1. pow : replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::pow → KILLED
    infix private fun Double.pow(d: Int) = Math.pow(this, d.toDouble())
30
}

Mutations

6

1.1
Location : getM1
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getM1 → SURVIVED

2.2
Location : getM2
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getM2 → SURVIVED

3.3
Location : getX1
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getX1 → SURVIVED

4.4
Location : getX2
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getX2 → SURVIVED

5.5
Location : getY1
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getY1 → SURVIVED

6.6
Location : getY2
Killed by : none
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::getY2 → SURVIVED

9

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

2.2
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

3.3
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double division with multiplication → KILLED

14

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

15

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

2.2
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

3.3
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

16

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

17

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

2.2
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

3.3
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

18

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

19

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

20

1.1
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

2.2
Location : interpolate
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::interpolate → KILLED

24

1.1
Location : h00
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

2.2
Location : h00
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

3.3
Location : h00
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

4.4
Location : h00
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

5.5
Location : h00
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h00 → KILLED

25

1.1
Location : h10
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

2.2
Location : h10
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

3.3
Location : h10
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

4.4
Location : h10
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h10 → KILLED

26

1.1
Location : h01
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

2.2
Location : h01
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double multiplication with division → KILLED

3.3
Location : h01
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double addition with subtraction → KILLED

4.4
Location : h01
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h01 → KILLED

27

1.1
Location : h11
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
Replaced double subtraction with addition → KILLED

2.2
Location : h11
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::h11 → KILLED

29

1.1
Location : pow
Killed by : com.github.sanity.pav.spline.CubicHermiteSplineSpec.com.github.sanity.pav.spline.CubicHermiteSplineSpec
replaced return of double value with -(x + 1) for com/github/sanity/pav/spline/CubicHermiteSpline::pow → KILLED

Active mutators

Tests examined


Report generated by PIT 1.1.10