class Algebra::Covector
Constants
- Matrices
Public Class Methods
[](*a)
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 687 def self.[](*a) covector(true){|i| a[i]} end
covector(conv = false, &b)
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 691 def self.covector(conv = false, &b) new((0...size).collect(&b), true) end
create(ground, n)
click to toggle source
Calls superclass method
Algebra::MatrixAlgebra::create
# File lib/algebra/matrix-algebra.rb, line 677 def self.create(ground, n) klass = super(ground, 1, n) klass.sysvar(:size, n) klass end
matrix(r = 1, s = size) { |0, j| ... }
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 695 def self.matrix(r = 1, s = size) covector{|j| yield(0, j)} end
new(array, conv = false)
click to toggle source
Calls superclass method
Algebra::MatrixAlgebra::new
# File lib/algebra/matrix-algebra.rb, line 651 def initialize(array, conv = false) @bone0 = array super([array], conv) end
Public Instance Methods
[](*x)
click to toggle source
def to_a
row(0)
end
Calls superclass method
Algebra::MatrixAlgebra::[]
# File lib/algebra/matrix-algebra.rb, line 668 def [](*x) case x.size when 1; super(0, x[0]) when 2; super(*x) else raise "size of index be 1 or 2" end end
each() { |x| ... }
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 656 def each @bone0.each do |x| yield x end end
inspect()
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 699 def inspect @bone0.inspect end
size()
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 662 def size; self.class.size; end
to_s()
click to toggle source
Calls superclass method
Algebra::MatrixAlgebra#to_s
# File lib/algebra/matrix-algebra.rb, line 703 def to_s super end
transpose()
click to toggle source
# File lib/algebra/matrix-algebra.rb, line 683 def transpose Algebra::Vector.create(ground, size).new(to_a) end