46 int main(
int argc,
char* argv[])
48 int numberFailedTests = 0;
50 if (argc>1)
if (argv[1][0]==
'-' && argv[1][1]==
'v') verbose =
true;
69 for(i = 0; i < 16; i++)
74 for(i = 0; i < 4; i++)
82 Ad[0] = 1; Ad[2] = 1; Ad[5] = 1; Ad[8] = 2; Ad[9] = 1; Ad[10] = 1; Ad[14] = 2; Ad[15] = 2;
84 bd[1] = 2; bd[2] = 1; bd[3] = 2;
85 Af[0] = 1; Af[2] = 1; Af[5] = 1; Af[8] = 2; Af[9] = 1; Af[10] = 1; Af[14] = 2; Af[15] = 2;
87 bf[1] = 2; bf[2] = 1; bf[3] = 2;
89 if (verbose) std::cout <<
"GESV test ... ";
90 L.
GESV(4, 1, Ad, 4, IPIV, bd, 4, &info);
91 M.
GESV(4, 1, Af, 4, IPIV, bf, 4, &info);
92 for(i = 0; i < 4; i++)
95 if (verbose && i==3) std::cout <<
"passed!" << std::endl;
97 if (verbose) std::cout <<
"FAILED" << std::endl;
103 if (verbose) std::cout <<
"LAPY2 test ... ";
104 float fx = 3, fy = 4;
105 float flapy = M.
LAPY2(fx, fy);
106 double dx = 3, dy = 4;
107 double dlapy = L.
LAPY2(dx, dy);
108 if ( dlapy == flapy && dlapy == 5.0 && flapy == 5.0
f ) {
109 if (verbose) std::cout <<
"passed!" << std::endl;
111 if (verbose) std::cout <<
"FAILED (" << dlapy <<
" != " << flapy <<
")" << std::endl;
115 #if ! (defined(__INTEL_COMPILER) && defined(_WIN32) ) 120 if (verbose) std::cout <<
"ILAENV test ... ";
124 if (verbose) std::cout <<
"passed!" << std::endl;
126 if (verbose) std::cout <<
"FAILED!" << std::endl;
132 if(numberFailedTests > 0)
135 std::cout <<
"Number of failed tests: " << numberFailedTests << std::endl;
136 std::cout <<
"End Result: TEST FAILED" << std::endl;
140 if(numberFailedTests==0)
141 std::cout <<
"End Result: TEST PASSED" << std::endl;
void GESV(const OrdinalType n, const OrdinalType nrhs, ScalarType *A, const OrdinalType lda, OrdinalType *IPIV, ScalarType *B, const OrdinalType ldb, OrdinalType *info) const
Computes the solution to a real system of linear equations A*X=B, where A is factored through GETRF a...
ScalarType LAPY2(const ScalarType x, const ScalarType y) const
Computes x^2 + y^2 safely, to avoid overflow.
OrdinalType ILAENV(const OrdinalType ispec, const std::string &NAME, const std::string &OPTS, const OrdinalType N1=-1, const OrdinalType N2=-1, const OrdinalType N3=-1, const OrdinalType N4=-1) const
Chooses problem-dependent parameters for the local environment.
Templated interface class to LAPACK routines.
The Templated LAPACK Wrapper Class.
std::string Teuchos_Version()
int size(const Comm< Ordinal > &comm)
Get the number of processes in the communicator.
int main(int argc, char *argv[])