示例#1
0
文件: Matrix.cs 项目: shadowaltar/Exp
        public void Set(T rowEntity, T columnEntity, double value)
        {
            if (!RowEntities.Contains(rowEntity) || !ColumnEntities.Contains(columnEntity))
            {
                throw new ArgumentException();
            }
            var i = RowEntities.IndexOf(rowEntity);
            var j = ColumnEntities.IndexOf(columnEntity);

            this[i, j] = value;
        }
示例#2
0
文件: Matrix.cs 项目: shadowaltar/Exp
        public double Get(T rowEntity, T columnEntity)
        {
            if (!RowEntities.Contains(rowEntity) || !ColumnEntities.Contains(columnEntity))
            {
                throw new ArgumentException();
            }
            var i = RowEntities.IndexOf(rowEntity);
            var j = ColumnEntities.IndexOf(columnEntity);

            return(this[i, j]);
        }