void OptHOM::calcScale(alglib::real_1d_array &scale) { scale.setlength(mesh.nPC()); // Calculate scale for (int iFV = 0; iFV < mesh.nFV(); iFV++) { std::vector<double> scaleFV(mesh.nPCFV(iFV),1.); mesh.pcScale(iFV,scaleFV); for (int iPC = 0; iPC < mesh.nPCFV(iFV); iPC++) scale[mesh.indPCFV(iFV,iPC)] = scaleFV[iPC]; } }