Added `var isSquare: Bool` to `Matrix<Scalar>`

This commit is contained in:
Vincent Esche 2019-10-16 14:04:15 +02:00
parent 538cf0c7fa
commit bbbfbd722e
1 changed files with 5 additions and 0 deletions

View File

@ -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) {