Diag() публичный статический Метод

Diagrams the given m.
public static Diag ( Matrix m ) : Vector
m Matrix Input Matrix.
Результат Vector
Пример #1
0
        /// <summary>Sorts this object.</summary>
        private void Sort()
        {
            //ordering
            var eigs = A.Diag()
                       .Select((d, i) => new Tuple <int, double>(i, d))
                       .OrderByDescending(j => j.Item2)
                       .ToArray();

            // sort eigenvectors
            var copy = V.Copy();

            for (var i = 0; i < eigs.Length; i++)
            {
                copy[i, VectorType.Col] = V[eigs[i].Item1, VectorType.Col];
            }

            // normalize eigenvectors
            copy.Normalize(VectorType.Col);
            V = copy;

            Eigenvalues = eigs.Select(t => t.Item2).ToArray();
        }
Пример #2
0
 /// <summary>A Matrix extension method that diagrams the given m.</summary>
 /// <param name="m">Matrix.</param>
 /// <returns>A Vector.</returns>
 public static Vector Diag(this Matrix m)
 {
     return(Matrix.Diag(m));
 }