Exemplo n.º 1
0
        public Matrix(Matrix etalon)
        {
            this.size  = etalon.size;
            this.arr2D = new int[size][];
            for (int i = 0; i < size; ++i)
            {
                this.arr2D[i] = new int[size];
                for (int j = 0; j < size; ++j)
                {
                    this.arr2D[i][j] = etalon[i, j];
                }
            }

            this.workInThread  = etalon.workInThread;
            this.threadAmount  = etalon.threadAmount;
            this.multiplyStyle = etalon.multiplyStyle;
        }
Exemplo n.º 2
0
        public Matrix(int size, int threadAmount, MultiplyStyle multiplyStyle = MultiplyStyle.Cannon)
        {
            if (threadAmount > size)
            {
                throw new ArgumentException("Thread amount could not be greater than size amount");
            }

            r         = new Random();
            this.size = size;
            arr2D     = new int[size][];
            for (int i = 0; i < size; ++i)
            {
                arr2D[i] = new int[size];
            }

            workInThread       = true;
            this.threadAmount  = threadAmount;
            this.multiplyStyle = multiplyStyle;
        }