| Class | Fixnum |
| In: |
lib/gsl/oper.rb
|
| Parent: | Object |
| * | -> | _orig_mul |
| / | -> | _orig_div |
# File lib/gsl/oper.rb, line 4
4: def *(other)
5: 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)
6: other.scale(self)
7: else
8: if GSL.have_tensor?
9: if other.kind_of?(GSL::Tensor) or other.kind_of?(GSL::Tensor::Int)
10: other.scale(self)
11: else
12: self._orig_mul(other)
13: end
14: else
15: self._orig_mul(other)
16: end
17: end
18: end
# File lib/gsl/oper.rb, line 20
20: def /(other)
21: if other.kind_of?(GSL::Poly) or other.kind_of?(GSL::Poly::Int)
22: a = GSL::Poly[1]; a[0] = self
23: GSL::Rational.new(a, other)
24: elsif other.kind_of?(GSL::Vector::Col)
25: other.scale(1.0/pow_2(other.dnrm2))
26: elsif other.kind_of?(GSL::Vector::Int::Col)
27: v = other.to_f
28: v.scale(1.0/pow_2(v.dnrm2))
29: else
30: self._orig_div(other)
31: end
32: end