  #  ifdef HAVE_TEUCHOS_COMPLEX
       template BLAS<long int, std::complex<float> >;
       template BLAS<long int, std::complex<double> >;
-diff -ruN trilinos-11.4.3/packages/teuchos/numerics/src/Teuchos_BLAS.cpp.orig trilinos-11.4.3-patched/packages/teuchos/numerics/src/Teuchos_BLAS.cpp.orig
---- trilinos-11.4.3/packages/teuchos/numerics/src/Teuchos_BLAS.cpp.orig	1969-12-31 17:00:00.000000000 -0700
-+++ trilinos-11.4.3-patched/packages/teuchos/numerics/src/Teuchos_BLAS.cpp.orig	2014-03-11 12:51:18.000000000 -0600
-@@ -0,0 +1,530 @@
-+// @HEADER
-+// ***********************************************************************
-+//
-+//                    Teuchos: Common Tools Package
-+//                 Copyright (2004) Sandia Corporation
-+//
-+// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
-+// license for use of this work by or on behalf of the U.S. Government.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// 1. Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+//
-+// 2. Redistributions in binary form must reproduce the above copyright
-+// notice, this list of conditions and the following disclaimer in the
-+// documentation and/or other materials provided with the distribution.
-+//
-+// 3. Neither the name of the Corporation nor the names of the
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
-+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
-+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+//
-+// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
-+//
-+// ***********************************************************************
-+// @HEADER
-+
-+#include "Teuchos_BLAS.hpp"
-+#include "Teuchos_BLAS_wrappers.hpp"
-+
-+/* for INTEL_CXML, the second arg may need to be changed to 'one'.  If so
-+the appropriate declaration of one will need to be added back into
-+functions that include the macro:
-+*/
-+
-+namespace {
-+#if defined (INTEL_CXML)
-+        unsigned int one=1;
-+#endif
-+} // namespace
-+
-+#ifdef CHAR_MACRO
-+#undef CHAR_MACRO
-+#endif
-+#if defined (INTEL_CXML)
-+#define CHAR_MACRO(char_var) &char_var, one
-+#else
-+#define CHAR_MACRO(char_var) &char_var
-+#endif
-+
-+
-+const char Teuchos::ESideChar[] = {'L' , 'R' };
-+const char Teuchos::ETranspChar[] = {'N' , 'T' , 'C' };
-+const char Teuchos::EUploChar[] = {'U' , 'L' };
-+const char Teuchos::EDiagChar[] = {'U' , 'N' };
-+const char Teuchos::ETypeChar[] = {'G' , 'L', 'U', 'H', 'B', 'Q', 'Z' };
-+//const char Teuchos::EFactChar[] = {'F', 'N' };
-+//const char Teuchos::ENormChar[] = {'O', 'I' };
-+//const char Teuchos::ECompQChar[] = {'N', 'I', 'V' };
-+//const char Teuchos::EJobChar[] = {'E', 'V', 'B' };
-+//const char Teuchos::EJobSChar[] = {'E', 'S' };
-+//const char Teuchos::EJobVSChar[] = {'V', 'N' };
-+//const char Teuchos::EHowmnyChar[] = {'A', 'S' };
-+//const char Teuchos::ECMachChar[] = {'E', 'S', 'B', 'P', 'N', 'R', 'M', 'U', 'L', 'O' };
-+//const char Teuchos::ESortChar[] = {'N', 'S'};
-+
-+
-+namespace {
-+
-+
-+template<typename Scalar>
-+Scalar generic_dot(const int n, const Scalar* x, const int incx,
-+  const Scalar* y, const int incy)
-+{
-+  typedef Teuchos::ScalarTraits<Scalar> ST;
-+  Scalar dot = 0.0;
-+  if (incx==1 && incy==1) {
-+    for (int i = 0; i < n; ++i)
-+      dot += (*x++)*ST::conjugate(*y++);
-+  }
-+  else {
-+    if (incx < 0)
-+      x = x - incx*(n-1);
-+    if (incy < 0)
-+      y = y - incy*(n-1);
-+    for (int i = 0; i < n; ++i, x+=incx, y+=incy)
-+      dot += (*x)*ST::conjugate(*y);
-+  }
-+  return dot;
-+}
-+
-+
-+} // namespace
-+
-+
-+namespace Teuchos {
-+
-+//Explicitly instantiating these templates for windows due to an issue with
-+//resolving them when linking dlls.
-+#ifdef _WIN32
-+#  ifdef HAVE_TEUCHOS_COMPLEX
-+     template BLAS<long int, std::complex<float> >;
-+     template BLAS<long int, std::complex<double> >;
-+#  endif
-+     template BLAS<long int, float>;
-+     template BLAS<long int, double>;
-+#endif
-+
-+  // *************************** BLAS<int,float> DEFINITIONS ******************************
-+
-+  void BLAS<int, float>::ROTG(float* da, float* db, float* c, float* s) const
-+  { SROTG_F77(da, db, c, s ); }
-+
-+  void BLAS<int, float>::ROT(const int n, float* dx, const int incx, float* dy, const int incy, float* c, float* s) const
-+  { SROT_F77(&n, dx, &incx, dy, &incy, c, s); }
-+
-+
-+  float BLAS<int, float>::ASUM(const int n, const float* x, const int incx) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    return cblas_sasum(n, x, incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    float tmp = SASUM_F77(&n, x, &incx);
-+    return tmp;
-+#else
-+    typedef ScalarTraits<float> ST;
-+    float sum = 0.0;
-+    if (incx == 1) {
-+      for (int i = 0; i < n; ++i)
-+        sum += ST::magnitude(*x++);
-+    }
-+    else {
-+      for (int i = 0; i < n; ++i, x+=incx)
-+        sum += ST::magnitude(*x);
-+    }
-+    return sum;
-+#endif
-+  }
-+
-+  void BLAS<int, float>::AXPY(const int n, const float alpha, const float* x, const int incx, float* y, const int incy) const
-+  { SAXPY_F77(&n, &alpha, x, &incx, y, &incy); }
-+
-+  void BLAS<int, float>::COPY(const int n, const float* x, const int incx, float* y, const int incy) const
-+  { SCOPY_F77(&n, x, &incx, y, &incy); }
-+
-+  float BLAS<int, float>::DOT(const int n, const float* x, const int incx, const float* y, const int incy) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    return cblas_sdot(n, x, incx, y, incy);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    return SDOT_F77(&n, x, &incx, y, &incy);
-+#else
-+    return generic_dot(n, x, incx, y, incy);
-+#endif
-+  }
-+
-+  int BLAS<int, float>::IAMAX(const int n, const float* x, const int incx) const
-+  { return ISAMAX_F77(&n, x, &incx); }
-+
-+  float BLAS<int, float>::NRM2(const int n, const float* x, const int incx) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    return cblas_snrm2(n, x, incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    return SNRM2_F77(&n, x, &incx);
-+#else
-+    return ScalarTraits<float>::squareroot(generic_dot(n, x, incx, x, incx));
-+#endif
-+  }
-+
-+  void BLAS<int, float>::SCAL(const int n, const float alpha, float* x, const int incx) const
-+  { SSCAL_F77(&n, &alpha, x, &incx); }
-+
-+  void BLAS<int, float>::GEMV(ETransp trans, const int m, const int n, const float alpha, const float* A, const int lda, const float* x, const int incx, const float beta, float* y, const int incy) const
-+  { SGEMV_F77(CHAR_MACRO(ETranspChar[trans]), &m, &n, &alpha, A, &lda, x, &incx, &beta, y, &incy); }
-+
-+  void BLAS<int, float>::GER(const int m, const int n, const float alpha, const float* x, const int incx, const float* y, const int incy, float* A, const int lda) const
-+  { SGER_F77(&m, &n, &alpha, x, &incx, y, &incy, A, &lda); }
-+
-+  void BLAS<int, float>::TRMV(EUplo uplo, ETransp trans, EDiag diag, const int n, const float* A, const int lda, float* x, const int incx) const
-+  { STRMV_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), CHAR_MACRO(EDiagChar[diag]), &n, A, &lda, x, &incx); }
-+
-+  void BLAS<int, float>::GEMM(ETransp transa, ETransp transb, const int m, const int n, const int k, const float alpha, const float* A, const int lda, const float* B, const int ldb, const float beta, float* C, const int ldc) const
-+  { SGEMM_F77(CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(ETranspChar[transb]), &m, &n, &k, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, float>::SYMM(ESide side, EUplo uplo, const int m, const int n, const float alpha, const float* A, const int lda, const float* B, const int ldb, const float beta, float* C, const int ldc) const
-+  { SSYMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), &m, &n, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, float>::SYRK(EUplo uplo, ETransp trans, const int n, const int k, const float alpha, const float* A, const int lda, const float beta, float* C, const int ldc) const
-+  { SSYRK_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), &n, &k, &alpha, A, &lda, &beta, C, &ldc); }
-+
-+  void BLAS<int, float>::TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const float alpha, const float* A, const int lda, float* B, const int ldb) const
-+  { STRMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  void BLAS<int, float>::TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const float alpha, const float* A, const int lda, float* B, const int ldb) const
-+  { STRSM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  // *************************** BLAS<int,double> DEFINITIONS ******************************
-+
-+  void BLAS<int, double>::ROTG(double* da, double* db, double* c, double* s) const
-+  { DROTG_F77(da, db, c, s); }
-+
-+  void BLAS<int, double>::ROT(const int n, double* dx, const int incx, double* dy, const int incy, double* c, double* s) const
-+  { DROT_F77(&n, dx, &incx, dy, &incy, c, s); }
-+
-+  double BLAS<int, double>::ASUM(const int n, const double* x, const int incx) const
-+  { return DASUM_F77(&n, x, &incx); }
-+
-+  void BLAS<int, double>::AXPY(const int n, const double alpha, const double* x, const int incx, double* y, const int incy) const
-+  { DAXPY_F77(&n, &alpha, x, &incx, y, &incy); }
-+
-+  void BLAS<int, double>::COPY(const int n, const double* x, const int incx, double* y, const int incy) const
-+  { DCOPY_F77(&n, x, &incx, y, &incy); }
-+
-+  double BLAS<int, double>::DOT(const int n, const double* x, const int incx, const double* y, const int incy) const
-+  {
-+    return DDOT_F77(&n, x, &incx, y, &incy);
-+  }
-+
-+  int BLAS<int, double>::IAMAX(const int n, const double* x, const int incx) const
-+  { return IDAMAX_F77(&n, x, &incx); }
-+
-+  double BLAS<int, double>::NRM2(const int n, const double* x, const int incx) const
-+  { return DNRM2_F77(&n, x, &incx); }
-+
-+  void BLAS<int, double>::SCAL(const int n, const double alpha, double* x, const int incx) const
-+  { DSCAL_F77(&n, &alpha, x, &incx); }
-+
-+  void BLAS<int, double>::GEMV(ETransp trans, const int m, const int n, const double alpha, const double* A, const int lda, const double* x, const int incx, const double beta, double* y, const int incy) const
-+  { DGEMV_F77(CHAR_MACRO(ETranspChar[trans]), &m, &n, &alpha, A, &lda, x, &incx, &beta, y, &incy); }
-+
-+  void BLAS<int, double>::GER(const int m, const int n, const double alpha, const double* x, const int incx, const double* y, const int incy, double* A, const int lda) const
-+  { DGER_F77(&m, &n, &alpha, x, &incx, y, &incy, A, &lda); }
-+
-+  void BLAS<int, double>::TRMV(EUplo uplo, ETransp trans, EDiag diag, const int n, const double* A, const int lda, double* x, const int incx) const
-+  { DTRMV_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), CHAR_MACRO(EDiagChar[diag]), &n, A, &lda, x, &incx); }
-+
-+  void BLAS<int, double>::GEMM(ETransp transa, ETransp transb, const int m, const int n, const int k, const double alpha, const double* A, const int lda, const double* B, const int ldb, const double beta, double* C, const int ldc) const
-+  { DGEMM_F77(CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(ETranspChar[transb]), &m, &n, &k, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, double>::SYMM(ESide side, EUplo uplo, const int m, const int n, const double alpha, const double* A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc) const
-+  { DSYMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), &m, &n, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, double>::SYRK(EUplo uplo, ETransp trans, const int n, const int k, const double alpha, const double* A, const int lda, const double beta, double* C, const int ldc) const
-+  { DSYRK_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), &n, &k, &alpha, A, &lda, &beta, C, &ldc); }
-+
-+  void BLAS<int, double>::TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const double alpha, const double* A, const int lda, double* B, const int ldb) const
-+  { DTRMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  void BLAS<int, double>::TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const double alpha, const double* A, const int lda, double* B, const int ldb) const
-+  { DTRSM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+#ifdef HAVE_TEUCHOS_COMPLEX
-+
-+  // *************************** BLAS<int,std::complex<float> > DEFINITIONS ******************************
-+
-+  void BLAS<int, std::complex<float> >::ROTG(std::complex<float>* da, std::complex<float>* db, float* c, std::complex<float>* s) const
-+  { CROTG_F77(da, db, c, s ); }
-+
-+  void BLAS<int, std::complex<float> >::ROT(const int n, std::complex<float>* dx, const int incx, std::complex<float>* dy, const int incy, float* c, std::complex<float>* s) const
-+  { CROT_F77(&n, dx, &incx, dy, &incy, c, s); }
-+
-+  float BLAS<int, std::complex<float> >::ASUM(const int n, const std::complex<float>* x, const int incx) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    return cblas_scasum(n, x, incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
-+    return (float) SCASUM_F77(&n, x, &incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    return SCASUM_F77(&n, x, &incx);
-+#else // Wow, you just plain don't have this routine.
-+    // mfh 01 Feb 2013: See www.netlib.org/blas/scasum.f.
-+    // I've enhanced this by accumulating in double precision.
-+    double result = 0;
-+    if (incx == 1) {
-+      for (int i = 0; i < n; ++i) {
-+	result += std::abs (std::real (x[i])) + std::abs (std::imag (x[i]));
-+      }
-+    } else {
-+      const int nincx = n * incx;
-+      for (int i = 0; i < nincx; i += incx) {
-+	result += std::abs (std::real (x[i])) + std::abs (std::imag (x[i]));
-+      }
-+    }
-+    return static_cast<float> (result);
-+#endif
-+  }
-+
-+  void BLAS<int, std::complex<float> >::AXPY(const int n, const std::complex<float> alpha, const std::complex<float>* x, const int incx, std::complex<float>* y, const int incy) const
-+  { CAXPY_F77(&n, &alpha, x, &incx, y, &incy); }
-+
-+  void BLAS<int, std::complex<float> >::COPY(const int n, const std::complex<float>* x, const int incx, std::complex<float>* y, const int incy) const
-+  { CCOPY_F77(&n, x, &incx, y, &incy); }
-+
-+  std::complex<float> BLAS<int, std::complex<float> >::DOT(const int n, const std::complex<float>* x, const int incx, const std::complex<float>* y, const int incy) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    std::complex<float> z;
-+    cblas_cdotc_sub(n,x,incx,y,incy,&z);
-+    return z;
-+#elif defined(HAVE_COMPLEX_BLAS_PROBLEM) && defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
-+    std::complex<float> z;
-+    CDOT_F77(&z, &n, x, &incx, y, &incy);
-+    return z;
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    return CDOT_F77(&n, x, &incx, y, &incy);
-+#else // Wow, you just plain don't have this routine.
-+    // mfh 01 Feb 2013: See www.netlib.org/blas/cdotc.f.
-+    // I've enhanced this by accumulating in double precision.
-+    std::complex<double> result (0, 0);
-+    if (n >= 0) {
-+      if (incx == 1 && incy == 1) {
-+	for (int i = 0; i < n; ++i) {
-+	  result += std::conj (x[i]) * y[i];
-+	}
-+      } else {
-+	int ix = 0;
-+	int iy = 0;
-+	if (incx < 0) {
-+	  ix = (1-n) * incx;
-+	}
-+	if (incy < 0) {
-+	  iy = (1-n) * incy;    
-+	}
-+	for (int i = 0; i < n; ++i) {
-+	  result += std::conj (x[ix]) * y[iy];
-+	  ix += incx;
-+	  iy += incy;
-+	}
-+      }
-+    }
-+    return static_cast<std::complex<float> > (result);
-+#endif
-+  }
-+
-+  int BLAS<int, std::complex<float> >::IAMAX(const int n, const std::complex<float>* x, const int incx) const
-+  { return ICAMAX_F77(&n, x, &incx); }
-+
-+  float BLAS<int, std::complex<float> >::NRM2(const int n, const std::complex<float>* x, const int incx) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    return cblas_scnrm2(n, x, incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
-+    return (float) SCNRM2_F77(&n, x, &incx);
-+#elif defined(HAVE_TEUCHOS_BLASFLOAT)
-+    return SCNRM2_F77(&n, x, &incx);
-+#else // Wow, you just plain don't have this routine.
-+    // mfh 01 Feb 2013: See www.netlib.org/blas/scnrm2.f.
-+    // I've enhanced this by accumulating in double precision.
-+    if (n < 1 || incx < 1) {
-+      return 0;
-+    } else {
-+      double scale = 0;
-+      double ssq = 1;
-+
-+      const int upper = 1 + (n-1)*incx;
-+      for (int ix = 0; ix < upper; ix += incx) {
-+	// The reference BLAS implementation cleverly scales the
-+	// intermediate result. so that even if the square of the norm
-+	// would overflow, computing the norm itself does not.  Hence,
-+	// "ssq" for "scaled square root."
-+	if (std::real (x[ix]) != 0) {
-+	  const double temp = std::abs (std::real (x[ix]));
-+	  if (scale < temp) {
-+	    const double scale_over_temp = scale / temp;
-+	    ssq = 1 + ssq * scale_over_temp*scale_over_temp;
-+	    // New scaling factor: biggest (in magnitude) real or imaginary part seen thus far.
-+	    scale = temp;
-+	  } else {
-+	    const double temp_over_scale = temp / scale;
-+	    ssq = ssq + temp_over_scale*temp_over_scale;
-+	  }
-+	}
-+	if (std::imag (x[ix]) != 0) {
-+	  const double temp = std::abs (std::imag (x[ix]));
-+	  if (scale < temp) {
-+	    const double scale_over_temp = scale / temp;
-+	    ssq = 1 + ssq * scale_over_temp*scale_over_temp;
-+	    // New scaling factor: biggest (in magnitude) real or imaginary part seen thus far.
-+	    scale = temp;
-+	  } else {
-+	    const double temp_over_scale = temp / scale;
-+	    ssq = ssq + temp_over_scale*temp_over_scale;
-+	  }
-+	}
-+      }
-+      return static_cast<float> (scale * std::sqrt (ssq));
-+    }
-+#endif
-+  }
-+
-+  void BLAS<int, std::complex<float> >::SCAL(const int n, const std::complex<float> alpha, std::complex<float>* x, const int incx) const
-+  { CSCAL_F77(&n, &alpha, x, &incx); }
-+
-+  void BLAS<int, std::complex<float> >::GEMV(ETransp trans, const int m, const int n, const std::complex<float> alpha, const std::complex<float>* A, const int lda, const std::complex<float>* x, const int incx, const std::complex<float> beta, std::complex<float>* y, const int incy) const
-+  { CGEMV_F77(CHAR_MACRO(ETranspChar[trans]), &m, &n, &alpha, A, &lda, x, &incx, &beta, y, &incy); }
-+
-+  void BLAS<int, std::complex<float> >::GER(const int m, const int n, const std::complex<float> alpha, const std::complex<float>* x, const int incx, const std::complex<float>* y, const int incy, std::complex<float>* A, const int lda) const
-+  { CGER_F77(&m, &n, &alpha, x, &incx, y, &incy, A, &lda); }
-+
-+  void BLAS<int, std::complex<float> >::TRMV(EUplo uplo, ETransp trans, EDiag diag, const int n, const std::complex<float>* A, const int lda, std::complex<float>* x, const int incx) const
-+  { CTRMV_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), CHAR_MACRO(EDiagChar[diag]), &n, A, &lda, x, &incx); }
-+
-+  void BLAS<int, std::complex<float> >::GEMM(ETransp transa, ETransp transb, const int m, const int n, const int k, const std::complex<float> alpha, const std::complex<float>* A, const int lda, const std::complex<float>* B, const int ldb, const std::complex<float> beta, std::complex<float>* C, const int ldc) const
-+  { CGEMM_F77(CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(ETranspChar[transb]), &m, &n, &k, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<float> >::SYMM(ESide side, EUplo uplo, const int m, const int n, const std::complex<float> alpha, const std::complex<float>* A, const int lda, const std::complex<float>* B, const int ldb, const std::complex<float> beta, std::complex<float>* C, const int ldc) const
-+  { CSYMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), &m, &n, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<float> >::SYRK(EUplo uplo, ETransp trans, const int n, const int k, const std::complex<float> alpha, const std::complex<float>* A, const int lda, const std::complex<float> beta, std::complex<float>* C, const int ldc) const
-+  { CSYRK_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), &n, &k, &alpha, A, &lda, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<float> >::TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const std::complex<float> alpha, const std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb) const
-+  { CTRMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  void BLAS<int, std::complex<float> >::TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const std::complex<float> alpha, const std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb) const
-+  { CTRSM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  // *************************** BLAS<int,std::complex<double> > DEFINITIONS ******************************
-+
-+  void BLAS<int, std::complex<double> >::ROTG(std::complex<double>* da, std::complex<double>* db, double* c, std::complex<double>* s) const
-+  { ZROTG_F77(da, db, c, s); }
-+
-+  void BLAS<int, std::complex<double> >::ROT(const int n, std::complex<double>* dx, const int incx, std::complex<double>* dy, const int incy, double* c, std::complex<double>* s) const
-+  { ZROT_F77(&n, dx, &incx, dy, &incy, c, s); }
-+
-+  double BLAS<int, std::complex<double> >::ASUM(const int n, const std::complex<double>* x, const int incx) const
-+  { return ZASUM_F77(&n, x, &incx); }
-+
-+  void BLAS<int, std::complex<double> >::AXPY(const int n, const std::complex<double> alpha, const std::complex<double>* x, const int incx, std::complex<double>* y, const int incy) const
-+  { ZAXPY_F77(&n, &alpha, x, &incx, y, &incy); }
-+
-+  void BLAS<int, std::complex<double> >::COPY(const int n, const std::complex<double>* x, const int incx, std::complex<double>* y, const int incy) const
-+  { ZCOPY_F77(&n, x, &incx, y, &incy); }
-+
-+  std::complex<double> BLAS<int, std::complex<double> >::DOT(const int n, const std::complex<double>* x, const int incx, const std::complex<double>* y, const int incy) const
-+  {
-+#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
-+    std::complex<double> z;
-+    cblas_zdotc_sub(n,x,incx,y,incy,&z);
-+    return z;
-+#elif defined(HAVE_COMPLEX_BLAS_PROBLEM)
-+#  if defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
-+    std::complex<double> z;
-+    ZDOT_F77(&z, &n, x, &incx, y, &incy);
-+    return z;
-+#  else 
-+    // mfh 01 Feb 2013: Your complex BLAS is broken, but the problem
-+    // doesn't have the easy workaround.  I'll just reimplement the
-+    // missing routine here.  See www.netlib.org/blas/zdotc.f.
-+    std::complex<double> ztemp (0, 0);
-+    if (n > 0) {
-+      if (incx == 1 && incy == 1) {
-+	for (int i = 0; i < n; ++i) {
-+	  ztemp += std::conj (x[i]) * y[i];
-+	}
-+      } else {
-+	int ix = 0;
-+	int iy = 0;
-+	if (incx < 0) {
-+	  ix = (1-n)*incx;
-+	}
-+	if (incy < 0) {
-+	  iy = (1-n)*incy;
-+	}
-+	for (int i = 0; i < n; ++i) {
-+	  ztemp += std::conj (x[ix]) * y[iy];
-+	  ix += incx;
-+	  iy += incy;
-+	}
-+      }
-+    }
-+    return ztemp;
-+
-+#  endif // defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
-+#else
-+    return ZDOT_F77(&n, x, &incx, y, &incy);
-+#endif
-+  }
-+
-+  int BLAS<int, std::complex<double> >::IAMAX(const int n, const std::complex<double>* x, const int incx) const
-+  { return IZAMAX_F77(&n, x, &incx); }
-+
-+  double BLAS<int, std::complex<double> >::NRM2(const int n, const std::complex<double>* x, const int incx) const
-+  { return ZNRM2_F77(&n, x, &incx); }
-+
-+  void BLAS<int, std::complex<double> >::SCAL(const int n, const std::complex<double> alpha, std::complex<double>* x, const int incx) const
-+  { ZSCAL_F77(&n, &alpha, x, &incx); }
-+
-+  void BLAS<int, std::complex<double> >::GEMV(ETransp trans, const int m, const int n, const std::complex<double> alpha, const std::complex<double>* A, const int lda, const std::complex<double>* x, const int incx, const std::complex<double> beta, std::complex<double>* y, const int incy) const
-+  { ZGEMV_F77(CHAR_MACRO(ETranspChar[trans]), &m, &n, &alpha, A, &lda, x, &incx, &beta, y, &incy); }
-+
-+  void BLAS<int, std::complex<double> >::GER(const int m, const int n, const std::complex<double> alpha, const std::complex<double>* x, const int incx, const std::complex<double>* y, const int incy, std::complex<double>* A, const int lda) const
-+  { ZGER_F77(&m, &n, &alpha, x, &incx, y, &incy, A, &lda); }
-+
-+  void BLAS<int, std::complex<double> >::TRMV(EUplo uplo, ETransp trans, EDiag diag, const int n, const std::complex<double>* A, const int lda, std::complex<double>* x, const int incx) const
-+  { ZTRMV_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), CHAR_MACRO(EDiagChar[diag]), &n, A, &lda, x, &incx); }
-+
-+  void BLAS<int, std::complex<double> >::GEMM(ETransp transa, ETransp transb, const int m, const int n, const int k, const std::complex<double> alpha, const std::complex<double>* A, const int lda, const std::complex<double>* B, const int ldb, const std::complex<double> beta, std::complex<double>* C, const int ldc) const
-+  { ZGEMM_F77(CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(ETranspChar[transb]), &m, &n, &k, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<double> >::SYMM(ESide side, EUplo uplo, const int m, const int n, const std::complex<double> alpha, const std::complex<double>* A, const int lda, const std::complex<double> *B, const int ldb, const std::complex<double> beta, std::complex<double> *C, const int ldc) const
-+  { ZSYMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), &m, &n, &alpha, A, &lda, B, &ldb, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<double> >::SYRK(EUplo uplo, ETransp trans, const int n, const int k, const std::complex<double> alpha, const std::complex<double>* A, const int lda, const std::complex<double> beta, std::complex<double>* C, const int ldc) const
-+  { ZSYRK_F77(CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[trans]), &n, &k, &alpha, A, &lda, &beta, C, &ldc); }
-+
-+  void BLAS<int, std::complex<double> >::TRMM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const std::complex<double> alpha, const std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb) const
-+  { ZTRMM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+  void BLAS<int, std::complex<double> >::TRSM(ESide side, EUplo uplo, ETransp transa, EDiag diag, const int m, const int n, const std::complex<double> alpha, const std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb) const
-+  { ZTRSM_F77(CHAR_MACRO(ESideChar[side]), CHAR_MACRO(EUploChar[uplo]), CHAR_MACRO(ETranspChar[transa]), CHAR_MACRO(EDiagChar[diag]), &m, &n, &alpha, A, &lda, B, &ldb); }
-+
-+#endif // HAVE_TEUCHOS_COMPLEX
-+
-+}

 
 # if using parallel MUMPS, must also link in scalapack and BLACS
 
diff -ruN trilinos-11.4.3/packages/amesos/CMakeLists.txt.rej trilinos-11.4.3-patched/packages/amesos/CMakeLists.txt.rej
--- trilinos-11.4.3/packages/amesos/CMakeLists.txt.rej	1969-12-31 17:00:00.000000000 -0700
+++ trilinos-11.4.3-patched/packages/amesos/CMakeLists.txt.rej	2014-03-11 12:51:18.000000000 -0600
@@ -0,0 +1,21 @@
+--- packages/amesos/CMakeLists.txt	2013-11-04 12:26:37.000000000 -0700
++++ packages/amesos/CMakeLists.txt	2014-01-09 21:22:55.685993200 -0700
+@@ -12,10 +12,15 @@
+ # B) Set up package-specific options
+ #
+ 
++#
++# TMA: We can actually build SuperLU_Dist without ParMETIS per a recent Tech-X
++# change made with the help of Sherry Li.
++#
++
+ # if using SuperLUDist, must also link in ParMETIS for some reason
+-IF(${PACKAGE_NAME}_ENABLE_SuperLUDist AND NOT ${PACKAGE_NAME}_ENABLE_ParMETIS)
+-  MESSAGE(FATAL_ERROR "The Amesos support for the SuperLUIDist TPL requires the ParMETIS TPL.  Either disable Amesos SuperLUDist support or enable the ParMETIS TPL.")
+-ENDIF()
++#IF(${PACKAGE_NAME}_ENABLE_SuperLUDist AND NOT ${PACKAGE_NAME}_ENABLE_ParMETIS)
++#  MESSAGE(FATAL_ERROR "The Amesos support for the SuperLUIDist TPL requires the ParMETIS TPL.  Either disable Amesos SuperLUDist support or enable the ParMETIS TPL.")
++#ENDIF()
+ 
+ # if using parallel MUMPS, must also link in scalapack and BLACS
+ 
diff -ruN trilinos-11.4.3/packages/amesos/src/Amesos_Superludist.h.orig trilinos-11.4.3-patched/packages/amesos/src/Amesos_Superludist.h.orig
--- trilinos-11.4.3/packages/amesos/src/Amesos_Superludist.h.orig	1969-12-31 17:00:00.000000000 -0700
+++ trilinos-11.4.3-patched/packages/amesos/src/Amesos_Superludist.h.orig	2014-03-11 12:51:18.000000000 -0600
@@ -0,0 +1,221 @@
+// @HEADER
+// ***********************************************************************
+// 
+//                Amesos: Direct Sparse Solver Package
+//                 Copyright (2004) Sandia Corporation
+// 
+// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
+// license for use of this work by or on behalf of the U.S. Government.
+// 
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//  
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//  
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+// Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
+// 
+// ***********************************************************************
+// @HEADER
+
+#ifndef AMESOS_SUPERLUDIST_H
+#define AMESOS_SUPERLUDIST_H
+
+#include "Amesos_ConfigDefs.h"
+#include "Amesos_BaseSolver.h"
+#include "Amesos_NoCopiable.h"
+#include "Amesos_Utils.h"
+#include "Amesos_Time.h"
+#include "Amesos_Status.h"
+#include "Amesos_Control.h"
+#include "Epetra_LinearProblem.h"
+#include "Teuchos_RCP.hpp"
+#ifdef EPETRA_MPI
+#include "Epetra_MpiComm.h"
+#else
+#include "Epetra_Comm.h"
+#endif
+
+
+// Amesos_Superludist_Pimpl contains a pointer to structures defined in 
+// superlu_ddefs.h.  This prevents Amesos_Superludist.h 
+// from having to include superludist.h.
+//
+//  Doxygen does not handle forward class references well.
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+class Amesos_Superlu_Pimpl ; 
+#endif
+
+
+//! Amesos_Superludist:  An object-oriented wrapper for Superludist.
+/*!  Amesos_Superludist will solve a linear systems of equations: <TT>A X = B</TT>
+   using Epetra objects and the Superludist solver library, where
+  <TT>A</TT> is an Epetra_RowMatrix and <TT>X</TT> and <TT>B</TT> are 
+  Epetra_MultiVector objects.
+*/
+class Amesos_Superludist: public Amesos_BaseSolver,
+                          private Amesos_Time,
+                          private Amesos_NoCopiable,
+                          private Amesos_Utils,
+                          private Amesos_Control,
+                          private Amesos_Status 
+{
+
+public: 
+
+  //@{ \name Constructor methods
+  //! Amesos_Superludist Constructor.
+  /*! Creates an Amesos_Superludist instance, using an Epetra_LinearProblem,
+      passing in an already-defined Epetra_LinearProblem object. 
+
+      Note: The operator in LinearProblem must be an
+      Epetra_RowMatrix.
+
+  */
+  Amesos_Superludist(const Epetra_LinearProblem& LinearProblem);
+
+  //! Amesos_Superludist Destructor.
+  /*! Completely deletes an Amesos_Superludist object.  
+  */  ~Amesos_Superludist(void);
+  //@}
+
+  //@{ \name Mathematical functions.
+
+  int SymbolicFactorization() ;
+
+  int NumericFactorization() ;
+
+  int Solve();
+
+
+  //@}
+  //@{ \name Attribute set methods
+  
+  //!  Amesos_Superludist does not support transpose at this time.
+  /*!  returns 0 if UseTranspose is set to false, else 1 (failure)
+   */
+  int SetUseTranspose(bool UseTranspose) { return( UseTranspose?1:0 );};
+
+  //@}
+  //@{ \name Attribute access functions
+
+  const Epetra_LinearProblem *GetProblem() const { return(Problem_); };
+
+  //! Returns true if SUPERLUDIST can handle this matrix shape 
+  /*! Returns true if the matrix shape is one that SUPERLUDIST can
+    handle. SUPERLUDIST only works with square matrices.  
+  */
+  bool MatrixShapeOK() const;
+
+  //! Always returns false. Superludist doesn't support transpose solve
+  bool UseTranspose() const {return(false);};
+  //@}
+
+  int SetParameters( Teuchos::ParameterList &ParameterList ) ;
+
+  //! Returns the number of symbolic factorizations performed by this object.
+  int NumSymbolicFact() const { return( Amesos_Status::NumSymbolicFact_ ); }
+
+  //! Returns the number of numeric factorizations performed by this object.
+  int NumNumericFact() const { return( Amesos_Status::NumNumericFact_ ); }
+
+  //! Returns the number of solves performed by this object.
+  int NumSolve() const { return( Amesos_Status::NumSolve_ ); }
+
+  //! Print various timig.
+  void PrintTiming() const;
+  
+  //! Print various information about the parameters used by Superludist.
+  void PrintStatus() const;
+
+  //! Extracts timing information from the current solver and places it in the parameter list.
+  void GetTiming( Teuchos::ParameterList &TimingParameterList ) const { Amesos_Time::GetTiming(TimingParameterList); }
+  
+private:  
+  inline const Epetra_Comm& Comm() const {return(GetProblem()->GetOperator()->Comm());};
+
+  inline const Epetra_Import& Importer() const
+  {
+    return(*(Importer_.get()));
+  }
+
+  inline const Epetra_Map& UniformMap() const
+  {
+    return(*(UniformMap_.get()));
+  }
+
+  inline const Epetra_RowMatrix& UniformMatrix() const
+  {
+    return(*(UniformMatrix_.get()));
+  }
+
+  inline Epetra_CrsMatrix& CrsUniformMatrix()
+  {
+    return(*(CrsUniformMatrix_.get()));
+  }
+
+  //
+  //  PrivateSuperluData_ contains pointers to data needed by klu whose
+  //  data structures are defined by klu.h
+  //
+  Teuchos::RCP<Amesos_Superlu_Pimpl> PrivateSuperluData_; 
+
+  int RedistributeA();
+
+  int ReFactor();
+  int Factor();
+  
+  const Epetra_LinearProblem* Problem_;
+  Epetra_RowMatrix *RowMatrixA_ ;  // Problem_->GetOperator()
+
+  RCP<Epetra_Map> UniformMap_;
+  RCP<Epetra_CrsMatrix> CrsUniformMatrix_;  
+  RCP<Epetra_RowMatrix> UniformMatrix_;  
+  Teuchos::RCP<Epetra_Import> Importer_;
+
+  //! Allows FactOption to be used on subsequent calls to pdgssvx from NumericFactorization
+  bool ReuseSymbolic_; 
+  //! redistribute the input matrix prior to calling Superludist
+  bool Redistribute_ ; 
+
+  //! \c true if the SuperLU_DIST's grid has been created (and has to be free'd)
+  int GridCreated_ ; 
+  int FactorizationDone_ ; 
+  //! \c true if NumericFactorization() has been successfully called.
+  bool FactorizationOK_ ;
+
+  //! Global dimension of the matrix.
+  int NumGlobalRows_; 
+
+  // Ap, Ai, Aval form the compressed row storage used by SuperLU_DIST
+  std::vector <int> Ap_;
+  std::vector <int> Ai_;
+  std::vector <double> Aval_;
+  //! Contains the global ID of local columns.
+  int* Global_Columns_;
+
+  int nprow_;
+  int npcol_;
+
+  bool PrintNonzeros_;
+  std::string ColPerm_;
+  std::string RowPerm_;
+  int* perm_c_;
+  int* perm_r_;
+  std::string IterRefine_;
+  bool ReplaceTinyPivot_;
+  bool Equil_;
+
+  int MtxConvTime_, MtxRedistTime_, VecRedistTime_;
+  int NumFactTime_, SolveTime_, OverheadTime_;
+ 
+};  // End of  class Amesos_Superludist  
+#endif /* AMESOS_SUPERLUDIST_H */
diff -ruN trilinos-11.4.3/packages/amesos/src/Amesos_Superludist.h.rej trilinos-11.4.3-patched/packages/amesos/src/Amesos_Superludist.h.rej
--- trilinos-11.4.3/packages/amesos/src/Amesos_Superludist.h.rej	1969-12-31 17:00:00.000000000 -0700
+++ trilinos-11.4.3-patched/packages/amesos/src/Amesos_Superludist.h.rej	2014-03-11 12:51:18.000000000 -0600
@@ -0,0 +1,13 @@
+--- packages/amesos/src/Amesos_Superludist.h	2013-11-04 12:26:38.000000000 -0700
++++ packages/amesos/src/Amesos_Superludist.h	2014-01-09 21:22:56.185199600 -0700
+@@ -115,8 +115,8 @@
+   */
+   bool MatrixShapeOK() const;
+ 
+-  //! Always returns true.
+-  bool UseTranspose() const {return(true);};
++  //! Always returns false.
++  bool UseTranspose() const {return(false);};
+   //@}
+ 
+   int SetParameters( Teuchos::ParameterList &ParameterList ) ;
diff -ruN trilinos-11.4.3/packages/ifpack/src/Ifpack_ICT.cpp trilinos-11.4.3-patched/packages/ifpack/src/Ifpack_ICT.cpp
--- trilinos-11.4.3/packages/ifpack/src/Ifpack_ICT.cpp	2013-11-21 13:11:43.000000000 -0700
+++ trilinos-11.4.3-patched/packages/ifpack/src/Ifpack_ICT.cpp	2014-03-11 12:51:18.000000000 -0600

 //#include "ml_lapack.h"
 #include "MLAPI_Error.h"
 #include "MLAPI_BaseObject.h"
diff -ruN trilinos-11.4.3/packages/ml/src/MLAPI/MLAPI_Workspace.cpp trilinos-11.4.3-patched/packages/ml/src/MLAPI/MLAPI_Workspace.cpp
--- trilinos-11.4.3/packages/ml/src/MLAPI/MLAPI_Workspace.cpp	2013-11-21 13:12:27.000000000 -0700
+++ trilinos-11.4.3-patched/packages/ml/src/MLAPI/MLAPI_Workspace.cpp	2014-03-11 12:51:18.000000000 -0600
