Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/Dobjects/Dtable_extras.rb,
lib/Dobjects/Dvector_extras.rb

Overview

:nodoc: all

Instance Method Summary collapse

Instance Method Details

#*(a) ⇒ Object


23
24
25
26
27
28
29
# File 'lib/Dobjects/Dtable_extras.rb', line 23

def *(a)
    if a.class == Dobjects::Dtable
        a*self
    else
        pre_ddata_mult(a)
    end
end

#**(a) ⇒ Object


39
40
41
42
43
44
45
# File 'lib/Dobjects/Dtable_extras.rb', line 39

def **(a)
    if a.class == Dobjects::Dtable
        a.as_exponent_of(self)
    else
        pre_ddata_pow(a)
    end
end

#+(a) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/Dobjects/Dtable_extras.rb', line 7

def +(a)
    if a.class == Dobjects::Dtable
        a+self
    else
        pre_ddata_add(a)
    end
end

#-(a) ⇒ Object


15
16
17
18
19
20
21
# File 'lib/Dobjects/Dtable_extras.rb', line 15

def -(a)
    if a.class == Dobjects::Dtable
        a.neg+self
    else
        pre_ddata_sub(a)
    end
end

#/(a) ⇒ Object


31
32
33
34
35
36
37
# File 'lib/Dobjects/Dtable_extras.rb', line 31

def /(a)
    if a.class == Dobjects::Dtable
        a.inv*self
    else
        pre_ddata_div(a)
    end
end

#pre_ddata_addObject


6
# File 'lib/Dobjects/Dtable_extras.rb', line 6

alias :pre_ddata_add :+

#pre_ddata_divObject


30
# File 'lib/Dobjects/Dtable_extras.rb', line 30

alias :pre_ddata_div :/

#pre_ddata_multObject


22
# File 'lib/Dobjects/Dtable_extras.rb', line 22

alias :pre_ddata_mult :*

#pre_ddata_powObject


38
# File 'lib/Dobjects/Dtable_extras.rb', line 38

alias :pre_ddata_pow :**

#pre_ddata_subObject


14
# File 'lib/Dobjects/Dtable_extras.rb', line 14

alias :pre_ddata_sub :-

#pre_dvec_addObject


308
309
310
311
312
313
314
# File 'lib/Dobjects/Dvector_extras.rb', line 308

def +(a)
    if a.class == Dobjects::Dtable
        a+self
    else
        pre_ddata_add(a)
    end
end

#pre_dvec_divObject


332
333
334
335
336
337
338
# File 'lib/Dobjects/Dvector_extras.rb', line 332

def /(a)
    if a.class == Dobjects::Dtable
        a.inv*self
    else
        pre_ddata_div(a)
    end
end

#pre_dvec_multObject


324
325
326
327
328
329
330
# File 'lib/Dobjects/Dvector_extras.rb', line 324

def *(a)
    if a.class == Dobjects::Dtable
        a*self
    else
        pre_ddata_mult(a)
    end
end

#pre_dvec_powObject


340
341
342
343
344
345
346
# File 'lib/Dobjects/Dvector_extras.rb', line 340

def **(a)
    if a.class == Dobjects::Dtable
        a.as_exponent_of(self)
    else
        pre_ddata_pow(a)
    end
end

#pre_dvec_subObject


316
317
318
319
320
321
322
# File 'lib/Dobjects/Dvector_extras.rb', line 316

def -(a)
    if a.class == Dobjects::Dtable
        a.neg+self
    else
        pre_ddata_sub(a)
    end
end