Added missing `// MARK: - …` to implementation files
This commit is contained in:
parent
59a14fdbd2
commit
741fa9a4cf
|
@ -588,6 +588,8 @@ public func dist<L: UnsafeMemoryAccessible, R: UnsafeMemoryAccessible>(_ lhs: L,
|
|||
return sqrt(distSq(lhs, rhs))
|
||||
}
|
||||
|
||||
// MARK: - Distance Squared
|
||||
|
||||
public func distSq<L: UnsafeMemoryAccessible, R: UnsafeMemoryAccessible>(_ lhs: L, _ rhs: R) -> Float where L.Element == Float, R.Element == Float {
|
||||
precondition(lhs.count == rhs.count, "Vectors must have equal count")
|
||||
let sub = lhs .- rhs
|
||||
|
|
|
@ -30,6 +30,8 @@ public struct Matrix<Scalar> where Scalar: FloatingPoint, Scalar: ExpressibleByF
|
|||
public let columns: Int
|
||||
var grid: [Scalar]
|
||||
|
||||
// MARK: - Initialization
|
||||
|
||||
public init(rows: Int, columns: Int, repeatedValue: Scalar) {
|
||||
self.rows = rows
|
||||
self.columns = columns
|
||||
|
@ -90,6 +92,8 @@ public struct Matrix<Scalar> where Scalar: FloatingPoint, Scalar: ExpressibleByF
|
|||
return matrix
|
||||
}
|
||||
|
||||
// MARK: - Subscript
|
||||
|
||||
public subscript(row: Int, column: Int) -> Scalar {
|
||||
get {
|
||||
assert(indexIsValidForRow(row, column: column))
|
||||
|
|
|
@ -29,7 +29,7 @@ public struct Vector<Scalar> where Scalar: FloatingPoint, Scalar: ExpressibleByF
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: - Initialize
|
||||
// MARK: - Initialization
|
||||
|
||||
public init(dimensions: Int, repeatedValue: Scalar) {
|
||||
let scalars = Array(repeating: repeatedValue, count: dimensions)
|
||||
|
|
Loading…
Reference in New Issue