Browse Source

Merge pull request #65 from cuda/nativefix

some cleanup and fixes for the native code
v2
Christoph Ruegg 14 years ago
parent
commit
7e420d62c2
  1. 98
      src/NativeWrappers/ACML/blas.c
  2. 927
      src/NativeWrappers/ACML/lapack.cpp
  3. 124
      src/NativeWrappers/GotoBlas2/blas.c
  4. 283
      src/NativeWrappers/GotoBlas2/cblas.h
  5. 5434
      src/NativeWrappers/GotoBlas2/clapack.h
  6. 224
      src/NativeWrappers/GotoBlas2/f2c.h
  7. 954
      src/NativeWrappers/GotoBlas2/lapack.cpp
  8. 27
      src/NativeWrappers/GotoBlas2/lapack.h
  9. 1238
      src/NativeWrappers/MKL/lapack.cpp
  10. 180
      src/NativeWrappers/Windows/ACML/ACMLWrapper.vcproj
  11. 165
      src/NativeWrappers/Windows/ACML/ACMLWrapper.vcxproj
  12. 102
      src/NativeWrappers/Windows/ACMLWrapperTests/ACMLWrapperTests.csproj
  13. 51
      src/NativeWrappers/Windows/ACMLWrapperTests/Complex/AcmlLinearAlgebraProviderTests.cs
  14. 51
      src/NativeWrappers/Windows/ACMLWrapperTests/Complex32/AcmlLinearAlgebraProviderTests.cs
  15. 51
      src/NativeWrappers/Windows/ACMLWrapperTests/Double/AcmlLinearAlgebraProviderTests.cs
  16. 36
      src/NativeWrappers/Windows/ACMLWrapperTests/Properties/AssemblyInfo.cs
  17. 51
      src/NativeWrappers/Windows/ACMLWrapperTests/Single/AcmlLinearAlgebraProviderTests.cs
  18. 170
      src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj
  19. 47
      src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj.filters
  20. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs
  21. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs
  22. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs
  23. 124
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj
  24. 36
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs
  25. 51
      src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs
  26. 8
      src/NativeWrappers/Windows/MKL/MKLWrapper.vcxproj
  27. 51
      src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Complex/MklLinearAlgebraProviderTests.cs
  28. 51
      src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Complex32/MklLinearAlgebraProviderTests.cs
  29. 51
      src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Double/MklLinearAlgebraProviderTests.cs
  30. 51
      src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Single/MklLinearAlgebraProviderTests.cs
  31. 462
      src/NativeWrappers/Windows/MKLWrapperTests/MKLWrapperTests.csproj
  32. 36
      src/NativeWrappers/Windows/MKLWrapperTests/Properties/AssemblyInfo.cs
  33. 61
      src/NativeWrappers/Windows/NativeWrappers.sln
  34. 3
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Common.cs
  35. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs
  36. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs
  37. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.double.cs
  38. 9
      src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.float.cs
  39. 12
      src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs
  40. 5
      src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs
  41. 1
      src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs
  42. 5
      src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs
  43. 1
      src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs
  44. 5
      src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs
  45. 1
      src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs
  46. 10
      src/Numerics/LinearAlgebra/Generic/Factorization/QR.cs
  47. 5
      src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs
  48. 1
      src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs
  49. 12
      src/UnitTests/LinearAlgebraProviderTests/Complex/LinearAlgebraProviderTests.cs
  50. 9
      src/UnitTests/LinearAlgebraProviderTests/Complex32/LinearAlgebraProviderTests.cs
  51. 2711
      src/UnitTests/LinearAlgebraProviderTests/Double/LinearAlgebraProviderTests.cs
  52. 11
      src/UnitTests/LinearAlgebraProviderTests/Single/LinearAlgebraProviderTests.cs
  53. 14
      src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs
  54. 37
      src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs
  55. 8
      src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs
  56. 13
      src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs
  57. 202
      src/UnitTests/LinearAlgebraTests/Complex32/Factorization/QRTests.cs
  58. 1
      src/UnitTests/LinearAlgebraTests/Complex32/MatrixTests.cs
  59. 17
      src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs
  60. 235
      src/UnitTests/LinearAlgebraTests/Double/Factorization/QRTests.cs
  61. 14
      src/UnitTests/LinearAlgebraTests/Double/MatrixTests.cs
  62. 18
      src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs
  63. 223
      src/UnitTests/LinearAlgebraTests/Single/Factorization/QRTests.cs
  64. 97
      src/UnitTests/MatrixHelpers.cs
  65. 3
      src/UnitTests/Properties/AssemblyInfo.cs
  66. 1
      src/UnitTests/UnitTests.csproj
  67. 12
      src/UnitTests/UseLinearAlgebraProvider.cs

98
src/NativeWrappers/ACML/blas.c

@ -1,98 +0,0 @@
#include "acml.h"
#include "wrapper_common.h"
enum TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114};
char getTransChar(TRANSPOSE);
DLLEXPORT void s_axpy(const int n, const float alpha, float x[], float y[]){
saxpy(n, alpha, x, 1, y, 1);
}
DLLEXPORT void d_axpy(const int n, const double alpha, double x[], double y[]){
daxpy(n, alpha, x, 1, y, 1);
}
DLLEXPORT void c_axpy(const int n, complex alpha, complex x[], complex y[]){
caxpy(n, &alpha, x, 1, y, 1);
}
DLLEXPORT void z_axpy(const int n, doublecomplex alpha, doublecomplex x[], doublecomplex y[]){
zaxpy(n, &alpha, x, 1, y, 1);
}
DLLEXPORT void s_scale(const int n, const float alpha, float x[]){
sscal(n, alpha, x, 1);
}
DLLEXPORT void d_scale(const int n, const double alpha, double x[]){
dscal(n, alpha, x, 1);
}
DLLEXPORT void c_scale(const int n, complex alpha, complex x[]){
cscal(n, &alpha, x, 1);
}
DLLEXPORT void z_scale(const int n, doublecomplex alpha, doublecomplex x[]){
zscal(n, &alpha, x, 1);
}
DLLEXPORT float s_dot_product(const int n, float x[], float y[]){
return sdot(n, x, 1, y, 1);
}
DLLEXPORT double d_dot_product(const int n, double x[], double y[]){
return ddot(n, x, 1, y, 1);
}
DLLEXPORT complex c_dot_product(const int n, complex x[], complex y[]){
return cdotu(n, x, 1, y, 1);
}
DLLEXPORT doublecomplex z_dot_product(int n, doublecomplex x[], doublecomplex y[]){
return zdotu(n, x, 1, y, 1);
}
DLLEXPORT void s_matrix_multiply(const enum TRANSPOSE transA, const enum TRANSPOSE transB, const int m, const int n, const int k, float alpha, float x[], float y[], float beta, float c[]){
int lda = transA == CblasNoTrans ? m : k;
int ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
sgemm(transAchar, transBchar, m, n, k, alpha, x, lda, y, ldb, beta, c, m);
}
DLLEXPORT void d_matrix_multiply(const enum TRANSPOSE transA, const enum TRANSPOSE transB, const int m, const int n, const int k, double alpha, double x[], double y[], double beta, double c[]){
int lda = transA == CblasNoTrans ? m : k;
int ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
dgemm(transAchar, transBchar, m, n, k, alpha, x, lda, y, ldb, beta, c, m);
}
DLLEXPORT void c_matrix_multiply(const enum TRANSPOSE transA, const enum TRANSPOSE transB, const int m, const int n, const int k, complex alpha, complex x[], complex y[], complex beta, complex c[]){
int lda = transA == CblasNoTrans ? m : k;
int ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
cgemm(transAchar, transBchar, m, n, k, &alpha, x, lda, y, ldb, &beta, c, m);
}
DLLEXPORT void z_matrix_multiply(const enum TRANSPOSE transA, const enum TRANSPOSE transB, const int m, const int n, const int k, doublecomplex alpha, doublecomplex x[], doublecomplex y[], doublecomplex beta, doublecomplex c[]){
int lda = transA == CblasNoTrans ? m : k;
int ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
zgemm(transAchar, transBchar, m, n, k, &alpha, x, lda, y, ldb, &beta, c, m);
}
char getTransChar(enum TRANSPOSE trans){
char cTrans;
switch( trans ){
case CblasNoTrans : cTrans = 'N';
break;
case CblasTrans : cTrans = 'T';
break;
case CblasConjTrans : cTrans = 'C';
break;
}
return cTrans;
}

927
src/NativeWrappers/ACML/lapack.cpp

@ -1,927 +0,0 @@
#include "acml.h"
#include "wrapper_common.h"
#include <algorithm>
extern "C"{
DLLEXPORT int s_lu_factor(int m, float a[], int ipiv[])
{
int info = 0;
sgetrf(m, m, a, m,ipiv,&info);
for(int i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int d_lu_factor(int m, double a[], int ipiv[])
{
int info = 0;
dgetrf(m, m,a, m, ipiv, &info);
for(int i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int c_lu_factor(int m, complex a[], int ipiv[])
{
int info = 0;
cgetrf(m, m, a, m,ipiv, &info);
for(int i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int z_lu_factor(int m, doublecomplex a[], int ipiv[])
{
int info = 0;
zgetrf(m, m, a, m, ipiv, &info);
for(int i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int s_lu_inverse(int n, float a[], float work[], int lwork)
{
int* ipiv = new int[n];
int info = 0;
sgetrf(n, n, a, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
return info;
}
SGETRI(&n, a, &n, ipiv, work, &lwork, &info);
delete[] ipiv;
return info;
}
DLLEXPORT int d_lu_inverse(int n, double a[], double work[], int lwork)
{
int* ipiv = new int[n];
int info = 0;
dgetrf(n, n, a, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
return info;
}
DGETRI(&n, a, &n, ipiv, work, &lwork, &info);
delete[] ipiv;
return info;
}
DLLEXPORT int c_lu_inverse(int n, complex a[], complex work[], int lwork)
{
int* ipiv = new int[n];
int info = 0;
cgetrf(n, n, a, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
return info;
}
CGETRI(&n, a, &n, ipiv, work, &lwork, &info);
delete[] ipiv;
return info;
}
DLLEXPORT int z_lu_inverse(int n, doublecomplex a[], doublecomplex work[], int lwork)
{
int* ipiv = new int[n];
int info = 0;
zgetrf(n, n, a, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
return info;
}
ZGETRI(&n, a, &n, ipiv, work, &lwork, &info);
delete[] ipiv;
return info;
}
DLLEXPORT int s_lu_inverse_factored(int n, float a[], int ipiv[], float work[], int lwork)
{
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
int info = 0;
SGETRI(&n, a, &n, ipiv, work, &lwork, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int d_lu_inverse_factored(int n, double a[], int ipiv[], double work[], int lwork)
{
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
int info = 0;
DGETRI(&n, a, &n, ipiv, work, &lwork, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int c_lu_inverse_factored(int n, complex a[], int ipiv[], complex work[], int lwork)
{
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
int info = 0;
CGETRI(&n, a, &n, ipiv, work, &lwork, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int z_lu_inverse_factored(int n, doublecomplex a[], int ipiv[], doublecomplex work[], int lwork)
{
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
int info = 0;
ZGETRI(&n, a, &n, ipiv, work, &lwork, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int s_lu_solve_factored(int n, int nrhs, float a[], int ipiv[], float b[])
{
int info = 0;
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
sgetrs(trans, n, nrhs, a, n, ipiv, b, n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int d_lu_solve_factored(int n, int nrhs, double a[], int ipiv[], double b[])
{
int info = 0;
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
dgetrs(trans, n, nrhs, a, n, ipiv, b, n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int c_lu_solve_factored(int n, int nrhs, complex a[], int ipiv[], complex b[])
{
int info = 0;
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
cgetrs(trans, n, nrhs, a, n, ipiv, b, n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int z_lu_solve_factored(int n, int nrhs, doublecomplex a[], int ipiv[], doublecomplex b[])
{
int info = 0;
int i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
zgetrs(trans, n, nrhs, a, n, ipiv, b, n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT int s_lu_solve(int n, int nrhs, float a[], float b[])
{
float* clone = new float[n*n];
std::memcpy(clone, a, n*n*sizeof(float));
int* ipiv = new int[n];
int info = 0;
sgetrf(n, n, clone, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
sgetrs(trans, n, nrhs, clone, n, ipiv, b, n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT int d_lu_solve(int n, int nrhs, double a[], double b[])
{
double* clone = new double[n*n];
std::memcpy(clone, a, n*n*sizeof(double));
int* ipiv = new int[n];
int info = 0;
dgetrf(n, n, clone, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
dgetrs(trans, n, nrhs, clone, n, ipiv, b, n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT int c_lu_solve(int n, int nrhs, complex a[], complex b[])
{
complex* clone = new complex[n*n];
std::memcpy(clone, a, n*n*sizeof(complex));
int* ipiv = new int[n];
int info = 0;
cgetrf(n, n, clone, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
cgetrs(trans, n, nrhs, clone, n, ipiv, b, n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT int z_lu_solve(int n, int nrhs, doublecomplex a[], doublecomplex b[])
{
doublecomplex* clone = new doublecomplex[n*n];
std::memcpy(clone, a, n*n*sizeof(doublecomplex));
int* ipiv = new int[n];
int info = 0;
zgetrf(n, n, clone, n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
zgetrs(trans, n, nrhs, clone, n, ipiv, b, n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT int s_cholesky_factor(int n, float a[]){
char uplo = 'L';
int info = 0;
spotrf(uplo, n, a, n, &info);
for (int i = 0; i < n; ++i)
{
int index = i * n;
for (int j = 0; j < n && i > j; ++j)
{
a[index + j] = 0;
}
}
return info;
}
DLLEXPORT int d_cholesky_factor(int n, double* a){
char uplo = 'L';
int info = 0;
dpotrf(uplo, n, a, n, &info);
for (int i = 0; i < n; ++i)
{
int index = i * n;
for (int j = 0; j < n && i > j; ++j)
{
a[index + j] = 0;
}
}
return info;
}
DLLEXPORT int c_cholesky_factor(int n, complex a[]){
char uplo = 'L';
int info = 0;
complex zero = {0.0f, 0.0f};
cpotrf(uplo, n, a, n, &info);
for (int i = 0; i < n; ++i)
{
int index = i * n;
for (int j = 0; j < n && i > j; ++j)
{
a[index + j] = zero;
}
}
return info;
}
DLLEXPORT int z_cholesky_factor(int n, doublecomplex a[]){
char uplo = 'L';
int info = 0;
doublecomplex zero = {0.0, 0.0};
zpotrf(uplo, n, a, n, &info);
for (int i = 0; i < n; ++i)
{
int index = i * n;
for (int j = 0; j < n && i > j; ++j)
{
a[index + j] = zero;
}
}
return info;
}
DLLEXPORT int s_cholesky_solve(int n, int nrhs, float a[], float b[])
{
float* clone = new float[n*n];
std::memcpy(clone, a, n*n*sizeof(float));
char uplo = 'L';
int info = 0;
spotrf(uplo, n, clone, n, &info);
if (info != 0){
delete[] clone;
return info;
}
spotrs(uplo, n, nrhs, clone, n, b, n, &info);
delete[] clone;
return info;
}
DLLEXPORT int d_cholesky_solve(int n, int nrhs, double a[], double b[])
{
double* clone = new double[n*n];
std::memcpy(clone, a, n*n*sizeof(double));
char uplo = 'L';
int info = 0;
dpotrf(uplo, n, clone, n, &info);
if (info != 0){
delete[] clone;
return info;
}
dpotrs(uplo, n, nrhs, clone, n, b, n, &info);
delete[] clone;
return info;
}
DLLEXPORT int c_cholesky_solve(int n, int nrhs, complex a[], complex b[])
{
complex* clone = new complex[n*n];
std::memcpy(clone, a, n*n*sizeof(complex));
char uplo = 'L';
int info = 0;
cpotrf(uplo, n, clone, n, &info);
if (info != 0){
delete[] clone;
return info;
}
cpotrs(uplo, n, nrhs, clone, n, b, n, &info);
delete[] clone;
return info;
}
DLLEXPORT int z_cholesky_solve(int n, int nrhs, doublecomplex a[], doublecomplex b[])
{
doublecomplex* clone = new doublecomplex[n*n];
std::memcpy(clone, a, n*n*sizeof(doublecomplex));
char uplo = 'L';
int info = 0;
zpotrf(uplo, n, clone, n, &info);
if (info != 0){
delete[] clone;
return info;
}
zpotrs(uplo, n, nrhs, clone, n, b, n, &info);
delete[] clone;
return info;
}
DLLEXPORT int s_cholesky_solve_factored(int n, int nrhs, float a[], float b[])
{
char uplo = 'L';
int info = 0;
spotrs(uplo, n, nrhs, a, n, b, n, &info);
return info;
}
DLLEXPORT int d_cholesky_solve_factored(int n, int nrhs, double a[], double b[])
{
char uplo = 'L';
int info = 0;
dpotrs(uplo, n, nrhs, a, n, b, n, &info);
return info;
}
DLLEXPORT int c_cholesky_solve_factored(int n, int nrhs, complex a[], complex b[])
{
char uplo = 'L';
int info = 0;
cpotrs(uplo, n, nrhs, a, n, b, n, &info);
return info;
}
DLLEXPORT int z_cholesky_solve_factored(int n, int nrhs, doublecomplex a[], doublecomplex b[])
{
char uplo = 'L';
int info = 0;
zpotrs(uplo, n, nrhs, a, n, b, n, &info);
return info;
}
DLLEXPORT int s_qr_factor(int m, int n, float r[], float tau[], float q[], float work[], int len)
{
int info = 0;
SGEQRF(&m, &n, r, &m, tau, work, &len, &info);
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
SORGQR(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
SORGQR(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT int d_qr_factor(int m, int n, double r[], double tau[], double q[], double work[], int len)
{
int info = 0;
DGEQRF(&m, &n, r, &m, tau, work, &len, &info);
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
DORGQR(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
DORGQR(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT int c_qr_factor(int m, int n, complex r[], complex tau[], complex q[], complex work[], int len)
{
int info = 0;
CGEQRF(&m, &n, r, &m, tau, work, &len, &info);
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
CUNGQR(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
CUNGQR(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT int z_qr_factor(int m, int n, doublecomplex r[], doublecomplex tau[], doublecomplex q[], doublecomplex work[], int len)
{
int info = 0;
ZGEQRF(&m, &n, r, &m, tau, work, &len, &info);
for (int i = 0; i < m; ++i)
{
for (int j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
ZUNGQR(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
ZUNGQR(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT int s_qr_solve(int m, int n, int bn, float r[], float b[], float x[], float work[], int len)
{
int info = 0;
float* clone_r = new float[m*n];
std::memcpy(clone_r, r, m*n*sizeof(float));
float* tau = new float[std::max(1, std::min(m,n))];
SGEQRF(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
float* clone_b = new float[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(float));
char side ='L';
char tran = 'T';
char upper = 'U';
char not = 'N';
SORMQR(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
strsm(side, upper, not, not, n, bn, 1.0, clone_r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT int d_qr_solve(int m, int n, int bn, double r[], double b[], double x[], double work[], int len)
{
int info = 0;
double* clone_r = new double[m*n];
std::memcpy(clone_r, r, m*n*sizeof(double));
double* tau = new double[std::max(1, std::min(m,n))];
DGEQRF(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
double* clone_b = new double[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(double));
char side ='L';
char tran = 'T';
char upper = 'U';
char not = 'N';
DORMQR(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
dtrsm(side, upper, not, not, n, bn, 1.0, clone_r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
delete[] tau;
delete[] clone_r;
return info;
}
DLLEXPORT int c_qr_solve(int m, int n, int bn, complex r[], complex b[], complex x[], complex work[], int len)
{
int info = 0;
complex* clone_r = new complex[m*n];
std::memcpy(clone_r, r, m*n*sizeof(complex));
complex* tau = new complex[std::min(m,n)];
CGEQRF(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
char side ='L';
char tran = 'C';
char upper = 'U';
char not = 'N';
complex* clone_b = new complex[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(complex));
CUNMQR(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
complex one = {1.0, 0.0};
ctrsm(side, upper, not, not, n, bn, &one, clone_r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT int z_qr_solve(int m, int n, int bn, doublecomplex r[], doublecomplex b[], doublecomplex x[], doublecomplex work[], int len)
{
int info = 0;
doublecomplex* clone_r = new doublecomplex[m*n];
std::memcpy(clone_r, r, m*n*sizeof(doublecomplex));
doublecomplex* tau = new doublecomplex[std::min(m,n)];
ZGEQRF(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
char side ='L';
char tran = 'C';
char upper = 'U';
char not = 'N';
doublecomplex* clone_b = new doublecomplex[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(doublecomplex));
ZUNMQR(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
doublecomplex one = {1.0, 0.0};
ztrsm(side, upper, not, not, n, bn, &one, clone_r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT int s_qr_solve_factored(int m, int n, int bn, float r[], float b[], float tau[], float x[], float work[], int len)
{
char side ='L';
char tran = 'T';
char upper = 'U';
char not = 'N';
int info = 0;
float* clone_b = new float[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(float));
SORMQR(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
strsm(side, upper, not, not, n, bn, 1.0, r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT int d_qr_solve_factored(int m, int n, int bn, double r[], double b[], double tau[], double x[], double work[], int len)
{
char side ='L';
char tran = 'T';
char upper = 'U';
char not = 'N';
int info = 0;
double* clone_b = new double[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(double));
DORMQR(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
dtrsm(side, upper, not, not, n, bn, 1.0, r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT int c_qr_solve_factored(int m, int n, int bn, complex r[], complex b[], complex tau[], complex x[], complex work[], int len)
{
char side ='L';
char tran = 'C';
char upper = 'U';
char not = 'N';
int info = 0;
complex* clone_b = new complex[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(complex));
CUNMQR(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
complex one = {1.0f, 0.0f};
ctrsm(side, upper, not, not, n, bn, &one, r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT int z_qr_solve_factored(int m, int n, int bn, doublecomplex r[], doublecomplex b[], doublecomplex tau[], doublecomplex x[], doublecomplex work[], int len)
{
char side ='L';
char tran = 'C';
char upper = 'U';
char not = 'N';
int info = 0;
doublecomplex* clone_b = new doublecomplex[m*bn];
std::memcpy(clone_b, b, m*bn*sizeof(doublecomplex));
ZUNMQR(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info, 1, 1);
doublecomplex one = {1.0, 0.0};
ztrsm(side, upper, not, not, n, bn, &one, r, m, clone_b, m);
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT int s_svd_factor(bool compute_vectors, int m, int n, float a[], float s[], float u[], float v[], float work[], int len)
{
int info = 0;
char job = compute_vectors ? 'A' : 'N';
SGESVD(&job, &job, &m, &n, a, &m, s, u, &m, v, &n, work, &len, &info, 1, 1);
return info;
}
DLLEXPORT int d_svd_factor(bool compute_vectors, int m, int n, double a[], double s[], double u[], double v[], double work[], int len)
{
int info = 0;
char job = compute_vectors ? 'A' : 'N';
DGESVD(&job, &job, &m, &n, a, &m, s, u, &m, v, &n, work, &len, &info, 1, 1);
return info;
}
DLLEXPORT int c_svd_factor(bool compute_vectors, int m, int n, complex a[], complex s[], complex u[], complex v[], complex work[], int len)
{
int info = 0;
int dim_s = std::min(m,n);
float* rwork = new float[5 * dim_s];
float* s_local = new float[dim_s];
char job = compute_vectors ? 'A' : 'N';
CGESVD(&job, &job, &m, &n, a, &m, s_local, u, &m, v, &n, work, &len, rwork, &info, 1 ,1);
for(int index = 0; index < dim_s; ++index){
complex value = {s_local[index], 0.0f};
s[index] = value;
}
delete[] rwork;
delete[] s_local;
return info;
}
DLLEXPORT int z_svd_factor(bool compute_vectors, int m, int n, doublecomplex a[], doublecomplex s[], doublecomplex u[], doublecomplex v[], doublecomplex work[], int len)
{
int info = 0;
int dim_s = std::min(m,n);
double* rwork = new double[5 * std::min(m, n)];
double* s_local = new double[dim_s];
char job = compute_vectors ? 'A' : 'N';
ZGESVD(&job, &job, &m, &n, a, &m, s_local, u, &m, v, &n, work, &len, rwork, &info, 1, 1);
for(int index = 0; index < dim_s; ++index){
doublecomplex value = {s_local[index], 0.0f};
s[index] = value;
}
delete[] rwork;
delete[] s_local;
return info;
}
}

124
src/NativeWrappers/GotoBlas2/blas.c

@ -1,124 +0,0 @@
#include "wrapper_common.h"
#include "f2c.h"
enum TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114};
void SAXPY(integer*, float*, float *x, integer* incx, float *y, integer* incy);
void DAXPY(integer*, double*, double *x, integer* incx, double *y, integer* incy);
void CAXPY(integer*, complex*, complex *x, integer* incx, complex *y, integer* incy);
void ZAXPY(integer*, doublecomplex*, doublecomplex *x, integer* incx, doublecomplex *y, integer* incy);
void SSCAL(integer*, float* alpha, float*, integer*);
void DSCAL(integer*, double* alpha, double*, integer*);
void CSCAL(integer*, complex* alpha, complex*, integer*);
void ZSCAL(integer*, doublecomplex* alpha, doublecomplex*, integer*);
float SDOT(integer*, float*, integer*, float*, integer*);
double DDOT(integer*, double*, integer*, double*, integer*);
complex CDOTU(integer*, complex*, integer*, complex*, integer*);
doublecomplex ZDOTU(integer*, doublecomplex*, integer*, doublecomplex*, integer*);
void SGEMM(char*, char*, integer*, integer*, integer*, float*, float*, integer*, float*, integer*, float*, float*, integer*);
void DGEMM(char*, char*, integer*, integer*, integer*, double*, double*, integer*, double*, integer*, double*, double*, integer*);
void CGEMM(char*, char*, integer*, integer*, integer*, complex*, complex*, integer*, complex*, integer*, complex*, complex*, integer*);
void ZGEMM(char*, char*, integer*, integer*, integer*, doublecomplex*, doublecomplex*, integer*, doublecomplex*, integer*, doublecomplex*, doublecomplex*, integer*);
char getTransChar(TRANSPOSE);
integer one = 1;
DLLEXPORT void s_axpy(integer n, float alpha, float x[], float y[]){
SAXPY(&n, &alpha, x, &one, y, &one);
}
DLLEXPORT void d_axpy(integer n, double alpha, double x[], double y[]){
DAXPY(&n, &alpha, x, &one, y, &one);
}
DLLEXPORT void c_axpy(integer n, complex alpha, complex x[], complex y[]){
CAXPY(&n, &alpha, x, &one, y, &one);
}
DLLEXPORT void z_axpy(integer n, doublecomplex alpha, doublecomplex x[], doublecomplex y[]){
ZAXPY(&n, &alpha, x, &one, y, &one);
}
DLLEXPORT void s_scale(integer n, float alpha, float x[]){
SSCAL(&n, &alpha, x, &one);
}
DLLEXPORT void d_scale(integer n, double alpha, double x[]){
DSCAL(&n, &alpha, x, &one);
}
DLLEXPORT void c_scale(integer n, complex alpha, complex x[]){
CSCAL(&n, &alpha, x, &one);
}
DLLEXPORT void z_scale(integer n, doublecomplex alpha, doublecomplex x[]){
ZSCAL(&n, &alpha, x, &one);
}
DLLEXPORT float s_dot_product(integer n, float x[], float y[]){
return SDOT(&n, x, &one, y, &one);
}
DLLEXPORT double d_dot_product(integer n, double x[], double y[]){
return DDOT(&n, x, &one, y, &one);
}
DLLEXPORT complex c_dot_product(integer n, complex x[], complex y[]){
return CDOTU(&n, x, &one, y, &one);
}
DLLEXPORT doublecomplex z_dot_product(integer n, doublecomplex x[], doublecomplex y[]){
return ZDOTU(&n, x, &one, y, &one);
}
DLLEXPORT void s_matrix_multiply(enum TRANSPOSE transA, enum TRANSPOSE transB, integer m, integer n, integer k, float alpha, float x[], float y[], float beta, float c[]){
integer lda = transA == CblasNoTrans ? m : k;
integer ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
SGEMM(&transAchar, &transBchar, &m, &n, &k, &alpha, x, &lda, y, &ldb, &beta, c, &m);
}
DLLEXPORT void d_matrix_multiply(enum TRANSPOSE transA, enum TRANSPOSE transB, integer m, integer n, integer k, double alpha, double x[], double y[], double beta, double c[]){
integer lda = transA == CblasNoTrans ? m : k;
integer ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
DGEMM(&transAchar, &transBchar, &m, &n, &k, &alpha, x, &lda, y, &ldb, &beta, c, &m);
}
DLLEXPORT void c_matrix_multiply(enum TRANSPOSE transA, enum TRANSPOSE transB, integer m, integer n, integer k, complex alpha, complex x[], complex y[], complex beta, complex c[]){
integer lda = transA == CblasNoTrans ? m : k;
integer ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
CGEMM(&transAchar, &transBchar, &m, &n, &k, &alpha, x, &lda, y, &ldb, &beta, c, &m);
}
DLLEXPORT void z_matrix_multiply(enum TRANSPOSE transA, enum TRANSPOSE transB, integer m, integer n, integer k, doublecomplex alpha, doublecomplex x[], doublecomplex y[], doublecomplex beta, doublecomplex c[]){
integer lda = transA == CblasNoTrans ? m : k;
integer ldb = transB == CblasNoTrans ? k : n;
char transAchar = getTransChar(transA);
char transBchar = getTransChar(transB);
ZGEMM(&transAchar, &transBchar, &m, &n, &k, &alpha, x, &lda, y, &ldb, &beta, c, &m);
}
char getTransChar(enum TRANSPOSE trans){
char cTrans;
switch( trans ){
case CblasNoTrans : cTrans = 'N';
break;
case CblasTrans : cTrans = 'T';
break;
case CblasConjTrans : cTrans = 'C';
break;
}
return cTrans;
}

283
src/NativeWrappers/GotoBlas2/cblas.h

@ -1,283 +0,0 @@
#ifndef CBLAS_H
#define CBLAS_H
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
#define CBLAS_INDEX int
#define blasint int
#define _Complex
#define Complex8 float
#define Complex16 double
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114};
enum CBLAS_UPLO {CblasUpper=121, CblasLower=122};
enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132};
enum CBLAS_SIDE {CblasLeft=141, CblasRight=142};
float cblas_sdsdot(blasint n, float, float *x, blasint incx, float *y, blasint incy);
double cblas_dsdot (blasint n, float *x, blasint incx, float *y, blasint incy);
float cblas_sdot(blasint n, float *x, blasint incx, float *y, blasint incy);
double cblas_ddot(blasint n, double *x, blasint incx, double *y, blasint incy);
float _Complex cblas_cdotu(blasint n, float *x, blasint incx, float *y, blasint incy);
float _Complex cblas_cdotc(blasint n, float *x, blasint incx, float *y, blasint incy);
double _Complex cblas_zdotu(blasint n, double *x, blasint incx, double *y, blasint incy);
double _Complex cblas_zdotc(blasint n, double *x, blasint incx, double *y, blasint incy);
void cblas_cdotu_sub(blasint n, float *x, blasint incx, float *y, blasint incy, float _Complex *ret);
void cblas_cdotc_sub(blasint n, float *x, blasint incx, float *y, blasint incy, float _Complex *ret);
void cblas_zdotu_sub(blasint n, double *x, blasint incx, double *y, blasint incy, double _Complex *ret);
void cblas_zdotc_sub(blasint n, double *x, blasint incx, double *y, blasint incy, double _Complex *ret);
float cblas_sasum (blasint n, float *x, blasint incx);
double cblas_dasum (blasint n, double *x, blasint incx);
float cblas_scasum(blasint n, float *x, blasint incx);
double cblas_dzasum(blasint n, double *x, blasint incx);
float cblas_snrm2 (blasint N, float *X, blasint incX);
double cblas_dnrm2 (blasint N, double *X, blasint incX);
float cblas_scnrm2(blasint N, float *X, blasint incX);
double cblas_dznrm2(blasint N, double *X, blasint incX);
CBLAS_INDEX cblas_isamax(blasint n, float *x, blasint incx);
CBLAS_INDEX cblas_idamax(blasint n, double *x, blasint incx);
CBLAS_INDEX cblas_icamax(blasint n, float *x, blasint incx);
CBLAS_INDEX cblas_izamax(blasint n, double *x, blasint incx);
void cblas_saxpy(blasint n, float, float *x, blasint incx, float *y, blasint incy);
void cblas_daxpy(blasint n, double, double *x, blasint incx, double *y, blasint incy);
void cblas_caxpy(blasint n, float *, float *x, blasint incx, float *y, blasint incy);
void cblas_zaxpy(blasint n, double *, double *x, blasint incx, double *y, blasint incy);
void cblas_scopy(blasint n, float *x, blasint incx, float *y, blasint incy);
void cblas_dcopy(blasint n, double *x, blasint incx, double *y, blasint incy);
void cblas_ccopy(blasint n, float *x, blasint incx, float *y, blasint incy);
void cblas_zcopy(blasint n, double *x, blasint incx, double *y, blasint incy);
void cblas_sswap(blasint n, float *x, blasint incx, float *y, blasint incy);
void cblas_dswap(blasint n, double *x, blasint incx, double *y, blasint incy);
void cblas_cswap(blasint n, float *x, blasint incx, float *y, blasint incy);
void cblas_zswap(blasint n, double *x, blasint incx, double *y, blasint incy);
void cblas_srot(blasint N, float *X, blasint incX, float *Y, blasint incY, float c, float s);
void cblas_drot(blasint N, double *X, blasint incX, double *Y, blasint incY, double c, double s);
void cblas_srotg(float *a, float *b, float *c, float *s);
void cblas_drotg(double *a, double *b, double *c, double *s);
void cblas_srotm(blasint N, float *X, blasint incX, float *Y, blasint incY, float *P);
void cblas_drotm(blasint N, double *X, blasint incX, double *Y, blasint incY, double *P);
void cblas_srotmg(float *d1, float *d2, float *b1, float b2, float *P);
void cblas_drotmg(double *d1, double *d2, double *b1, double b2, double *P);
void cblas_sscal(blasint N, float alpha, float *X, blasint incX);
void cblas_dscal(blasint N, double alpha, double *X, blasint incX);
void cblas_cscal(blasint N, float *alpha, float *X, blasint incX);
void cblas_zscal(blasint N, double *alpha, double *X, blasint incX);
void cblas_csscal(blasint N, float alpha, float *X, blasint incX);
void cblas_zdscal(blasint N, double alpha, double *X, blasint incX);
void cblas_sgemv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE trans, blasint m, blasint n,
float alpha, float *a, blasint lda, float *x, blasint incx, float beta, float *y, blasint incy);
void cblas_dgemv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE trans, blasint m, blasint n,
double alpha, double *a, blasint lda, double *x, blasint incx, double beta, double *y, blasint incy);
void cblas_cgemv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE trans, blasint m, blasint n,
float *alpha, float *a, blasint lda, float *x, blasint incx, float *beta, float *y, blasint incy);
void cblas_zgemv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE trans, blasint m, blasint n,
double *alpha, double *a, blasint lda, double *x, blasint incx, double *beta, double *y, blasint incy);
void cblas_sger (enum CBLAS_ORDER order, blasint M, blasint N, float alpha, float *X, blasint incX, float *Y, blasint incY, float *A, blasint lda);
void cblas_dger (enum CBLAS_ORDER order, blasint M, blasint N, double alpha, double *X, blasint incX, double *Y, blasint incY, double *A, blasint lda);
void cblas_cgeru(enum CBLAS_ORDER order, blasint M, blasint N, float *alpha, float *X, blasint incX, float *Y, blasint incY, float *A, blasint lda);
void cblas_cgerc(enum CBLAS_ORDER order, blasint M, blasint N, float *alpha, float *X, blasint incX, float *Y, blasint incY, float *A, blasint lda);
void cblas_zgeru(enum CBLAS_ORDER order, blasint M, blasint N, double *alpha, double *X, blasint incX, double *Y, blasint incY, double *A, blasint lda);
void cblas_zgerc(enum CBLAS_ORDER order, blasint M, blasint N, double *alpha, double *X, blasint incX, double *Y, blasint incY, double *A, blasint lda);
void cblas_strsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, float *A, blasint lda, float *X, blasint incX);
void cblas_dtrsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, double *A, blasint lda, double *X, blasint incX);
void cblas_ctrsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, float *A, blasint lda, float *X, blasint incX);
void cblas_ztrsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, double *A, blasint lda, double *X, blasint incX);
void cblas_strmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, float *A, blasint lda, float *X, blasint incX);
void cblas_dtrmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, double *A, blasint lda, double *X, blasint incX);
void cblas_ctrmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, float *A, blasint lda, float *X, blasint incX);
void cblas_ztrmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag, blasint N, double *A, blasint lda, double *X, blasint incX);
void cblas_ssyr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *X, blasint incX, float *A, blasint lda);
void cblas_dsyr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X, blasint incX, double *A, blasint lda);
void cblas_cher(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *X, blasint incX, float *A, blasint lda);
void cblas_zher(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X, blasint incX, double *A, blasint lda);
void cblas_ssyr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,blasint N, float alpha, float *X,
blasint incX, float *Y, blasint incY, float *A, blasint lda);
void cblas_dsyr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X,
blasint incX, double *Y, blasint incY, double *A, blasint lda);
void cblas_cher2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float *alpha, float *X, blasint incX,
float *Y, blasint incY, float *A, blasint lda);
void cblas_zher2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double *alpha, double *X, blasint incX,
double *Y, blasint incY, double *A, blasint lda);
void cblas_sgbmv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint M, blasint N,
blasint KL, blasint KU, float alpha, float *A, blasint lda, float *X, blasint incX, float beta, float *Y, blasint incY);
void cblas_dgbmv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint M, blasint N,
blasint KL, blasint KU, double alpha, double *A, blasint lda, double *X, blasint incX, double beta, double *Y, blasint incY);
void cblas_cgbmv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint M, blasint N,
blasint KL, blasint KU, float *alpha, float *A, blasint lda, float *X, blasint incX, float *beta, float *Y, blasint incY);
void cblas_zgbmv(enum CBLAS_ORDER order, enum CBLAS_TRANSPOSE TransA, blasint M, blasint N,
blasint KL, blasint KU, double *alpha, double *A, blasint lda, double *X, blasint incX, double *beta, double *Y, blasint incY);
void cblas_ssbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, blasint K, float alpha, float *A,
blasint lda, float *X, blasint incX, float beta, float *Y, blasint incY);
void cblas_dsbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, blasint K, double alpha, double *A,
blasint lda, double *X, blasint incX, double beta, double *Y, blasint incY);
void cblas_stbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, float *A, blasint lda, float *X, blasint incX);
void cblas_dtbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, double *A, blasint lda, double *X, blasint incX);
void cblas_ctbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, float *A, blasint lda, float *X, blasint incX);
void cblas_ztbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, double *A, blasint lda, double *X, blasint incX);
void cblas_stbsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, float *A, blasint lda, float *X, blasint incX);
void cblas_dtbsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, double *A, blasint lda, double *X, blasint incX);
void cblas_ctbsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, float *A, blasint lda, float *X, blasint incX);
void cblas_ztbsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, blasint K, double *A, blasint lda, double *X, blasint incX);
void cblas_stpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, float *Ap, float *X, blasint incX);
void cblas_dtpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, double *Ap, double *X, blasint incX);
void cblas_ctpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, float *Ap, float *X, blasint incX);
void cblas_ztpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, double *Ap, double *X, blasint incX);
void cblas_stpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, float *Ap, float *X, blasint incX);
void cblas_dtpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, double *Ap, double *X, blasint incX);
void cblas_ctpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, float *Ap, float *X, blasint incX);
void cblas_ztpsv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA, enum CBLAS_DIAG Diag,
blasint N, double *Ap, double *X, blasint incX);
void cblas_ssymv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *A,
blasint lda, float *X, blasint incX, float beta, float *Y, blasint incY);
void cblas_dsymv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *A,
blasint lda, double *X, blasint incX, double beta, double *Y, blasint incY);
void cblas_chemv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float *alpha, float *A,
blasint lda, float *X, blasint incX, float *beta, float *Y, blasint incY);
void cblas_zhemv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double *alpha, double *A,
blasint lda, double *X, blasint incX, double *beta, double *Y, blasint incY);
void cblas_sspmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *Ap,
float *X, blasint incX, float beta, float *Y, blasint incY);
void cblas_dspmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *Ap,
double *X, blasint incX, double beta, double *Y, blasint incY);
void cblas_sspr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *X, blasint incX, float *Ap);
void cblas_dspr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X, blasint incX, double *Ap);
void cblas_chpr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *X, blasint incX, float *A);
void cblas_zhpr(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X,blasint incX, double *A);
void cblas_sspr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float alpha, float *X, blasint incX, float *Y, blasint incY, float *A);
void cblas_dspr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double alpha, double *X, blasint incX, double *Y, blasint incY, double *A);
void cblas_chpr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, float *alpha, float *X, blasint incX, float *Y, blasint incY, float *Ap);
void cblas_zhpr2(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, double *alpha, double *X, blasint incX, double *Y, blasint incY, double *Ap);
void cblas_chbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, blasint K,
float *alpha, float *A, blasint lda, float *X, blasint incX, float *beta, float *Y, blasint incY);
void cblas_zhbmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N, blasint K,
double *alpha, double *A, blasint lda, double *X, blasint incX, double *beta, double *Y, blasint incY);
void cblas_chpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N,
float *alpha, float *Ap, float *X, blasint incX, float *beta, float *Y, blasint incY);
void cblas_zhpmv(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, blasint N,
double *alpha, double *Ap, double *X, blasint incX, double *beta, double *Y, blasint incY);
void cblas_sgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K,
float alpha, float *A, blasint lda, float *B, blasint ldb, float beta, float *C, blasint ldc);
void cblas_dgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K,
double alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc);
void cblas_cgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K,
float *alpha, float *A, blasint lda, float *B, blasint ldb, float *beta, float *C, blasint ldc);
void cblas_zgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA, enum CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K,
double *alpha, double *A, blasint lda, double *B, blasint ldb, double *beta, double *C, blasint ldc);
void cblas_ssymm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
float alpha, float *A, blasint lda, float *B, blasint ldb, float beta, float *C, blasint ldc);
void cblas_dsymm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
double alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc);
void cblas_csymm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
float *alpha, float *A, blasint lda, float *B, blasint ldb, float *beta, float *C, blasint ldc);
void cblas_zsymm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
double *alpha, double *A, blasint lda, double *B, blasint ldb, double *beta, double *C, blasint ldc);
void cblas_ssyrk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, float alpha, float *A, blasint lda, float beta, float *C, blasint ldc);
void cblas_dsyrk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, double alpha, double *A, blasint lda, double beta, double *C, blasint ldc);
void cblas_csyrk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, float *alpha, float *A, blasint lda, float *beta, float *C, blasint ldc);
void cblas_zsyrk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, double *alpha, double *A, blasint lda, double *beta, double *C, blasint ldc);
void cblas_ssyr2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, float alpha, float *A, blasint lda, float *B, blasint ldb, float beta, float *C, blasint ldc);
void cblas_dsyr2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, double alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc);
void cblas_csyr2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, float *alpha, float *A, blasint lda, float *B, blasint ldb, float *beta, float *C, blasint ldc);
void cblas_zsyr2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans,
blasint N, blasint K, double *alpha, double *A, blasint lda, double *B, blasint ldb, double *beta, double *C, blasint ldc);
void cblas_strmm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, float alpha, float *A, blasint lda, float *B, blasint ldb);
void cblas_dtrmm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, double alpha, double *A, blasint lda, double *B, blasint ldb);
void cblas_ctrmm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, float *alpha, float *A, blasint lda, float *B, blasint ldb);
void cblas_ztrmm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, double *alpha, double *A, blasint lda, double *B, blasint ldb);
void cblas_strsm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, float alpha, float *A, blasint lda, float *B, blasint ldb);
void cblas_dtrsm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, double alpha, double *A, blasint lda, double *B, blasint ldb);
void cblas_ctrsm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, float *alpha, float *A, blasint lda, float *B, blasint ldb);
void cblas_ztrsm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_DIAG Diag, blasint M, blasint N, double *alpha, double *A, blasint lda, double *B, blasint ldb);
void cblas_chemm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
float *alpha, float *A, blasint lda, float *B, blasint ldb, float *beta, float *C, blasint ldc);
void cblas_zhemm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side, enum CBLAS_UPLO Uplo, blasint M, blasint N,
double *alpha, double *A, blasint lda, double *B, blasint ldb, double *beta, double *C, blasint ldc);
void cblas_cherk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans, blasint N, blasint K,
float alpha, float *A, blasint lda, float beta, float *C, blasint ldc);
void cblas_zherk(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans, blasint N, blasint K,
double alpha, double *A, blasint lda, double beta, double *C, blasint ldc);
void cblas_cher2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans, blasint N, blasint K,
float *alpha, float *A, blasint lda, float *B, blasint ldb, float beta, float *C, blasint ldc);
void cblas_zher2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANSPOSE Trans, blasint N, blasint K,
double *alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc);
void cblas_xerbla(blasint p, char *rout, char *form, ...);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

5434
src/NativeWrappers/GotoBlas2/clapack.h

File diff suppressed because it is too large

224
src/NativeWrappers/GotoBlas2/f2c.h

@ -1,224 +0,0 @@
/* f2c.h -- Standard Fortran to C header file */
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
typedef long int integer;
typedef unsigned long int uinteger;
typedef char *address;
typedef short int shortint;
typedef float real;
typedef double doublereal;
typedef struct { real r, i; } complex;
typedef struct { doublereal r, i; } doublecomplex;
typedef long int logical;
typedef short int shortlogical;
typedef char logical1;
typedef char integer1;
#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */
typedef long long longint; /* system-dependent */
typedef unsigned long long ulongint; /* system-dependent */
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
#endif
#define TRUE_ (1)
#define FALSE_ (0)
/* Extern is for use with -E */
#ifndef Extern
#define Extern extern
#endif
/* I/O stuff */
#ifdef f2c_i2
/* for -i2 */
typedef short flag;
typedef short ftnlen;
typedef short ftnint;
#else
typedef long int flag;
typedef long int ftnlen;
typedef long int ftnint;
#endif
/*external read, write*/
typedef struct
{ flag cierr;
ftnint ciunit;
flag ciend;
char *cifmt;
ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
{ flag icierr;
char *iciunit;
flag iciend;
char *icifmt;
ftnint icirlen;
ftnint icirnum;
} icilist;
/*open*/
typedef struct
{ flag oerr;
ftnint ounit;
char *ofnm;
ftnlen ofnmlen;
char *osta;
char *oacc;
char *ofm;
ftnint orl;
char *oblnk;
} olist;
/*close*/
typedef struct
{ flag cerr;
ftnint cunit;
char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
{ flag aerr;
ftnint aunit;
} alist;
/* inquire */
typedef struct
{ flag inerr;
ftnint inunit;
char *infile;
ftnlen infilen;
ftnint *inex; /*parameters in standard's order*/
ftnint *inopen;
ftnint *innum;
ftnint *innamed;
char *inname;
ftnlen innamlen;
char *inacc;
ftnlen inacclen;
char *inseq;
ftnlen inseqlen;
char *indir;
ftnlen indirlen;
char *infmt;
ftnlen infmtlen;
char *inform;
ftnint informlen;
char *inunf;
ftnlen inunflen;
ftnint *inrecl;
ftnint *innrec;
char *inblank;
ftnlen inblanklen;
} inlist;
#define VOID void
union Multitype { /* for multiple entry points */
integer1 g;
shortint h;
integer i;
/* longint j; */
real r;
doublereal d;
complex c;
doublecomplex z;
};
typedef union Multitype Multitype;
/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
struct Vardesc { /* for Namelist */
char *name;
char *addr;
ftnlen *dims;
int type;
};
typedef struct Vardesc Vardesc;
struct Namelist {
char *name;
Vardesc **vars;
int nvars;
};
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x)
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
#define dmin(a,b) (doublereal)min(a,b)
#define dmax(a,b) (doublereal)max(a,b)
#define bit_test(a,b) ((a) >> (b) & 1)
#define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
#define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
/* procedure parameter types for -A and -C++ */
#define F2C_proc_par_types 1
#ifdef __cplusplus
typedef int /* Unknown procedure type */ (*U_fp)(...);
typedef shortint (*J_fp)(...);
typedef integer (*I_fp)(...);
typedef real (*R_fp)(...);
typedef doublereal (*D_fp)(...), (*E_fp)(...);
typedef /* Complex */ VOID (*C_fp)(...);
typedef /* Double Complex */ VOID (*Z_fp)(...);
typedef logical (*L_fp)(...);
typedef shortlogical (*K_fp)(...);
typedef /* Character */ VOID (*H_fp)(...);
typedef /* Subroutine */ int (*S_fp)(...);
#else
typedef int /* Unknown procedure type */ (*U_fp)();
typedef shortint (*J_fp)();
typedef integer (*I_fp)();
typedef real (*R_fp)();
typedef doublereal (*D_fp)(), (*E_fp)();
typedef /* Complex */ VOID (*C_fp)();
typedef /* Double Complex */ VOID (*Z_fp)();
typedef logical (*L_fp)();
typedef shortlogical (*K_fp)();
typedef /* Character */ VOID (*H_fp)();
typedef /* Subroutine */ int (*S_fp)();
#endif
/* E_fp is for real functions when -R is not specified */
typedef VOID C_f; /* complex function */
typedef VOID H_f; /* character function */
typedef VOID Z_f; /* double complex function */
typedef doublereal E_f; /* real function with -R not specified */
/* undef any lower-case symbols that your C compiler predefines, e.g.: */
#ifndef Skip_f2c_Undefs
#undef cray
#undef gcos
#undef mc68010
#undef mc68020
#undef mips
#undef pdp11
#undef sgi
#undef sparc
#undef sun
#undef sun2
#undef sun3
#undef sun4
#undef u370
#undef u3b
#undef u3b2
#undef u3b5
#undef unix
#undef vax
#endif
#endif

954
src/NativeWrappers/GotoBlas2/lapack.cpp

@ -1,954 +0,0 @@
#include "wrapper_common.h"
#include <algorithm>
#include "lapack.h"
extern "C"{
void STRSM(char*, char*, char*, char*, integer*, integer*, float*, float*, integer*, float*, integer*);
void DTRSM(char*, char*, char*, char*, integer*, integer*, double*, double*, integer*, double*, integer*);
void CTRSM(char*, char*, char*, char*, integer*, integer*, complex*, complex*, integer*, complex*, integer*);
void ZTRSM(char*, char*, char*, char*, integer*, integer*, doublecomplex*, doublecomplex*, integer*, doublecomplex*, integer*);
DLLEXPORT float s_matrix_norm(char norm, integer m, integer n, float a[], float work[])
{
return slange_(&norm, &m, &n, a, &m, work);
}
DLLEXPORT double d_matrix_norm(char norm, integer m, integer n, double a[], double work[])
{
return dlange_(&norm, &m, &n, a, &m, work);
}
DLLEXPORT float c_matrix_norm(char norm, integer m, integer n, complex a[], float work[])
{
return clange_(&norm, &m, &n, a, &m, work);
}
DLLEXPORT double z_matrix_norm(char norm, integer m, integer n, doublecomplex a[], double work[])
{
return zlange_(&norm, &m, &n, a, &m, work);
}
DLLEXPORT integer s_lu_factor(integer m, float a[], integer ipiv[])
{
integer info = 0;
sgetrf_(&m,&m,a,&m,ipiv,&info);
for(integer i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer d_lu_factor(integer m, double a[], integer ipiv[])
{
integer info = 0;
dgetrf_(&m,&m,a,&m,ipiv,&info);
for(integer i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer c_lu_factor(integer m, complex a[], integer ipiv[])
{
integer info = 0;
cgetrf_(&m,&m,a,&m,ipiv,&info);
for(integer i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer z_lu_factor(integer m, doublecomplex a[], integer ipiv[])
{
integer info = 0;
zgetrf_(&m,&m,a,&m,ipiv,&info);
for(integer i = 0; i < m; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer s_lu_inverse(integer n, float a[], float work[], integer lwork)
{
integer* ipiv = new integer[n];
integer info = 0;
sgetrf_(&n,&n,a,&n,ipiv,&info);
if (info != 0){
delete[] ipiv;
return info;
}
sgetri_(&n,a,&n,ipiv,work,&lwork,&info);
delete[] ipiv;
return info;
}
DLLEXPORT integer d_lu_inverse(integer n, double a[], double work[], integer lwork)
{
integer* ipiv = new integer[n];
integer info = 0;
dgetrf_(&n,&n,a,&n,ipiv,&info);
if (info != 0){
delete[] ipiv;
return info;
}
dgetri_(&n,a,&n,ipiv,work,&lwork,&info);
delete[] ipiv;
return info;
}
DLLEXPORT integer c_lu_inverse(integer n, complex a[], complex work[], integer lwork)
{
integer* ipiv = new integer[n];
integer info = 0;
cgetrf_(&n,&n,a,&n,ipiv,&info);
if (info != 0){
delete[] ipiv;
return info;
}
cgetri_(&n,a,&n,ipiv,work,&lwork,&info);
delete[] ipiv;
return info;
}
DLLEXPORT integer z_lu_inverse(integer n, doublecomplex a[], doublecomplex work[], integer lwork)
{
integer* ipiv = new integer[n];
integer info = 0;
zgetrf_(&n,&n,a,&n,ipiv,&info);
if (info != 0){
delete[] ipiv;
return info;
}
zgetri_(&n,a,&n,ipiv,work,&lwork,&info);
delete[] ipiv;
return info;
}
DLLEXPORT integer s_lu_inverse_factored(integer n, float a[], integer ipiv[], float work[], integer lwork)
{
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
integer info = 0;
sgetri_(&n,a,&n,ipiv,work,&lwork,&info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer d_lu_inverse_factored(integer n, double a[], integer ipiv[], double work[], integer lwork)
{
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
integer info = 0;
dgetri_(&n,a,&n,ipiv,work,&lwork,&info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer c_lu_inverse_factored(integer n, complex a[], integer ipiv[], complex work[], integer lwork)
{
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
integer info = 0;
cgetri_(&n,a,&n,ipiv,work,&lwork,&info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer z_lu_inverse_factored(integer n, doublecomplex a[], integer ipiv[], doublecomplex work[], integer lwork)
{
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
integer info = 0;
zgetri_(&n,a,&n,ipiv,work,&lwork,&info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer s_lu_solve_factored(integer n, integer nrhs, float a[], integer ipiv[], float b[])
{
integer info = 0;
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
sgetrs_(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer d_lu_solve_factored(integer n, integer nrhs, double a[], integer ipiv[], double b[])
{
integer info = 0;
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
dgetrs_(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer c_lu_solve_factored(integer n, integer nrhs, complex a[], integer ipiv[], complex b[])
{
integer info = 0;
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
cgetrs_(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer z_lu_solve_factored(integer n, integer nrhs, doublecomplex a[], integer ipiv[], doublecomplex b[])
{
integer info = 0;
integer i;
for(i = 0; i < n; ++i ){
ipiv[i] += 1;
}
char trans ='N';
zgetrs_(&trans, &n, &nrhs, a, &n, ipiv, b, &n, &info);
for(i = 0; i < n; ++i ){
ipiv[i] -= 1;
}
return info;
}
DLLEXPORT integer s_lu_solve(integer n, integer nrhs, float a[], float b[])
{
float* clone = new float[n*n];
memcpy(clone, a, n*n*sizeof(float));
integer* ipiv = new integer[n];
integer info = 0;
sgetrf_(&n, &n, clone, &n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
sgetrs_(&trans, &n, &nrhs, clone, &n, ipiv, b, &n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT integer d_lu_solve(integer n, integer nrhs, double a[], double b[])
{
double* clone = new double[n*n];
memcpy(clone, a, n*n*sizeof(double));
integer* ipiv = new integer[n];
integer info = 0;
dgetrf_(&n, &n, clone, &n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
dgetrs_(&trans, &n, &nrhs, clone, &n, ipiv, b, &n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT integer c_lu_solve(integer n, integer nrhs, complex a[], complex b[])
{
complex* clone = new complex[n*n];
memcpy(clone, a, n*n*sizeof(complex));
integer* ipiv = new integer[n];
integer info = 0;
cgetrf_(&n, &n, clone, &n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
cgetrs_(&trans, &n, &nrhs, clone, &n, ipiv, b, &n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT integer z_lu_solve(integer n, integer nrhs, doublecomplex a[], doublecomplex b[])
{
doublecomplex* clone = new doublecomplex[n*n];
memcpy(clone, a, n*n*sizeof(doublecomplex));
integer* ipiv = new integer[n];
integer info = 0;
zgetrf_(&n, &n, clone, &n, ipiv, &info);
if (info != 0){
delete[] ipiv;
delete[] clone;
return info;
}
char trans ='N';
zgetrs_(&trans, &n, &nrhs, clone, &n, ipiv, b, &n, &info);
delete[] ipiv;
delete[] clone;
return info;
}
DLLEXPORT integer s_cholesky_factor(integer n, float a[]){
char uplo = 'L';
integer info = 0;
spotrf_(&uplo, &n, a, &n, &info);
for (integer i = 0; i < n; ++i)
{
integer index = i * n;
for (integer j = 0; j < n && i > j; ++j)
{
a[index + j] = 0;
}
}
return info;
}
DLLEXPORT integer d_cholesky_factor(integer n, double* a){
char uplo = 'L';
integer info = 0;
dpotrf_(&uplo, &n, a, &n, &info);
for (integer i = 0; i < n; ++i)
{
integer index = i * n;
for (integer j = 0; j < n && i > j; ++j)
{
a[index + j] = 0;
}
}
return info;
}
DLLEXPORT integer c_cholesky_factor(integer n, complex a[]){
char uplo = 'L';
integer info = 0;
complex zero = {0.0f, 0.0f};
cpotrf_(&uplo, &n, a, &n, &info);
for (integer i = 0; i < n; ++i)
{
integer index = i * n;
for (integer j = 0; j < n && i > j; ++j)
{
a[index + j] = zero;
}
}
return info;
}
DLLEXPORT integer z_cholesky_factor(integer n, doublecomplex a[]){
char uplo = 'L';
integer info = 0;
doublecomplex zero = {0.0, 0.0};
zpotrf_(&uplo, &n, a, &n, &info);
for (integer i = 0; i < n; ++i)
{
integer index = i * n;
for (integer j = 0; j < n && i > j; ++j)
{
a[index + j] = zero;
}
}
return info;
}
DLLEXPORT integer s_cholesky_solve(integer n, integer nrhs, float a[], float b[])
{
float* clone = new float[n*n];
memcpy(clone, a, n*n*sizeof(float));
char uplo = 'L';
integer info = 0;
spotrf_(&uplo, &n, clone, &n, &info);
if (info != 0){
delete[] clone;
return info;
}
spotrs_(&uplo, &n, &nrhs, clone, &n, b, &n, &info);
delete[] clone;
return info;
}
DLLEXPORT integer d_cholesky_solve(integer n, integer nrhs, double a[], double b[])
{
double* clone = new double[n*n];
memcpy(clone, a, n*n*sizeof(double));
char uplo = 'L';
integer info = 0;
dpotrf_(&uplo, &n, clone, &n, &info);
if (info != 0){
delete[] clone;
return info;
}
dpotrs_(&uplo, &n, &nrhs, clone, &n, b, &n, &info);
delete[] clone;
return info;
}
DLLEXPORT integer c_cholesky_solve(integer n, integer nrhs, complex a[], complex b[])
{
complex* clone = new complex[n*n];
memcpy(clone, a, n*n*sizeof(complex));
char uplo = 'L';
integer info = 0;
cpotrf_(&uplo, &n, clone, &n, &info);
if (info != 0){
delete[] clone;
return info;
}
cpotrs_(&uplo, &n, &nrhs, clone, &n, b, &n, &info);
delete[] clone;
return info;
}
DLLEXPORT integer z_cholesky_solve(integer n, integer nrhs, doublecomplex a[], doublecomplex b[])
{
doublecomplex* clone = new doublecomplex[n*n];
memcpy(clone, a, n*n*sizeof(doublecomplex));
char uplo = 'L';
integer info = 0;
zpotrf_(&uplo, &n, clone, &n, &info);
if (info != 0){
delete[] clone;
return info;
}
zpotrs_(&uplo, &n, &nrhs, clone, &n, b, &n, &info);
delete[] clone;
return info;
}
DLLEXPORT integer s_cholesky_solve_factored(integer n, integer nrhs, float a[], float b[])
{
char uplo = 'L';
integer info = 0;
spotrs_(&uplo, &n, &nrhs, a, &n, b, &n, &info);
return info;
}
DLLEXPORT integer d_cholesky_solve_factored(integer n, integer nrhs, double a[], double b[])
{
char uplo = 'L';
integer info = 0;
dpotrs_(&uplo, &n, &nrhs, a, &n, b, &n, &info);
return info;
}
DLLEXPORT integer c_cholesky_solve_factored(integer n, integer nrhs, complex a[], complex b[])
{
char uplo = 'L';
integer info = 0;
cpotrs_(&uplo, &n, &nrhs, a, &n, b, &n, &info);
return info;
}
DLLEXPORT integer z_cholesky_solve_factored(integer n, integer nrhs, doublecomplex a[], doublecomplex b[])
{
char uplo = 'L';
integer info = 0;
zpotrs_(&uplo, &n, &nrhs, a, &n, b, &n, &info);
return info;
}
DLLEXPORT integer s_qr_factor(integer m, integer n, float r[], float tau[], float q[], float work[], integer len)
{
integer info = 0;
sgeqrf_(&m, &n, r, &m, tau, work, &len, &info);
for (integer i = 0; i < m; ++i)
{
for (integer j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
sorgqr_(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
sorgqr_(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT integer d_qr_factor(integer m, integer n, double r[], double tau[], double q[], double work[], integer len)
{
integer info = 0;
dgeqrf_(&m, &n, r, &m, tau, work, &len, &info);
for (integer i = 0; i < m; ++i)
{
for (integer j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
dorgqr_(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
dorgqr_(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT integer c_qr_factor(integer m, integer n, complex r[], complex tau[], complex q[], complex work[], integer len)
{
integer info = 0;
cgeqrf_(&m, &n, r, &m, tau, work, &len, &info);
for (integer i = 0; i < m; ++i)
{
for (integer j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
cungqr_(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
cungqr_(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT integer z_qr_factor(integer m, integer n, doublecomplex r[], doublecomplex tau[], doublecomplex q[], doublecomplex work[], integer len)
{
integer info = 0;
zgeqrf_(&m, &n, r, &m, tau, work, &len, &info);
for (integer i = 0; i < m; ++i)
{
for (integer j = 0; j < m && j < n; ++j)
{
if (i > j)
{
q[j * m + i] = r[j * m + i];
}
}
}
//compute the q elements explicitly
if (m <= n)
{
zungqr_(&m, &m, &m, q, &m, tau, work, &len, &info);
}
else
{
zungqr_(&m, &n, &n, q, &m, tau, work, &len, &info);
}
return info;
}
DLLEXPORT integer s_qr_solve(integer m, integer n, integer bn, float r[], float b[], float x[], float work[], integer len)
{
integer info = 0;
float* clone_r = new float[m*n];
memcpy(clone_r, r, m*n*sizeof(float));
float* tau = new float[max(1, min(m,n))];
sgeqrf_(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
float* clone_b = new float[m*bn];
memcpy(clone_b, b, m*bn*sizeof(float));
char side ='L';
char tran = 'T';
char upper = 'U';
char no = 'N';
float one = 1.f;
sormqr_(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info);
STRSM(&side, &upper, &no, &no, &n, &bn, &one, clone_r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT integer d_qr_solve(integer m, integer n, integer bn, double r[], double b[], double x[], double work[], integer len)
{
integer info = 0;
double* clone_r = new double[m*n];
memcpy(clone_r, r, m*n*sizeof(double));
double* tau = new double[max(1, min(m,n))];
dgeqrf_(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
double* clone_b = new double[m*bn];
memcpy(clone_b, b, m*bn*sizeof(double));
char side ='L';
char tran = 'T';
char upper = 'U';
char no = 'N';
double one = 1.;
dormqr_(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info);
DTRSM(&side, &upper, &no, &no, &n, &bn, &one, clone_r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
delete[] tau;
delete[] clone_r;
return info;
}
DLLEXPORT integer c_qr_solve(integer m, integer n, integer bn, complex r[], complex b[], complex x[], complex work[], integer len)
{
integer info = 0;
complex* clone_r = new complex[m*n];
memcpy(clone_r, r, m*n*sizeof(complex));
complex* tau = new complex[min(m,n)];
cgeqrf_(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
char side ='L';
char tran = 'C';
char upper = 'U';
char no = 'N';
complex* clone_b = new complex[m*bn];
memcpy(clone_b, b, m*bn*sizeof(complex));
cunmqr_(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info);
complex one = {1.0, 0.0};
CTRSM(&side, &upper, &no, &no, &n, &bn, &one, clone_r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT integer z_qr_solve(integer m, integer n, integer bn, doublecomplex r[], doublecomplex b[], doublecomplex x[], doublecomplex work[], integer len)
{
integer info = 0;
doublecomplex* clone_r = new doublecomplex[m*n];
memcpy(clone_r, r, m*n*sizeof(doublecomplex));
doublecomplex* tau = new doublecomplex[min(m,n)];
zgeqrf_(&m, &n, clone_r, &m, tau, work, &len, &info);
if (info != 0)
{
delete[] clone_r;
delete[] tau;
return info;
}
char side ='L';
char tran = 'C';
char upper = 'U';
char no = 'N';
doublecomplex* clone_b = new doublecomplex[m*bn];
memcpy(clone_b, b, m*bn*sizeof(doublecomplex));
zunmqr_(&side, &tran, &m, &bn, &n, clone_r, &m, tau, clone_b, &m, work, &len, &info);
doublecomplex one = {1.0, 0.0};
ZTRSM(&side, &upper, &no, &no, &n, &bn, &one, clone_r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_r;
delete[] tau;
delete[] clone_b;
return info;
}
DLLEXPORT integer s_qr_solve_factored(integer m, integer n, integer bn, float r[], float b[], float tau[], float x[], float work[], integer len)
{
char side ='L';
char tran = 'T';
integer info = 0;
char upper = 'U';
char no = 'N';
float one = 1.f;
float* clone_b = new float[m*bn];
memcpy(clone_b, b, m*bn*sizeof(float));
sormqr_(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info);
STRSM(&side, &upper, &no, &no, &n, &bn, &one, r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT integer d_qr_solve_factored(integer m, integer n, integer bn, double r[], double b[], double tau[], double x[], double work[], integer len)
{
char side ='L';
char tran = 'T';
integer info = 0;
char upper = 'U';
char no = 'N';
double one = 1.;
double* clone_b = new double[m*bn];
memcpy(clone_b, b, m*bn*sizeof(double));
dormqr_(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info);
DTRSM(&side, &upper, &no, &no, &n, &bn, &one, r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT integer c_qr_solve_factored(integer m, integer n, integer bn, complex r[], complex b[], complex tau[], complex x[], complex work[], integer len)
{
char side ='L';
char tran = 'C';
integer info = 0;
char upper = 'U';
char no = 'N';
complex* clone_b = new complex[m*bn];
memcpy(clone_b, b, m*bn*sizeof(complex));
cunmqr_(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info);
complex one = {1.0f, 0.0f};
CTRSM(&side, &upper, &no, &no, &n, &bn, &one, r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT integer z_qr_solve_factored(integer m, integer n, integer bn, doublecomplex r[], doublecomplex b[], doublecomplex tau[], doublecomplex x[], doublecomplex work[], integer len)
{
char side ='L';
char tran = 'C';
integer info = 0;
char upper = 'U';
char no = 'N';
doublecomplex* clone_b = new doublecomplex[m*bn];
memcpy(clone_b, b, m*bn*sizeof(doublecomplex));
zunmqr_(&side, &tran, &m, &bn, &n, r, &m, tau, clone_b, &m, work, &len, &info);
doublecomplex one = {1.0, 0.0};
ZTRSM(&side, &upper, &no, &no, &n, &bn, &one, r, &m, clone_b, &m);
for (integer i = 0; i < n; ++i)
{
for (integer j = 0; j < bn; ++j)
{
x[j * n + i] = clone_b[j * m + i];
}
}
delete[] clone_b;
return info;
}
DLLEXPORT integer s_svd_factor(bool compute_vectors, integer m, integer n, float a[], float s[], float u[], float v[], float work[], integer len)
{
integer info = 0;
char job = compute_vectors ? 'A' : 'N';
sgesvd_(&job, &job, &m, &n, a, &m, s, u, &m, v, &n, work, &len, &info);
return info;
}
DLLEXPORT integer d_svd_factor(bool compute_vectors, integer m, integer n, double a[], double s[], double u[], double v[], double work[], integer len)
{
integer info = 0;
char job = compute_vectors ? 'A' : 'N';
dgesvd_(&job, &job, &m, &n, a, &m, s, u, &m, v, &n, work, &len, &info);
return info;
}
DLLEXPORT integer c_svd_factor(bool compute_vectors, integer m, integer n, complex a[], complex s[], complex u[], complex v[], complex work[], integer len)
{
integer info = 0;
integer dim_s = min(m,n);
float* rwork = new float[5 * dim_s];
float* s_local = new float[dim_s];
char job = compute_vectors ? 'A' : 'N';
cgesvd_(&job, &job, &m, &n, a, &m, s_local, u, &m, v, &n, work, &len, rwork, &info);
for(integer index = 0; index < dim_s; ++index){
complex value = {s_local[index], 0.0f};
s[index] = value;
}
delete[] rwork;
delete[] s_local;
return info;
}
DLLEXPORT integer z_svd_factor(bool compute_vectors, integer m, integer n, doublecomplex a[], doublecomplex s[], doublecomplex u[], doublecomplex v[], doublecomplex work[], integer len)
{
integer info = 0;
integer dim_s = min(m,n);
double* rwork = new double[5 * min(m, n)];
double* s_local = new double[dim_s];
char job = compute_vectors ? 'A' : 'N';
zgesvd_(&job, &job, &m, &n, a, &m, s_local, u, &m, v, &n, work, &len, rwork, &info);
for(integer index = 0; index < dim_s; ++index){
doublecomplex value = {s_local[index], 0.0f};
s[index] = value;
}
delete[] rwork;
delete[] s_local;
return info;
}
}

27
src/NativeWrappers/GotoBlas2/lapack.h

@ -1,27 +0,0 @@
#ifndef LAPACK_H
#define LAPACK_H
extern "C"{
#include "f2c.h"
#include "clapack.h"
enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114};
enum CBLAS_UPLO {CblasUpper=121, CblasLower=122};
enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132};
enum CBLAS_SIDE {CblasLeft=141, CblasRight=142};
float slange_(char*, integer*, integer*, float*, integer*, float*);
float dlange_(char*, integer*, integer*, double*, integer*, double*);
float clange_(char*, integer*, integer*, complex*, integer*, float*);
float zlange_(char*, integer*, integer*, doublecomplex*, integer*, double*);
void cblas_strsm(CBLAS_ORDER, CBLAS_SIDE, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, integer, integer, float, float*, integer, float*, integer);
void cblas_dtrsm(CBLAS_ORDER, CBLAS_SIDE, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, integer, integer, double, double*, integer, double*, integer);
void cblas_ctrsm(CBLAS_ORDER, CBLAS_SIDE, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, integer, integer, complex*, complex*, integer, complex*, integer);
void cblas_ztrsm(CBLAS_ORDER, CBLAS_SIDE, CBLAS_UPLO, CBLAS_TRANSPOSE, CBLAS_DIAG, integer, integer, doublecomplex*, doublecomplex*, integer, doublecomplex*, integer);
}
#endif

1238
src/NativeWrappers/MKL/lapack.cpp

File diff suppressed because it is too large

180
src/NativeWrappers/Windows/ACML/ACMLWrapper.vcproj

@ -1,180 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ACMLWrapper"
ProjectGUID="{434AB06D-DD34-4E12-A296-9B3E72CD56E2}"
RootNamespace="ACMLWrapper"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

165
src/NativeWrappers/Windows/ACML/ACMLWrapper.vcxproj

@ -1,165 +0,0 @@
<?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>{8774BCBE-27D0-44D2-A1B3-8ED705E252CB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ACMKWrapper</RootNamespace>
<ProjectName>ACMLWrapper</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ACMKWRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;C:\AMD\acml4.4.0\ifort32_mp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\AMD\acml4.4.0\ifort32_mp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libacml_mp_dll.lib;kernel32.lib;user32.lib;</AdditionalDependencies>
<OutputFile>$(OutDir)MathNET.Numerics.ACML.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ACMKWRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;C:\AMD\acml4.4.0\ifort64_mp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>C:\AMD\acml4.4.0\ifort64_mp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libacml_mp_dll.lib;kernel32.lib;user32.lib;</AdditionalDependencies>
<OutputFile>$(OutDir)MathNET.Numerics.ACML.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ACMKWRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;C:\AMD\acml4.4.0\ifort32_mp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>C:\AMD\acml4.4.0\ifort32_mp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libacml_mp_dll.lib;kernel32.lib;user32.lib;</AdditionalDependencies>
<OutputFile>$(OutDir)MathNET.Numerics.ACML.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ACMKWRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;C:\AMD\acml4.4.0\ifort64_mp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>C:\AMD\acml4.4.0\ifort64_mp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libacml_mp_dll.lib;kernel32.lib;user32.lib;</AdditionalDependencies>
<OutputFile>$(OutDir)MathNET.Numerics.ACML.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\Common\resource.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\ACML\blas.c" />
<ClCompile Include="..\..\ACML\lapack.cpp" />
<ClCompile Include="..\..\Common\WindowsDLL.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

102
src/NativeWrappers/Windows/ACMLWrapperTests/ACMLWrapperTests.csproj

@ -1,102 +0,0 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8A42A7F3-23C0-46D9-9DBA-B9039EB3C8EB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ACMLWrapperTests</RootNamespace>
<AssemblyName>ACMLWrapperTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="MathNet.Numerics">
<HintPath>..\..\..\..\out\debug\Net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\UnitTests\AssertHelpers.cs">
<Link>AssertHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex32\LinearAlgebraProviderTests.cs">
<Link>Complex32\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex\LinearAlgebraProviderTests.cs">
<Link>Complex\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs">
<Link>Double\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Single\LinearAlgebraProviderTests.cs">
<Link>Single\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="Complex32\AcmlLinearAlgebraProviderTests.cs" />
<Compile Include="Complex\AcmlLinearAlgebraProviderTests.cs" />
<Compile Include="Double\AcmlLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Single\AcmlLinearAlgebraProviderTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\Release\MathNET.Numerics.ACML.dll">
<Link>MathNET.Numerics.ACML.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="C:\AMD\acml4.4.0\ifort32_mp\lib\libacml_mp_dll.dll">
<Link>libacml_mp_dll.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="C:\AMD\acml4.4.0\ifort32_mp\lib\libifcoremd.dll">
<Link>libifcoremd.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="C:\AMD\acml4.4.0\ifort32_mp\lib\libiomp5md.dll">
<Link>libiomp5md.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="C:\AMD\acml4.4.0\ifort32_mp\lib\libmmd.dll">
<Link>libmmd.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>

51
src/NativeWrappers/Windows/ACMLWrapperTests/Complex/AcmlLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="AcmlLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.AcmlBlasWrapperTests.LinearAlgebra.Complex
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the ACML linear algebra provider.
/// </summary>
[TestFixture]
public class AcmlLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="AcmlLinearAlgebraProviderTests"/> class.
/// </summary>
public AcmlLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/ACMLWrapperTests/Complex32/AcmlLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="AcmlLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.AcmlBlasWrapperTests.LinearAlgebra.Complex32
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the ACML linear algebra provider.
/// </summary>
[TestFixture]
public class AcmlLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="AcmlLinearAlgebraProviderTests"/> class.
/// </summary>
public AcmlLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/ACMLWrapperTests/Double/AcmlLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="AcmlLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.AcmlBlasWrapperTests.LinearAlgebra.Double
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the ACML linear algebra provider.
/// </summary>
[TestFixture]
public class AcmlLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="AcmlLinearAlgebraProviderTests"/> class.
/// </summary>
public AcmlLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();
}
}
}

36
src/NativeWrappers/Windows/ACMLWrapperTests/Properties/AssemblyInfo.cs

@ -1,36 +0,0 @@
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("ACMLWrapperTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("ACMLWrapperTests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[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("83801bc7-d554-4669-aede-db11d009d283")]
// 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.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

51
src/NativeWrappers/Windows/ACMLWrapperTests/Single/AcmlLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="AcmlLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.AcmlBlasWrapperTests.LinearAlgebra.Single
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the ACML linear algebra provider.
/// </summary>
[TestFixture]
public class AcmlLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="AcmlLinearAlgebraProviderTests"/> class.
/// </summary>
public AcmlLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();
}
}
}

170
src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj

@ -1,170 +0,0 @@
<?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>{507FF69E-32A6-495A-9DE2-20EC10EE8963}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>GotoBLAS2Wrapper</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GOTOBLAS2WRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;..\..\GotoBLAS2;.\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2\x86;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2.lib;libf2c_x86.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GOTOBLAS2WRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;..\..\GotoBLAS2;.\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GOTOBLAS2WRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;..\..\GotoBLAS2;.\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2\x86;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GOTOBLAS2WRAPPER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\Common;..\..\GotoBLAS2;.\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\GotoBLAS2;</AdditionalLibraryDirectories>
<AdditionalDependencies>libgoto2_core2p-r1.13_x86_64.lib;libf2c_x86_64.lib;lapack_x86_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<OutputFile>$(OutDir)MathNET.Numerics.GotoBLAS2.dll</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\Common\resource.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Common\wrapper_common.h" />
<ClInclude Include="..\..\GotoBlas2\clapack.h" />
<ClInclude Include="..\..\GotoBlas2\f2c.h" />
<ClInclude Include="..\..\GotoBlas2\lapack.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\Common\WindowsDLL.cpp" />
<ClCompile Include="..\..\GotoBlas2\blas.c" />
<ClCompile Include="..\..\GotoBlas2\lapack.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

47
src/NativeWrappers/Windows/GotoBLAS2/GotoBLAS2Wrapper.vcxproj.filters

@ -1,47 +0,0 @@
<?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;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\Common\resource.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Common\wrapper_common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\GotoBlas2\lapack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\GotoBlas2\clapack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\GotoBlas2\f2c.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\Common\WindowsDLL.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\GotoBlas2\blas.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\GotoBlas2\lapack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex/GotoBlasLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Complex32/GotoBlasLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Complex32
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Double/GotoBlasLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Double;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Double
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

124
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/GotoBLAS2WrapperTests.csproj

@ -1,124 +0,0 @@
<?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>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{56FFAB18-CAA6-4913-8123-610872BFD60A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GotoBLAS2WrapperTests</RootNamespace>
<AssemblyName>GotoBLAS2WrapperTests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisLogFile>bin\Debug\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\GotoBLAS2WrapperTests.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<ItemGroup>
<Reference Include="MathNet.Numerics, Version=2011.4.1.635, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\out\debug\Net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\..\..\lib\NUnit.2.5.9\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\UnitTests\AssertHelpers.cs">
<Link>AssertHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\complex32\LinearAlgebraProviderTests.cs">
<Link>Complex32\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\complex\LinearAlgebraProviderTests.cs">
<Link>Complex\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\double\LinearAlgebraProviderTests.cs">
<Link>Double\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\unittests\linearalgebraprovidertests\single\LinearAlgebraProviderTests.cs">
<Link>Single\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="Complex32\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Complex\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Double\GotoBlasLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Single\GotoBlasLinearAlgebraProviderTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\..\lib\GotoBLAS2\x86\libgoto2.dll">
<Link>libgoto2.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Release\MathNET.Numerics.GotoBLAS2.dll">
<Link>MathNET.Numerics.GotoBLAS2.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>

36
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Properties/AssemblyInfo.cs

@ -1,36 +0,0 @@
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("GotoBLAS2WrapperTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("GotoBLAS2WrapperTests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
[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("eea98ed9-b5a4-4c81-ac6b-808eecd4bedf")]
// 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.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

51
src/NativeWrappers/Windows/GotoBLAS2WrapperTests/Single/GotoBlasLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single;
namespace MathNet.Numerics.GotoBlasWrapperTests.LinearAlgebra.Single
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the GotoBLAS2 linear algebra provider.
/// </summary>
[TestFixture]
public class GotoBlasLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="GotoBlasLinearAlgebraProviderTests"/> class.
/// </summary>
public GotoBlasLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.GotoBlas.GotoBlasLinearAlgebraProvider();
}
}
}

8
src/NativeWrappers/Windows/MKL/MKLWrapper.vcxproj

@ -69,19 +69,19 @@
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\..\lib\Windows\$(Platform)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\..\lib\Windows\$(Platform)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\..\lib\Windows\$(Platform)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<OutDir>$(SolutionDir)..\..\..\lib\Windows\$(Platform)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

51
src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Complex/MklLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex;
namespace MathNet.Numerics.MklWrapperTests.LinearAlgebra.Complex
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the MKL linear algebra provider.
/// </summary>
[TestFixture]
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="MklLinearAlgebraProviderTests"/> class.
/// </summary>
public MklLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Complex32/MklLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32;
namespace MathNet.Numerics.MklWrapperTests.LinearAlgebra.Complex32
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the MKL linear algebra provider.
/// </summary>
[TestFixture]
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="MklLinearAlgebraProviderTests"/> class.
/// </summary>
public MklLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Double/MklLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Double;
namespace MathNet.Numerics.MklWrapperTests.LinearAlgebra.Double
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the MKL linear algebra provider.
/// </summary>
[TestFixture]
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="MklLinearAlgebraProviderTests"/> class.
/// </summary>
public MklLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();
}
}
}

51
src/NativeWrappers/Windows/MKLWrapperTests/LinearAlgebra/Single/MklLinearAlgebraProviderTests.cs

@ -1,51 +0,0 @@
// <copyright file="MklLinearAlgebraProviderTests.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>
using MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single;
namespace MathNet.Numerics.MklWrapperTests.LinearAlgebra.Single
{
using NUnit.Framework;
/// <summary>
/// Unit test container for the MKL linear algebra provider.
/// </summary>
[TestFixture]
public class MklLinearAlgebraProviderTests : LinearAlgebraProviderTests
{
/// <summary>
/// Initializes a new instance of the <see cref="MklLinearAlgebraProviderTests"/> class.
/// </summary>
public MklLinearAlgebraProviderTests()
{
Control.LinearAlgebraProvider = new Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();
}
}
}

462
src/NativeWrappers/Windows/MKLWrapperTests/MKLWrapperTests.csproj

@ -55,10 +55,6 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="MathNet.Numerics, Version=2011.2.14.770, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\out\debug\Net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
@ -82,22 +78,437 @@
<Link>AssertHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex32\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Complex32\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Complex32\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Complex\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Complex\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Complex\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Double\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Double\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraProviderTests\Single\LinearAlgebraProviderTests.cs">
<Link>LinearAlgebra\Single\LinearAlgebraProviderTests.cs</Link>
<Link>LinearAlgebraProviderTests\Single\LinearAlgebraProviderTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DenseMatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\DenseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DenseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex32\DenseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DenseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Complex32\DenseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DenseVectorTests.cs">
<Link>LinearAlgebraTests\Complex32\DenseVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\DiagonalMatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\DiagonalMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\CholeskyTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\CholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\EvdTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\EvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\GramSchmidtTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\GramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\LUTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\LUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\QRTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\QRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\SvdTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\SvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserCholeskyTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserCholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserEvdTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserEvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserGramSchmidtTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserGramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserLUTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserLUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserQRTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserQRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\Factorization\UserSvdTests.cs">
<Link>LinearAlgebraTests\Complex32\Factorization\UserSvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\MatrixLoader.cs">
<Link>LinearAlgebraTests\Complex32\MatrixLoader.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\MatrixStructureTheory.cs">
<Link>LinearAlgebraTests\Complex32\MatrixStructureTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\MatrixTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Complex32\MatrixTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\MatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\MatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\SparseMatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\SparseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\SparseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex32\SparseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\SparseVectorTest.cs">
<Link>LinearAlgebraTests\Complex32\SparseVectorTest.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\SparseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Complex32\SparseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\UserDefinedMatrix.cs">
<Link>LinearAlgebraTests\Complex32\UserDefinedMatrix.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\UserDefinedMatrixTests.cs">
<Link>LinearAlgebraTests\Complex32\UserDefinedMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\UserDefinedVector.cs">
<Link>LinearAlgebraTests\Complex32\UserDefinedVector.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\UserDefinedVectorTests.cs">
<Link>LinearAlgebraTests\Complex32\UserDefinedVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\VectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex32\VectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\VectorTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Complex32\VectorTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\VectorTests.cs">
<Link>LinearAlgebraTests\Complex32\VectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex32\VectorTests.Norm.cs">
<Link>LinearAlgebraTests\Complex32\VectorTests.Norm.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\DenseMatrixTests.cs">
<Link>LinearAlgebraTests\Complex\DenseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\DenseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex\DenseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\DenseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Complex\DenseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\DenseVectorTests.cs">
<Link>LinearAlgebraTests\Complex\DenseVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\DiagonalMatrixTests.cs">
<Link>LinearAlgebraTests\Complex\DiagonalMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\CholeskyTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\CholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\EvdTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\EvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\GramSchmidtTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\GramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\LUTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\LUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\QRTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\QRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\SvdTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\SvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserCholeskyTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserCholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserEvdTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserEvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserGramSchmidtTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserGramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserLUTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserLUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserQRTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserQRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\Factorization\UserSvdTests.cs">
<Link>LinearAlgebraTests\Complex\Factorization\UserSvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\MatrixLoader.cs">
<Link>LinearAlgebraTests\Complex\MatrixLoader.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\MatrixStructureTheory.cs">
<Link>LinearAlgebraTests\Complex\MatrixStructureTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\MatrixTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Complex\MatrixTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\MatrixTests.cs">
<Link>LinearAlgebraTests\Complex\MatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\SparseMatrixTests.cs">
<Link>LinearAlgebraTests\Complex\SparseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\SparseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex\SparseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\SparseVectorTest.cs">
<Link>LinearAlgebraTests\Complex\SparseVectorTest.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\SparseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Complex\SparseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\UserDefinedMatrix.cs">
<Link>LinearAlgebraTests\Complex\UserDefinedMatrix.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\UserDefinedMatrixTests.cs">
<Link>LinearAlgebraTests\Complex\UserDefinedMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\UserDefinedVector.cs">
<Link>LinearAlgebraTests\Complex\UserDefinedVector.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\UserDefinedVectorTests.cs">
<Link>LinearAlgebraTests\Complex\UserDefinedVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\VectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Complex\VectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\VectorTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Complex\VectorTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\VectorTests.cs">
<Link>LinearAlgebraTests\Complex\VectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Complex\VectorTests.Norm.cs">
<Link>LinearAlgebraTests\Complex\VectorTests.Norm.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\DenseMatrixTests.cs">
<Link>LinearAlgebraTests\Double\DenseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\DenseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Double\DenseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\DenseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Double\DenseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\DenseVectorTests.cs">
<Link>LinearAlgebraTests\Double\DenseVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\DiagonalMatrixTests.cs">
<Link>LinearAlgebraTests\Double\DiagonalMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\CholeskyTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\CholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\EvdTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\EvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\GramSchmidtTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\GramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\LUTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\LUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\QRTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\QRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\SvdTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\SvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserCholeskyTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserCholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserEvdTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserEvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserGramSchmidtTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserGramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserLUTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserLUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserQRTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserQRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\Factorization\UserSvdTests.cs">
<Link>LinearAlgebraTests\Double\Factorization\UserSvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\MatrixLoader.cs">
<Link>LinearAlgebraTests\Double\MatrixLoader.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\MatrixStructureTheory.cs">
<Link>LinearAlgebraTests\Double\MatrixStructureTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\MatrixTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Double\MatrixTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\MatrixTests.cs">
<Link>LinearAlgebraTests\Double\MatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\SparseMatrixTests.cs">
<Link>LinearAlgebraTests\Double\SparseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\SparseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Double\SparseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\SparseVectorTest.cs">
<Link>LinearAlgebraTests\Double\SparseVectorTest.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\SparseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Double\SparseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\UserDefinedMatrix.cs">
<Link>LinearAlgebraTests\Double\UserDefinedMatrix.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\UserDefinedMatrixTests.cs">
<Link>LinearAlgebraTests\Double\UserDefinedMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\UserDefinedVector.cs">
<Link>LinearAlgebraTests\Double\UserDefinedVector.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\UserDefinedVectorTests.cs">
<Link>LinearAlgebraTests\Double\UserDefinedVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\VectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Double\VectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\VectorTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Double\VectorTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\VectorTests.cs">
<Link>LinearAlgebraTests\Double\VectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Double\VectorTests.Norm.cs">
<Link>LinearAlgebraTests\Double\VectorTests.Norm.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\MatrixStructureTheory.Access.cs">
<Link>LinearAlgebraTests\MatrixStructureTheory.Access.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\MatrixStructureTheory.cs">
<Link>LinearAlgebraTests\MatrixStructureTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\MatrixStructureTheory.Reform.cs">
<Link>LinearAlgebraTests\MatrixStructureTheory.Reform.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\DenseMatrixTests.cs">
<Link>LinearAlgebraTests\Single\DenseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\DenseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Single\DenseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\DenseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Single\DenseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\DenseVectorTests.cs">
<Link>LinearAlgebraTests\Single\DenseVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\DiagonalMatrixTests.cs">
<Link>LinearAlgebraTests\Single\DiagonalMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\CholeskyTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\CholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\EvdTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\EvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\GramSchmidtTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\GramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\LUTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\LUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\QRTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\QRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\SvdTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\SvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserCholeskyTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserCholeskyTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserEvdTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserEvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserGramSchmidtTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserGramSchmidtTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserLUTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserLUTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserQRTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserQRTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\Factorization\UserSvdTests.cs">
<Link>LinearAlgebraTests\Single\Factorization\UserSvdTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\MatrixLoader.cs">
<Link>LinearAlgebraTests\Single\MatrixLoader.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\MatrixStructureTheory.cs">
<Link>LinearAlgebraTests\Single\MatrixStructureTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\MatrixTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Single\MatrixTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\MatrixTests.cs">
<Link>LinearAlgebraTests\Single\MatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\SparseMatrixTests.cs">
<Link>LinearAlgebraTests\Single\SparseMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\SparseVectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Single\SparseVectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\SparseVectorTest.cs">
<Link>LinearAlgebraTests\Single\SparseVectorTest.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\SparseVectorTest.TextHandling.cs">
<Link>LinearAlgebraTests\Single\SparseVectorTest.TextHandling.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\UserDefinedMatrix.cs">
<Link>LinearAlgebraTests\Single\UserDefinedMatrix.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\UserDefinedMatrixTests.cs">
<Link>LinearAlgebraTests\Single\UserDefinedMatrixTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\UserDefinedVector.cs">
<Link>LinearAlgebraTests\Single\UserDefinedVector.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\UserDefinedVectorTests.cs">
<Link>LinearAlgebraTests\Single\UserDefinedVectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\VectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\Single\VectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\VectorTests.Arithmetic.cs">
<Link>LinearAlgebraTests\Single\VectorTests.Arithmetic.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\VectorTests.cs">
<Link>LinearAlgebraTests\Single\VectorTests.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\Single\VectorTests.Norm.cs">
<Link>LinearAlgebraTests\Single\VectorTests.Norm.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\LinearAlgebraTests\VectorArithmeticTheory.cs">
<Link>LinearAlgebraTests\VectorArithmeticTheory.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\MatrixHelpers.cs">
<Link>MatrixHelpers.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\Properties\AssemblyInfo.cs">
<Link>Properties\AssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\Properties\Settings.Designer.cs">
<Link>Properties\Settings.Designer.cs</Link>
</Compile>
<Compile Include="..\..\..\UnitTests\UseLinearAlgebraProvider.cs">
<Link>UseLinearAlgebraProvider.cs</Link>
</Compile>
<Compile Include="LinearAlgebra\Complex32\MklLinearAlgebraProviderTests.cs" />
<Compile Include="LinearAlgebra\Complex\MklLinearAlgebraProviderTests.cs" />
<Compile Include="LinearAlgebra\Double\MklLinearAlgebraProviderTests.cs" />
<Compile Include="LinearAlgebra\Single\MklLinearAlgebraProviderTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
@ -117,15 +528,36 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="..\Win32\Release\libiomp5md.dll">
<None Include="..\..\..\..\data\Matlab\sparse-small.mat">
<Link>data\Matlab\sparse-small.mat</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\..\UnitTests\Properties\Settings.settings">
<Link>Properties\Settings.settings</Link>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Numerics.IO\Numerics.IO.csproj">
<Project>{eb1a5d32-f264-4bce-beb7-0b97085075be}</Project>
<Name>Numerics.IO</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Numerics\Numerics.csproj">
<Project>{b7cae5f4-a23f-4438-b5be-41226618b695}</Project>
<Name>Numerics</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\..\lib\Windows\Win32\libiomp5md.dll">
<Link>libiomp5md.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Win32\Release\MathNET.Numerics.MKL.dll">
<Content Include="..\..\..\..\lib\Windows\Win32\MathNET.Numerics.MKL.dll">
<Link>MathNET.Numerics.MKL.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\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.

36
src/NativeWrappers/Windows/MKLWrapperTests/Properties/AssemblyInfo.cs

@ -1,36 +0,0 @@
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("MKLWrapperTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("MKLWrapperTests")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
[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("079338ef-4536-4095-b9cd-ada44d75923f")]
// 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.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

61
src/NativeWrappers/Windows/NativeWrappers.sln

@ -13,6 +13,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MKLWrapper", "MKL\MKLWrappe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MKLWrapperTests", "MKLWrapperTests\MKLWrapperTests.csproj", "{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Numerics", "..\..\Numerics\Numerics.csproj", "{B7CAE5F4-A23F-4438-B5BE-41226618B695}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Numerics.IO", "..\..\Numerics.IO\Numerics.IO.csproj", "{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -23,6 +27,10 @@ Global
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release-Signed|Any CPU = Release-Signed|Any CPU
Release-Signed|Mixed Platforms = Release-Signed|Mixed Platforms
Release-Signed|Win32 = Release-Signed|Win32
Release-Signed|x64 = Release-Signed|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|Any CPU.ActiveCfg = Debug|x64
@ -33,12 +41,19 @@ Global
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|x64.ActiveCfg = Debug|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Debug|x64.Build.0 = Debug|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Any CPU.ActiveCfg = Release|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.Build.0 = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.ActiveCfg = Release|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Mixed Platforms.Build.0 = Release|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|Win32.Build.0 = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|x64.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release|x64.Build.0 = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|Any CPU.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|Mixed Platforms.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|Mixed Platforms.Build.0 = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|Win32.ActiveCfg = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|Win32.Build.0 = Release|Win32
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|x64.ActiveCfg = Release|x64
{C0B0DBA9-7FB0-4C87-BDB1-3EED19DC2B8F}.Release-Signed|x64.Build.0 = Release|x64
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -51,6 +66,48 @@ Global
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release|Win32.ActiveCfg = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release|x64.ActiveCfg = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|Any CPU.Build.0 = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|Mixed Platforms.ActiveCfg = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|Mixed Platforms.Build.0 = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|Win32.ActiveCfg = Release|Any CPU
{D0AD591B-0CE6-4A6D-8DEA-01777EE09BC3}.Release-Signed|x64.ActiveCfg = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|Win32.ActiveCfg = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Debug|x64.ActiveCfg = Debug|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|Any CPU.Build.0 = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|Win32.ActiveCfg = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release|x64.ActiveCfg = Release|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|Any CPU.ActiveCfg = Release-Signed|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|Any CPU.Build.0 = Release-Signed|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|Mixed Platforms.ActiveCfg = Release-Signed|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|Mixed Platforms.Build.0 = Release-Signed|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|Win32.ActiveCfg = Release-Signed|Any CPU
{B7CAE5F4-A23F-4438-B5BE-41226618B695}.Release-Signed|x64.ActiveCfg = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|Win32.ActiveCfg = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Debug|x64.ActiveCfg = Debug|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|Any CPU.Build.0 = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|Win32.ActiveCfg = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release|x64.ActiveCfg = Release|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|Any CPU.ActiveCfg = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|Any CPU.Build.0 = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|Mixed Platforms.ActiveCfg = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|Mixed Platforms.Build.0 = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|Win32.ActiveCfg = Release-Signed|Any CPU
{EB1A5D32-F264-4BCE-BEB7-0B97085075BE}.Release-Signed|x64.ActiveCfg = Release-Signed|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

3
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Common.cs

@ -200,6 +200,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
return SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix, work);
}
/* BUG in MKL'S ZLANGE routine. Using managed code until it is fixed.
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
@ -358,6 +359,6 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
}
return SafeNativeMethods.z_matrix_norm((byte)norm, rows, columns, matrix, work);
}
}*/
}
}

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex.cs

@ -740,14 +740,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.z_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.z_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.Complex32.cs

@ -739,14 +739,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.c_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.c_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.double.cs

@ -843,14 +843,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.d_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.d_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

9
src/Numerics/Algorithms/LinearAlgebra/Mkl/MklLinearAlgebraProvider.float.cs

@ -743,14 +743,7 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
throw new ArgumentException(Resources.WorkArrayTooSmall, "work");
}
if (method == QRMethod.Full)
{
SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
else
{
SafeNativeMethods.s_thin_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
SafeNativeMethods.s_qr_solve(rows, columns, columnsB, a, b, x, work, work.Length);
}
/// <summary>

12
src/Numerics/Algorithms/LinearAlgebra/Mkl/SafeNativeMethods.cs

@ -242,18 +242,6 @@ namespace MathNet.Numerics.Algorithms.LinearAlgebra.Mkl
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int z_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int s_thin_qr_solve(int m, int n, int bn, float[] r, float[] b, [In, Out] float[] x, [In, Out] float[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int d_thin_qr_solve(int m, int n, int bn, double[] r, double[] b, [In, Out] double[] x, [In, Out] double[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int c_thin_qr_solve(int m, int n, int bn, Complex32[] r, Complex32[] b, [In, Out] Complex32[] x, [In, Out] Complex32[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int z_thin_qr_solve(int m, int n, int bn, Complex[] r, Complex[] b, [In, Out] Complex[] x, [In, Out] Complex[] work, int len);
[DllImport(DllName, ExactSpelling = true, SetLastError = false, CallingConvention = CallingConvention.Cdecl)]
internal static extern int s_qr_solve_factored(int m, int n, int bn, float[] r, float[] b, float[] tau, [In, Out] float[] x, [In, Out] float[] work, int len);

5
src/Numerics/LinearAlgebra/Complex/Factorization/DenseQR.cs

@ -77,6 +77,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
Tau = new Complex[Math.Min(matrix.RowCount, matrix.ColumnCount)];
if (method == QRMethod.Full)
@ -143,7 +144,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
throw new NotSupportedException("Can only do QR factorization for dense matrices at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values, QrMethod);
}
/// <summary>
@ -188,7 +189,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
throw new NotSupportedException("Can only do QR factorization for dense vectors at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values, QrMethod);
}
}
}

1
src/Numerics/LinearAlgebra/Complex/Factorization/UserQR.cs

@ -69,6 +69,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
var minmn = Math.Min(matrix.RowCount, matrix.ColumnCount);
var u = new Complex[minmn][];

5
src/Numerics/LinearAlgebra/Complex32/Factorization/DenseQR.cs

@ -77,6 +77,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
Tau = new Complex32[Math.Min(matrix.RowCount, matrix.ColumnCount)];
if (method == QRMethod.Full)
@ -143,7 +144,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
throw new NotSupportedException("Can only do QR factorization for dense matrices at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values, QrMethod);
}
/// <summary>
@ -188,7 +189,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
throw new NotSupportedException("Can only do QR factorization for dense vectors at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values, QrMethod);
}
}
}

1
src/Numerics/LinearAlgebra/Complex32/Factorization/UserQR.cs

@ -69,6 +69,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
var minmn = Math.Min(matrix.RowCount, matrix.ColumnCount);
var u = new Complex32[minmn][];

5
src/Numerics/LinearAlgebra/Double/Factorization/DenseQR.cs

@ -76,6 +76,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
Tau = new double[Math.Min(matrix.RowCount, matrix.ColumnCount)];
if (method == QRMethod.Full)
@ -143,7 +144,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
throw new NotSupportedException("Can only do QR factorization for dense matrices at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values, QrMethod);
}
/// <summary>
@ -188,7 +189,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
throw new NotSupportedException("Can only do QR factorization for dense vectors at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values, QrMethod);
}
}
}

1
src/Numerics/LinearAlgebra/Double/Factorization/UserQR.cs

@ -68,6 +68,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
var minmn = Math.Min(matrix.RowCount, matrix.ColumnCount);
var u = new double[minmn][];

10
src/Numerics/LinearAlgebra/Generic/Factorization/QR.cs

@ -81,6 +81,15 @@ namespace MathNet.Numerics.LinearAlgebra.Generic.Factorization
set;
}
/// <summary>
/// The QR factorization method.
/// </summary>
protected QRMethod QrMethod
{
get;
set;
}
/// <summary>
/// Internal method which routes the call to perform the QR factorization to the appropriate class.
/// </summary>
@ -89,6 +98,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic.Factorization
/// <returns>A QR factorization object.</returns>
internal static QR<T> Create(Matrix<T> matrix, QRMethod method = QRMethod.Full)
{
if (typeof(T) == typeof(double))
{
var dense = matrix as LinearAlgebra.Double.DenseMatrix;

5
src/Numerics/LinearAlgebra/Single/Factorization/DenseQR.cs

@ -76,6 +76,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
Tau = new float[Math.Min(matrix.RowCount, matrix.ColumnCount)];
if (method == QRMethod.Full)
@ -142,7 +143,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
throw new NotSupportedException("Can only do QR factorization for dense matrices at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, input.ColumnCount, dresult.Values, QrMethod);
}
/// <summary>
@ -187,7 +188,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
throw new NotSupportedException("Can only do QR factorization for dense vectors at the moment.");
}
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values);
Control.LinearAlgebraProvider.QRSolveFactored(((DenseMatrix)MatrixQ).Values, ((DenseMatrix)MatrixR).Values, MatrixR.RowCount, MatrixR.ColumnCount, Tau, dinput.Values, 1, dresult.Values, QrMethod);
}
}
}

1
src/Numerics/LinearAlgebra/Single/Factorization/UserQR.cs

@ -68,6 +68,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single.Factorization
throw Matrix.DimensionsDontMatch<ArgumentException>(matrix);
}
QrMethod = method;
var minmn = Math.Min(matrix.RowCount, matrix.ColumnCount);
var u = new float[minmn][];

12
src/UnitTests/LinearAlgebraProviderTests/Complex/LinearAlgebraProviderTests.cs

@ -38,7 +38,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex
/// <summary>
/// Base class for linear algebra provider tests.
/// </summary>
[TestFixture, UseLinearAlgebraProvider]
[TestFixture]
public class LinearAlgebraProviderTests
{
/// <summary>
@ -224,7 +224,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex
public void CanComputeMatrixL1NormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new double[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(12.1, norm, 6);
}
@ -235,7 +236,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex
public void CanComputeMatrixFrobeniusNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new double[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(10.777754868246, norm, 8);
}
@ -246,7 +248,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex
public void CanComputeMatrixInfinityNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.InfinityNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new double[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.InfinityNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
Assert.AreEqual(16.5, norm.Real);
}
@ -916,7 +919,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex
var mx = new DenseMatrix(matrix.ColumnCount, 2, x);
var mb = matrix * mx;
Console.WriteLine(mx);
AssertHelpers.AlmostEqual(mb[0, 0], b[0], 14);
AssertHelpers.AlmostEqual(mb[1, 0], b[1], 14);
AssertHelpers.AlmostEqual(mb[2, 0], b[2], 14);

9
src/UnitTests/LinearAlgebraProviderTests/Complex32/LinearAlgebraProviderTests.cs

@ -39,7 +39,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32
/// <summary>
/// Base class for linear algebra provider tests.
/// </summary>
[TestFixture, UseLinearAlgebraProvider]
[TestFixture]
public class LinearAlgebraProviderTests
{
/// <summary>
@ -225,7 +225,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32
public void CanComputeMatrixL1NormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(12.1f, norm, 6);
}
@ -236,7 +237,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32
public void CanComputeMatrixFrobeniusNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(10.777754868246f, norm, 8);
}
@ -247,6 +249,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Complex32
public void CanComputeMatrixInfinityNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.InfinityNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
Assert.AreEqual(16.5, norm.Real);
}

2711
src/UnitTests/LinearAlgebraProviderTests/Double/LinearAlgebraProviderTests.cs

File diff suppressed because it is too large

11
src/UnitTests/LinearAlgebraProviderTests/Single/LinearAlgebraProviderTests.cs

@ -38,7 +38,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single
/// <summary>
/// Base class for linear algebra provider tests.
/// </summary>
[TestFixture, UseLinearAlgebraProvider]
[TestFixture]
public class LinearAlgebraProviderTests
{
/// <summary>
@ -224,7 +224,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single
public void CanComputeMatrixL1NormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.OneNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(12.1, norm, 6);
}
@ -235,7 +236,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single
public void CanComputeMatrixFrobeniusNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.FrobeniusNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
AssertHelpers.AlmostEqual(10.777754868246, norm, 8);
}
@ -246,7 +248,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraProviderTests.Single
public void CanComputeMatrixInfinityNormWithWorkArray()
{
var matrix = _matrices["Square3x3"];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.InfinityNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values);
var work = new float[18];
var norm = Control.LinearAlgebraProvider.MatrixNorm(Norm.InfinityNorm, matrix.RowCount, matrix.ColumnCount, matrix.Values, work);
Assert.AreEqual(16.5, norm);
}

14
src/UnitTests/LinearAlgebraTests/Complex/Factorization/EvdTests.cs

@ -122,8 +122,8 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
public void CanFactorizeRandomSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var factorEvd = matrixA.Evd();
var eigenValues = factorEvd.EigenValues();
var eigenVectors = factorEvd.EigenVectors();
var d = factorEvd.D();
@ -207,13 +207,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -247,13 +248,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -294,13 +296,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrixWhenResultVectorGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
@ -339,13 +342,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrixWhenResultMatrixGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();

37
src/UnitTests/LinearAlgebraTests/Complex/Factorization/QRTests.cs

@ -181,6 +181,25 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
AssertHelpers.AlmostEqual(matrixA[i, j], matrixQfromR[i, j], 9);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) = I
var matrixQсtQ = q.ConjugateTranspose() * q;
for (var i = 0; i < matrixQсtQ.RowCount; i++)
{
for (var j = 0; j < matrixQсtQ.ColumnCount; j++)
{
if (i == j)
{
Assert.AreEqual(matrixQсtQ[i, j].Real, 1.0, 1e-3);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0, 1e-3);
}
else
{
Assert.AreEqual(matrixQсtQ[i, j].Real, 0.0, 1e-3);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0, 1e-3);
}
}
}
}
/// <summary>
@ -221,6 +240,16 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
}
}
// Make sure the Q*R is the original matrix.
var matrixQfromR = q * r;
for (var i = 0; i < matrixQfromR.RowCount; i++)
{
for (var j = 0; j < matrixQfromR.ColumnCount; j++)
{
AssertHelpers.AlmostEqual(matrixA[i, j], matrixQfromR[i, j], 9);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) = I
var matrixQсtQ = q.ConjugateTranspose() * q;
for (var i = 0; i < matrixQсtQ.RowCount; i++)
@ -229,13 +258,13 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex.Factorization
{
if (i == j)
{
Assert.AreEqual(matrixQсtQ[i, j].Real, 1.0f, 1e-3f);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0f, 1e-3f);
Assert.AreEqual(matrixQсtQ[i, j].Real, 1.0, 1e-3);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0, 1e-3);
}
else
{
Assert.AreEqual(matrixQсtQ[i, j].Real, 0.0f, 1e-3f);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0f, 1e-3f);
Assert.AreEqual(matrixQсtQ[i, j].Real, 0.0, 1e-3);
Assert.AreEqual(matrixQсtQ[i, j].Imaginary, 0.0, 1e-3);
}
}
}

8
src/UnitTests/LinearAlgebraTests/Complex/MatrixTests.Arithmetic.cs

@ -1067,7 +1067,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
{
for (var j = 0; j < data.ColumnCount; j++)
{
Assert.AreEqual(data[i, j] * other[i, j], result[i, j]);
var value = data[i, j]*other[i, j];
Assert.AreEqual(value.Real, result[i, j].Real, 1e-12);
Assert.AreEqual(value.Imaginary, result[i, j].Imaginary, 1e-12);
}
}
@ -1076,7 +1078,9 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
{
for (var j = 0; j < data.ColumnCount; j++)
{
Assert.AreEqual(data[i, j] * other[i, j], result[i, j]);
var value = data[i, j] * other[i, j];
Assert.AreEqual(value.Real, result[i, j].Real, 1e-12);
Assert.AreEqual(value.Imaginary, result[i, j].Imaginary, 1e-12);
}
}
}

13
src/UnitTests/LinearAlgebraTests/Complex32/Factorization/EvdTests.cs

@ -119,6 +119,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
public void CanFactorizeRandomSymmetricMatrix([Values(1, 2, 5, 10, 50, 100)] int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var factorEvd = matrixA.Evd();
var eigenVectors = factorEvd.EigenVectors();
var d = factorEvd.D();
@ -203,13 +204,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
[Test, Ignore]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -244,13 +246,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -292,13 +295,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
[Test, Ignore]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrixWhenResultVectorGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
@ -338,13 +342,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrixWhenResultMatrixGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteHermitianDenseMatrix(order);
MatrixHelpers.ForceConjugateSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();

202
src/UnitTests/LinearAlgebraTests/Complex32/Factorization/QRTests.cs

@ -242,6 +242,17 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
}
}
// Make sure the Q*R is the original matrix.
var matrixQfromR = q * r;
for (var i = 0; i < matrixQfromR.RowCount; i++)
{
for (var j = 0; j < matrixQfromR.ColumnCount; j++)
{
Assert.AreEqual(matrixA[i, j].Real, matrixQfromR[i, j].Real, 1e-3f);
Assert.AreEqual(matrixA[i, j].Imaginary, matrixQfromR[i, j].Imaginary, 1e-3f);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) = I
var matrixQсtQ = q.ConjugateTranspose() * q;
for (var i = 0; i < matrixQсtQ.RowCount; i++)
@ -454,5 +465,196 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32.Factorization
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random vector (Ax=b).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var resultx = factorQR.Solve(vectorb);
Assert.AreEqual(matrixA.ColumnCount, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
// Check the reconstruction.
for (var i = 0; i < order; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 3);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixX = factorQR.Solve(matrixB);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j].Real, matrixBReconstruct[i, j].Real, 1e-3);
Assert.AreEqual(matrixB[i, j].Imaginary, matrixBReconstruct[i, j].Imaginary, 1e-3);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve for a random vector into a result vector.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorWhenResultVectorGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var vectorbCopy = vectorb.Clone();
var resultx = new DenseVector(order);
factorQR.Solve(vectorb, resultx);
Assert.AreEqual(vectorb.Count, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
// Check the reconstruction.
for (var i = 0; i < vectorb.Count; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 3);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure b didn't change.
for (var i = 0; i < vectorb.Count; i++)
{
Assert.AreEqual(vectorbCopy[i], vectorb[i]);
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B) into a result matrix.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixWhenResultMatrixGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixBCopy = matrixB.Clone();
var matrixX = new DenseMatrix(order, order);
factorQR.Solve(matrixB, matrixX);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j].Real, matrixBReconstruct[i, j].Real, 1e-3);
Assert.AreEqual(matrixB[i, j].Imaginary, matrixBReconstruct[i, j].Imaginary, 1e-3);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure B didn't change.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixBCopy[i, j], matrixB[i, j]);
}
}
}
}
}

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

@ -27,7 +27,6 @@
namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32
{
using NUnit.Framework;
using Complex32 = Numerics.Complex32;
/// <summary>
/// Abstract class with the common set of matrix tests

17
src/UnitTests/LinearAlgebraTests/Double/Factorization/EvdTests.cs

@ -24,13 +24,14 @@
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
using MathNet.Numerics.LinearAlgebra.Generic;
namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
{
using System;
using System.Numerics;
using LinearAlgebra.Double;
using LinearAlgebra.Double.Factorization;
using LinearAlgebra.Generic.Factorization;
using NUnit.Framework;
/// <summary>
@ -123,6 +124,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
public void CanFactorizeRandomSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var factorEvd = matrixA.Evd();
var eigenVectors = factorEvd.EigenVectors();
var d = factorEvd.D();
@ -207,13 +209,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -240,6 +243,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
}
}
//private
/// <summary>
/// Can solve a system of linear equations for a random matrix and symmetric matrix (AX=B).
/// </summary>
@ -247,13 +251,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -295,13 +300,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrixWhenResultVectorGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
@ -340,13 +346,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrixWhenResultMatrixGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();

235
src/UnitTests/LinearAlgebraTests/Double/Factorization/QRTests.cs

@ -172,7 +172,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
}
// Make sure the Q*R is the original matrix.
var matrixQfromR = q * r;
var matrixQfromR = q*r;
for (var i = 0; i < matrixQfromR.RowCount; i++)
{
for (var j = 0; j < matrixQfromR.ColumnCount; j++)
@ -180,6 +180,23 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
Assert.AreEqual(matrixA[i, j], matrixQfromR[i, j], 1.0e-11);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) =
var matrixQtQ = q.Transpose() * q;
for (var i = 0; i < matrixQtQ.RowCount; i++)
{
for (var j = 0; j < matrixQtQ.ColumnCount; j++)
{
if (i == j)
{
Assert.AreEqual(matrixQtQ[i, j], 1.0, 1e-3);
}
else
{
Assert.AreEqual(matrixQtQ[i, j], 0.0, 1e-3);
}
}
}
}
/// <summary>
@ -221,7 +238,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
}
// Make sure the Q*R is the original matrix.
var matrixQfromR = q * r;
var matrixQfromR = q*r;
for (var i = 0; i < matrixQfromR.RowCount; i++)
{
for (var j = 0; j < matrixQfromR.ColumnCount; j++)
@ -229,6 +246,23 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
Assert.AreEqual(matrixA[i, j], matrixQfromR[i, j], 1.0e-11);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) =
var matrixQtQ = q.Transpose() * q;
for (var i = 0; i < matrixQtQ.RowCount; i++)
{
for (var j = 0; j < matrixQtQ.ColumnCount; j++)
{
if (i == j)
{
Assert.AreEqual(matrixQtQ[i, j], 1.0, 1e-3);
}
else
{
Assert.AreEqual(matrixQtQ[i, j], 0.0, 1e-3);
}
}
}
}
/// <summary>
@ -252,7 +286,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
Assert.AreEqual(matrixA.ColumnCount, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
var matrixBReconstruct = matrixA*resultx;
// Check the reconstruction.
for (var i = 0; i < order; i++)
@ -295,7 +329,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
var matrixBReconstruct = matrixA*matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
@ -338,7 +372,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
Assert.AreEqual(vectorb.Count, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
var matrixBReconstruct = matrixA*resultx;
// Check the reconstruction.
for (var i = 0; i < vectorb.Count; i++)
@ -390,7 +424,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
var matrixBReconstruct = matrixA*matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
@ -419,5 +453,194 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double.Factorization
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random vector (Ax=b).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var resultx = factorQR.Solve(vectorb);
Assert.AreEqual(matrixA.ColumnCount, resultx.Count);
var matrixBReconstruct = matrixA*resultx;
// Check the reconstruction.
for (var i = 0; i < order; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 9);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixX = factorQR.Solve(matrixB);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA*matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
AssertHelpers.AlmostEqual(matrixB[i, j], matrixBReconstruct[i, j], 9);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve for a random vector into a result vector.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorWhenResultVectorGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var vectorbCopy = vectorb.Clone();
var resultx = new DenseVector(order);
factorQR.Solve(vectorb, resultx);
Assert.AreEqual(vectorb.Count, resultx.Count);
var matrixBReconstruct = matrixA*resultx;
// Check the reconstruction.
for (var i = 0; i < vectorb.Count; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 9);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure b didn't change.
for (var i = 0; i < vectorb.Count; i++)
{
Assert.AreEqual(vectorbCopy[i], vectorb[i]);
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B) into a result matrix.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixWhenResultMatrixGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixBCopy = matrixB.Clone();
var matrixX = new DenseMatrix(order, order);
factorQR.Solve(matrixB, matrixX);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA*matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
AssertHelpers.AlmostEqual(matrixB[i, j], matrixBReconstruct[i, j], 9);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure B didn't change.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixBCopy[i, j], matrixB[i, j]);
}
}
}
}
}

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

@ -66,13 +66,13 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
public virtual void CanComputeFrobeniusNorm()
{
var matrix = TestMatrices["Square3x3"];
AssertHelpers.AlmostEqual(10.77775486824598, matrix.FrobeniusNorm(), 14);
AssertHelpers.AlmostEqual(10.77775486824598, matrix.FrobeniusNorm(), 7);
matrix = TestMatrices["Wide2x3"];
AssertHelpers.AlmostEqual(4.79478883789474, matrix.FrobeniusNorm(), 14);
AssertHelpers.AlmostEqual(4.79478883789474, matrix.FrobeniusNorm(), 7);
matrix = TestMatrices["Tall3x2"];
AssertHelpers.AlmostEqual(7.54122006044115, matrix.FrobeniusNorm(), 14);
AssertHelpers.AlmostEqual(7.54122006044115, matrix.FrobeniusNorm(), 7);
}
/// <summary>
@ -85,10 +85,10 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
Assert.AreEqual(16.5, matrix.InfinityNorm());
matrix = TestMatrices["Wide2x3"];
Assert.AreEqual(6.6, matrix.InfinityNorm());
Assert.AreEqual(6.6, matrix.InfinityNorm(), 1e-7);
matrix = TestMatrices["Tall3x2"];
Assert.AreEqual(9.9, matrix.InfinityNorm());
Assert.AreEqual(9.9, matrix.InfinityNorm(), 1e-4);
}
/// <summary>
@ -98,13 +98,13 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
public virtual void CanComputeL1Norm()
{
var matrix = TestMatrices["Square3x3"];
Assert.AreEqual(12.1, matrix.L1Norm());
Assert.AreEqual(12.1, matrix.L1Norm(), 1e-4);
matrix = TestMatrices["Wide2x3"];
Assert.AreEqual(5.5, matrix.L1Norm());
matrix = TestMatrices["Tall3x2"];
Assert.AreEqual(8.8, matrix.L1Norm());
Assert.AreEqual(8.8, matrix.L1Norm(), 1e-4);
}
/// <summary>

18
src/UnitTests/LinearAlgebraTests/Single/Factorization/EvdTests.cs

@ -28,7 +28,6 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
{
using System;
using System.Numerics;
using LinearAlgebra.Generic.Factorization;
using LinearAlgebra.Single;
using LinearAlgebra.Single.Factorization;
using NUnit.Framework;
@ -113,6 +112,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
public void CanFactorizeRandomSymmetricMatrix([Values(1, 2, 5, 10, 50, 100)] int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var factorEvd = matrixA.Evd();
var eigenVectors = factorEvd.EigenVectors();
var d = factorEvd.D();
@ -197,13 +197,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -237,13 +238,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrix(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -263,7 +265,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-2);
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-1);
}
}
@ -284,13 +286,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorAndSymmetricMatrixWhenResultVectorGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
@ -329,13 +332,14 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
[Test]
[TestCase(1)]
[TestCase(2)]
[TestCase(5, Ignore = true, IgnoreReason = "Problem with native providers determining if the matrix is symmetric.")]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixAndSymmetricMatrixWhenResultMatrixGiven(int order)
{
var matrixA = MatrixLoader.GenerateRandomPositiveDefiniteDenseMatrix(order);
MatrixHelpers.ForceSymmetric(matrixA);
var matrixACopy = matrixA.Clone();
var factorEvd = matrixA.Evd();
@ -358,7 +362,7 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-2);
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-1);
}
}

223
src/UnitTests/LinearAlgebraTests/Single/Factorization/QRTests.cs

@ -181,6 +181,24 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
Assert.AreEqual(matrixA[i, j], matrixQfromR[i, j], 1e-4);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) = I
var matrixQtQ = q.Transpose() * q;
for (var i = 0; i < matrixQtQ.RowCount; i++)
{
for (var j = 0; j < matrixQtQ.ColumnCount; j++)
{
if (i == j)
{
Assert.AreEqual(matrixQtQ[i, j], 1.0f, 1e-3f);
}
else
{
Assert.AreEqual(matrixQtQ[i, j], 0.0f, 1e-3f);
}
}
}
}
/// <summary>
@ -230,6 +248,23 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
Assert.AreEqual(matrixA[i, j], matrixQfromR[i, j], 1.0e-4);
}
}
// Make sure the Q is unitary --> (Q*)x(Q) = I
var matrixQtQ = q.Transpose() * q;
for (var i = 0; i < matrixQtQ.RowCount; i++)
{
for (var j = 0; j < matrixQtQ.ColumnCount; j++)
{
if (i == j)
{
Assert.AreEqual(matrixQtQ[i, j], 1.0f, 1e-3f);
}
else
{
Assert.AreEqual(matrixQtQ[i, j], 0.0f, 1e-3f);
}
}
}
}
/// <summary>
@ -411,6 +446,194 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single.Factorization
}
}
// Make sure B didn't change.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixBCopy[i, j], matrixB[i, j]);
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random vector (Ax=b).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var resultx = factorQR.Solve(vectorb);
Assert.AreEqual(matrixA.ColumnCount, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
// Check the reconstruction.
for (var i = 0; i < order; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 3);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B).
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixX = factorQR.Solve(matrixB);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-3);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
}
/// <summary>
/// Can solve for a random vector into a result vector.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomVectorWhenResultVectorGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var vectorb = MatrixLoader.GenerateRandomDenseVector(order);
var vectorbCopy = vectorb.Clone();
var resultx = new DenseVector(order);
factorQR.Solve(vectorb, resultx);
Assert.AreEqual(vectorb.Count, resultx.Count);
var matrixBReconstruct = matrixA * resultx;
// Check the reconstruction.
for (var i = 0; i < vectorb.Count; i++)
{
AssertHelpers.AlmostEqual(vectorb[i], matrixBReconstruct[i], 3);
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure b didn't change.
for (var i = 0; i < vectorb.Count; i++)
{
Assert.AreEqual(vectorbCopy[i], vectorb[i]);
}
}
/// <summary>
/// Can solve a system of linear equations for a random matrix (AX=B) into a result matrix.
/// </summary>
/// <param name="order">Matrix order.</param>
[TestCase(1)]
[TestCase(2)]
[TestCase(5)]
[TestCase(10)]
[TestCase(50)]
[TestCase(100)]
public void CanSolveForRandomMatrixWhenResultMatrixGivenUsingThinQR(int order)
{
var matrixA = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixACopy = matrixA.Clone();
var factorQR = matrixA.QR(QRMethod.Thin);
var matrixB = MatrixLoader.GenerateRandomDenseMatrix(order, order);
var matrixBCopy = matrixB.Clone();
var matrixX = new DenseMatrix(order, order);
factorQR.Solve(matrixB, matrixX);
// The solution X row dimension is equal to the column dimension of A
Assert.AreEqual(matrixA.ColumnCount, matrixX.RowCount);
// The solution X has the same number of columns as B
Assert.AreEqual(matrixB.ColumnCount, matrixX.ColumnCount);
var matrixBReconstruct = matrixA * matrixX;
// Check the reconstruction.
for (var i = 0; i < matrixB.RowCount; i++)
{
for (var j = 0; j < matrixB.ColumnCount; j++)
{
Assert.AreEqual(matrixB[i, j], matrixBReconstruct[i, j], 1e-3);
}
}
// Make sure A didn't change.
for (var i = 0; i < matrixA.RowCount; i++)
{
for (var j = 0; j < matrixA.ColumnCount; j++)
{
Assert.AreEqual(matrixACopy[i, j], matrixA[i, j]);
}
}
// Make sure B didn't change.
for (var i = 0; i < matrixB.RowCount; i++)
{

97
src/UnitTests/MatrixHelpers.cs

@ -0,0 +1,97 @@
// <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>
using System;
using System.Numerics;
using MathNet.Numerics.LinearAlgebra.Generic;
namespace MathNet.Numerics.UnitTests
{
/// <summary>
/// Matrix utility functions to simplify tests.
/// </summary>
static public class MatrixHelpers
{
/// <summary>
/// Forces a matrix elements to symmetric. Copies the lower triangle to the upper triangle.
/// </summary>
/// <typeparam name="T">The matrix type.</typeparam>
/// <param name="matrix">The matrix to make symmetric.</param>
static public void ForceSymmetric<T>(Matrix<T> matrix) where T : struct, IEquatable<T>, IFormattable
{
if (matrix.RowCount != matrix.ColumnCount)
{
throw new ArgumentException("matrix must be square.", "matrix");
}
for (var row = 0; row < matrix.RowCount; row++)
{
for (var column = 0; column < row; column++)
{
matrix.At(column, row, matrix.At(row, column));
}
}
}
/// <summary>
/// Forces a matrix elements to conjugate symmetric. Copies the conjugate of the values
/// from the lower triangle to the upper triangle.
/// </summary>
/// <param name="matrix">The matrix to make conjugate symmetric.</param>
static public void ForceConjugateSymmetric(Matrix<Complex> matrix)
{
if (matrix.RowCount != matrix.ColumnCount)
{
throw new ArgumentException("matrix must be square.", "matrix");
}
for (var row = 0; row < matrix.RowCount; row++)
{
for (var column = 0; column < row; column++)
{
matrix.At(column, row, matrix.At(row, column).Conjugate());
}
}
}
/// <summary>
/// Forces a matrix elements to conjugate symmetric. Copies the conjugate of the values
/// from the lower triangle to the upper triangle.
/// </summary>
/// <param name="matrix">The matrix to make conjugate symmetric.</param>
public static void ForceConjugateSymmetric(Matrix<Complex32> matrix)
{
if (matrix.RowCount != matrix.ColumnCount)
{
throw new ArgumentException("matrix must be square.", "matrix");
}
for (var row = 0; row < matrix.RowCount; row++)
{
for (var column = 0; column < row; column++)
{
matrix.At(column, row, matrix.At(row, column).Conjugate());
}
}
}
}
}

3
src/UnitTests/Properties/AssemblyInfo.cs

@ -1,5 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using MathNet.Numerics.UnitTests;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@ -31,3 +32,5 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: UseLinearAlgebraProvider]

1
src/UnitTests/UnitTests.csproj

@ -742,6 +742,7 @@
</Compile>
<Compile Include="LinearAlgebraTests\Double\VectorArithmeticTheory.cs" />
<Compile Include="LinearAlgebraTests\VectorArithmeticTheory.cs" />
<Compile Include="MatrixHelpers.cs" />
<Compile Include="NumberTheoryTests\GcdRelatedTest.cs" />
<Compile Include="NumberTheoryTests\GcdRelatedTestBigInteger.cs" />
<Compile Include="NumberTheoryTests\IntegerTheoryTest.cs" />

12
src/UnitTests/UseLinearAlgebraProvider.cs

@ -28,13 +28,15 @@
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
using System;
using NUnit.Framework;
namespace MathNet.Numerics.UnitTests
{
public class UseLinearAlgebraProvider : TestActionAttribute
[AttributeUsage(AttributeTargets.Assembly)]
public class UseLinearAlgebraProvider : Attribute, ITestAction
{
public override void BeforeTest(TestDetails testDetails)
public void BeforeTest(TestDetails testDetails)
{
var provider = Properties.Settings.Default.LinearAlgebraProvider.ToLowerInvariant();
@ -44,7 +46,11 @@ namespace MathNet.Numerics.UnitTests
}
}
public override ActionTargets Targets
public void AfterTest(TestDetails details)
{
}
public ActionTargets Targets
{
get { return ActionTargets.Suite; }
}

Loading…
Cancel
Save