Closed npriyadarshi closed 7 years ago
Seems like you're missing some code here.
@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?
Let's try this: can you please explain to me how your implementation works?
In the det function i type cast the object dtype to float.
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?)
@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?
should i change the det function so that it does not require LAPACK function and the i can follow as in PR #514 ?
@npriyadarshi Let's rewind a bit. Why do we have an :object
dtype? How does it differ from the float and integer dtypes?
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.
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.
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.
@mohawkjohn In continuation with the work done by you in PR #501.