Methods
B
C
D
E
F
H
I
P
S
T
U
Instance Public methods
binary_search(binary, size, searchKey, low, middle, high)
# File bin/librbdiscrete.rb, line 302
def binary_search(binary, size, searchKey, low, middle, high)
    while (low <= high)
        middle=(low+high)/2;
        print_row(binary, size, low, middle, high);
        if (searchKey == binary[middle])
            return middle;
        elsif (searchKey <= binary[middle])
            high=middle-1
        else 
            low=middle+1
        end
    end
end
binary_search(binary, size, searchKey, low, middle, high)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 302
def binary_search(binary, size, searchKey, low, middle, high)
    while (low <= high)
        middle=(low+high)/2;
        print_row(binary, size, low, middle, high);
        if (searchKey == binary[middle])
            return middle;
        elsif (searchKey <= binary[middle])
            high=middle-1
        else 
            low=middle+1
        end
    end
end
binary_search(binary, size, searchKey, low, middle, high)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 302
def binary_search(binary, size, searchKey, low, middle, high)
    while (low <= high)
        middle=(low+high)/2;
        print_row(binary, size, low, middle, high);
        if (searchKey == binary[middle])
            return middle;
        elsif (searchKey <= binary[middle])
            high=middle-1
        else 
            low=middle+1
        end
    end
end
binary_search(binary, size, search_key, low, middle, high)
# File lib/librbdiscrete.rb, line 301
def binary_search(binary, size, search_key, low, middle, high)
    while (low <= high)
        middle=(low+high)/2;
        print_row(binary, size, low, middle, high);
        if (search_key == binary[middle])
            return middle;
        elsif (search_key <= binary[middle])
            high=middle-1
        else 
            low=middle+1
        end
    end
end
birds_eye(n, k)
# File lib/librbdiscrete.rb, line 325
def birds_eye(n, k)
    return ((n-k)/(k+1));
end
birds_eye(n, k)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 326
def birds_eye(n, k)
    return ((n-k)/(k+1));
end
birds_eye(n, k)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 326
def birds_eye(n, k)
    return ((n-k)/(k+1));
end
birds_eye(n, k)
# File bin/librbdiscrete.rb, line 326
def birds_eye(n, k)
    return ((n-k)/(k+1));
end
combinatorial(glb, ksb)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 145
def combinatorial(glb, ksb)
    if(glb < ksb)
        raise RuntimeError.new("Global set cannot be greater than k-subsets")
    end
    sbst_given_size = factorial(glb)/(factorial(ksb)*factorial(glb-ksb)).to_f
    return sbst_given_size
end
combinatorial(glb, ksb)
# File lib/librbdiscrete.rb, line 144
def combinatorial(glb, ksb)
    if(glb < ksb)
        raise RuntimeError.new("Global set cannot be greater than k-subsets")
    end
    sbst_given_size = factorial(glb)/(factorial(ksb)*factorial(glb-ksb)).to_f
    return sbst_given_size
end
combinatorial(glb, ksb)
# File bin/librbdiscrete.rb, line 145
def combinatorial(glb, ksb)
    if(glb < ksb)
        raise RuntimeError.new("Global set cannot be greater than k-subsets")
    end
    sbst_given_size = factorial(glb)/(factorial(ksb)*factorial(glb-ksb)).to_f
    return sbst_given_size
end
combinatorial(glb, ksb)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 145
def combinatorial(glb, ksb)
    if(glb < ksb)
        raise RuntimeError.new("Global set cannot be greater than k-subsets")
    end
    sbst_given_size = factorial(glb)/(factorial(ksb)*factorial(glb-ksb)).to_f
    return sbst_given_size
end
commfail()
# File pkg/RubMat-2.1.5/lib/main.rb, line 20
def commfail
  # Raise exceptions from fail situation and gives new command_line
end
commsuccss()
# File pkg/RubMat-2.1.5/lib/main.rb, line 16
def commsuccss
  # Return success statement and new command_line
end
dist_pres(presnum)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 232
def dist_pres(presnum)
    return factorial(presnum)/iterative_fact(presnum);
end
dist_pres(presnum)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 232
def dist_pres(presnum)
    return factorial(presnum)/iterative_fact(presnum);
end
dist_pres(presnum)
# File bin/librbdiscrete.rb, line 232
def dist_pres(presnum)
    return factorial(presnum)/iterative_fact(presnum);
end
dist_pres(presnum)
# File lib/librbdiscrete.rb, line 231
def dist_pres(presnum)
    return factorial(presnum)/iterative_fact(presnum);
end
eagle_view(m, t)
# File bin/librbdiscrete.rb, line 340
def eagle_view(m, t)
    return (EVALUE**((t*t)/m));
end
eagle_view(m, t)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 340
def eagle_view(m, t)
    return (EVALUE**((t*t)/m));
end
eagle_view(m, t)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 340
def eagle_view(m, t)
    return (EVALUE**((t*t)/m));
end
eagle_view(m, t)
# File lib/librbdiscrete.rb, line 339
def eagle_view(m, t)
    return (EVALUE**((t*t)/m));
end
factorial( n )
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 22
def factorial( n )
    if n <= 1
        return 1
    else
        return n*factorial( n-1 ).to_i
    end
end
factorial( n )
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 22
def factorial( n )
    if n <= 1
        return 1
    else
        return n*factorial( n-1 ).to_i
    end
end
factorial( n )
# File lib/librbdiscrete.rb, line 23
def factorial( n )
    if (n <= 1)
        return 1
    else
        return n*factorial( n-1 ).to_i
    end
end
factorial( n )
# File bin/librbdiscrete.rb, line 22
def factorial( n )
    if n <= 1
        return 1
    else
        return n*factorial( n-1 ).to_i
    end
end
fermat_little(p, a)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 406
def fermat_little(p, a)
    if(p%(ui_pow(a, (p-1))-1) == 0)
        return 0
    elsif
        return 1
    end
end
fermat_little(p, a)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 406
def fermat_little(p, a)
    if(p%(ui_pow(a, (p-1))-1) == 0)
        return 0
    elsif
        return 1
    end
end
fermat_little(p, a)
# File bin/librbdiscrete.rb, line 406
def fermat_little(p, a)
    if(p%(ui_pow(a, (p-1))-1) == 0)
        return 0
    elsif
        return 1
    end
end
fermat_little(p, a)
# File lib/librbdiscrete.rb, line 405
def fermat_little(p, a)
  begin
    if(p%(ui_pow(a, (p-1))-1) == 0)
        return 0
    else
        return 1
    end
  end
rescue
  begin
    ArgumentError.new("High load. Terminated.")
  end
end
fib(n)
# File lib/librbdiscrete.rb, line 246
def fib(n)
    if (n <= 1) 
        return n;
    else
        return fib(n-1)+fib(n-2);
    end
end
fib(n)
# File bin/librbdiscrete.rb, line 247
def fib(n)
    if (n <= 1) 
        return n;
    elsif 
        return fib(n-1)+fib(n-2);
    end
end
fib(n)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 247
def fib(n)
    if (n <= 1) 
        return n;
    elsif 
        return fib(n-1)+fib(n-2);
    end
end
fib(n)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 247
def fib(n)
    if (n <= 1) 
        return n;
    elsif 
        return fib(n-1)+fib(n-2);
    end
end
help()
# File lib/help.rb, line 2
def help
puts "
Valid Commands
===============
help              Show this manpage
certain           Show certain conditions page
factorial         Recursive definition of factorial
                  'n' is the number which will calculated in procedure
binsearch         *binary => array
                  *size => binary array's size
                  *search_key => Compare string
                    *General values
                        *low => low value representation
                        *middle => middle value representation
                        *high => high value representation
birdseye          Bird's Eye View Procedure
combinatorial     'glb' represents is General mass of combinatorial approach
                  'klb' represents is Selection mass of combinatorial approach
distpres          'presnum' value represents Present count.
eagleview         Eagle View Procedure
fermatlittle      Fermat Little Theorem's Procedural Representation
fib               Additive recursive definition of Fibonacci
isprime           Is Prime Procedure
                  'nb' is the input argument number of procedure
iterativefact     Iterative factorial of procedural representation
sigma             Sigma procedure's simple procedure is rely on '(ax+b)^pw'
                  a represented by inta;
                  b represented by intb;
                  x represented by intx;
                  power represented by pw.
stirling          'strln' is the stirling number in stirling formula
subset            'zerosbst' variable, decision mechanism of zero subset is included or not included
                  'gen' is the general mass elements(objects) number
fibsum            Fibonacci Sum Procedure
twinprdx          Twin Paradox Lemma Solution Procedure
                  Selection mass represented by 'mass' value
uipow             Non-balanced power calculation procedure
"
end
inspect()
# File pkg/RubMat-2.1.5/lib/main.rb, line 38
def inspect
  # Read arguments and defines commands
  # Will handle command line whitespaces
  
  if (commnd == 'help')
    # Help of commands and usages
  end
  if (commnd == 'certain')
    # Certain conditions
  end
end
is_prime(nb)
# File lib/librbdiscrete.rb, line 375
def is_prime(nb)
    test = count = 0
    if (nb == 1)
        return -1
    end
    for i in 2..nb-1
        count++
        if (nb % i == 0)
            test = false
        end
    end
    if (!test)
        return 1
    else
        return 0
    end
end
is_prime(nb)
# File bin/librbdiscrete.rb, line 376
def is_prime(nb)
    test = count = 0
    if (nb != 1)
        return -1
    end
    for i in 2..nb-1
        count++
        if (nb % i == 0)
            test = 1
        end
    end
    if (!test)
        return 1
    elsif
        return 0
    end
end
is_prime(nb)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 376
def is_prime(nb)
    test = count = 0
    if (nb != 1)
        return -1
    end
    for i in 2..nb-1
        count++
        if (nb % i == 0)
            test = 1
        end
    end
    if (!test)
        return 1
    elsif
        return 0
    end
end
is_prime(nb)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 376
def is_prime(nb)
    test = count = 0
    if (nb != 1)
        return -1
    end
    for i in 2..nb-1
        count++
        if (nb % i == 0)
            test = 1
        end
    end
    if (!test)
        return 1
    elsif
        return 0
    end
end
iterative_fact(itrtnum)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 67
def iterative_fact(itrtnum)
    itrtnum.downto(1) do
        total *= factorial(itrtnum)
    end
    return total
end
iterative_fact(itrtnum)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 67
def iterative_fact(itrtnum)
    itrtnum.downto(1) do
        total *= factorial(itrtnum)
    end
    return total
end
iterative_fact(itrtnum)
# File lib/librbdiscrete.rb, line 68
def iterative_fact(itrtnum)
    itrtnum.downto(1) do
        total *= factorial(itrtnum)
    end
    return total
end
iterative_fact(itrtnum)
# File bin/librbdiscrete.rb, line 67
def iterative_fact(itrtnum)
    itrtnum.downto(1) do
        total *= factorial(itrtnum)
    end
    return total
end
print_row(binary, size, low, mid, high)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 270
def print_row(binary, size, low, mid, high)
    for i in 0..size-1
        if (i <low || i > high)
            print ("     ")
        end
        if(i == mid)
            puts binary[i]
        end
        if(nil)
            puts binary[i]
        end
    end
end
print_row(binary, size, low, mid, high)
# File lib/librbdiscrete.rb, line 269
def print_row(binary, size, low, mid, high)
    for i in 0..size-1
        if (i <low || i > high)
            print ("     ")
        end
        if(i == mid)
            puts binary[i]
        end
        if(nil)
            puts binary[i]
        end
    end
end
print_row(binary, size, low, mid, high)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 270
def print_row(binary, size, low, mid, high)
    for i in 0..size-1
        if (i <low || i > high)
            print ("     ")
        end
        if(i == mid)
            puts binary[i]
        end
        if(nil)
            puts binary[i]
        end
    end
end
print_row(binary, size, low, mid, high)
# File bin/librbdiscrete.rb, line 270
def print_row(binary, size, low, mid, high)
    for i in 0..size-1
        if (i <low || i > high)
            print ("     ")
        end
        if(i == mid)
            puts binary[i]
        end
        if(nil)
            puts binary[i]
        end
    end
end
sigma(inta, intx, intb, pw)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 169
def sigma(inta, intx, intb, pw)
    ttl = 0
    for i in 1..intx
        ttl += (inta*intx+intb)
    end
    if(pw == 1)
      return ttl
    end
    if(pw > 1)
        ttl=ui_pow(ttl, pw)
      return ttl
    end
    if(pw == 0)
      return 1
    end
end
sigma(inta, intx, intb, pw)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 169
def sigma(inta, intx, intb, pw)
    ttl = 0
    for i in 1..intx
        ttl += (inta*intx+intb)
    end
    if(pw == 1)
      return ttl
    end
    if(pw > 1)
        ttl=ui_pow(ttl, pw)
      return ttl
    end
    if(pw == 0)
      return 1
    end
end
sigma(inta, intx, intb, pw)
# File bin/librbdiscrete.rb, line 169
def sigma(inta, intx, intb, pw)
    ttl = 0
    for i in 1..intx
        ttl += (inta*intx+intb)
    end
    if(pw == 1)
      return ttl
    end
    if(pw > 1)
        ttl=ui_pow(ttl, pw)
      return ttl
    end
    if(pw == 0)
      return 1
    end
end
sigma(inta, intx, intb, pw)
# File lib/librbdiscrete.rb, line 168
def sigma(inta, intx, intb, pw)
    ttl = 0
    for i in 1..intx
        ttl += (inta*intx+intb)
    end
    if(pw == 1)
      return ttl
    end
    if(pw > 1)
        ttl=ui_pow(ttl, pw)
      return ttl
    end
    if(pw == 0)
      return 1
    end
end
stirling(strln)
# File bin/librbdiscrete.rb, line 197
def stirling(strln)
  return (strln/constants1.EVALUE**strln)*Math.sqrt(2*constants1.PIVALUE*strln);
end
stirling(strln)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 197
def stirling(strln)
  return (strln/constants1.EVALUE**strln)*Math.sqrt(2*constants1.PIVALUE*strln);
end
stirling(strln)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 197
def stirling(strln)
  return (strln/constants1.EVALUE**strln)*Math.sqrt(2*constants1.PIVALUE*strln);
end
stirling(strln)
# File lib/librbdiscrete.rb, line 196
def stirling(strln)
  return (strln/constants1.EVALUE**strln)*Math.sqrt(2*constants1.PIVALUE*strln);
end
stirling(strln)
# File test/testprocedure.rb, line 4
def stirling(strln)
  return (strln/EVALUE**strln)*Math.sqrt(2*PIVALUE*strln);
end
subset(gen, zerosbst)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 86
def subset(gen, zerosbst)
    main = case (zerosbst)
    when zerosbst == 'y'
            rslt = ui_pow(2, gen) - 1
            return rslt
    when zerosbst == 'n'
            rslt = ui_pow(2, gen)
            return rslt
    else
            puts "Enter 'y' or 'n' char"
    end
    return main
end
subset(gen, zerosbst)
# File lib/librbdiscrete.rb, line 87
def subset(gen, zerosbst)
    main = case (zerosbst)
    when zerosbst == true
            rslt = ui_pow(2, gen) - 1
            return rslt
    when zerosbst == false
            rslt = ui_pow(2, gen)
            return rslt
    end
    return main
end
subset(gen, zerosbst)
# File bin/librbdiscrete.rb, line 86
def subset(gen, zerosbst)
    main = case (zerosbst)
    when zerosbst == 'y'
            rslt = ui_pow(2, gen) - 1
            return rslt
    when zerosbst == 'n'
            rslt = ui_pow(2, gen)
            return rslt
    else
            puts "Enter 'y' or 'n' char"
    end
    return main
end
subset(gen, zerosbst)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 86
def subset(gen, zerosbst)
    main = case (zerosbst)
    when zerosbst == 'y'
            rslt = ui_pow(2, gen) - 1
            return rslt
    when zerosbst == 'n'
            rslt = ui_pow(2, gen)
            return rslt
    else
            puts "Enter 'y' or 'n' char"
    end
    return main
end
sum_of_fib(n)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 356
def sum_of_fib(n)
   return fib(n+2)-1;
end
sum_of_fib(n)
# File bin/librbdiscrete.rb, line 356
def sum_of_fib(n)
   return fib(n+2)-1;
end
sum_of_fib(n)
# File lib/librbdiscrete.rb, line 355
def sum_of_fib(n)
   return fib(n+2)-1;
end
sum_of_fib(n)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 356
def sum_of_fib(n)
   return fib(n+2)-1;
end
to_bool()
# File lib/librbdiscrete.rb, line 428
def to_bool
  if (self.to_bool == 1)
    puts "TRUE"
  elsif (self.to_bool == 0)
    puts "FALSE"
  elsif (self.to_bool == -1)
    puts "NaN"
  end
end
twin_prdx(mass)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 212
def twin_prdx(mass)
    top=1
    for i in 366..366-mass
        top *= i
    end
    return top/ui_pow(366, mass)
end
twin_prdx(mass)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 212
def twin_prdx(mass)
    top=1
    for i in 366..366-mass
        top *= i
    end
    return top/ui_pow(366, mass)
end
twin_prdx(mass)
# File bin/librbdiscrete.rb, line 212
def twin_prdx(mass)
    top=1
    for i in 366..366-mass
        top *= i
    end
    return top/ui_pow(366, mass)
end
twin_prdx(mass)
# File lib/librbdiscrete.rb, line 211
def twin_prdx(mass)
    top=1
    for i in 366..366-mass
        top *= i
    end
    return top/ui_pow(366, mass)
end
ui_pow(base, exp)
# File pkg/RubMat-2.1.5/bin/librbdiscrete.rb, line 42
def ui_pow(base, exp)
    result = 1;
    while (exp)
        if (exp & 1)
            result *= base
        end
        exp >>= 1;
        base *= base
    end
    if(exp==0)
        result=base
    end
    return result
end
ui_pow(base, exp)
# File lib/librbdiscrete.rb, line 43
def ui_pow(base, exp)
    result = 1;
    while (exp)
        if (exp & 1)
            result *= base
        end
        exp >>= 1;
        base *= base
    end
    if(exp==0)
        result=base
    end
    return result
end
ui_pow(base, exp)
# File bin/librbdiscrete.rb, line 42
def ui_pow(base, exp)
    result = 1;
    while (exp)
        if (exp & 1)
            result *= base
        end
        exp >>= 1;
        base *= base
    end
    if(exp==0)
        result=base
    end
    return result
end
ui_pow(base, exp)
# File pkg/RubMat-2.1.5/lib/librbdiscrete.rb, line 42
def ui_pow(base, exp)
    result = 1;
    while (exp)
        if (exp & 1)
            result *= base
        end
        exp >>= 1;
        base *= base
    end
    if(exp==0)
        result=base
    end
    return result
end