Skip to content
Snippets Groups Projects
Matrix.cs 1.05 KiB
Newer Older
using System;
using System.Collections.Generic;

namespace WindStressPRM
{
    /// <summary>
    /// Generic Matrix of type T
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Matrix<T>
    {
        /// <summary>
        /// AffineCoefficients for matrix from raster projection
        /// </summary>
        public double[] AffineCoefficients { get; set; }
        /// <summary>
        /// Size of cell. In meters
        /// </summary>
        public CellSize Size { get; set; }
        /// <summary>
        /// Cells Container
        /// </summary>
        public T[,] Cells { get; set; }
        /// <summary>
        /// Number of rows in matrix
        /// </summary>
        /// <returns></returns>
        public int RowsCount()
        {
            return Cells.Rank > 0 ? Cells.GetLength(0) : 0;
        }
        /// <summary>
        /// Number of columns 
        /// </summary>
        /// <returns></returns>
        public int ColumnCount()
        {
            return Cells.Rank > 1 ? Cells.GetLength(1) : 0;
        }
    }
}