Skip to content
This repository has been archived by the owner on Dec 22, 2018. It is now read-only.

Fix incorrect LatinHypercube documentation and add code for Uniform c… #160

Merged
merged 1 commit into from
Feb 19, 2017

Conversation

btracey
Copy link
Member

@btracey btracey commented Feb 17, 2017

…onvenience

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"
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -44,6 +44,22 @@ func NewUniform(bnds []Bound, src *rand.Source) *Uniform {
return u
}

func NewUnitUniform(dim int, src *rand.Source) *Uniform {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment here please.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -9,6 +9,8 @@ import (
"math/rand"
)

var UnitUniform = Uniform{Min: 0, Max: 1}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment here please.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@btracey btracey merged commit d97bad7 into master Feb 19, 2017
@btracey btracey deleted the fixlatin branch February 19, 2017 00:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants