mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
add gps
This commit is contained in:
parent
f9dffa3b97
commit
c84be29413
47 changed files with 8227 additions and 0 deletions
46
luci-app-gpoint-main/test/matrix_test.lua
Normal file
46
luci-app-gpoint-main/test/matrix_test.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
local matrix = require("matrix_lib")
|
||||
|
||||
|
||||
function test_copy()
|
||||
local foo = matrix.create(3, 3)
|
||||
local bar = matrix.create(3, 3)
|
||||
foo[1][1] = 1337.0
|
||||
bar = matrix.copy(foo, bar)
|
||||
|
||||
assert(bar[1][1] == 1337.0)
|
||||
end
|
||||
|
||||
function test_inverse()
|
||||
local foo = matrix.create(4, 4)
|
||||
foo = matrix.set(foo, 1.0, 2.0, 3.0, 4.0,
|
||||
4.0, 1.0, 7.0, 9.0,
|
||||
0.0, 0.0, -4.0, -4.0,
|
||||
2.3, 3.4, 3.1, 0.0)
|
||||
|
||||
local foo_copy = matrix.copy(foo)
|
||||
local bar = matrix.create(4, 4)
|
||||
local identity = matrix.create(4, 4)
|
||||
|
||||
identity = matrix.set_identity(identity)
|
||||
|
||||
matrix.print(foo)
|
||||
print("--------------")
|
||||
matrix.print(bar)
|
||||
print("--------------")
|
||||
assert(matrix.destructive_invert(foo, bar))
|
||||
matrix.print(foo)
|
||||
print("--------------")
|
||||
matrix.print(bar)
|
||||
print("--------------")
|
||||
|
||||
assert(matrix.equal(foo, identity, 0.0001))
|
||||
foo = matrix.multiply(foo_copy, bar, foo)
|
||||
assert(matrix.equal(foo, identity, 0.0001))
|
||||
foo = matrix.multiply(bar, foo_copy, foo)
|
||||
assert(matrix.equal(foo, identity, 0.0001))
|
||||
end
|
||||
|
||||
test_copy()
|
||||
test_inverse()
|
||||
print("OK")
|
||||
Loading…
Add table
Add a link
Reference in a new issue