コード例 #1
0
        private void Initialise()
        {
            var costMatrixCopy = CostMatrix.Copy();

            if (CostMatrix.NumberOfRows > CostMatrix.NumberOfColumns)
            {
                _isTransposed  = true;
                costMatrixCopy = costMatrixCopy.Transpose();
            }

            _numberOfRows    = costMatrixCopy.NumberOfRows;
            _numberOfColumns = costMatrixCopy.NumberOfColumns;

            _c = costMatrixCopy.Data;

            _path = new int[_numberOfRows + _numberOfColumns + 1, 2];

            _rowCover    = new int[_numberOfRows];
            _columnCover = new int[_numberOfColumns];

            _m = new double[_numberOfRows, _numberOfColumns];

            _stepNumber = 1;
        }
コード例 #2
0
 /// <summary>
 ///   Finds the minimum value of a function. The solution vector
 ///   will be made available at the <see cref="Solution" /> property.
 /// </summary>
 ///
 /// <returns>Returns <c>true</c> if the method converged to a <see cref="Solution" />.
 /// In this case, the found value will also be available at the <see cref="Value" />
 /// property.</returns>
 ///
 public bool Minimize()
 {
     return(run(CostMatrix.Copy()));
 }