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

Reverse() public static method

Enumerates reverse in this collection.
public static Reverse ( Matrix source, VectorType t = VectorType.Row ) : IEnumerable
source Matrix Source for the.
t VectorType (Optional) Row or Column sum.
return IEnumerable
        public static IEnumerable<Vector> Reverse(Matrix source, VectorType t = VectorType.Row)
        {
            int length = t == VectorType.Row ? source.Rows : source.Cols;
            for (int i = length - 1; i > -1; i--)
                yield return source[i, t];
        }

Usage Example

コード例 #1
0
 /// <summary>Enumerates reverse in this collection.</summary>
 /// <param name="source">The source to act on.</param>
 /// <param name="t">(Optional) Row or Column sum.</param>
 /// <returns>
 /// An enumerator that allows foreach to be used to process reverse in this collection.
 /// </returns>
 public static IEnumerable <Vector> Reverse(this Matrix source, VectorType t = VectorType.Row)
 {
     return(Matrix.Reverse(source, t));
 }