2 using System.Collections.Generic;
12 where MatrixElementType:new()
24 public new MatrixElementType[,]
this[
int LayerNr]
34 MatrixElementType[,] L =
new MatrixElementType[Width, Height];
35 for (
int y = 0; y < Height; y++)
37 for (
int x = 0; x < Width; x++)
39 L[x, y] =
new MatrixElementType();
51 if (value.GetUpperBound(0) == Width - 1 && value.GetUpperBound(1) == Height - 1)
53 base[LayerNr] = value;
57 throw new Exception(
"Supplied array has a illegal width ({0}) or height ({1}). Expecting {2} for width and {3} for height.".Build(
new object[] {value.GetUpperBound(0)+1,value.GetUpperBound(1)+1,Width,Height}));
72 get {
return _Width; }
73 set { _Width = value.Limit(1,
int.MaxValue); }
77 private int _Height=1;
87 get {
return _Height; }
88 set { _Height = value.Limit(1,
int.MaxValue); }
Sorted dictionary of layers for the matrix toys.