private void DrawInitial() { var arr = MathExtend.ListTo2DArr(inputData); var table = this.DrawTable(arr); addRowsFromSource(table, ref dataTable); dataTable.Visible = true; }
private bool NeedFiction() { bool res = false; for (int i = 0; i < freeCount; i++) // first column besides c0 { if (_matrix[i, 0] < 0) { res = true; MathExtend.SumMatrixRows(ref _matrix, i, freeCount + 1); } } return(res); }
private void OptimizeMatrix() // get rid of all fractions { for (int i = 0; i < _dataMatrix.GetUpperBound(0); i++) { for (int j = 0; j < _dataMatrix.GetUpperBound(1); j++) { double frac = Math.Abs(_dataMatrix[i, j] - Math.Truncate(_dataMatrix[i, j])); if (frac > 0) { MathExtend.MultipleMatrixRow(ref _dataMatrix, 1 / frac, i); } } } }
private void RowImprove(int target) { int col = SolvingColumn(target); int row = SolvingRow(col); double[,] tempMatrix = MathExtend.Copy(_tempMatrixes[_tempMatrixes.Count - 1]); MathExtend.Jordan(ref tempMatrix, row, col); _tempMatrixes.Add(CalcSum(tempMatrix)); int temp = _plan[row]; _plan[row] = _allVariables[col - 1]; _allVariables[col - 1] = _plan[row]; //_tempMatrixes.Add(tempMatrix); }
public static double Nok(double a, double b) { return(Math.Abs(a * b) / MathExtend.Nod(a, b)); }