github.com/Anderson-Lu/gobox@v0.0.0-20191127065433-3e6c4c2da420/number/feasible_region.go (about)

     1  package number
     2  
     3  //计算一阶差分
     4  func CalcFeasibleRegion(x []float64) []float64 {
     5  	y := make([]float64, len(x)-1)
     6  	for i := 0; i < len(x)-1; i++ {
     7  		y[i] = x[i+1] - x[i]
     8  	}
     9  	return y
    10  }