コード例 #1
0
 public List <LocationBO> Get(string[] Ids)
 {
     long[] identities = new long[Ids.Length];
     Ids.ToList().Select(x => identities.Append(long.Parse(x)));
     return(_location.Get(identities.ToList()));
 }
コード例 #2
0
        public bool CheckResult()
        {
            var testValues = new long[] { 0, 2, 5, 31, 54 };

            var freeVars = new Matrix <long>(testValues.Length + 1, CountOfFreeVariables, testValues.Append(0L));
            var random   = new Random();

            freeVars[testValues.Length] = new Vector <long>(Enumerable.Repeat(0, CountOfFreeVariables)
                                                            .Select(x => Convert.ToInt64(random.Next())));

            var differenceUnknownAndFree = CountOfUnknown - CountOfFreeVariables;

            foreach (var freeRow in (IEnumerable <IVector <long> >)freeVars)
            {
                var solution = new Vector <long>(CountOfUnknown);

                for (var i = 0; i < solution.Count; ++i)
                {
                    var matrixRowEquationPlusOne = Matrix[CountOfEquation + i];
                    solution[i] = matrixRowEquationPlusOne[CountOfUnknown];

                    for (var j = 0; j < CountOfFreeVariables; ++j)
                    {
                        solution[i] += freeRow[j] * matrixRowEquationPlusOne[differenceUnknownAndFree + j];
                    }
                }

                foreach (var row in (IEnumerable <IVector <long> >)OriginalMatrix)
                {
                    var result = row[^ 1];