Skip to content

Commit a50654f

Browse files
committed
Lint
1 parent 347e433 commit a50654f

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

Sources/FirebladeMath/Functions/determinant.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ public func determinant(_ mat: Mat4x4f) -> Float {
1313
#if FRB_MATH_USE_SIMD
1414
return simd.simd_determinant(mat.storage)
1515
#else
16-
return mat[0, 0]*mat[1, 1]*mat[2, 2]*mat[3, 3] - mat[1, 0]*mat[0, 1]*mat[2, 2]*mat[3, 3] + mat[0, 2]*mat[0, 1]*mat[1, 2]*mat[3, 3]
17-
- mat[0, 0]*mat[2, 1]*mat[1, 2]*mat[3, 3] + mat[1, 0]*mat[2, 1]*mat[0, 2]*mat[3, 3] - mat[0, 2]*mat[1, 1]*mat[0, 2]*mat[3, 3]
18-
+ mat[0, 2]*mat[1, 1]*mat[3, 2]*mat[0, 3] - mat[1, 0]*mat[2, 1]*mat[3, 2]*mat[0, 3] + mat[3, 0]*mat[2, 1]*mat[1, 2]*mat[0, 3]
19-
- mat[0, 2]*mat[3, 1]*mat[1, 2]*mat[0, 3] + mat[1, 0]*mat[3, 1]*mat[2, 2]*mat[0, 3] - mat[3, 0]*mat[1, 1]*mat[2, 2]*mat[0, 3]
20-
+ mat[3, 0]*mat[0, 1]*mat[2, 2]*mat[1, 3] - mat[0, 0]*mat[3, 1]*mat[2, 2]*mat[1, 3] + mat[0, 2]*mat[3, 1]*mat[0, 2]*mat[1, 3]
21-
- mat[3, 0]*mat[2, 1]*mat[0, 2]*mat[1, 3] + mat[0, 0]*mat[2, 1]*mat[3, 2]*mat[1, 3] - mat[0, 2]*mat[0, 1]*mat[3, 2]*mat[1, 3]
22-
+ mat[1, 0]*mat[0, 1]*mat[3, 2]*mat[2, 3] - mat[0, 0]*mat[1, 1]*mat[3, 2]*mat[2, 3] + mat[3, 0]*mat[1, 1]*mat[0, 2]*mat[2, 3]
23-
- mat[1, 0]*mat[3, 1]*mat[0, 2]*mat[2, 3] + mat[0, 0]*mat[3, 1]*mat[1, 2]*mat[2, 3] - mat[3, 0]*mat[0, 1]*mat[1, 2]*mat[2, 3]
16+
return mat[0, 0] * mat[1, 1] * mat[2, 2] * mat[3, 3] - mat[1, 0] * mat[0, 1] * mat[2, 2] * mat[3, 3] + mat[0, 2] * mat[0, 1] * mat[1, 2] * mat[3, 3]
17+
- mat[0, 0] * mat[2, 1] * mat[1, 2] * mat[3, 3] + mat[1, 0] * mat[2, 1] * mat[0, 2] * mat[3, 3] - mat[0, 2] * mat[1, 1] * mat[0, 2] * mat[3, 3]
18+
+ mat[0, 2] * mat[1, 1] * mat[3, 2] * mat[0, 3] - mat[1, 0] * mat[2, 1] * mat[3, 2] * mat[0, 3] + mat[3, 0] * mat[2, 1] * mat[1, 2] * mat[0, 3]
19+
- mat[0, 2] * mat[3, 1] * mat[1, 2] * mat[0, 3] + mat[1, 0] * mat[3, 1] * mat[2, 2] * mat[0, 3] - mat[3, 0] * mat[1, 1] * mat[2, 2] * mat[0, 3]
20+
+ mat[3, 0] * mat[0, 1] * mat[2, 2] * mat[1, 3] - mat[0, 0] * mat[3, 1] * mat[2, 2] * mat[1, 3] + mat[0, 2] * mat[3, 1] * mat[0, 2] * mat[1, 3]
21+
- mat[3, 0] * mat[2, 1] * mat[0, 2] * mat[1, 3] + mat[0, 0] * mat[2, 1] * mat[3, 2] * mat[1, 3] - mat[0, 2] * mat[0, 1] * mat[3, 2] * mat[1, 3]
22+
+ mat[1, 0] * mat[0, 1] * mat[3, 2] * mat[2, 3] - mat[0, 0] * mat[1, 1] * mat[3, 2] * mat[2, 3] + mat[3, 0] * mat[1, 1] * mat[0, 2] * mat[2, 3]
23+
- mat[1, 0] * mat[3, 1] * mat[0, 2] * mat[2, 3] + mat[0, 0] * mat[3, 1] * mat[1, 2] * mat[2, 3] - mat[3, 0] * mat[0, 1] * mat[1, 2] * mat[2, 3]
2424
#endif
2525
}
2626

@@ -37,14 +37,14 @@ public func determinant(_ mat: Mat4x4d) -> Double {
3737
#if FRB_MATH_USE_SIMD
3838
return simd.simd_determinant(mat.storage)
3939
#else
40-
return mat[0, 0]*mat[1, 1]*mat[2, 2]*mat[3, 3] - mat[1, 0]*mat[0, 1]*mat[2, 2]*mat[3, 3] + mat[0, 2]*mat[0, 1]*mat[1, 2]*mat[3, 3]
41-
- mat[0, 0]*mat[2, 1]*mat[1, 2]*mat[3, 3] + mat[1, 0]*mat[2, 1]*mat[0, 2]*mat[3, 3] - mat[0, 2]*mat[1, 1]*mat[0, 2]*mat[3, 3]
42-
+ mat[0, 2]*mat[1, 1]*mat[3, 2]*mat[0, 3] - mat[1, 0]*mat[2, 1]*mat[3, 2]*mat[0, 3] + mat[3, 0]*mat[2, 1]*mat[1, 2]*mat[0, 3]
43-
- mat[0, 2]*mat[3, 1]*mat[1, 2]*mat[0, 3] + mat[1, 0]*mat[3, 1]*mat[2, 2]*mat[0, 3] - mat[3, 0]*mat[1, 1]*mat[2, 2]*mat[0, 3]
44-
+ mat[3, 0]*mat[0, 1]*mat[2, 2]*mat[1, 3] - mat[0, 0]*mat[3, 1]*mat[2, 2]*mat[1, 3] + mat[0, 2]*mat[3, 1]*mat[0, 2]*mat[1, 3]
45-
- mat[3, 0]*mat[2, 1]*mat[0, 2]*mat[1, 3] + mat[0, 0]*mat[2, 1]*mat[3, 2]*mat[1, 3] - mat[0, 2]*mat[0, 1]*mat[3, 2]*mat[1, 3]
46-
+ mat[1, 0]*mat[0, 1]*mat[3, 2]*mat[2, 3] - mat[0, 0]*mat[1, 1]*mat[3, 2]*mat[2, 3] + mat[3, 0]*mat[1, 1]*mat[0, 2]*mat[2, 3]
47-
- mat[1, 0]*mat[3, 1]*mat[0, 2]*mat[2, 3] + mat[0, 0]*mat[3, 1]*mat[1, 2]*mat[2, 3] - mat[3, 0]*mat[0, 1]*mat[1, 2]*mat[2, 3]
40+
return mat[0, 0] * mat[1, 1] * mat[2, 2] * mat[3, 3] - mat[1, 0] * mat[0, 1] * mat[2, 2] * mat[3, 3] + mat[0, 2] * mat[0, 1] * mat[1, 2] * mat[3, 3]
41+
- mat[0, 0] * mat[2, 1] * mat[1, 2] * mat[3, 3] + mat[1, 0] * mat[2, 1] * mat[0, 2] * mat[3, 3] - mat[0, 2] * mat[1, 1] * mat[0, 2] * mat[3, 3]
42+
+ mat[0, 2] * mat[1, 1] * mat[3, 2] * mat[0, 3] - mat[1, 0] * mat[2, 1] * mat[3, 2] * mat[0, 3] + mat[3, 0] * mat[2, 1] * mat[1, 2] * mat[0, 3]
43+
- mat[0, 2] * mat[3, 1] * mat[1, 2] * mat[0, 3] + mat[1, 0] * mat[3, 1] * mat[2, 2] * mat[0, 3] - mat[3, 0] * mat[1, 1] * mat[2, 2] * mat[0, 3]
44+
+ mat[3, 0] * mat[0, 1] * mat[2, 2] * mat[1, 3] - mat[0, 0] * mat[3, 1] * mat[2, 2] * mat[1, 3] + mat[0, 2] * mat[3, 1] * mat[0, 2] * mat[1, 3]
45+
- mat[3, 0] * mat[2, 1] * mat[0, 2] * mat[1, 3] + mat[0, 0] * mat[2, 1] * mat[3, 2] * mat[1, 3] - mat[0, 2] * mat[0, 1] * mat[3, 2] * mat[1, 3]
46+
+ mat[1, 0] * mat[0, 1] * mat[3, 2] * mat[2, 3] - mat[0, 0] * mat[1, 1] * mat[3, 2] * mat[2, 3] + mat[3, 0] * mat[1, 1] * mat[0, 2] * mat[2, 3]
47+
- mat[1, 0] * mat[3, 1] * mat[0, 2] * mat[2, 3] + mat[0, 0] * mat[3, 1] * mat[1, 2] * mat[2, 3] - mat[3, 0] * mat[0, 1] * mat[1, 2] * mat[2, 3]
4848
#endif
4949
}
5050

Sources/FirebladeMath/Matrix/Matrix+Multiplication.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ public func multiply(_ lhs: Mat4x4d, _ rhs: Mat4x4d) -> Mat4x4d {
1717
#else
1818
return Mat4x4d(
1919
Vec4d(
20-
lhs[0] * rhs[0] + lhs[4] * rhs[1] + lhs[8] * rhs[2] + lhs[12] * rhs[3],
21-
lhs[1] * rhs[0] + lhs[5] * rhs[1] + lhs[9] * rhs[2] + lhs[13] * rhs[3],
22-
lhs[2] * rhs[0] + lhs[6] * rhs[1] + lhs[10] * rhs[2] + lhs[14] * rhs[3],
23-
lhs[3] * rhs[0] + lhs[7] * rhs[1] + lhs[11] * rhs[2] + lhs[15] * rhs[3]
20+
lhs[0] * rhs[0] + lhs[4] * rhs[1] + lhs[8] * rhs[2] + lhs[12] * rhs[3],
21+
lhs[1] * rhs[0] + lhs[5] * rhs[1] + lhs[9] * rhs[2] + lhs[13] * rhs[3],
22+
lhs[2] * rhs[0] + lhs[6] * rhs[1] + lhs[10] * rhs[2] + lhs[14] * rhs[3],
23+
lhs[3] * rhs[0] + lhs[7] * rhs[1] + lhs[11] * rhs[2] + lhs[15] * rhs[3]
2424
),
2525
Vec4d(
26-
lhs[0] * rhs[4] + lhs[4] * rhs[5] + lhs[8] * rhs[6] + lhs[12] * rhs[7],
27-
lhs[1] * rhs[4] + lhs[5] * rhs[5] + lhs[9] * rhs[6] + lhs[13] * rhs[7],
28-
lhs[2] * rhs[4] + lhs[6] * rhs[5] + lhs[10] * rhs[6] + lhs[14] * rhs[7],
29-
lhs[3] * rhs[4] + lhs[7] * rhs[5] + lhs[11] * rhs[6] + lhs[15] * rhs[7]
26+
lhs[0] * rhs[4] + lhs[4] * rhs[5] + lhs[8] * rhs[6] + lhs[12] * rhs[7],
27+
lhs[1] * rhs[4] + lhs[5] * rhs[5] + lhs[9] * rhs[6] + lhs[13] * rhs[7],
28+
lhs[2] * rhs[4] + lhs[6] * rhs[5] + lhs[10] * rhs[6] + lhs[14] * rhs[7],
29+
lhs[3] * rhs[4] + lhs[7] * rhs[5] + lhs[11] * rhs[6] + lhs[15] * rhs[7]
3030
),
3131
Vec4d(
32-
lhs[0] * rhs[8] + lhs[4] * rhs[9] + lhs[8] * rhs[10] + lhs[12] * rhs[11],
33-
lhs[1] * rhs[8] + lhs[5] * rhs[9] + lhs[9] * rhs[10] + lhs[13] * rhs[11],
34-
lhs[2] * rhs[8] + lhs[6] * rhs[9] + lhs[10] * rhs[10] + lhs[14] * rhs[11],
35-
lhs[3] * rhs[8] + lhs[7] * rhs[9] + lhs[11] * rhs[10] + lhs[15] * rhs[11]
32+
lhs[0] * rhs[8] + lhs[4] * rhs[9] + lhs[8] * rhs[10] + lhs[12] * rhs[11],
33+
lhs[1] * rhs[8] + lhs[5] * rhs[9] + lhs[9] * rhs[10] + lhs[13] * rhs[11],
34+
lhs[2] * rhs[8] + lhs[6] * rhs[9] + lhs[10] * rhs[10] + lhs[14] * rhs[11],
35+
lhs[3] * rhs[8] + lhs[7] * rhs[9] + lhs[11] * rhs[10] + lhs[15] * rhs[11]
3636
),
3737
Vec4d(
38-
lhs[0] * rhs[12] + lhs[4] * rhs[13] + lhs[8] * rhs[14] + lhs[12] * rhs[15],
39-
lhs[1] * rhs[12] + lhs[5] * rhs[13] + lhs[9] * rhs[14] + lhs[13] * rhs[15],
38+
lhs[0] * rhs[12] + lhs[4] * rhs[13] + lhs[8] * rhs[14] + lhs[12] * rhs[15],
39+
lhs[1] * rhs[12] + lhs[5] * rhs[13] + lhs[9] * rhs[14] + lhs[13] * rhs[15],
4040
lhs[2] * rhs[12] + lhs[6] * rhs[13] + lhs[10] * rhs[14] + lhs[14] * rhs[15],
4141
lhs[3] * rhs[12] + lhs[7] * rhs[13] + lhs[11] * rhs[14] + lhs[15] * rhs[15]
4242
)
@@ -87,26 +87,26 @@ public func multiply(_ lhs: Mat4x4f, _ rhs: Mat4x4f) -> Mat4x4f {
8787
#else
8888
return Mat4x4f(
8989
Vec4f(
90-
lhs[0] * rhs[0] + lhs[4] * rhs[1] + lhs[8] * rhs[2] + lhs[12] * rhs[3],
91-
lhs[1] * rhs[0] + lhs[5] * rhs[1] + lhs[9] * rhs[2] + lhs[13] * rhs[3],
92-
lhs[2] * rhs[0] + lhs[6] * rhs[1] + lhs[10] * rhs[2] + lhs[14] * rhs[3],
93-
lhs[3] * rhs[0] + lhs[7] * rhs[1] + lhs[11] * rhs[2] + lhs[15] * rhs[3]
90+
lhs[0] * rhs[0] + lhs[4] * rhs[1] + lhs[8] * rhs[2] + lhs[12] * rhs[3],
91+
lhs[1] * rhs[0] + lhs[5] * rhs[1] + lhs[9] * rhs[2] + lhs[13] * rhs[3],
92+
lhs[2] * rhs[0] + lhs[6] * rhs[1] + lhs[10] * rhs[2] + lhs[14] * rhs[3],
93+
lhs[3] * rhs[0] + lhs[7] * rhs[1] + lhs[11] * rhs[2] + lhs[15] * rhs[3]
9494
),
9595
Vec4f(
96-
lhs[0] * rhs[4] + lhs[4] * rhs[5] + lhs[8] * rhs[6] + lhs[12] * rhs[7],
97-
lhs[1] * rhs[4] + lhs[5] * rhs[5] + lhs[9] * rhs[6] + lhs[13] * rhs[7],
98-
lhs[2] * rhs[4] + lhs[6] * rhs[5] + lhs[10] * rhs[6] + lhs[14] * rhs[7],
99-
lhs[3] * rhs[4] + lhs[7] * rhs[5] + lhs[11] * rhs[6] + lhs[15] * rhs[7]
96+
lhs[0] * rhs[4] + lhs[4] * rhs[5] + lhs[8] * rhs[6] + lhs[12] * rhs[7],
97+
lhs[1] * rhs[4] + lhs[5] * rhs[5] + lhs[9] * rhs[6] + lhs[13] * rhs[7],
98+
lhs[2] * rhs[4] + lhs[6] * rhs[5] + lhs[10] * rhs[6] + lhs[14] * rhs[7],
99+
lhs[3] * rhs[4] + lhs[7] * rhs[5] + lhs[11] * rhs[6] + lhs[15] * rhs[7]
100100
),
101101
Vec4f(
102-
lhs[0] * rhs[8] + lhs[4] * rhs[9] + lhs[8] * rhs[10] + lhs[12] * rhs[11],
103-
lhs[1] * rhs[8] + lhs[5] * rhs[9] + lhs[9] * rhs[10] + lhs[13] * rhs[11],
104-
lhs[2] * rhs[8] + lhs[6] * rhs[9] + lhs[10] * rhs[10] + lhs[14] * rhs[11],
105-
lhs[3] * rhs[8] + lhs[7] * rhs[9] + lhs[11] * rhs[10] + lhs[15] * rhs[11]
102+
lhs[0] * rhs[8] + lhs[4] * rhs[9] + lhs[8] * rhs[10] + lhs[12] * rhs[11],
103+
lhs[1] * rhs[8] + lhs[5] * rhs[9] + lhs[9] * rhs[10] + lhs[13] * rhs[11],
104+
lhs[2] * rhs[8] + lhs[6] * rhs[9] + lhs[10] * rhs[10] + lhs[14] * rhs[11],
105+
lhs[3] * rhs[8] + lhs[7] * rhs[9] + lhs[11] * rhs[10] + lhs[15] * rhs[11]
106106
),
107107
Vec4f(
108-
lhs[0] * rhs[12] + lhs[4] * rhs[13] + lhs[8] * rhs[14] + lhs[12] * rhs[15],
109-
lhs[1] * rhs[12] + lhs[5] * rhs[13] + lhs[9] * rhs[14] + lhs[13] * rhs[15],
108+
lhs[0] * rhs[12] + lhs[4] * rhs[13] + lhs[8] * rhs[14] + lhs[12] * rhs[15],
109+
lhs[1] * rhs[12] + lhs[5] * rhs[13] + lhs[9] * rhs[14] + lhs[13] * rhs[15],
110110
lhs[2] * rhs[12] + lhs[6] * rhs[13] + lhs[10] * rhs[14] + lhs[14] * rhs[15],
111111
lhs[3] * rhs[12] + lhs[7] * rhs[13] + lhs[11] * rhs[14] + lhs[15] * rhs[15]
112112
)

Tests/FirebladeMathTests/XCTestManifests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension FunctionTests {
5454
("test_sqrt", test_sqrt),
5555
("test_step", test_step),
5656
("test_tan", test_tan),
57-
("test_tanh", test_tanh)
57+
("test_tanh", test_tanh),
5858
]
5959
}
6060

@@ -88,7 +88,7 @@ extension Mat4x4fTests {
8888
("testTranslateMatrixByVector", testTranslateMatrixByVector),
8989
("testTranslation", testTranslation),
9090
("testTranslationInit", testTranslationInit),
91-
("testUpperLeft", testUpperLeft)
91+
("testUpperLeft", testUpperLeft),
9292
]
9393
}
9494

@@ -120,15 +120,15 @@ extension Quat4fTests {
120120
("testRotMat3x3", testRotMat3x3),
121121
("testRotMat4x4", testRotMat4x4),
122122
("testSubtract", testSubtract),
123-
("testVectorInit", testVectorInit)
123+
("testVectorInit", testVectorInit),
124124
]
125125
}
126126

127127
public func __allTests() -> [XCTestCaseEntry] {
128128
return [
129129
testCase(FunctionTests.__allTests__FunctionTests),
130130
testCase(Mat4x4fTests.__allTests__Mat4x4fTests),
131-
testCase(Quat4fTests.__allTests__Quat4fTests)
131+
testCase(Quat4fTests.__allTests__Quat4fTests),
132132
]
133133
}
134134
#endif

0 commit comments

Comments
 (0)