Class: Algebra::MatrixAlgebraQuint
Instance Attribute Summary collapse
#body, #ground, #left, #right
Instance Method Summary
collapse
-
#divide_c!(j, c) ⇒ Object
-
#divide_r!(i, c) ⇒ Object
-
#dup ⇒ Object
-
#initialize(matrix, left = nil, right = nil, lefti = nil, righti = nil) ⇒ MatrixAlgebraQuint
constructor
A new instance of MatrixAlgebraQuint.
-
#mix_c!(i, j, c = nil) ⇒ Object
-
#mix_r!(i, j, c = nil) ⇒ Object
-
#multiply_c!(j, c) ⇒ Object
-
#multiply_r!(i, c) ⇒ Object
-
#replace(other) ⇒ Object
-
#sswap_r!(i, j) ⇒ Object
-
#swap_c!(i, j) ⇒ Object
-
#swap_r!(i, j) ⇒ Object
-
#to_ary ⇒ Object
(also: #to_a)
-
#transpose ⇒ Object
#[], #csize, #display, #each_i, #each_j, #left_eliminate!, #row!, #rsize
#_coeff, #e_diagonalize, #e_diagonalize!, #e_inverse, #el_sweep!, #el_sweep_old!, #elementary_divisor, factorize, #horizontal_sweep!, #sq_find_nondiv, #vertical_sweep!
#divide_c, #divide_r, #kernel_basis, #left_eliminate!, #left_eliminate_euclidian!, #left_inverse, #left_sweep, #mix_c, #mix_r, #multiply_c, #multiply_r, #step_matrix?, #swap_c, #swap_r
Constructor Details
#initialize(matrix, left = nil, right = nil, lefti = nil, righti = nil) ⇒ MatrixAlgebraQuint
Returns a new instance of MatrixAlgebraQuint.
200
201
202
203
204
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 200
def initialize(matrix, left = nil, right = nil, lefti = nil, righti = nil)
super(matrix, left, right)
@lefti = lefti ? lefti : @left_type.unity
@righti = righti ? righti : @right_type.unity
end
|
Instance Attribute Details
Returns the value of attribute lefti.
199
200
201
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 199
def lefti
@lefti
end
|
Returns the value of attribute righti.
199
200
201
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 199
def righti
@righti
end
|
Instance Method Details
#divide_c!(j, c) ⇒ Object
257
258
259
260
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 257
def divide_c!(j, c)
@righti.multiply_r!(j, c)
super
end
|
#divide_r!(i, c) ⇒ Object
252
253
254
255
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 252
def divide_r!(i, c)
@lefti.multiply_c!(i, c)
super
end
|
212
213
214
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 212
def dup
self.class.new(body.dup, left.dup, right.dup, lefti.dup, righti.dup)
end
|
#mix_c!(i, j, c = nil) ⇒ Object
267
268
269
270
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 267
def mix_c!(i, j, c = nil)
@righti.mix_r!(j, i, c ? -c : -1)
super
end
|
#mix_r!(i, j, c = nil) ⇒ Object
262
263
264
265
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 262
def mix_r!(i, j, c = nil)
@lefti.mix_c!(j, i, c ? -c : -1)
super
end
|
#multiply_c!(j, c) ⇒ Object
247
248
249
250
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 247
def multiply_c!(j, c)
@righti.divide_r!(j, c)
super
end
|
#multiply_r!(i, c) ⇒ Object
242
243
244
245
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 242
def multiply_r!(i, c)
@lefti.divide_c!(i, c)
super
end
|
#replace(other) ⇒ Object
221
222
223
224
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 221
def replace(other)
initialize(other.body, other.left, other.right, other.lefti, other.righti)
self
end
|
#sswap_r!(i, j) ⇒ Object
227
228
229
230
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 227
def sswap_r!(i, j)
@lefti.swap_c!(i, j)
super
end
|
#swap_c!(i, j) ⇒ Object
237
238
239
240
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 237
def swap_c!(i, j)
@righti.swap_r!(i, j)
super
end
|
#swap_r!(i, j) ⇒ Object
232
233
234
235
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 232
def swap_r!(i, j)
@lefti.swap_c!(i, j)
super
end
|
#to_ary ⇒ Object
Also known as:
to_a
206
207
208
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 206
def to_ary
[body, left, right, lefti, righti]
end
|
#transpose ⇒ Object
216
217
218
219
|
# File 'lib/algebra/matrix-algebra-triplet.rb', line 216
def transpose
self.class.new(body.transpose, right.transpose, left.transpose,
righti.transpose, lefti.transpose)
end
|