Browse Source

LA providers: reworked how the tests setup

pull/36/head
Marcus Cuda 17 years ago
parent
commit
b61f6df24d
  1. 5
      src/NativeWrappers/ATLASWrapperTests/ATLASWrapperTests.csproj
  2. 4
      src/NativeWrappers/ATLASWrapperTests/LinearAlgebra/Double/AtlasLinearAlgebraProviderTests.cs
  3. 23
      src/NativeWrappers/Common/LinearAlgebra/Double/NativeVectorTests.cs
  4. 4
      src/NativeWrappers/MKLWrapper32Tests/LinearAlgebra/Double/MklLinearAlgebraProviderTests.cs
  5. 5
      src/NativeWrappers/MKLWrapper32Tests/MKLWrapper32Tests.csproj
  6. 7
      src/NativeWrappers/MKLWrapper64Tests/MKLWrapper64Tests.csproj
  7. 11
      src/NativeWrappers/NativeWrappers.sln
  8. 200
      src/UnitTests/LinearAlgebraTests/Double/LinearAlgebraProviderTests.cs
  9. 13
      src/UnitTests/LinearAlgebraTests/Double/ManagedLinearAlgebraProviderTests.cs
  10. 1
      src/UnitTests/LinearAlgebraTests/Double/MatrixTests.cs
  11. 1
      src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs
  12. 2
      src/UnitTests/UnitTests.csproj

5
src/NativeWrappers/ATLASWrapperTests/ATLASWrapperTests.csproj

@ -66,10 +66,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\LinearAlgebra\Double\NativeVectorTests.cs">
<Link>LinearAlgebra\Double\NativeVectorTests.cs</Link>
</Compile>
<Compile Include="LinearAlgebra\Double\AtlasVectorTests.cs" />
<Compile Include="LinearAlgebra\Double\AtlasLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

4
src/NativeWrappers/ATLASWrapperTests/LinearAlgebra/Double/AtlasVectorTests.cs → src/NativeWrappers/ATLASWrapperTests/LinearAlgebra/Double/AtlasLinearAlgebraProviderTests.cs

@ -1,9 +1,9 @@
namespace MathNet.Numerics.ATLASWrapperTests.LinearAlgebra.Double
{
using MbUnit.Framework;
using Numerics.LinearAlgebra.Double;
using UnitTests.LinearAlgebraTests.Double;
public class AtlasVectorTests : NativeVectorTests
public class AtlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
[FixtureSetUp]
public void SetUpProvider()

23
src/NativeWrappers/Common/LinearAlgebra/Double/NativeVectorTests.cs

@ -1,23 +0,0 @@
namespace MathNet.Numerics.LinearAlgebra.Double
{
using System.Collections.Generic;
public abstract class NativeVectorTests : UnitTests.LinearAlgebraTests.Double.VectorTests
{
protected override Vector CreateVector(int size)
{
return new DenseVector(size);
}
protected override Vector CreateVector(IList<double> data)
{
var vector = new DenseVector(data.Count);
for (var index = 0; index < data.Count; index++)
{
vector[index] = data[index];
}
return vector;
}
}
}

4
src/NativeWrappers/MKLWrapper32Tests/LinearAlgebra/Double/MklVectorTests.cs → src/NativeWrappers/MKLWrapper32Tests/LinearAlgebra/Double/MklLinearAlgebraProviderTests.cs

@ -1,9 +1,9 @@
namespace MathNet.Numerics.MKLWrapperTests.LinearAlgebra.Double
{
using MbUnit.Framework;
using Numerics.LinearAlgebra.Double;
using UnitTests.LinearAlgebraTests.Double;
public class MklVectorTests : NativeVectorTests
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
[FixtureSetUp]
public void SetUpProvider()

5
src/NativeWrappers/MKLWrapper32Tests/MKLWrapper32Tests.csproj

@ -66,10 +66,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\LinearAlgebra\Double\NativeVectorTests.cs">
<Link>LinearAlgebra\Double\NativeVectorTests.cs</Link>
</Compile>
<Compile Include="LinearAlgebra\Double\MklVectorTests.cs" />
<Compile Include="LinearAlgebra\Double\MklLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>

7
src/NativeWrappers/MKLWrapper64Tests/MKLWrapper64Tests.csproj

@ -70,11 +70,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Common\LinearAlgebra\Double\NativeVectorTests.cs">
<Link>LinearAlgebra\Double\NativeVectorTests.cs</Link>
</Compile>
<Compile Include="..\MKLWrapper32Tests\LinearAlgebra\Double\MklVectorTests.cs">
<Link>LinearAlgebra\Double\MklVectorTests.cs</Link>
<Compile Include="..\MKLWrapper32Tests\LinearAlgebra\Double\MklLinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Double\MklLinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

11
src/NativeWrappers/NativeWrappers.sln

@ -19,13 +19,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKLWrapper64Tests", "MKLWra
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKLWrapper32Tests", "MKLWrapper32Tests\MKLWrapper32Tests.csproj", "{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LinearAlgebra", "LinearAlgebra", "{28304BC9-F668-4D43-9055-E1D37090F7A2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Double", "Double", "{7957ECEC-3AAE-40CD-9A79-8DFDF284B3FE}"
ProjectSection(SolutionItems) = preProject
Common\LinearAlgebra\Double\NativeVectorTests.cs = Common\LinearAlgebra\Double\NativeVectorTests.cs
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -104,8 +97,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{28304BC9-F668-4D43-9055-E1D37090F7A2} = {5A0892FF-82CE-40FC-BCE1-73810C615F52}
{7957ECEC-3AAE-40CD-9A79-8DFDF284B3FE} = {28304BC9-F668-4D43-9055-E1D37090F7A2}
EndGlobalSection
EndGlobal

200
src/UnitTests/LinearAlgebraTests/Double/LinearAlgebraProviderTests.cs

@ -0,0 +1,200 @@
namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
{
using Algorithms.LinearAlgebra;
using MbUnit.Framework;
[TestFixture]
public abstract class LinearAlgebraProviderTests
{
protected ILinearAlgebraProvider<double> Provider{ get; set;}
[Test, Ignore]
public void CanAddVectorToScaledVector(double[] y, double alpha, double[] x)
{
}
[Test, Ignore]
public void CanScaleArray(double alpha, double[] x)
{
}
[Test, Ignore]
public void CanComputeDotProduct(double[] x, double[] y)
{
}
[Test, Ignore]
public void CanAddArrays(double[] x, double[] y, double[] result)
{
}
[Test, Ignore]
public void CanSubtractArrays(double[] x, double[] y, double[] result)
{
}
[Test, Ignore]
public void CanPointWiseMultiplyArrays(double[] x, double[] y, double[] result)
{
}
[Test, Ignore]
public void CanComputeMatrixNorm(Norm norm, double[] matrix){}
[Test, Ignore]
public void CanComputeMatrixNorm(Norm norm, double[] matrix, double[] work)
{
}
[Test, Ignore]
public void CanMatrixMultiply(double[] x, int xRows, int xColumns, double[] y, int yRows, int yColumns, double[] result)
{
}
[Test, Ignore]
public void CanMatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, double alpha, double[] a,
int aRows, int aColumns, double[] b, int bRows, int bColumns, double beta, double[] c)
{
}
[Test, Ignore]
public void CanComputeLUFactor(double[] a, int[] ipiv)
{
}
[Test, Ignore]
public void CanComputeLUInverse(double[] a)
{
}
public void CanComputeLUInverseFactored(double[] a, int[] ipiv)
{
}
[Test, Ignore]
public void CanComputeLUInverse(double[] a, double[] work)
{
}
[Test, Ignore]
public void CanComputeLUInverseFactored(double[] a, int[] ipiv, double[] work)
{
}
[Test, Ignore]
public void CanComputeLUSolve(int columnsOfB, double[] a, double[] b)
{
}
[Test, Ignore]
public void CanComputeLUSolveFactored(int columnsOfB, double[] a, int ipiv, double[] b)
{
}
[Test, Ignore]
public void CanComputeLUSolve(Transpose transposeA, int columnsOfB, double[] a, double[] b)
{
}
[Test, Ignore]
public void CanComputeLUSolveFactored(Transpose transposeA, int columnsOfB, double[] a, int ipiv, double[] b)
{
}
[Test, Ignore]
public void CanComputeCholeskyFactor(double[] a, int order)
{
}
[Test, Ignore]
public void CanComputeCholeskySolve(int columnsOfB, double[] a, double[] b)
{
}
[Test, Ignore]
public void CanComputeCholeskySolveFactored(int columnsOfB, double[] a, double[] b)
{
}
[Test, Ignore]
public void CanComputeQRFactor(double[] r, double[] q)
{
}
[Test, Ignore]
public void CanComputeQRFactor(double[] r, double[] q, double[] work)
{
}
[Test, Ignore]
public void CanComputeQRSolve(int columnsOfB, double[] r, double[] q, double[] b, double[] x)
{
}
[Test, Ignore]
public void CanComputeQRSolve(int columnsOfB, double[] r, double[] q, double[] b, double[] x, double[] work)
{
}
[Test, Ignore]
public void CanComputeQRSolveFactored(int columnsOfB, double[] q, double[] r, double[] b, double[] x)
{
}
[Test, Ignore]
public void CanComputeSinguarValueDecomposition(bool computeVectors, double[] a, double[] s, double[] u, double[] vt)
{
}
[Test, Ignore]
public void CanComputeSingularValueDecomposition(bool computeVectors, double[] a, double[] s, double[] u, double[] vt, double[] work)
{
}
[Test, Ignore]
public void CanComputeSvdSolve(double[] a, double[] s, double[] u, double[] vt, double[] b, double[] x)
{
}
[Test, Ignore]
public void CanComputeSvdSolve(double[] a, double[] s, double[] u, double[] vt, double[] b, double[] x, double[] work)
{
}
[Test, Ignore]
public void CanComputeSvdSolveFactored(int columnsOfB, double[] s, double[] u, double[] vt, double[] b, double[] x)
{
}
}
}

13
src/UnitTests/LinearAlgebraTests/Double/ManagedLinearAlgebraProviderTests.cs

@ -0,0 +1,13 @@
namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
{
using MbUnit.Framework;
public class ManagedLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
[FixtureSetUp]
public void SetProvider()
{
Provider = new Algorithms.LinearAlgebra.ManagedLinearAlgebraProvider();
}
}
}

1
src/UnitTests/LinearAlgebraTests/Double/MatrixTests.cs

@ -6,6 +6,7 @@ using MbUnit.Framework;
namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
{
[TestFixture]
public abstract partial class MatrixTests
{
protected Dictionary<string, double[,]> testData2D;

1
src/UnitTests/LinearAlgebraTests/Double/VectorTests.cs

@ -8,6 +8,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
{
using System.Collections;
[TestFixture]
public abstract partial class VectorTests
{
protected readonly double[] _data = {1, 2, 3, 4, 5};

2
src/UnitTests/UnitTests.csproj

@ -90,6 +90,8 @@
<Compile Include="InterpolationTests\InterpolationFunctionalContract.cs" />
<Compile Include="InterpolationTests\InterpolationInfrastructureContract.cs" />
<Compile Include="InterpolationTests\InterpolationFunctionalTest.cs" />
<Compile Include="LinearAlgebraTests\Double\LinearAlgebraProviderTests.cs" />
<Compile Include="LinearAlgebraTests\Double\ManagedLinearAlgebraProviderTests.cs" />
<Compile Include="LinearAlgebraTests\Double\UserDefinedMatrixTests.cs" />
<Compile Include="LinearAlgebraTests\Double\MatrixTests.cs" />
<Compile Include="LinearAlgebraTests\Double\DenseMatrixTests.cs" />

Loading…
Cancel
Save