Skip to content

Commit

Permalink
Fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
chewxy committed May 31, 2018
1 parent 6314d1b commit 8f2bcc9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions arith.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "math"
// Pow performs elementwise
// a̅ ^ b̅
func Pow(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
switch b[i] {
Expand All @@ -24,7 +23,6 @@ func Pow(a, b []float64) {
}

func Mod(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
a[i] = math.Mod(v, b[i])
Expand Down Expand Up @@ -93,7 +91,6 @@ func PowOfR(a []float64, s float64) {

// Max takes two slices, a̅ + b̅, and compares them elementwise. The highest value is put into a̅.
func Max(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]

for i, v := range a {
Expand All @@ -106,7 +103,6 @@ func Max(a, b []float64) {

// Min takes two slices, a̅ + b̅ and compares them elementwise. The lowest value is put into a̅.
func Min(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]

for i, v := range a {
Expand Down
4 changes: 0 additions & 4 deletions go.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "math"

// Add performs a̅ + b̅. a̅ will be clobbered
func Add(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
a[i] = v + b[i]
Expand All @@ -15,7 +14,6 @@ func Add(a, b []float64) {

// Sub performs a̅ - b̅. a̅ will be clobbered
func Sub(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
a[i] = v - b[i]
Expand All @@ -24,7 +22,6 @@ func Sub(a, b []float64) {

// Mul performs a̅ × b̅. a̅ will be clobbered
func Mul(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
a[i] = v * b[i]
Expand All @@ -33,7 +30,6 @@ func Mul(a, b []float64) {

// Div performs a̅ ÷ b̅. a̅ will be clobbered
func Div(a, b []float64) {
a = a[:len(a)]
b = b[:len(a)]
for i, v := range a {
if b[i] == 0 {
Expand Down
12 changes: 0 additions & 12 deletions incr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "math"

// IncrAdd performs a̅ + b̅ and then adds it elementwise to the incr slice
func IncrAdd(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
Expand All @@ -14,7 +13,6 @@ func IncrAdd(a, b, incr []float64) {

// IncrSub performs a̅ = b̅ and then adds it elementwise to the incr slice
func IncrSub(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
Expand All @@ -24,7 +22,6 @@ func IncrSub(a, b, incr []float64) {

// IncrMul performs a̅ × b̅ and then adds it elementwise to the incr slice
func IncrMul(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
Expand All @@ -33,7 +30,6 @@ func IncrMul(a, b, incr []float64) {
}

func IncrDiv(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
Expand All @@ -47,7 +43,6 @@ func IncrDiv(a, b, incr []float64) {

// IncrDiv performs a̅ ÷ b̅. a̅ will be clobbered
func IncrPow(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
Expand All @@ -68,7 +63,6 @@ func IncrPow(a, b, incr []float64) {

// IncrMod performs a̅ % b̅ then adds it to incr
func IncrMod(a, b, incr []float64) {
a = a[:len(a)]
b = b[:len(a)]
incr = incr[:len(a)]

Expand All @@ -80,7 +74,6 @@ func IncrMod(a, b, incr []float64) {
// Scale multiplies all values in the slice by the scalar and then increments the incr slice
// incr += a̅ * s
func IncrScale(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += v * s
Expand All @@ -96,7 +89,6 @@ func IncrScaleInv(a []float64, s float64, incr []float64) {
/// IncrScaleInvR divides all numbers in the slice by a scalar and then increments the incr slice
// incr += s / a̅
func IncrScaleInvR(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += s / v
Expand All @@ -106,7 +98,6 @@ func IncrScaleInvR(a []float64, s float64, incr []float64) {
// IncrTrans adds all the values in the slice by a scalar and then increments the incr slice
// incr += a̅ + s
func IncrTrans(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += v + s
Expand All @@ -122,7 +113,6 @@ func IncrTransInv(a []float64, s float64, incr []float64) {
// IncrTransInvR subtracts all the numbers in a slice from a scalar and then increments the incr slice
// incr += s - a̅
func IncrTransInvR(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += s - v
Expand All @@ -132,7 +122,6 @@ func IncrTransInvR(a []float64, s float64, incr []float64) {
// IncrPowOf performs elementwise power function and then increments the incr slice
// incr += a̅ ^ s
func IncrPowOf(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += math.Pow(v, s)
Expand All @@ -142,7 +131,6 @@ func IncrPowOf(a []float64, s float64, incr []float64) {
// PowOfR performs elementwise power function below and then increments the incr slice.
// incr += s ^ a̅
func IncrPowOfR(a []float64, s float64, incr []float64) {
a = a[:len(a)]
incr = incr[:len(a)]
for i, v := range a {
incr[i] += math.Pow(s, v)
Expand Down

0 comments on commit 8f2bcc9

Please sign in to comment.