// ----------------------------------------------------------------------------- // file="Exception" // Project: StgSharp // Copyright (c) Nitload. // SPDX-License-Identifier: MIT // ----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; using System.Threading.Tasks; namespace StgSharp.Mathematics.Numeric { public class MatrixDimensionMismatchException : Exception where T : unmanaged, INumber { public MatrixDimensionMismatchException( Matrix right, Matrix ans ) : base($""" Matrix dimensions must agree but current: right({right?.ColumnLength ?? 0}×{right?.RowLength ?? 0}), ans({ans?.ColumnLength ?? 0}×{ans?.RowLength ?? 0}) """ ) { } public MatrixDimensionMismatchException( Matrix left, Matrix right, Matrix ans ) : base($""" Matrix dimensions must agree but current: left({left?.ColumnLength ?? 0}×{left?.RowLength ?? 0}), right({right?.ColumnLength ?? 0}×{right?.RowLength ?? 0}), ans({ans?.ColumnLength ?? 0}×{ans?.RowLength ?? 0}) """ ) { } } }