-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d96b34f
commit b89ab7b
Showing
13 changed files
with
22 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "block_ldlt.hxx" | ||
|
@@ -132,7 +129,7 @@ void print_d(int n, T *d) { | |
template <typename T> | ||
void make_singular(int n, int col1, int col2, T *a, int lda) { | ||
T *col = new T[n]; | ||
|
||
T a11 = a[col1*(lda+1)]; | ||
T a21 = (col1 < col2) ? a[col1*lda + col2] | ||
: a[col2*lda + col1]; | ||
|
@@ -208,7 +205,7 @@ int test_maxloc(int from, bool zero=false) { | |
} | ||
} | ||
|
||
/* Call both simple and avx versions and check they get the same answer */ | ||
/* Call both simple and avx versions and check they get the same answer */ | ||
T mv1, mv2; | ||
int rloc1, cloc1, rloc2, cloc2; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "cholesky.hxx" | ||
|
@@ -27,7 +24,7 @@ int test_cholesky(int m, int n, int blksz, bool debug=false) { | |
/* Take a copy */ | ||
double *l = new double[m*lda]; | ||
memcpy(l, a, m*lda*sizeof(double)); | ||
|
||
/* Factor first m x n part with our code, generate contrib block */ | ||
if(debug) { printf("PRE:\n"); print_mat(" %e", m, l, lda); } | ||
int info; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "framework.hxx" | ||
|
@@ -103,7 +100,7 @@ double backward_error(int n, double const* a, int lda, double const* rhs, int nr | |
for(int i=0; i<n; ++i) { | ||
rhsnorm = std::max(rhsnorm, fabs(rhs[i])); | ||
residnorm = std::max(residnorm, fabs(resid[i])); | ||
if(std::isnan(resid[i])) residnorm = resid[i]; | ||
if(std::isnan(resid[i])) residnorm = resid[i]; | ||
solnnorm = std::max(solnnorm, fabs(r*ldsoln+soln[i])); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "ldlt_app.hxx" | ||
|
@@ -83,7 +80,7 @@ void solve(int m, int n, const int *perm, const T *l, int ldl, const T *d, const | |
template <typename T> | ||
void make_singular(int n, int col1, int col2, T *a, int lda) { | ||
T *col = new T[n]; | ||
|
||
T a11 = a[col1*(lda+1)]; | ||
T a21 = (col1 < col2) ? a[col1*lda + col2] | ||
: a[col2*lda + col1]; | ||
|
@@ -411,7 +408,7 @@ template <typename T> | |
void print_mat (int n, int *perm, T *a, int lda) { | ||
for(int i=0; i<n; i++) { | ||
printf("%d:", perm[i]); | ||
for(int j=0; j<n; j++) | ||
for(int j=0; j<n; j++) | ||
printf(" %le", a[j*lda+i]); | ||
printf("\n"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "ldlt_nopiv.hxx" | ||
|
@@ -27,7 +24,7 @@ int test_ldlt(int m, int n, bool debug=false) { | |
/* Take a copy */ | ||
double *l = new double[m*lda]; | ||
memcpy(l, a, m*lda*sizeof(double)); | ||
|
||
/* Factor first m x n part with our code */ | ||
double *work = new double[2*m]; | ||
if(debug) { printf("PRE:\n"); print_mat(" %e", m, l, lda); } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#include "ldlt_tpp.hxx" | ||
|
@@ -83,7 +80,7 @@ void solve(int m, int n, const int *perm, const T *l, int ldl, const T *d, const | |
template <typename T> | ||
void make_singular(int n, int col1, int col2, T *a, int lda) { | ||
T *col = new T[n]; | ||
|
||
T a11 = a[col1*(lda+1)]; | ||
T a21 = (col1 < col2) ? a[col1*lda + col2] | ||
: a[col2*lda + col1]; | ||
|
@@ -337,7 +334,7 @@ template <typename T> | |
void print_mat (int n, int *perm, T *a, int lda) { | ||
for(int i=0; i<n; i++) { | ||
printf("%d:", perm[i]); | ||
for(int j=0; j<n; j++) | ||
for(int j=0; j<n; j++) | ||
printf(" %le", a[j*lda+i]); | ||
printf("\n"); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
* | ||
* Authors: Jonathan Hogg (STFC) | ||
* | ||
* IMPORTANT: This file is NOT licenced under the BSD licence. If you wish to | ||
* licence this code, please contact STFC via [email protected] | ||
* (We are currently deciding what licence to release this code under if it | ||
* proves to be useful beyond our own academic experiments) | ||
* Licence: BSD licence, see LICENCE file for details | ||
* | ||
*/ | ||
#pragma once | ||
|