예제 #1
0
        public Matrix(Vector[] vectors)
        {
            int rows = vectors.Length;

            if (rows <= 0)
            {
                throw new ArgumentException("Array vectors count must be > 0", nameof(vectors));
            }

            int maxColumns = vectors[0].GetSize();

            for (int j = 1; j < rows; j++)
            {
                if (maxColumns < vectors[j].GetSize())
                {
                    maxColumns = vectors[j].GetSize();
                }
            }

            Rows = new Vector[rows];
            for (int i = 0; i < rows; i++)
            {
                Vector alignmentVector = new Vector(vectors[i]);
                alignmentVector.MakeAlignment(maxColumns);
                Rows[i] = alignmentVector;
            }
        }