Skip to content


Subversion checkout URL

You can clone with
Download ZIP


NMatrix::BLAS::cblas_rotg needs a rational-safe algorithm, dtype specifier #49

mohawkjohn opened this Issue · 1 comment

1 participant


The BLAS algorithm will not work proplery for Rationals or Integers (due to sqrt call). It's enabled for Rational currently, but will likely throw a Ruby exception (ArgumentError).

cblas_rotg also doesn't have any matrix arguments, so there needs to be some way for the user to specify the correct dtype (:float32 instead of the default :float64, :complex64 instead of the default complex128).

This should set the standard for any other BLAS functions which don't have NMatrix/NVector arguments from which to infer dtype.

@mohawkjohn mohawkjohn referenced this issue from a commit
@mohawkjohn mohawkjohn Added CBLAS function cblas_rotg. Algorithm sucks, won't work properly…
… for Rational due to sqrt. Added negation and std::sqrt for RubyObject and Rational. See also issue #49.
@mohawkjohn mohawkjohn referenced this issue from a commit
@mohawkjohn mohawkjohn Improved cblas_rotg behavior, partially fixing issue #49. Still needs…
… rational-safe algorithm.

Updated History and README with new features

This issue now duplicates #47.

@mohawkjohn mohawkjohn closed this
@mohawkjohn mohawkjohn was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.