X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=dev4%2Fpsychlops%2Fcore%2Fmath%2Fmatrix.cs;fp=dev4%2Fpsychlops%2Fcore%2Fmath%2Fmatrix.cs;h=0000000000000000000000000000000000000000;hb=7fe25aa821826f09903fb14def74d6b0376e3b5a;hp=de4a8363ad29e9035e293d4b0d8e82196d3ead60;hpb=af114e9e36fd9c2cdf79f95313e0b8712e253ed3;p=psychlops%2Fsilverlight.git diff --git a/dev4/psychlops/core/math/matrix.cs b/dev4/psychlops/core/math/matrix.cs deleted file mode 100644 index de4a836..0000000 --- a/dev4/psychlops/core/math/matrix.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; - -namespace Psychlops -{ - - - public abstract class Matrix - { - public abstract double this[int row, int col] - { - get; - set; - } - - /* - public abstract Internal.MatrixExpression this[Interval row, Interval col] - { - get; - set; - } - - - /* - public static Matrix operator +(Matrix m, double d) - { - return new Internal.MatrixExpression(); - } - */ - - public abstract int rows { get; } - public abstract int cols { get; } - public int getRows() { return rows; } - public int getCols() { return cols; } - - } - - - namespace Internal - { - - public class MatrixImplementation : Matrix - { - internal double[,] elements; - - public MatrixImplementation(int dnrow, int dncol) - { - elements = new double[dnrow, dncol]; - } - - public override double this[int row, int col] - { - get - { - return elements[row - 1, col - 1]; - } - set - { - elements[row - 1, col - 1] = value; - } - } - /* - public override MatrixExpression this[Interval row, Interval col] - { - get - { - return new MatrixExpression(this, row.int_floor(), col.int_floor(), row.int_ceil(), col.int_ceil()); - } - set - { - for(int r = 0, r<) - elements[row - 1, col - 1] = value; - } - } - * */ - - public override int rows { get { return elements.GetLength(0); } } - public override int cols { get { return elements.GetLength(1); } } - - } - - public class MatrixExpression : Matrix - { - MatrixImplementation imp; - readonly int brow, bcol; - readonly int erow, ecol; - - internal MatrixExpression(MatrixImplementation target, int dbrow, int dbcol, int derow, int decol) - { - brow = dbrow; - bcol = dbcol; - erow = derow; - ecol = decol; - imp = target; - } - - public override double this[int row, int col] - { - get - { - return imp.elements[(row - 1 - brow), (col - 1 - bcol)]; - } - set - { - imp.elements[(row - 1 - brow), (col - 1 - bcol)] = value; - } - } - - public override int rows { get { return erow - brow + 1; } } - public override int cols { get { return ecol - bcol + 1; } } - } - } - -} \ No newline at end of file