Added `var isSquare: Bool` to `Matrix<Scalar>`
This commit is contained in:
parent
538cf0c7fa
commit
bbbfbd722e
|
@ -28,8 +28,13 @@ public enum MatrixAxies {
|
|||
public struct Matrix<Scalar> where Scalar: FloatingPoint, Scalar: ExpressibleByFloatLiteral {
|
||||
public let rows: Int
|
||||
public let columns: Int
|
||||
|
||||
var grid: [Scalar]
|
||||
|
||||
public var isSquare: Bool {
|
||||
return self.rows == self.columns
|
||||
}
|
||||
|
||||
// MARK: - Initialization
|
||||
|
||||
public init(rows: Int, columns: Int, repeatedValue: Scalar) {
|
||||
|
|
Loading…
Reference in New Issue