Commit 6615f254 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

USE_STERF preprocessor flag

Say -DUSE_STERF to use [ds]sterf instead of [ds]stedc
parent 84cb2ee4
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -223,7 +223,22 @@ extern "C" void cstedc_(char*,
                        int*,
                        int*);

extern "C" void dsterf_(int*, double*, double*, int*);

extern "C" void ssterf_(int*, float*, float*, int*);

// ============================================================================

inline void STERF(int* n, double* d, double* e, int* info)
{
	dsterf_(n, d, e, info);
}

inline void STERF(int* n, float* d, float* e, int* info)
{
	ssterf_(n, d, e, info);
}

inline void GESV(int ma,
                 int mb,
                 float* a,
+3 −0
Original line number Diff line number Diff line
#include "TridiagonalMatrix.h"

#ifndef USE_STERF

namespace PsimagLite {

template<>
@@ -69,3 +71,4 @@ void TridiagonalMatrix<float>::diag(TridiagonalMatrix<float>::VectorRealType& ei
}

}
#endif
+15 −0
Original line number Diff line number Diff line
@@ -142,7 +142,22 @@ public:
		m(n - 1, n - 1) = a_[n-1];
	}


#ifndef USE_STERF
	void diag(VectorRealType&, SizeType) const;
#else
	void diag(VectorRealType& eigs, SizeType nn)
	{
		int n = nn;
		VectorType e = b_;
		eigs = a_;
		int info = 0;
		psimag::LAPACK::STERF(&n, &(eigs[0]), &(e[1]), &info);

		if (info == 0) return;
		throw RuntimeError("FATAL: *sterf_ failed with info = " + ttos(info) + "\n");
	}
#endif

	void push(const FieldType& a,const FieldType& b)
	{