Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#positive_definite?, #positive_semidefinite?, #rank_deficient? #411

Open
translunar opened this issue Nov 30, 2015 · 10 comments
Open

#positive_definite?, #positive_semidefinite?, #rank_deficient? #411

translunar opened this issue Nov 30, 2015 · 10 comments

Comments

@translunar
Copy link
Member

These methods, among others, would be useful for users wanting to check matrix properties.

@johnmarinelli
Copy link

Hi! I'd like to take a shot at this. I think I can have something to show within a week or two.

@translunar
Copy link
Member Author

Wonderful! Thanks so much for getting involved. =D

@johnmarinelli
Copy link

@MohawkJohn Hey! I'm afraid I don't understand what the second parameter of NMatrix::rank is supposed to do, but if I can use that function to calculate the rank of the matrix then rank_deficient? would be really easy to implement.

@translunar
Copy link
Member Author

#rank basically allows you to iterate along either rows or columns or through the depth of the tensor if it's more than 2-dimensional. So the first argument is row, column, or depth; and the second argument is which one of those. If you do rank(0,1), it gives you row 1. If you do rank(1,5), it gives you column 5. If you do rank(2,1), you get layer 1. Make sense?

@johnmarinelli
Copy link

@MohawkJohn yep, perfect sense! I ended up using the gesvd to calculate rank. Since this needs the nmatrix/lapacke gem, I have a couple of questions -

  1. Is that okay? Or did you want it to be implemented without the lapacke dependency?
  2. How can I test the nmatrix functions that require lapacke? The tests that are already in place catch a NotImplementedException, even though I have the nmatrix-lapacke gem installed.

@wlevine
Copy link

wlevine commented Dec 7, 2015

You can run the tests with rake spec nmatrix_plugins=lapacke which will
require the nmatrix/lapacke gem
On Dec 7, 2015 4:16 PM, "John Marinelli" notifications@github.com wrote:

@MohawkJohn https://github.com/mohawkjohn yep, perfect sense! I ended
up using the gesvd to calculate rank. Since this needs the nmatrix/lapacke
gem, I have a couple of questions -

  1. Is that okay? Or did you want it to be implemented without the lapacke
    dependency?
  2. How can I test the nmatrix functions that require lapacke? The tests
    that are already in place give me a NotImplementedException, even though I
    have the nmatrix-lapacke gem installed.


Reply to this email directly or view it on GitHub
#411 (comment).

@translunar
Copy link
Member Author

Is using gesvd the most economical way to calculate rank?

@johnmarinelli
Copy link

@MohawkJohn , well, I know there are a variety of ways to calculate whether or not a matrix is full rank or not; but I thought that SVD was the only way to calculate rank?

@translunar
Copy link
Member Author

Yup, you're right. Had to check my reference. =) Yes, lapacke sounds good.

@johnmarinelli
Copy link

@MohawkJohn sounds good; i will continue to push on :) @wlevine thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants