private void PrecomputeAuralProperties(Matrix <double> K, Matrix <double> M) { // Call to the numpy server to compute evd Numpy.EvdResult evd = Numpy.LinAlg.Eigh(K); var lambdas = evd.EigenValues; var mgains = evd.EigenVectors; // Initialize output structurs List <zdouble> wp = new List <zdouble>(); List <zdouble> wm = new List <zdouble>(); List <double> mass = new List <double>(); List <Vector <double> > aggregatedColumns = new List <Vector <double> >(); for (int i = 0; i < lambdas.Count;) { zdouble probe = GetOmega(lambdas[i], 1); double _freq = GetFreqFrom(probe); if (_freq < MIN_FREQ || _freq > MAX_FREQ) { i++; continue; } wp.Add(probe); wm.Add(GetOmega(lambdas[i], -1)); mass.Add(M[i, i]); i = SumColumnsUntilDlc(i, _freq, mgains, lambdas, aggregatedColumns); } _omegaPlus = VB.DenseOfEnumerable(wp); _omegaMinus = VB.DenseOfEnumerable(wm); _massMatrix = MB.DenseOfDiagonalArray(mass.ToArray()); _gainMatrix = MB.DenseOfColumns(aggregatedColumns); // call numpy server to compute pseudo-inverse _gainMatrixT = Numpy.LinAlg.Pinv(_gainMatrix); }