Module | JBLAS::ComplexMixin |
In: |
lib/jblas/complex.rb
|
Syntactic sugar for complex numbers.
Defines the arithmetic operators *, +, -, /, and coercion such that the complex numbers interact well with the builtin numerics.
Get the conjugate of the complex number
# File lib/jblas/complex.rb, line 90 def conj; JAVA_METHOD; end
Divide with swapped operands.
This means that a.rdiv(b) = b / a. This method is necessary to make coercion work.
# File lib/jblas/complex.rb, line 72 def rdiv(o); inv * o; end
Subtract with swapped operands.
This means that a.rsub(b) = b - a. This method is necessary to make coercion work.
# File lib/jblas/complex.rb, line 67 def rsub(o); -self + o; end