Browse Source

Simplify root files slightly

optimization-1
Christoph Ruegg 13 years ago
parent
commit
a179264f75
  1. 54
      src/Numerics/IPrecisionSupport.cs
  2. 7
      src/Numerics/Numerics.csproj
  3. 7
      src/Numerics/PortableAttributes.cs
  4. 22
      src/Numerics/Precision.cs
  5. 12
      src/Numerics/SerializableAttribute.cs

54
src/Numerics/IPrecisionSupport.cs

@ -1,54 +0,0 @@
// <copyright file="IPrecisionSupport.cs" company="Math.NET">
// Math.NET Numerics, part of the Math.NET Project
// http://numerics.mathdotnet.com
// http://github.com/mathnet/mathnet-numerics
// http://mathnetnumerics.codeplex.com
//
// Copyright (c) 2009-2010 Math.NET
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
namespace MathNet.Numerics
{
/// <summary>
/// Support Interface for Precision Operations (like AlmostEquals).
/// </summary>
/// <typeparam name="T">Type of the implementing class.</typeparam>
public interface IPrecisionSupport<in T>
{
/// <summary>
/// Returns a Norm of a value of this type, which is appropriate for measuring how
/// close this value is to zero.
/// </summary>
/// <returns>A norm of this value.</returns>
double Norm();
/// <summary>
/// Returns a Norm of the difference of two values of this type, which is
/// appropriate for measuring how close together these two values are.
/// </summary>
/// <param name="otherValue">The value to compare with.</param>
/// <returns>A norm of the difference between this and the other value.</returns>
double NormOfDifference(T otherValue);
}
}

7
src/Numerics/Numerics.csproj

@ -126,7 +126,6 @@
<Compile Include="Statistics\QuantileDefinition.cs" />
<Compile Include="Statistics\StreamingStatistics.cs" />
<Compile Include="Statistics\SortedArrayStatistics.cs" />
<Compile Include="TargetedPatchingOptOutAttribute.cs" />
<Compile Include="Distributions\Continuous\Cauchy.cs" />
<Compile Include="Distributions\Continuous\Chi.cs" />
<Compile Include="Distributions\Continuous\ChiSquare.cs" />
@ -385,7 +384,6 @@
<Compile Include="IntegralTransforms\HartleyOptions.cs" />
<Compile Include="GlobalizationHelper.cs" />
<Compile Include="Interpolation\EquidistantPolynomialInterpolation.cs" />
<Compile Include="IPrecisionSupport.cs" />
<Compile Include="IntegralTransforms\Algorithms\DiscreteFourierTransform.Options.cs" />
<Compile Include="IntegralTransforms\Algorithms\DiscreteFourierTransform.Bluestein.cs" />
<Compile Include="IntegralTransforms\Algorithms\DiscreteFourierTransform.Naive.cs" />
@ -429,7 +427,7 @@
<Compile Include="Random\WH1982.cs" />
<Compile Include="Random\WH2006.cs" />
<Compile Include="Random\Xorshift.cs" />
<Compile Include="SerializableAttribute.cs" />
<Compile Include="PortableAttributes.cs" />
<Compile Include="Signals\SignalGenerator.Random.cs" />
<Compile Include="Signals\SignalGenerator.Chebyshev.cs" />
<Compile Include="Signals\SignalGenerator.Equidistant.cs" />
@ -488,9 +486,6 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="MathNet.Numerics.snk" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

7
src/Numerics/TargetedPatchingOptOutAttribute.cs → src/Numerics/PortableAttributes.cs

@ -1,8 +1,14 @@
#if PORTABLE
using System;
namespace MathNet.Numerics
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class SerializableAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class TargetedPatchingOptOutAttribute : Attribute
{
@ -13,4 +19,5 @@ namespace MathNet.Numerics
}
}
}
#endif

22
src/Numerics/Precision.cs

@ -41,6 +41,28 @@ namespace MathNet.Numerics
using Complex = System.Numerics.Complex;
#endif
/// <summary>
/// Support Interface for Precision Operations (like AlmostEquals).
/// </summary>
/// <typeparam name="T">Type of the implementing class.</typeparam>
public interface IPrecisionSupport<in T>
{
/// <summary>
/// Returns a Norm of a value of this type, which is appropriate for measuring how
/// close this value is to zero.
/// </summary>
/// <returns>A norm of this value.</returns>
double Norm();
/// <summary>
/// Returns a Norm of the difference of two values of this type, which is
/// appropriate for measuring how close together these two values are.
/// </summary>
/// <param name="otherValue">The value to compare with.</param>
/// <returns>A norm of the difference between this and the other value.</returns>
double NormOfDifference(T otherValue);
}
/// <summary>
/// Utilities for working with floating point numbers.
/// </summary>

12
src/Numerics/SerializableAttribute.cs

@ -1,12 +0,0 @@
#if PORTABLE
using System;
namespace MathNet.Numerics
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class SerializableAttribute : Attribute
{
}
}
#endif
Loading…
Cancel
Save