public mtrx_str(mtrx_str b) { num_str = new double[b.Length]; for (int i = 0; i < num_str.Length; ++i) { num_str[i] = b[i]; } }
//поменять строки местами public void Swap_Str(int a, int b) { mtrx_str c = mass[a]; mass[a] = mass[b]; mass[b] = c; ++num_swaps; }
public static mtrx_str operator *(double b, mtrx_str a) { mtrx_str c = new mtrx_str(a.Length); for (int i = 0; i < c.Length; ++i) { c[i] = a[i] * b; } return(c); }
public static mtrx_str operator -(mtrx_str a, double b) { mtrx_str c = new mtrx_str(a.Length); for (int i = 0; i < c.Length; ++i) { c[i] = a[i] - b; } return(c); }
public matrix(int i_, int j_) { mass = new mtrx_str[i_]; for (int i = 0; i < mass.Length; ++i) { mass[i] = new mtrx_str(j_); } Length = i_ * j_; I_Length = i_; J_Length = j_; num_swaps = 0; Name = ""; }
public matrix(matrix b, string new_name) { mass = new mtrx_str[b.I_Length]; for (int i = 0; i < mass.Length; ++i) { mass[i] = new mtrx_str(b.mass[i]); } Length = b.Length; I_Length = b.I_Length; J_Length = b.J_Length; num_swaps = b.num_swaps; Name = new_name; }
public static mtrx_str operator /(double b, mtrx_str a) { mtrx_str c = new mtrx_str(a.Length); for (int i = 0; i < c.Length; ++i) { if (a[i].Equals(0)) { throw new MatrixOperationExeption(); } c[i] = b / a[i]; } return(c); }
public static mtrx_str operator /(mtrx_str a, double b) { mtrx_str c = new mtrx_str(a.Length); if (b.Equals(0)) { throw new MatrixOperationExeption(); } for (int i = 0; i < c.Length; ++i) { c[i] = a[i] / b; } return(c); }
public static mtrx_str operator -(mtrx_str a, mtrx_str b) { if (a.Length != b.Length) { throw new MatrixOperationExeption(); } mtrx_str c = new mtrx_str(a.Length); for (int i = 0; i < c.Length; ++i) { c[i] = a[i] - b[i]; } return(c); }