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

Add some documentations for dense matrix. #105

Closed
wants to merge 5 commits into from

Conversation

lazywei
Copy link

@lazywei lazywei commented Feb 18, 2015

Current documentation is not clear unless users look into the source code. So I decide to add some documentations to several common methods.
Please let me know if there is any concern.

Thanks.

@kortschak
Copy link
Member

Please take a look at #26. This is the kind of documentation that needs to be added. This PR was stalled.

@lazywei
Copy link
Author

lazywei commented Feb 18, 2015

@kortschak thanks for your reply, but I don't really understand what you mean. Do you mean
(0) This PR (#105) documentation is not needed?
or
(1) I should somehow merge the documentations in that PR (#26) into this one?

Thanks.

@kortschak
Copy link
Member

The documentation is needed, but the PR I mentioned is stalled. It would be nice if it was unstalled.

@btracey
Copy link
Member

btracey commented Feb 18, 2015

Hi @lazywei , thanks for wanting to contribute.

What @kortschak means is that #26 contains documentation additions more along the lines of the package style. If you could incorporate those changes into this PR that would be great.

@lazywei
Copy link
Author

lazywei commented Feb 18, 2015

OK, so here is what I'm going to do: I'll try to merge (by hands) the documentation parts in #26, and try to modify the documentation style in my previous commit to match the guideline of this package.
Please let me know if there is any other thing I should be aware of!
Thanks.

@kortschak
Copy link
Member

I would like to get agreement from @antoine-lizee for those to be incorporated. He has not been added to the A+C and #26 was not accepted for other reasons. If it were simple, I'd have gone through and done it my self.

@lazywei
Copy link
Author

lazywei commented Feb 18, 2015

Sure, I have mentioned @antoine-lizee in that PR. I'll put this PR on hold then.

@antoine-lizee
Copy link

Please go ahead! Thanks for asking.

@lazywei
Copy link
Author

lazywei commented Feb 21, 2015

@antoine-lizee thanks!
@kortschak so I'm going to move the docs in #26 into this PR, is that fine by you?

@kortschak
Copy link
Member

SGTM

lazywei pushed a commit to lazywei/matrix that referenced this pull request Feb 21, 2015
Please refer to these two Pull Requests gonum#26 and
gonum#105 for more details of this commit.
The original docs are written by @antoine-lizee (https://github.com/antoine-lizee),
and this commit only modifies some content. Therefore, all credits should go to antoine.
@lazywei
Copy link
Author

lazywei commented Feb 21, 2015

I've pushed new commit, @kortschak please help me review them.
Thanks.

@kortschak
Copy link
Member

Initial comments are that comment lines should around 80 character to ease reading and don't bother starting new lines unless you are starting a new paragraph in the godoc (or at ~80).

@@ -65,6 +65,11 @@ type Dense struct {
capRows, capCols int
}

// NewDense creates a new matrix of type *Dense with dimensions r and c. If the mat argument is nil,
// a new data slice is allocated.
// Data slice is of Row-major order, i.e., the (i, j) element in matrix should be at (i*c + j)-th
Copy link
Member

Choose a reason for hiding this comment

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

The data must be arranged in row-major order, i.e. the (i*c + j)-th element in mat is the {i, j}-th element in the matrix.

Copy link
Author

Choose a reason for hiding this comment

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

will fix in next commit.

// Mul takes the matrix product of a and b, placing the result in the receiver.
// Note that the arguments a or b should be either Matrix or *Dense.
// Therfore, if a or b is of type Dense, you'll need to pass them by address.
// For example: m.Mul(a, &b) when a is *Dense and b is Dense.
Copy link
Member

Choose a reason for hiding this comment

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

Remove the lines after the first. This is better covered by an example.

Copy link
Author

Choose a reason for hiding this comment

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

As mentioned, where should we put this into an example?

Copy link
Member

Choose a reason for hiding this comment

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

It doesn't need to be here. It's not specific to Mul.

@btracey
Copy link
Member

btracey commented Feb 21, 2015

When I say "Example", I mean in the testing sense. See the Example section in the overview of http://golang.org/pkg/testing/

// mat argument is nil, a new data slice is allocated.
// The data must be arranged in row-major order, i.e. the (i*c + j)-th element
// in mat is the {i, j}-th element in the matrix.
// See Reset for how to use zero-sized matrix.
Copy link
Member

Choose a reason for hiding this comment

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

godoc needs a blank comment line to start a new paragraph.

@kortschak
Copy link
Member

There are still undocumented methods, but I think that we should just get this committed and work on the missing methods later (#112 covers this) - I don't want this to go stale again. @btracey?

@btracey
Copy link
Member

btracey commented Mar 10, 2015

SGTM

@lazywei
Copy link
Author

lazywei commented Mar 11, 2015

Sorry that I'm a little buzy this weeks. I'll finish the rest work in the following 2~3 days.
Please let me know if there is any other thing you guys think that should be added/included in this PR.
Thanks.

@kortschak
Copy link
Member

kortschak commented Mar 11, 2015 via email

@kortschak
Copy link
Member

@lazywei BTW the diffs should be taken after you have rebased your work onto master. If you don't have time to do this, let me know and I'll merge #113 instead.

Chih-Wei Chang added 5 commits March 15, 2015 21:13
Please refer to these two Pull Requests gonum#26 and
gonum#105 for more details of this commit.
The original docs are written by @antoine-lizee (https://github.com/antoine-lizee),
and this commit only modifies some content. Therefore, all credits should go to antoine.
@lazywei
Copy link
Author

lazywei commented Mar 15, 2015

@kortschak I've finished the rebase. I'm not sure how to add the example test and the doc for capRow/capCol, so I'll leave it to you guys, is that OK?

Thanks.

@kortschak
Copy link
Member

I think this is just easier if I merge #113,

@kortschak kortschak closed this Mar 16, 2015
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.

None yet

4 participants