Browse Source
matrix:made the internal data array public on the dense matrices tests:started using MSTest for the provider testspull/36/head
36 changed files with 1406 additions and 879 deletions
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<TestSettings name="Local" id="0046459d-be0e-4d4c-8154-b85ef3eca170" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> |
|||
<Description>These are default test settings for a local test run.</Description> |
|||
<Deployment enabled="false" /> |
|||
<Execution hostProcessPlatform="MSIL"> |
|||
<Hosts skipUnhostableTests="false" /> |
|||
<TestTypeSpecific> |
|||
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b"> |
|||
<AssemblyResolution> |
|||
<TestDirectory useLoadContext="true" /> |
|||
</AssemblyResolution> |
|||
</UnitTestRunConfig> |
|||
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207"> |
|||
<Browser name="Internet Explorer 7.0"> |
|||
<Headers> |
|||
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" /> |
|||
<Header name="Accept" value="*/*" /> |
|||
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" /> |
|||
<Header name="Accept-Encoding" value="GZIP" /> |
|||
</Headers> |
|||
</Browser> |
|||
</WebTestRunConfiguration> |
|||
</TestTypeSpecific> |
|||
<AgentRule name="LocalMachineDefaultRole"> |
|||
</AgentRule> |
|||
</Execution> |
|||
</TestSettings> |
|||
@ -0,0 +1,281 @@ |
|||
// <copyright file="AssertHelpers.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.UnitTests |
|||
{ |
|||
using System.Collections.Generic; |
|||
using System.Numerics; |
|||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|||
|
|||
/// <summary>
|
|||
/// A class which includes some assertion helper methods particularly for numerical code.
|
|||
/// </summary>
|
|||
internal class AssertHelpers |
|||
{ |
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
public static void AreEqual(Complex expected, Complex actual) |
|||
{ |
|||
if (expected.IsNaN() && actual.IsNaN()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
if (expected.IsInfinity() && expected.IsInfinity()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
bool pass = expected.Real.AlmostEqual(actual.Real); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Real components are not equal. Expected:{0}; Actual:{1}", expected.Real, actual.Real); |
|||
} |
|||
|
|||
pass = expected.Imaginary.AlmostEqual(actual.Imaginary); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Imaginary components are not equal. Expected:{0}; Actual:{1}", expected.Imaginary, actual.Imaginary); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
public static void AreEqual(Complex32 expected, Complex32 actual) |
|||
{ |
|||
if (expected.IsNaN() && actual.IsNaN()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
if (expected.IsInfinity() && expected.IsInfinity()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
bool pass = expected.Real.AlmostEqual(actual.Real); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Real components are not equal. Expected:{0}; Actual:{1}", expected.Real, actual.Real); |
|||
} |
|||
|
|||
pass = expected.Imaginary.AlmostEqual(actual.Imaginary); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Imaginary components are not equal. Expected:{0}; Actual:{1}", expected.Imaginary, actual.Imaginary); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain number of decimal places. If both
|
|||
/// <paramref name="expected"/> and <paramref name="actual"/> are NaN then no assert is thrown.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
/// <param name="decimalPlaces">The number of decimal places to agree on.</param>
|
|||
public static void AlmostEqual(double expected, double actual, int decimalPlaces) |
|||
{ |
|||
if (double.IsNaN(expected) && double.IsNaN(actual)) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
bool pass = expected.AlmostEqualInDecimalPlaces(actual, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
// signals Gallio that the test failed.
|
|||
Assert.Fail("Not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected, actual); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain number of decimal places. If both
|
|||
/// <paramref name="expected"/> and <paramref name="actual"/> are NaN then no assert is thrown.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
/// <param name="decimalPlaces">The number of decimal places to agree on.</param>
|
|||
public static void AlmostEqual(float expected, float actual, int decimalPlaces) |
|||
{ |
|||
if (float.IsNaN(expected) && float.IsNaN(actual)) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
bool pass = expected.AlmostEqualInDecimalPlaces(actual, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
// signals Gallio that the test failed.
|
|||
Assert.Fail("Not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected, actual); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain number of decimal places.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
/// <param name="decimalPlaces">The number of decimal places to agree on.</param>
|
|||
public static void AlmostEqual(Complex expected, Complex actual, int decimalPlaces) |
|||
{ |
|||
bool pass = expected.Real.AlmostEqualInDecimalPlaces(actual.Real, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Real components are not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected.Real, actual.Real); |
|||
} |
|||
|
|||
pass = expected.Imaginary.AlmostEqualInDecimalPlaces(actual.Imaginary, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Imaginary components are not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected.Imaginary, actual.Imaginary); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain number of decimal places.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
/// <param name="decimalPlaces">The number of decimal places to agree on.</param>
|
|||
public static void AlmostEqual(Complex32 expected, Complex32 actual, int decimalPlaces) |
|||
{ |
|||
bool pass = expected.Real.AlmostEqualInDecimalPlaces(actual.Real, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Real components are not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected.Real, actual.Real); |
|||
} |
|||
|
|||
pass = expected.Imaginary.AlmostEqualInDecimalPlaces(actual.Imaginary, decimalPlaces); |
|||
if (!pass) |
|||
{ |
|||
Assert.Fail("Imaginary components are not equal within {0} places. Expected:{1}; Actual:{2}", decimalPlaces, expected.Imaginary, actual.Imaginary); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain
|
|||
/// maximum error.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of the structures. Must implement
|
|||
/// <see cref="IPrecisionSupport{T}"/>.</typeparam>
|
|||
/// <param name="expected">The expected value.</param>
|
|||
/// <param name="actual">The actual value.</param>
|
|||
/// <param name="maximumError">The accuracy required for being almost equal.</param>
|
|||
public static void AlmostEqual<T>(T expected, T actual, double maximumError) |
|||
where T : IPrecisionSupport<T> |
|||
{ |
|||
if (!actual.AlmostEqualWithError(expected, maximumError)) |
|||
{ |
|||
Assert.Fail("Not equal within a maximum error {0}. Expected:{1}; Actual:{2}", maximumError, expected, actual); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain
|
|||
/// maximum error.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value list.</param>
|
|||
/// <param name="actual">The actual value list.</param>
|
|||
/// <param name="maximumError">The accuracy required for being almost equal.</param>
|
|||
public static void AlmostEqualList(IList<double> expected, IList<double> actual, double maximumError) |
|||
{ |
|||
for (int i = 0; i < expected.Count; i++) |
|||
{ |
|||
if (!actual[i].AlmostEqualWithError(expected[i], maximumError)) |
|||
{ |
|||
Assert.Fail("Not equal within a maximum error {0}. Expected:{1}; Actual:{2}", maximumError, expected[i], actual[i]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain
|
|||
/// maximum error.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value list.</param>
|
|||
/// <param name="actual">The actual value list.</param>
|
|||
/// <param name="maximumError">The accuracy required for being almost equal.</param>
|
|||
public static void AlmostEqualList(IList<float> expected, IList<float> actual, double maximumError) |
|||
{ |
|||
for (int i = 0; i < expected.Count; i++) |
|||
{ |
|||
if (!actual[i].AlmostEqualWithError(expected[i], maximumError)) |
|||
{ |
|||
Assert.Fail("Not equal within a maximum error {0}. Expected:{1}; Actual:{2}", maximumError, expected[i], actual[i]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain
|
|||
/// maximum error.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of the structures. Must implement
|
|||
/// <see cref="IPrecisionSupport{T}"/>.</typeparam>
|
|||
/// <param name="expected">The expected value list.</param>
|
|||
/// <param name="actual">The actual value list.</param>
|
|||
/// <param name="maximumError">The accuracy required for being almost equal.</param>
|
|||
public static void AlmostEqualList<T>(IList<T> expected, IList<T> actual, double maximumError) |
|||
where T : IPrecisionSupport<T> |
|||
{ |
|||
for (int i = 0; i < expected.Count; i++) |
|||
{ |
|||
if (!actual[i].AlmostEqualWithError(expected[i], maximumError)) |
|||
{ |
|||
Assert.Fail("Not equal within a maximum error {0}. Expected:{1}; Actual:{2}", maximumError, expected[i], actual[i]); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Asserts that the expected value and the actual value are equal up to a certain
|
|||
/// maximum error.
|
|||
/// </summary>
|
|||
/// <param name="expected">The expected value list.</param>
|
|||
/// <param name="actual">The actual value list.</param>
|
|||
/// <param name="maximumError">The accuracy required for being almost equal.</param>
|
|||
public static void AlmostEqualList(IList<Complex> expected, IList<Complex> actual, double maximumError) |
|||
{ |
|||
for (int i = 0; i < expected.Count; i++) |
|||
{ |
|||
if (!actual[i].AlmostEqualWithError(expected[i], maximumError)) |
|||
{ |
|||
Assert.Fail("Not equal within a maximum error {0}. Expected:{1}; Actual:{2}", maximumError, expected[i], actual[i]); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,381 @@ |
|||
// <copyright file="LinearAlgebraProviderTests.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.UnitTests.LinearAlgebraProviderTests.Double |
|||
{ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Algorithms.LinearAlgebra; |
|||
using LinearAlgebra.Double; |
|||
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|||
|
|||
/// <summary>
|
|||
/// Base class for linear algebra provider tests.
|
|||
/// </summary>
|
|||
[TestClass] |
|||
public abstract class LinearAlgebraProviderTests |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets linear algebra provider to test.
|
|||
/// </summary>
|
|||
protected static ILinearAlgebraProvider<double> Provider |
|||
{ |
|||
get; |
|||
set; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// The Y double test vector.
|
|||
/// </summary>
|
|||
private readonly double[] _y = new[] { 1.1, 2.2, 3.3, 4.4, 5.5 }; |
|||
|
|||
/// <summary>
|
|||
/// The X double test vector.
|
|||
/// </summary>
|
|||
private readonly double[] _x = new[] { 6.6, 7.7, 8.8, 9.9, 10.1 }; |
|||
|
|||
/// <summary>
|
|||
/// Test matrix to use.
|
|||
/// </summary>
|
|||
private readonly IDictionary<string, DenseMatrix> _matrices = new Dictionary<string, DenseMatrix> |
|||
{ |
|||
{ "Singular3x3", new DenseMatrix(new[,] { { 1.0, 1.0, 2.0 }, { 1.0, 1.0, 2.0 }, { 1.0, 1.0, 2.0 } }) }, |
|||
{ "Square3x3", new DenseMatrix(new[,] { { -1.1, -2.2, -3.3 }, { 0.0, 1.1, 2.2 }, { -4.4, 5.5, 6.6 } }) }, |
|||
{ "Square4x4", new DenseMatrix(new[,] { { -1.1, -2.2, -3.3, -4.4 }, { 0.0, 1.1, 2.2, 3.3 }, { 1.0, 2.1, 6.2, 4.3 }, { -4.4, 5.5, 6.6, -7.7 } }) }, |
|||
{ "Singular4x4", new DenseMatrix(new[,] { { -1.1, -2.2, -3.3, -4.4 }, { -1.1, -2.2, -3.3, -4.4 }, { -1.1, -2.2, -3.3, -4.4 }, { -1.1, -2.2, -3.3, -4.4 } }) }, |
|||
{ "Tall3x2", new DenseMatrix(new[,] { { -1.1, -2.2 }, { 0.0, 1.1 }, { -4.4, 5.5 } }) }, |
|||
{ "Wide2x3", new DenseMatrix(new[,] { { -1.1, -2.2, -3.3 }, { 0.0, 1.1, 2.2 } }) } |
|||
}; |
|||
|
|||
/// <summary>
|
|||
/// Can add a vector to scaled vector
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanAddVectorToScaledVectorDouble() |
|||
{ |
|||
var result = new double[_y.Length]; |
|||
Array.Copy(_y, result, _y.Length); |
|||
|
|||
Provider.AddVectorToScaledVector(result, 0, _x); |
|||
for (var i = 0; i < _y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(_y, result, _y.Length); |
|||
Provider.AddVectorToScaledVector(result, 1, _x); |
|||
for (var i = 0; i < _y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_y[i] + _x[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(_y, result, _y.Length); |
|||
Provider.AddVectorToScaledVector(result, Math.PI, _x); |
|||
for (var i = 0; i < _y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_y[i] + (Math.PI * _x[i]), result[i]); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can scale an array.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanScaleArray() |
|||
{ |
|||
var result = new double[_y.Length]; |
|||
|
|||
Array.Copy(_y, result, _y.Length); |
|||
Provider.ScaleArray(1, result); |
|||
for (var i = 0; i < _y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(_y, result, _y.Length); |
|||
Provider.ScaleArray(Math.PI, result); |
|||
for (var i = 0; i < _y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_y[i] * Math.PI, result[i]); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute the dot product.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeDotProduct() |
|||
{ |
|||
var result = Provider.DotProduct(_x, _y); |
|||
AssertHelpers.AlmostEqual(152.35, result, 15); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can add two arrays.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanAddArrays() |
|||
{ |
|||
var result = new double[_y.Length]; |
|||
Provider.AddArrays(_x, _y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_x[i] + _y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can subtract two arrays.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanSubtractArrays() |
|||
{ |
|||
var result = new double[_y.Length]; |
|||
Provider.SubtractArrays(_x, _y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_x[i] - _y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can pointwise multiply two arrays.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanPointWiseMultiplyArrays() |
|||
{ |
|||
var result = new double[_y.Length]; |
|||
Provider.PointWiseMultiplyArrays(_x, _y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(_x[i] * _y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute L1 norm.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixL1Norm() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute Frobenius norm.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixFrobeniusNorm() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute Infinity norm.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixInfinityNorm() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute L1 norm using a work array.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixL1NormWithWorkArray() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute Frobenius norm using a work array.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixFrobeniusNormWithWorkArray() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute Infinity norm using a work array.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeMatrixInfinityNormWithWorkArray() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply two square matrices.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplySquareMatrices() |
|||
{ |
|||
var x = _matrices["Singular3x3"]; |
|||
var y = _matrices["Square3x3"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiply(x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply a wide and tall matrix.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplyWideAndTallMatrices() |
|||
{ |
|||
var x = _matrices["Wide2x3"]; |
|||
var y = _matrices["Tall3x2"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiply(x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply a tall and wide matrix.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplyTallAndWideMatrices() |
|||
{ |
|||
var x = _matrices["Tall3x2"]; |
|||
var y = _matrices["Wide2x3"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiply(x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply two square matrices.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplySquareMatricesWithUpdate() |
|||
{ |
|||
var x = _matrices["Singular3x3"]; |
|||
var y = _matrices["Square3x3"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.2, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(2.2 * x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply a wide and tall matrix.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplyWideAndTallMatricesWithUpdate() |
|||
{ |
|||
var x = _matrices["Wide2x3"]; |
|||
var y = _matrices["Tall3x2"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.2, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(2.2 * x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can multiply a tall and wide matrix.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanMultiplyTallAndWideMatricesWithUpdate() |
|||
{ |
|||
var x = _matrices["Tall3x2"]; |
|||
var y = _matrices["Wide2x3"]; |
|||
var c = new DenseMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.2, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0, c.Data); |
|||
|
|||
for (var i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (var j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(2.2 * x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Can compute the Cholesky factorization.
|
|||
/// </summary>
|
|||
[TestMethod] |
|||
public void CanComputeCholeskyFactor() |
|||
{ |
|||
var matrix = new double[] { 1, 1, 1, 1, 1, 5, 5, 5, 1, 5, 14, 14, 1, 5, 14, 15 }; |
|||
Provider.CholeskyFactor(matrix, 4); |
|||
Assert.AreEqual(matrix[0], 1); |
|||
Assert.AreEqual(matrix[1], 1); |
|||
Assert.AreEqual(matrix[2], 1); |
|||
Assert.AreEqual(matrix[3], 1); |
|||
Assert.AreEqual(matrix[4], 0); |
|||
Assert.AreEqual(matrix[5], 2); |
|||
Assert.AreEqual(matrix[6], 2); |
|||
Assert.AreEqual(matrix[7], 2); |
|||
Assert.AreEqual(matrix[8], 0); |
|||
Assert.AreEqual(matrix[9], 0); |
|||
Assert.AreEqual(matrix[10], 3); |
|||
Assert.AreEqual(matrix[11], 3); |
|||
Assert.AreEqual(matrix[12], 0); |
|||
Assert.AreEqual(matrix[13], 0); |
|||
Assert.AreEqual(matrix[14], 0); |
|||
Assert.AreEqual(matrix[15], 1); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProductVersion> |
|||
</ProductVersion> |
|||
<SchemaVersion>2.0</SchemaVersion> |
|||
<ProjectGuid>{624FB757-A724-4B0D-85EB-F0563CE43A33}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>MathNet.Numerics.UnitTests</RootNamespace> |
|||
<AssemblyName>MathNet.Numerics.MSUnitTests</AssemblyName> |
|||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core"> |
|||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
|||
</Reference> |
|||
<Reference Include="System.Numerics" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> |
|||
<Visible>False</Visible> |
|||
</CodeAnalysisDependentAssemblyPaths> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="AssertHelpers.cs" /> |
|||
<Compile Include="LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs" /> |
|||
<Compile Include="LinearAlgebraProviderTests\Double\ManagedLinearAlgebraProviderTests.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Numerics\Numerics.csproj"> |
|||
<Project>{B7CAE5F4-A23F-4438-B5BE-41226618B695}</Project> |
|||
<Name>Numerics</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -0,0 +1,35 @@ |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
// General Information about an assembly is controlled through the following
|
|||
// set of attributes. Change these attribute values to modify the information
|
|||
// associated with an assembly.
|
|||
[assembly: AssemblyTitle("MSUnitTests")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("Microsoft")] |
|||
[assembly: AssemblyProduct("MSUnitTests")] |
|||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("38b7aca0-5350-4ed4-9637-ae52b0107e48")] |
|||
|
|||
// Version information for an assembly consists of the following four values:
|
|||
//
|
|||
// Major Version
|
|||
// Minor Version
|
|||
// Build Number
|
|||
// Revision
|
|||
//
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
|||
// by using the '*' as shown below:
|
|||
[assembly: AssemblyVersion("1.0.0.0")] |
|||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> |
|||
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6"> |
|||
<RunConfiguration id="0046459d-be0e-4d4c-8154-b85ef3eca170" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
|||
</TestList> |
|||
</TestLists> |
|||
@ -1,14 +0,0 @@ |
|||
namespace MathNet.Numerics.MklWrapperTests.LinearAlgebra.Double |
|||
{ |
|||
using MbUnit.Framework; |
|||
using UnitTests.LinearAlgebraTests.Double; |
|||
|
|||
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests |
|||
{ |
|||
[FixtureSetUp] |
|||
public void SetUpProvider() |
|||
{ |
|||
Provider = new Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\ATLAS\blas.h" /> |
|||
<ClInclude Include="..\..\Common\common.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ResourceCompile Include="..\..\Common\resource.rc" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\ATLAS\lapack.cpp" /> |
|||
<ClCompile Include="..\..\Common\blas.c" /> |
|||
<ClCompile Include="..\..\Common\WindowsDLL.cpp" /> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>{A848B8C9-E72A-4716-A8F1-04104CC2422F}</ProjectGuid> |
|||
<RootNamespace>ATLASWrapper</RootNamespace> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup> |
|||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>Disabled</Optimization> |
|||
<AdditionalIncludeDirectories>C:\source\mathnet-marcus\src\NativeWrappers\Common;C:\source\mathnet-marcus\src\NativeWrappers\ATLAS;C:\cygwin\tmp\ATLAS\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<MinimalRebuild>true</MinimalRebuild> |
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>libcblas.a;libatlas.a;liblapack.a;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.ATLAS.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\cygwin\tmp\ATLAS\parallel\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<TargetMachine>MachineX86</TargetMachine> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<AdditionalIncludeDirectories>C:\source\mathnet-marcus\src\NativeWrappers\Common;C:\source\mathnet-marcus\src\NativeWrappers\ATLAS;C:\source\mathnet-marcus\src\NativeWrappers\ATLAS\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>libcblas.a;libatlas.a;liblapack.a;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.ATLAS.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\source\mathnet-marcus\src\NativeWrappers\ATLAS\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<TargetMachine>MachineX86</TargetMachine> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
|||
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="Source Files"> |
|||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> |
|||
</Filter> |
|||
<Filter Include="Header Files"> |
|||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
|||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> |
|||
</Filter> |
|||
<Filter Include="Resource Files"> |
|||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> |
|||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\ATLAS\blas.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\Common\common.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ResourceCompile Include="..\..\Common\resource.rc"> |
|||
<Filter>Resource Files</Filter> |
|||
</ResourceCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\Common\blas.c"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\Common\WindowsDLL.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\ATLAS\lapack.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,201 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}</ProjectGuid> |
|||
<RootNamespace>MKLWrapper</RootNamespace> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>DynamicLibrary</ConfigurationType> |
|||
<CharacterSet>MultiByte</CharacterSet> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup> |
|||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir> |
|||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> |
|||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>Disabled</Optimization> |
|||
<AdditionalIncludeDirectories>..\..\Common;..\..\MKL;C:\Program Files\Intel\MKL\10.2.6.037\include;</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<MinimalRebuild>true</MinimalRebuild> |
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>mkl_intel_c.lib;mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.MKL.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\Program Files\Intel\MKL\10.2.6.037\ia32\lib</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<TargetMachine>MachineX86</TargetMachine> |
|||
</Link> |
|||
<PostBuildEvent> |
|||
<Command>copy "C:\Program Files\Intel\MKL\10.2.6.037\ia32\bin\libiomp5md.dll" $(OutDir)</Command> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<Midl> |
|||
<TargetEnvironment>X64</TargetEnvironment> |
|||
</Midl> |
|||
<ClCompile> |
|||
<Optimization>Disabled</Optimization> |
|||
<AdditionalIncludeDirectories>..\..\Common;..\..\MKL;C:\Program Files\Intel\MKL\10.2.6.037\include;</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<MinimalRebuild>true</MinimalRebuild> |
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>mkl_intel_lp64.lib;mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.MKL.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\Program Files\Intel\MKL\10.2.6.037\em64t\lib</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<TargetMachine>MachineX64</TargetMachine> |
|||
</Link> |
|||
<PostBuildEvent> |
|||
<Command>copy "C:\Program Files\Intel\MKL\10.2.6.037\em64t\bin\libiomp5md.dll" $(OutDir)</Command> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<AdditionalIncludeDirectories>..\..\Common;..\..\MKL;C:\Program Files\Intel\MKL\10.2.6.037\include;</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>mkl_intel_c.lib;mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.MKL.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\Program Files\Intel\MKL\10.2.6.037\ia32\lib</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<TargetMachine>MachineX86</TargetMachine> |
|||
</Link> |
|||
<PostBuildEvent> |
|||
<Command>copy "C:\Program Files\Intel\MKL\10.2.6.037\ia32\bin\libiomp5md.dll" $(OutDir)</Command> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<Midl> |
|||
<TargetEnvironment>X64</TargetEnvironment> |
|||
</Midl> |
|||
<ClCompile> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<AdditionalIncludeDirectories>..\..\Common;..\..\MKL;C:\Program Files\Intel\MKL\10.2.6.037\include;</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<WarningLevel>Level3</WarningLevel> |
|||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
|||
<CompileAs>Default</CompileAs> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalDependencies>mkl_intel_lp64.lib;mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;%(AdditionalDependencies)</AdditionalDependencies> |
|||
<OutputFile>$(OutDir)MathNET.Numerics.MKL.dll</OutputFile> |
|||
<AdditionalLibraryDirectories>C:\Program Files\Intel\MKL\10.2.6.037\em64t\lib</AdditionalLibraryDirectories> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<TargetMachine>MachineX64</TargetMachine> |
|||
</Link> |
|||
<PostBuildEvent> |
|||
<Command>copy "C:\Program Files\Intel\MKL\10.2.6.037\em64t\bin\libiomp5md.dll" $(OutDir)</Command> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\Common\common.h" /> |
|||
<ClInclude Include="..\..\MKL\blas.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ResourceCompile Include="..\..\Common\resource.rc" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\Common\blas.c" /> |
|||
<ClCompile Include="..\..\Common\WindowsDLL.cpp" /> |
|||
<ClCompile Include="..\..\MKL\lapack.cpp" /> |
|||
<ClCompile Include="..\..\MKL\vector_functions.c" /> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
|||
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="Source Files"> |
|||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> |
|||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> |
|||
</Filter> |
|||
<Filter Include="Header Files"> |
|||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> |
|||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> |
|||
</Filter> |
|||
<Filter Include="Resource Files"> |
|||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> |
|||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\Common\common.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\MKL\blas.h"> |
|||
<Filter>Header Files</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ResourceCompile Include="..\..\Common\resource.rc"> |
|||
<Filter>Resource Files</Filter> |
|||
</ResourceCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\Common\blas.c"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\Common\WindowsDLL.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\MKL\lapack.cpp"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\MKL\vector_functions.c"> |
|||
<Filter>Source Files</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<TestSettings name="Trace and Test Impact" id="5b7586ca-82ed-4988-8010-b5c2efbec5e8" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"> |
|||
<Description>These are test settings for Trace and Test Impact.</Description> |
|||
<Execution> |
|||
<TestTypeSpecific /> |
|||
<AgentRule name="Execution Agents"> |
|||
<DataCollectors> |
|||
<DataCollector uri="datacollector://microsoft/SystemInfo/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo.SystemInfoDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="System Information"> |
|||
</DataCollector> |
|||
<DataCollector uri="datacollector://microsoft/ActionLog/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.ManualTest.ActionLog.ActionLogPlugin, Microsoft.VisualStudio.TestTools.ManualTest.ActionLog, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Actions"> |
|||
</DataCollector> |
|||
<DataCollector uri="datacollector://microsoft/HttpProxy/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.HttpProxyCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Client Proxy for IntelliTrace and Test Impact"> |
|||
</DataCollector> |
|||
<DataCollector uri="datacollector://microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Test Impact"> |
|||
</DataCollector> |
|||
<DataCollector uri="datacollector://microsoft/TraceDebugger/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="IntelliTrace"> |
|||
</DataCollector> |
|||
</DataCollectors> |
|||
</AgentRule> |
|||
</Execution> |
|||
</TestSettings> |
|||
@ -1,367 +0,0 @@ |
|||
// <copyright file="LinearAlgebraProviderTests.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.UnitTests.LinearAlgebraTests.Double |
|||
{ |
|||
using System; |
|||
using Algorithms.LinearAlgebra; |
|||
using LinearAlgebra.Double; |
|||
using LinearAlgebra.Generic; |
|||
using MbUnit.Framework; |
|||
|
|||
[TestFixture] |
|||
public abstract class LinearAlgebraProviderTests : MatrixLoader |
|||
{ |
|||
protected ILinearAlgebraProvider<double> Provider{ get; set;} |
|||
|
|||
private double[] y = new [] { 1.1, 2.2, 3.3, 4.4, 5.5 }; |
|||
private double[] x = new[] { 6.6, 7.7, 8.8, 9.9, 10.1 }; |
|||
|
|||
[Test, MultipleAsserts] |
|||
public void CanAddVectorToScaledVector() |
|||
{ |
|||
var result = new double[y.Length]; |
|||
Array.Copy(y, result, y.Length); |
|||
|
|||
Provider.AddVectorToScaledVector(result, 0, x); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.AddVectorToScaledVector(result, 1, x); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] + x[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.AddVectorToScaledVector(result, Math.PI, x); |
|||
for( var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] + Math.PI * x[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
public void CanScaleArray() |
|||
{ |
|||
var result = new double[y.Length]; |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.ScaleArray(1, result); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.ScaleArray(Math.PI, result); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] * Math.PI, result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanComputeDotProduct() |
|||
{ |
|||
var result = Provider.DotProduct(x, y); |
|||
AssertHelpers.AlmostEqual(152.35, result, 15); |
|||
} |
|||
|
|||
[Test] |
|||
public void CanAddArrays() |
|||
{ |
|||
var result = new double[y.Length]; |
|||
Provider.AddArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] + y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanSubtractArrays() |
|||
{ |
|||
var result = new double[y.Length]; |
|||
Provider.SubtractArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] - y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanPointWiseMultiplyArrays() |
|||
{ |
|||
var result = new double[y.Length]; |
|||
Provider.PointWiseMultiplyArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] * y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeMatrixNorm(Norm norm, double[] matrix){} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeMatrixNorm(Norm norm, double[] matrix, double[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
[Row("Singular3x3", "Square3x3")] |
|||
[Row("Singular4x4", "Square4x4")] |
|||
[Row("Wide2x3", "Square3x3")] |
|||
[Row("Wide2x3", "Tall3x2")] |
|||
[Row("Tall3x2", "Wide2x3")] |
|||
public void CanMatrixMultiply(string nameX, string nameY) |
|||
{ |
|||
var x = (DenseMatrix)TestMatrices[nameX]; |
|||
var y = (DenseMatrix)TestMatrices[nameY]; |
|||
var c = (DenseMatrix)CreateMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiply(x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(x.Row(i) * y.Column(j), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
[Row("Singular3x3", "Square3x3")] |
|||
[Row("Singular4x4", "Square4x4")] |
|||
[Row("Wide2x3", "Square3x3")] |
|||
[Row("Wide2x3", "Tall3x2")] |
|||
[Row("Tall3x2", "Wide2x3")] |
|||
public void CanMatrixMultiplyWithUpdate(string nameX, string nameY) |
|||
{ |
|||
var x = (DenseMatrix)TestMatrices[nameX]; |
|||
var y = (DenseMatrix)TestMatrices[nameY]; |
|||
var c = (DenseMatrix)CreateMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.0, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(2 * (x.Row(i) * y.Column(j)), c[i, j], 15); |
|||
} |
|||
} |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.0, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(4 * (x.Row(i) * y.Column(j)), c[i, j], 15); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[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] |
|||
public void CanComputeCholeskyFactor() |
|||
{ |
|||
var matrix = new double[] { 1, 1, 1, 1, 1, 5, 5, 5, 1, 5, 14, 14, 1, 5, 14, 15 }; |
|||
Provider.CholeskyFactor(matrix, 4); |
|||
Assert.AreEqual(matrix[0], 1); |
|||
Assert.AreEqual(matrix[1], 1); |
|||
Assert.AreEqual(matrix[2], 1); |
|||
Assert.AreEqual(matrix[3], 1); |
|||
Assert.AreEqual(matrix[4], 0); |
|||
Assert.AreEqual(matrix[5], 2); |
|||
Assert.AreEqual(matrix[6], 2); |
|||
Assert.AreEqual(matrix[7], 2); |
|||
Assert.AreEqual(matrix[8], 0); |
|||
Assert.AreEqual(matrix[9], 0); |
|||
Assert.AreEqual(matrix[10], 3); |
|||
Assert.AreEqual(matrix[11], 3); |
|||
Assert.AreEqual(matrix[12], 0); |
|||
Assert.AreEqual(matrix[13], 0); |
|||
Assert.AreEqual(matrix[14], 0); |
|||
Assert.AreEqual(matrix[15], 1); |
|||
} |
|||
|
|||
[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) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override Matrix<double> CreateMatrix(int rows, int columns) |
|||
{ |
|||
return new DenseMatrix(rows, columns); |
|||
} |
|||
|
|||
protected override Matrix<double> CreateMatrix(double[,] data) |
|||
{ |
|||
return new DenseMatrix(data); |
|||
} |
|||
|
|||
protected override Vector<double> CreateVector(int size) |
|||
{ |
|||
return new DenseVector(size); |
|||
} |
|||
|
|||
protected override Vector<double> CreateVector(double[] data) |
|||
{ |
|||
return new DenseVector(data); |
|||
} |
|||
} |
|||
} |
|||
@ -1,367 +0,0 @@ |
|||
// <copyright file="LinearAlgebraProviderTests.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.UnitTests.LinearAlgebraTests.Single |
|||
{ |
|||
using System; |
|||
using Algorithms.LinearAlgebra; |
|||
using LinearAlgebra.Single; |
|||
using LinearAlgebra.Generic; |
|||
using MbUnit.Framework; |
|||
|
|||
[TestFixture] |
|||
public abstract class LinearAlgebraProviderTests : MatrixLoader |
|||
{ |
|||
protected ILinearAlgebraProvider<float> Provider{ get; set;} |
|||
|
|||
private float[] y = new [] { 1.1f, 2.2f, 3.3f, 4.4f, 5.5f }; |
|||
private float[] x = new[] { 6.6f, 7.7f, 8.8f, 9.9f, 10.1f }; |
|||
|
|||
[Test, MultipleAsserts] |
|||
public void CanAddVectorToScaledVector() |
|||
{ |
|||
var result = new float[y.Length]; |
|||
Array.Copy(y, result, y.Length); |
|||
|
|||
Provider.AddVectorToScaledVector(result, 0, x); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.AddVectorToScaledVector(result, 1, x); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] + x[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.AddVectorToScaledVector(result, (float)Math.PI, x); |
|||
for( var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] + (float)Math.PI * x[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
public void CanScaleArray() |
|||
{ |
|||
var result = new float[y.Length]; |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.ScaleArray(1, result); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i], result[i]); |
|||
} |
|||
|
|||
Array.Copy(y, result, y.Length); |
|||
Provider.ScaleArray((float)Math.PI, result); |
|||
for (var i = 0; i < y.Length; i++) |
|||
{ |
|||
Assert.AreEqual(y[i] * (float)Math.PI, result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanComputeDotProduct() |
|||
{ |
|||
var result = Provider.DotProduct(x, y); |
|||
AssertHelpers.AlmostEqual(152.35f, result, 15); |
|||
} |
|||
|
|||
[Test] |
|||
public void CanAddArrays() |
|||
{ |
|||
var result = new float[y.Length]; |
|||
Provider.AddArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] + y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanSubtractArrays() |
|||
{ |
|||
var result = new float[y.Length]; |
|||
Provider.SubtractArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] - y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test] |
|||
public void CanPointWiseMultiplyArrays() |
|||
{ |
|||
var result = new float[y.Length]; |
|||
Provider.PointWiseMultiplyArrays(x, y, result); |
|||
for (var i = 0; i < result.Length; i++) |
|||
{ |
|||
Assert.AreEqual(x[i] * y[i], result[i]); |
|||
} |
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeMatrixNorm(Norm norm, float[] matrix){} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeMatrixNorm(Norm norm, float[] matrix, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
[Row("Singular3x3", "Square3x3")] |
|||
[Row("Singular4x4", "Square4x4")] |
|||
[Row("Wide2x3", "Square3x3")] |
|||
[Row("Wide2x3", "Tall3x2")] |
|||
[Row("Tall3x2", "Wide2x3")] |
|||
public void CanMatrixMultiply(string nameX, string nameY) |
|||
{ |
|||
var x = (DenseMatrix)TestMatrices[nameX]; |
|||
var y = (DenseMatrix)TestMatrices[nameY]; |
|||
var c = (DenseMatrix)CreateMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiply(x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(x.Row(i) * y.Column(j), c[i, j], 7); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[Test, MultipleAsserts] |
|||
[Row("Singular3x3", "Square3x3")] |
|||
[Row("Singular4x4", "Square4x4")] |
|||
[Row("Wide2x3", "Square3x3")] |
|||
[Row("Wide2x3", "Tall3x2")] |
|||
[Row("Tall3x2", "Wide2x3")] |
|||
public void CanMatrixMultiplyWithUpdate(string nameX, string nameY) |
|||
{ |
|||
var x = (DenseMatrix)TestMatrices[nameX]; |
|||
var y = (DenseMatrix)TestMatrices[nameY]; |
|||
var c = (DenseMatrix)CreateMatrix(x.RowCount, y.ColumnCount); |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.0f, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0f, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(2.0f * (x.Row(i) * y.Column(j)), c[i, j], 7); |
|||
} |
|||
} |
|||
|
|||
Provider.MatrixMultiplyWithUpdate(Transpose.DontTranspose, Transpose.DontTranspose, 2.0f, x.Data, x.RowCount, x.ColumnCount, y.Data, y.RowCount, y.ColumnCount, 1.0f, c.Data); |
|||
|
|||
for (int i = 0; i < c.RowCount; i++) |
|||
{ |
|||
for (int j = 0; j < c.ColumnCount; j++) |
|||
{ |
|||
AssertHelpers.AlmostEqual(4.0f * (x.Row(i) * y.Column(j)), c[i, j], 7); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUFactor(float[] a, int[] ipiv) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUInverse(float[] a) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public void CanComputeLUInverseFactored(float[] a, int[] ipiv) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUInverse(float[] a, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUInverseFactored(float[] a, int[] ipiv, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUSolve(int columnsOfB, float[] a, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUSolveFactored(int columnsOfB, float[] a, int ipiv, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUSolve(Transpose transposeA, int columnsOfB, float[] a, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeLUSolveFactored(Transpose transposeA, int columnsOfB, float[] a, int ipiv, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test] |
|||
public void CanComputeCholeskyFactor() |
|||
{ |
|||
var matrix = new float[] { 1, 1, 1, 1, 1, 5, 5, 5, 1, 5, 14, 14, 1, 5, 14, 15 }; |
|||
Provider.CholeskyFactor(matrix, 4); |
|||
Assert.AreEqual(matrix[0], 1); |
|||
Assert.AreEqual(matrix[1], 1); |
|||
Assert.AreEqual(matrix[2], 1); |
|||
Assert.AreEqual(matrix[3], 1); |
|||
Assert.AreEqual(matrix[4], 0); |
|||
Assert.AreEqual(matrix[5], 2); |
|||
Assert.AreEqual(matrix[6], 2); |
|||
Assert.AreEqual(matrix[7], 2); |
|||
Assert.AreEqual(matrix[8], 0); |
|||
Assert.AreEqual(matrix[9], 0); |
|||
Assert.AreEqual(matrix[10], 3); |
|||
Assert.AreEqual(matrix[11], 3); |
|||
Assert.AreEqual(matrix[12], 0); |
|||
Assert.AreEqual(matrix[13], 0); |
|||
Assert.AreEqual(matrix[14], 0); |
|||
Assert.AreEqual(matrix[15], 1); |
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeCholeskySolve(int columnsOfB, float[] a, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeCholeskySolveFactored(int columnsOfB, float[] a, float[] b) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeQRFactor(float[] r, float[] q) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeQRFactor(float[] r, float[] q, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeQRSolve(int columnsOfB, float[] r, float[] q, float[] b, float[] x) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeQRSolve(int columnsOfB, float[] r, float[] q, float[] b, float[] x, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeQRSolveFactored(int columnsOfB, float[] q, float[] r, float[] b, float[] x) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeSinguarValueDecomposition(bool computeVectors, float[] a, float[] s, float[] u, float[] vt) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeSingularValueDecomposition(bool computeVectors, float[] a, float[] s, float[] u, float[] vt, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeSvdSolve(float[] a, float[] s, float[] u, float[] vt, float[] b, float[] x) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeSvdSolve(float[] a, float[] s, float[] u, float[] vt, float[] b, float[] x, float[] work) |
|||
{ |
|||
|
|||
} |
|||
|
|||
[Test, Ignore] |
|||
public void CanComputeSvdSolveFactored(int columnsOfB, float[] s, float[] u, float[] vt, float[] b, float[] x) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override Matrix<float> CreateMatrix(int rows, int columns) |
|||
{ |
|||
return new DenseMatrix(rows, columns); |
|||
} |
|||
|
|||
protected override Matrix<float> CreateMatrix(float[,] data) |
|||
{ |
|||
return new DenseMatrix(data); |
|||
} |
|||
|
|||
protected override Vector<float> CreateVector(int size) |
|||
{ |
|||
return new DenseVector(size); |
|||
} |
|||
|
|||
protected override Vector<float> CreateVector(float[] data) |
|||
{ |
|||
return new DenseVector(data); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue