Class Float
In: lib/gsl/oper.rb
Parent: Object
Float Fixnum TopLevel

Methods

*   /  

External Aliases

* -> _orig_mul
/ -> _orig_div

Public Instance methods

[Source]

    # File lib/gsl/oper.rb, line 39
39:   def *(other)
40:     if other.kind_of?(GSL::Matrix) or other.kind_of?(GSL::Vector) or other.kind_of?(GSL::Matrix::Int) or other.kind_of?(GSL::Vector::Int) or other.kind_of?(GSL::Vector::Complex)or other.kind_of?(GSL::Matrix::Complex)
41:       other.scale(self)
42:     else
43:       if GSL.have_tensor?
44:         if other.kind_of?(GSL::Tensor) or other.kind_of?(GSL::Tensor::Int)
45:           other.scale(self)
46:         else
47:           self._orig_mul(other)
48:         end
49:       else
50:         self._orig_mul(other)
51:       end
52:     end
53:   end

[Source]

    # File lib/gsl/oper.rb, line 55
55:   def /(other)
56:     if other.kind_of?(GSL::Poly) or other.kind_of?(GSL::Poly::Int)
57:       a = GSL::Poly[1]; a[0] = self
58:       GSL::Rational.new(a, other)
59:     elsif other.kind_of?(GSL::Vector::Col) 
60:       other.scale(1.0/pow_2(other.dnrm2))
61:     elsif other.kind_of?(GSL::Vector::Int::Col)
62:       v = other.to_f
63:       v.scale(1.0/pow_2(v.dnrm2))
64:     else
65:       self._orig_div(other)
66:     end
67:   end

[Validate]