2020-03-21 00:10:20 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using Tand.Core.Api;
|
|
|
|
|
|
|
|
namespace Tand.Core.Benchmarks
|
|
|
|
{
|
|
|
|
public interface IRationalsProvider
|
|
|
|
{
|
2022-12-13 20:11:26 +00:00
|
|
|
[Tand<ExecutionTimeTand<IRationalsProvider>>]
|
2020-03-21 00:10:20 +00:00
|
|
|
ICollection<Rational> Generate(IEnumerable<(int n, int d)> input);
|
|
|
|
}
|
|
|
|
|
|
|
|
public class RationalsProvider : IRationalsProvider
|
|
|
|
{
|
|
|
|
public ICollection<Rational> Generate(IEnumerable<(int n, int d)> input) => input.Select(tuple => new Rational(tuple.n, tuple.d)).ToList();
|
|
|
|
}
|
|
|
|
}
|