//hashCode public DualMatrix(DualNumber[,] entries) { if (entries == null) { throw new ArgumentNullException(); } for (int i = 0; i < entries.GetLength(0); i++) { for (int j = 0; j < entries.GetLength(1); j++) { if (entries[i, j] == null) { throw new ArgumentNullException(); } } } this.entries = (DualNumber[,])entries.Clone(); }
/************************************************************************* Copyright (c) 2005-2007, Sergey Bochkanov (ALGLIB project). >>> SOURCE LICENSE >>> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (www.fsf.org); either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GNU General Public License is available at http://www.fsf.org/licensing/licenses >>> END OF LICENSE >>> *************************************************************************/ private static DualNumber spdmatrixdet(DualNumber[,] a, int n, bool isupper) { DualNumber result = 0; a = (DualNumber[,])a.Clone(); if (!spdmatrixcholesky(ref a, n, isupper)) { result = -1; } else { result = spdmatrixcholeskydet(ref a, n); } return result; }