/* Copyright 2015-present MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using MongoDB.Driver.Core.Misc;
namespace MongoDB.Driver.Linq
{
///
/// Enumerable Extensions for MongoDB.
///
public static class MongoEnumerable
{
internal static HashSet ToHashSet(this IEnumerable source)
{
Ensure.IsNotNull(source, nameof(source));
return new HashSet(source);
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static float StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static float? StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static decimal StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static decimal? StandardDeviationPopulation(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static float StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static float? StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static decimal StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the population standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static decimal? StandardDeviationPopulation(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationPopulation();
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static float StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static float? StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static decimal StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values.
///
/// A sequence of values to calculate the population standard deviation of.
///
/// The population standard deviation of the sequence of values.
///
public static decimal? StandardDeviationSample(this IEnumerable source)
{
throw new NotSupportedException("This method is not functional. It is only usable in conjunction with MongoDB.");
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static float StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static float? StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static double? StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static decimal StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
///
/// Computes the sample standard deviation of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
///
/// The type of the elements of .
/// A sequence of values to calculate the population standard deviation of.
/// A transform function to apply to each element.
///
/// The population standard deviation of the sequence of values.
///
public static decimal? StandardDeviationSample(this IEnumerable source, Func selector)
{
return source.Select(selector).StandardDeviationSample();
}
}
}