15 #ifndef QMCPLUSPLUS_DETERMINANT_OPERATORS_FAST_H 16 #define QMCPLUSPLUS_DETERMINANT_OPERATORS_FAST_H 39 inline static double zero() {
return 0.0; }
40 inline static double one() {
return 1.0; }
49 inline static std::complex<double>
one() {
return value_type(1.0, 0.0); }
57 inline static float zero() {
return 0.0f; }
58 inline static float one() {
return 1.0f; }
67 inline static std::complex<float>
one() {
return value_type(1.0f, 0.0f); }
81 c_ratio = T(1) / c_ratio;
82 BLAS::gemv(
'T',
m,
m, c_ratio, pinv,
m, tv, 1,
const_traits<T>::zero(), temp, 1);
84 memcpy(rcopy, pinv +
m * rowchanged,
m *
sizeof(T));
98 c_ratio =
cone / c_ratio;
99 BLAS::gemv(
'N',
m,
m, c_ratio, pinv,
m, tv, 1, T(), temp, 1);
100 temp[colchanged] =
cone - c_ratio;
107 const T* restrict r_replaced,
112 BLAS::gemv(
'T',
m, howmany, const_one(T()), tm_new,
m, r_replaced, 1, T(), ratios, 1);
115 template<
typename T,
typename INDARRAY>
117 const T* restrict r_replaced,
122 for (
int i = 0; i < ind.size(); ++i)
123 ratios[i] =
BLAS::dot(r_replaced, tm_new + ind[i] *
m,
m);
128 const T* restrict r_replaced,
133 for (
int i = 0; i < howmany; ++i)
134 ratios[i] =
BLAS::dot(r_replaced, tm_new + i *
m,
m);
145 template<
typename MAT,
typename VV>
148 return BLAS::dot(pinv.cols(), pinv.data() + colchanged, pinv.cols(), tc.data(), 1);
163 template<
typename MAT,
typename VV,
typename IV>
174 value_type old_v = refinv(r_replaced, colchanged);
177 for (
int i = 0; i < ind.size(); ++i)
178 ratios[i] = res0 - pinned + old_v * tcm[ind[i] +
m];
static std::complex< float > minus_one()
helper functions for EinsplineSetBuilder
static std::complex< double > one()
constexpr std::complex< float > cone
static std::complex< float > one()
static std::complex< float > zero()
static std::complex< double > zero()
static double minus_one()
static void gemv(int n, int m, const double *restrict amat, const double *restrict x, double *restrict y)
void getRatiosByRowSubstitution_dummy(const T *restrict tm_new, const T *restrict r_replaced, T *restrict ratios, int m, int howmany)
static void ger(int m, int n, double alpha, const double *x, int incx, const double *y, int incy, double *a, int lda)
static std::complex< double > minus_one()
std::complex< float > value_type
static T dot(int n, const T *restrict a, const T *restrict b)
Declaraton of Vector<T,Alloc> Manage memory through Alloc directly and allow referencing an existing ...
void det_row_update(T *restrict pinv, const T *restrict tv, int m, int rowchanged, T c_ratio, T *restrict temp, T *restrict rcopy)
static void copy(int n, const T *restrict a, T *restrict b)
void getRatiosByRowSubstitution(const T *restrict tm_new, const T *restrict r_replaced, T *restrict ratios, int m, int howmany)
void det_col_update(T *restrict pinv, const T *restrict tv, int m, int colchanged, T c_ratio, T *restrict temp, T *restrict rcopy)
QMCTraits::FullPrecRealType value_type
T getRatioByColSubstitution(const T *restrict pinv, const T *restrict tc, int m, int colchanged)
evaluate the determinant ratio with a column substitution
std::complex< double > value_type