simplify division code
This commit is contained in:
parent
6686e4f919
commit
b01337378a
7
fermi.go
7
fermi.go
|
@ -250,8 +250,6 @@ func divideDists(old_dist Dist, new_dist Dist) (Dist, error) {
|
||||||
return nil, errors.New("Error: division by zero scalar")
|
return nil, errors.New("Error: division by zero scalar")
|
||||||
}
|
}
|
||||||
return multiplyLogDists(o, Lognormal{low: 1.0 / float64(n), high: 1.0 / float64(n)}), nil
|
return multiplyLogDists(o, Lognormal{low: 1.0 / float64(n), high: 1.0 / float64(n)}), nil
|
||||||
default:
|
|
||||||
return operateDistsAsSamples(old_dist, new_dist, "/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Scalar:
|
case Scalar:
|
||||||
|
@ -265,13 +263,10 @@ func divideDists(old_dist Dist, new_dist Dist) (Dist, error) {
|
||||||
return nil, errors.New("Error: division by zero scalar")
|
return nil, errors.New("Error: division by zero scalar")
|
||||||
}
|
}
|
||||||
return Scalar(float64(o) / float64(n)), nil
|
return Scalar(float64(o) / float64(n)), nil
|
||||||
default:
|
|
||||||
return operateDistsAsSamples(old_dist, new_dist, "/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
return operateDistsAsSamples(old_dist, new_dist, "/")
|
|
||||||
}
|
}
|
||||||
|
return operateDistsAsSamples(old_dist, new_dist, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generic distribution operations
|
// Generic distribution operations
|
||||||
|
|
Loading…
Reference in New Issue
Block a user