numl.Math.LinearAlgebra.Matrix.Indices C# (CSharp) Метод

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

Enumerates indices in this collection.
public static Indices ( Matrix source, bool>.Func f, VectorType t ) : IEnumerable
source Matrix Source for the.
f bool>.Func The Func<Vector,bool> to process.
t VectorType Row or Column sum.
Результат IEnumerable
        public static IEnumerable<int> Indices(Matrix source, Func<Vector, bool> f, VectorType t)
        {
            int max = t == VectorType.Row ? source.Rows : source.Cols;
            for (int i = 0; i < max; i++)
                if (f(source[i, t]))
                    yield return i;
        }

Same methods

Matrix::Indices ( Matrix source, bool>.Func f ) : IEnumerable

Usage Example

Пример #1
0
 /// <summary>Enumerates indices in this collection.</summary>
 /// <param name="source">Source for the.</param>
 /// <param name="f">The Func&lt;Vector,bool&gt; to process.</param>
 /// <returns>
 /// An enumerator that allows foreach to be used to process indices in this collection.
 /// </returns>
 public static IEnumerable <int> Indices(Matrix source, Func <Vector, bool> f)
 {
     return(Matrix.Indices(source, f, VectorType.Row));
 }
All Usage Examples Of numl.Math.LinearAlgebra.Matrix::Indices