コード例 #1
0
        public System_of_Linear_Equation(int n)
        {
            sle = new Linear_Equation[n];

            for (int i = 0; i < CountX; i++)
            {
                sle[i] = new Linear_Equation(n);
            }
        }
コード例 #2
0
        public static Linear_Equation operator -(Linear_Equation a)
        {
            Linear_Equation result = new Linear_Equation(a.CountX);

            for (int i = 0; i <= result.CountX; i++)
            {
                result[i] = -a[i];
            }
            return(result);
        }
コード例 #3
0
        public static Linear_Equation operator /(double r, Linear_Equation a)
        {
            Linear_Equation result = new Linear_Equation(a.CountX);

            for (int i = 0; i <= result.CountX; i++)
            {
                result[i] = a[i] / r;
            }
            return(result);
        }
コード例 #4
0
        public static Linear_Equation operator +(Linear_Equation a, Linear_Equation b)
        {
            Linear_Equation result = new Linear_Equation(a.CountX);

            for (int i = 0; i <= result.CountX; i++)
            {
                double c = a[i] + b[i];
                result[i] = Math.Abs(c) < 0.0001 ? 0 : c;
            }
            return(result);
        }