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

fixes det method for dtype object #575

Closed
wants to merge 1 commit into from
Closed

fixes det method for dtype object #575

wants to merge 1 commit into from

Conversation

npriyadarshi
Copy link

@MohawkJohn In continuation with the work done by you in PR #501.

@translunar
Copy link
Member

Seems like you're missing some code here.

@npriyadarshi
Copy link
Author

@MohawkJohn i do not understand what part of my code is missing could you please help me out with this. Is this not the correct way to implement it?

@translunar
Copy link
Member

Let's try this: can you please explain to me how your implementation works?

@npriyadarshi
Copy link
Author

In the det function i type cast the object dtype to float.

@translunar
Copy link
Member

What happens if the Object can't be cast to a decimal value? (For that matter, why would we have an :object dtype at all if we could always just treat it as a decimal?)

@npriyadarshi
Copy link
Author

@MohawkJohn in lib/nmatrix/math.rb in the method det .getrf is being used on a copy(with typecasted dtype) of the matrix whose determinant is to be found out. should i throw an exception if it cannot be cast into decimal value? or is there any other way to fix the issue?

@npriyadarshi
Copy link
Author

should i change the det function so that it does not require LAPACK function and the i can follow as in PR #514 ?

@translunar
Copy link
Member

@npriyadarshi Let's rewind a bit. Why do we have an :object dtype? How does it differ from the float and integer dtypes?

@npriyadarshi
Copy link
Author

Object dtypes represent ruby objects i mean any variable in ruby be it string,decimal, integer etc. I dont actually understand why we have dtype object.

@translunar
Copy link
Member

We have object dtypes because matrix operations like determinants exist not only for the set of nxn integer matrices and the set of nxn real matrices, but others as well. We cannot possibly create a dtype for each of these cases because we can't envision them all. So the Ruby object dtype allows people to use those algorithms on any arbitrary domain.

@translunar
Copy link
Member

I'm going to close this for now. You're welcome to discuss on the Google Group, or reopen when you think you've got a solution ready.

@translunar translunar closed this Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants