예제 #1
0
 /// <summary>
 /// Sanity check for operations requiring matrices with the same number of Slices, Rows and Columns.
 /// </summary>
 /// <exception cref="ArgumentException">if <i>Slices() != B.Slices() || Rows() != B.Rows() || Columns() != B.Columns() || Slices() != C.Slices() || Rows() != C.Rows() || Columns() != C.Columns()</i>.</exception>
 public virtual void CheckShape(AbstractMatrix3D B, AbstractMatrix3D C)
 {
     if (Slices != B.Slices || Rows != B.Rows || Columns != B.Columns || Slices != C.Slices || Rows != C.Rows || Columns != C.Columns)
     {
         throw new ArgumentException("Incompatible dimensions: " + ToStringShort() + ", " + B.ToStringShort() + ", " + C.ToStringShort());
     }
 }
 /// <summary>
 /// Sanity check for operations requiring matrices with the same number of Slices, Rows and Columns.
 /// </summary>
 /// <exception cref="ArgumentException">if <i>Slices() != B.Slices() || Rows() != B.Rows() || Columns() != B.Columns() || Slices() != C.Slices() || Rows() != C.Rows() || Columns() != C.Columns()</i>.</exception>
 public virtual void CheckShape(AbstractMatrix3D B, AbstractMatrix3D C)
 {
     if (Slices != B.Slices || Rows != B.Rows || Columns != B.Columns || Slices != C.Slices || Rows != C.Rows || Columns != C.Columns)
     {
         throw new ArgumentException(String.Format(Cern.LocalizedResources.Instance().Exception_IncompatibleDimensions3, ToStringShort(), B.ToStringShort(), C.ToStringShort()));
     }
 }
예제 #3
0
 /// <summary>
 /// Returns a short string representation describing the shape of the matrix.
 /// </summary>
 /// <param name="matrix">
 /// The matrix.
 /// </param>
 /// <returns>
 /// A short string representation describing the shape of the matrix.
 /// </returns>
 public static string Shape(AbstractMatrix3D matrix)
 {
     return(matrix.Slices + " x " + matrix.Rows + " x " + matrix.Columns + " matrix ");
 }