numl.Math.LinearAlgebra.Matrix.Min C# (CSharp) Method

Min() public static method

Returns a vector of the minimum values for each row/column.
public static Min ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix
t VectorType Use column or row (default: Col)
return Vector
        public static Vector Min(Matrix source, VectorType t = VectorType.Col)
        {
            int num = (t == VectorType.Row ? source.Cols : source.Rows);
            VectorType vectorType = (t == VectorType.Row ? VectorType.Col : VectorType.Row);
            Vector vectors = new Vector(num);
            for (int i = 0; i < num; i++)
            {
                vectors[i] = Enumerable.Min(source[i, vectorType]);
            }
            return vectors;
        }

Same methods

Matrix::Min ( Matrix source ) : double

Usage Example

示例#1
0
 /// <summary>
 /// Summarizes a given Matrix.
 /// </summary>
 /// <param name="matrix">Matrix to summarize.</param>
 /// <param name="byVector">Indicates which direction to summarize, default is <see cref="VectorType.Row"/> indicating top-down.</param>
 /// <returns></returns>
 public static Summary Summarize(Matrix matrix, VectorType byVector = VectorType.Row)
 {
     return new Summary()
     {
         Average = matrix.Mean(byVector),
         StandardDeviation = matrix.StdDev(byVector),
         Minimum = matrix.Min(byVector),
         Maximum = matrix.Max(byVector),
         Median = matrix.Median(byVector)
     };
 }
All Usage Examples Of numl.Math.LinearAlgebra.Matrix::Min