-
Notifications
You must be signed in to change notification settings - Fork 23
Fix incorrect LatinHypercube documentation and add code for Uniform c… #160
Conversation
distmv/general.go
Outdated
badReceiver = "distmv: input slice is not nil or the correct length" | ||
badSizeMismatch = "distmv: size mismatch" | ||
badZeroDimension = "distmv: zero dimensional input" | ||
badNonPosDimension = "distmv: non-positive dimension input" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the prefix of bad is not helpful here. This is the same issue as badSizeMismatch
. nonPositiveDimension
seems more meaningful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought that we were using bad
as a generic panic prefix. I guess I misunderstood the previous suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"bad" just means that, that the thing was bad without necessarily saying why. So "badSizeMismatch" would either be "badSize" or preferably "sizeMismatch" (since that is the message). The same argument holds here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
distmv/uniform.go
Outdated
@@ -44,6 +44,22 @@ func NewUniform(bnds []Bound, src *rand.Source) *Uniform { | |||
return u | |||
} | |||
|
|||
func NewUnitUniform(dim int, src *rand.Source) *Uniform { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment here please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
distuv/uniform.go
Outdated
@@ -9,6 +9,8 @@ import ( | |||
"math/rand" | |||
) | |||
|
|||
var UnitUniform = Uniform{Min: 0, Max: 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment here please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…onvenience