Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Cramers-rule/Sidef/cramers-rule.sidef
Normal file
26
Task/Cramers-rule/Sidef/cramers-rule.sidef
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
func cramers_rule(A, terms) {
|
||||
gather {
|
||||
for i in ^A {
|
||||
var Ai = A.map{.map{_}}
|
||||
for j in ^terms {
|
||||
Ai[j][i] = terms[j]
|
||||
}
|
||||
take(Ai.det)
|
||||
}
|
||||
} »/» A.det
|
||||
}
|
||||
|
||||
var matrix = [
|
||||
[2, -1, 5, 1],
|
||||
[3, 2, 2, -6],
|
||||
[1, 3, 3, -1],
|
||||
[5, -2, -3, 3],
|
||||
]
|
||||
|
||||
var free_terms = [-3, -32, -47, 49]
|
||||
var (w, x, y, z) = cramers_rule(matrix, free_terms)...
|
||||
|
||||
say "w = #{w}"
|
||||
say "x = #{x}"
|
||||
say "y = #{y}"
|
||||
say "z = #{z}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue