void CheMPS2::TensorX::update(TensorT * denT){ if (moving_right){ //PARALLEL #pragma omp parallel for schedule(dynamic) for (int ikappa=0; ikappa<nKappa; ikappa++){ makenewRight(ikappa, denT); } } else { //PARALLEL #pragma omp parallel for schedule(dynamic) for (int ikappa=0; ikappa<nKappa; ikappa++){ makenewLeft(ikappa, denT); } } }
void CheMPS2::TensorL::makenew(TensorT * denT){ if (movingRight){ makenewRight(denT); } else{ makenewLeft( denT); } }
void CheMPS2::TensorX::update(TensorT * denT, TensorL ** Ltensors, TensorX * Xtensor, TensorQ * Qtensor, TensorOperator * Atensor, TensorOperator * Ctensor, TensorOperator * Dtensor){ if (moving_right){ //PARALLEL #pragma omp parallel { const bool doOtherThings = (index>1) ? true : false ; const int dimL = (doOtherThings) ? denBK->gMaxDimAtBound(index-1) : 0 ; const int dimR = (doOtherThings) ? denBK->gMaxDimAtBound(index) : 0 ; double * workmemLL = (doOtherThings) ? new double[dimL*dimL] : NULL ; double * workmemLR = (doOtherThings) ? new double[dimL*dimR] : NULL ; double * workmemRR = (doOtherThings) ? new double[dimR*dimR] : NULL ; #pragma omp for schedule(dynamic) for (int ikappa=0; ikappa<nKappa; ikappa++){ makenewRight(ikappa, denT); if (doOtherThings){ update_moving_right(ikappa, Xtensor, denT, workmemLR); addTermQLRight(ikappa, denT, Ltensors, Qtensor, workmemRR, workmemLR, workmemLL); addTermARight(ikappa, denT, Atensor, workmemRR, workmemLR); addTermCRight(ikappa, denT, Ctensor, workmemLR); addTermDRight(ikappa, denT, Dtensor, workmemLR); } } if (doOtherThings){ delete [] workmemLL; delete [] workmemLR; delete [] workmemRR; } } } else { //PARALLEL #pragma omp parallel { const bool doOtherThings = (index<Prob->gL()-1) ? true : false ; const int dimL = (doOtherThings) ? denBK->gMaxDimAtBound(index) : 0 ; const int dimR = (doOtherThings) ? denBK->gMaxDimAtBound(index+1) : 0 ; double * workmemLL = (doOtherThings) ? new double[dimL*dimL] : NULL ; double * workmemLR = (doOtherThings) ? new double[dimL*dimR] : NULL ; double * workmemRR = (doOtherThings) ? new double[dimR*dimR] : NULL ; #pragma omp for schedule(dynamic) for (int ikappa=0; ikappa<nKappa; ikappa++){ makenewLeft(ikappa, denT); if (doOtherThings){ update_moving_left(ikappa, Xtensor, denT, workmemLR); addTermQLLeft(ikappa, denT, Ltensors, Qtensor, workmemLL, workmemLR, workmemRR); addTermALeft(ikappa, denT, Atensor, workmemLR, workmemLL); addTermCLeft(ikappa, denT, Ctensor, workmemLR); addTermDLeft(ikappa, denT, Dtensor, workmemLR); } } if (doOtherThings){ delete [] workmemLL; delete [] workmemLR; delete [] workmemRR; } } } }
void CheMPS2::TensorS0::makenew(TensorL * denL, TensorT * denT, double * workmem){ if (moving_right){ makenewRight(denL, denT, workmem); } else{ makenewLeft( denL, denT, workmem); } }