/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2013 SDPA Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------- */ #include "sdpa_parts.h" #include "sdpa_linear.h" #include "sdpa_newton.h" namespace sdpa { ComputeTime::ComputeTime() { Predictor = 0.0; Corrector = 0.0; StepPredictor = 0.0; StepCorrector = 0.0; xMatTime = 0.0; zMatTime = 0.0; xMatzMatTime = 0.0; invzMatTime = 0.0; EigxMatTime = 0.0; EigzMatTime = 0.0; EigxMatzMatTime = 0.0; makebMat = 0.0; B_DIAG = 0.0; B_F1 = 0.0; B_F2 = 0.0; B_F3 = 0.0; B_PRE = 0.0; makebMatgVec = 0.0; makerMat = 0.0; choleskybMat = 0.0; solve = 0.0; sumDz = 0.0; makedX = 0.0; symmetriseDx = 0.0; makedXdZ = 0.0; updateRes = 0.0; MainLoop = 0.0; FileRead = 0.0; FileCheck = 0.0; FileChange= 0.0; TotalTime = 0.0; } ComputeTime::~ComputeTime() { // Nothing needs. } void ComputeTime::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"\n"); #if 0 if (TotalTime <= 0.0) { return; } #endif fprintf(fpout, " Time(sec) "); fprintf(fpout," Ratio(%% : MainLoop) \n"); fprintf(fpout, " Predictor time = %f, %f\n", Predictor, Predictor/MainLoop*100.0); fprintf(fpout, " Corrector time = %f, %f\n", Corrector, Corrector/MainLoop*100.0); fprintf(fpout, " Make bMat time = %f, %f\n", makebMat, makebMat/MainLoop*100.0); fprintf(fpout, " Make bDia time = %f, %f\n", B_DIAG,B_DIAG/MainLoop*100.0); fprintf(fpout, " Make bF1 time = %f, %f\n", B_F1,B_F1/MainLoop*100.0); fprintf(fpout, " Make bF2 time = %f, %f\n", B_F2,B_F2/MainLoop*100.0); fprintf(fpout, " Make bF3 time = %f, %f\n", B_F3,B_F3/MainLoop*100.0); fprintf(fpout, " Make bPRE time = %f, %f\n", B_PRE,B_PRE/MainLoop*100.0); fprintf(fpout, " Make rMat time = %f, %f\n", makerMat, makerMat/MainLoop*100.0); fprintf(fpout, " Make bMatgVec = %f, %f\n", makebMatgVec, makebMatgVec/MainLoop*100.0); fprintf(fpout, " Cholesky bMat = %f, %f\n", choleskybMat, choleskybMat/MainLoop*100.0); fprintf(fpout, " Ste Pre time = %f, %f\n", StepPredictor, StepPredictor/MainLoop*100.0); fprintf(fpout, " Ste Cor time = %f, %f\n", StepCorrector, StepCorrector/MainLoop*100.0); fprintf(fpout, " solve = %f, %f\n", solve, solve/MainLoop*100.0); fprintf(fpout, " sumDz = %f, %f\n", sumDz, sumDz/MainLoop*100.0); fprintf(fpout, " makedX = %f, %f\n", makedX, makedX/MainLoop*100.0); fprintf(fpout, " symmetriseDx = %f, %f\n", symmetriseDx, symmetriseDx/MainLoop*100.0); fprintf(fpout, " makedXdZ = %f, %f\n", makedXdZ, makedXdZ/MainLoop*100.0); fprintf(fpout, " xMatTime = %f, %f\n", xMatTime, xMatTime/MainLoop*100.0); fprintf(fpout, " zMatTime = %f, %f\n", zMatTime, zMatTime/MainLoop*100.0); fprintf(fpout, " invzMatTime = %f, %f\n", invzMatTime, invzMatTime/MainLoop*100.0); fprintf(fpout, " xMatzMatTime = %f, %f\n", xMatzMatTime, xMatzMatTime/MainLoop*100.0); fprintf(fpout, " EigxMatTime = %f, %f\n", EigxMatTime, EigxMatTime/MainLoop*100.0); fprintf(fpout, " EigzMatTime = %f, %f\n", EigzMatTime, EigzMatTime/MainLoop*100.0); fprintf(fpout, " EigxMatzMatTime = %f, %f\n", EigxMatzMatTime, EigxMatzMatTime/MainLoop*100.0); fprintf(fpout, " updateRes = %f, %f\n", updateRes, updateRes/MainLoop*100.0); double total_eigen = EigxMatTime + EigzMatTime + EigxMatzMatTime; fprintf(fpout, " EigTime = %f, %f\n", total_eigen, total_eigen/MainLoop*100.0); double sub_total_bMat = MainLoop - makebMat; fprintf(fpout, " sub_total_bMat = %f, %f\n", sub_total_bMat, sub_total_bMat/MainLoop*100.0); fprintf(fpout, " Main Loop = %f, %f\n", MainLoop, MainLoop/MainLoop*100.0); fprintf(fpout, " File Check = %f, %f\n", FileCheck, FileCheck/MainLoop*100.0); fprintf(fpout, " File Change = %f, %f\n", FileChange, FileChange/MainLoop*100.0); fprintf(fpout, " File Read = %f, %f\n", FileRead, FileRead/MainLoop*100.0); fprintf(fpout, " Total = %f, %f\n", TotalTime, TotalTime/MainLoop*100.0); fprintf(fpout, "\n"); return; } //------------------------------------------------------------- Parameter::Parameter() { // setDefaultParameter(); } Parameter::Parameter(FILE* parameterFile) { readFile(parameterFile); } Parameter::~Parameter() { // Nothings needs. } void Parameter::setDefaultParameter(Parameter::parameterType type) { if (type == PARAMETER_STABLE_BUT_SLOW) { maxIteration = 1000; epsilonStar = 1.0e-7; lambdaStar = 1.0e+4; omegaStar = 2.0; lowerBound = -1.0e+5; upperBound = 1.0e+5; betaStar = 0.1; betaBar = 0.5; gammaStar = 0.8; epsilonDash = 1.0e-7; } else if (type == PARAMETER_UNSTABLE_BUT_FAST) { maxIteration = 100; epsilonStar = 1.0e-7; lambdaStar = 1.0e+2; omegaStar = 2.0; lowerBound = -1.0e+5; upperBound = 1.0e+5; betaStar = 0.01; betaBar = 0.02; gammaStar = 0.95; epsilonDash = 1.0e-7; } else { maxIteration = 100; epsilonStar = 1.0e-7; lambdaStar = 1.0e+2; omegaStar = 2.0; lowerBound = -1.0e+5; upperBound = 1.0e+5; betaStar = 0.1; betaBar = 0.3; gammaStar = 0.9; epsilonDash = 1.0e-7; } strcpy(xPrint,xPRINT_DEFAULT); strcpy(XPrint,XPRINT_DEFAULT); strcpy(YPrint,YPRINT_DEFAULT); strcpy(infPrint,infPRINT_DEFAULT); } char Parameter::xPRINT_DEFAULT[PRINT_DEFAULT_LENGTH] = "%+8.3e"; char Parameter::XPRINT_DEFAULT[PRINT_DEFAULT_LENGTH] = "%+8.3e"; char Parameter::YPRINT_DEFAULT[PRINT_DEFAULT_LENGTH] = "%+8.3e"; char Parameter::infPRINT_DEFAULT[PRINT_DEFAULT_LENGTH] = "%+10.16e"; void Parameter::readFile(FILE* parameterFile) { fscanf(parameterFile,"%d%*[^\n]",&maxIteration); fscanf(parameterFile,"%lf%*[^\n]",&epsilonStar); fscanf(parameterFile,"%lf%*[^\n]",&lambdaStar); fscanf(parameterFile,"%lf%*[^\n]",&omegaStar); fscanf(parameterFile,"%lf%*[^\n]",&lowerBound); fscanf(parameterFile,"%lf%*[^\n]",&upperBound); fscanf(parameterFile,"%lf%*[^\n]",&betaStar); fscanf(parameterFile,"%lf%*[^\n]",&betaBar); fscanf(parameterFile,"%lf%*[^\n]",&gammaStar); fscanf(parameterFile,"%lf%*[^\n]",&epsilonDash); fscanf(parameterFile,"%s %*[^\n]",xPrint); fscanf(parameterFile,"%s %*[^\n]",XPrint); fscanf(parameterFile,"%s %*[^\n]",YPrint); fscanf(parameterFile,"%s %*[^\n]",infPrint); if (strcmp(xPrint,NO_P_FORMAT)!=0 && xPrint[0]!='%') { rMessage("Strange xPrint[" << xPrint << "]" " migh cause trouble when printing x"); } if (strcmp(XPrint,NO_P_FORMAT)!=0 && XPrint[0]!='%') { rMessage("Strange XPrint[" << XPrint << "]" " migh cause trouble when printing X."); } if (strcmp(YPrint,NO_P_FORMAT)!=0 && YPrint[0]!='%') { rMessage("Strange YPrint[" << YPrint << "]" " migh cause trouble when printing Y."); } if (strcmp(infPrint,NO_P_FORMAT)!=0 && infPrint[0]!='%') { rMessage("Strange infPrint[" << infPrint << "]" " migh cause trouble when printing information."); } } void Parameter::display(FILE* fpout, char* printFormat) { if (fpout == NULL) { return; } if (strcmp(printFormat,NO_P_FORMAT) == 0) { fprintf(fpout,"%s\n",NO_P_FORMAT); return; } fprintf(fpout, "** Parameters **\n"); fprintf(fpout, "maxIteration = %d\n",maxIteration); fprintf(fpout, "epsilonStar = "); fprintf(fpout, printFormat, epsilonStar ); fprintf(fpout, "\n"); fprintf(fpout, "lambdaStar = "); fprintf(fpout, printFormat, lambdaStar ); fprintf(fpout, "\n"); fprintf(fpout, "omegaStar = "); fprintf(fpout, printFormat, omegaStar ); fprintf(fpout, "\n"); fprintf(fpout, "lowerBound = "); fprintf(fpout, printFormat, lowerBound); fprintf(fpout, "\n"); fprintf(fpout, "upperBound = "); fprintf(fpout, printFormat, upperBound); fprintf(fpout, "\n"); fprintf(fpout, "betaStar = "); fprintf(fpout, printFormat, betaStar ); fprintf(fpout, "\n"); fprintf(fpout, "betaBar = "); fprintf(fpout, printFormat, betaBar ); fprintf(fpout, "\n"); fprintf(fpout, "gammaStar = "); fprintf(fpout, printFormat, gammaStar ); fprintf(fpout, "\n"); fprintf(fpout, "epsilonDash = "); fprintf(fpout, printFormat, epsilonDash ); fprintf(fpout, "\n"); #if 1 fprintf(fpout, "xPrint = %s \n", xPrint ); fprintf(fpout, "XPrint = %s \n", XPrint ); fprintf(fpout, "YPrint = %s \n", YPrint ); fprintf(fpout, "infPrint = %s \n", infPrint ); #endif return; } //---------------------------------------------------------- StepLength::StepLength() { primal = 0.0; dual = 0.0; } StepLength::~StepLength() { finalize(); } void StepLength::initialize(double alphaP, double alphaD) { primal = alphaP; dual = alphaD; } void StepLength::finalize() { // Nothing needs. } double StepLength::minBlockVector(BlockVector& aVec) { int nBlock = aVec.nBlock; double ret = aVec.ele[0].ele[0]; double tmp; int size = aVec.ele[0].nDim; for (int j=1; j1.0) { primal = 1.0; } if (dual>1.0) { dual = 1.0; } } void StepLength::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"alpha.primal = %8.3e\n",primal); fprintf(fpout,"alpha.dual = %8.3e\n",dual); } //------------------------------------------------- DirectionParameter::DirectionParameter(double betaStar) { initialize(betaStar); } DirectionParameter::~DirectionParameter() { // Nothing needs. } void DirectionParameter::initialize(double betaStar) { value = betaStar; } void DirectionParameter::Predictor(Phase& phase, Switch& reduction, Parameter& param) { const double nu = 2.0; if (phase.value == SolveInfo::pdFEAS) { value = param.betaStar; } else { value = param.betaBar; if (reduction.switchType==Switch::AFFINE) { value = nu; } } } void DirectionParameter::Centering() { value = 1.0; } void DirectionParameter:: MehrotraCorrector(Phase& phase, StepLength& alpha, Solutions& currentPt, AverageComplementarity& mu, Parameter& param) { int nDim = currentPt.nDim; CholmodSpace& cholmodSpace = currentPt.cholmodSpace; // Lal::let(uMatzMat,'=',newton.DxMat,'.',currentPt.zMat); // Lal::let(xMatvMat,'=',currentPt.xMat,'.',newton.DzMat); // Lal::let(uMatvMat,'=',newton.DxMat,'.',newton.DzMat); double uMatzMat = 0.0; double xMatvMat = 0.0; double uMatvMat = 0.0; for (int l=0; l 1.0) { value = 1.0; } } else { if (value < param.betaBar) { value = param.betaBar; } } // rMessage("MehrotraCorrector : " << value); } void DirectionParameter::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"beta.value = %8.3e\n",value); } //--------------------------------------------------- Switch::Switch(SwitchType switchType) { initialize(switchType); } Switch::~Switch() { // Nothing needs. } void Switch::initialize(SwitchType switchType) { this->switchType = switchType; } void Switch::MehrotraPredictor(Phase& phase) { if (phase.value==SolveInfo::noINFO || phase.value==SolveInfo::pFEAS || phase.value==SolveInfo::dFEAS) { // At least one of primal or dual is infeasible. switchType = CENTERING; } else { switchType = AFFINE; } } void Switch::display(FILE* fpout) { if (fpout == NULL) { return; } if (switchType == CENTERING) { fprintf(fpout,"reduction.switchType == CENTERING\n"); } else { fprintf(fpout,"reduction.switchType == AFFINE\n"); } } // ---------------------------------------- AverageComplementarity::AverageComplementarity(double lambdaStar) { initialize(lambdaStar); } AverageComplementarity::~AverageComplementarity() { // Nothing needs. } void AverageComplementarity::initialize(double lambdaStar) { initial = lambdaStar*lambdaStar; current = initial; // rMessage("initial average = " << initial); } void AverageComplementarity::update(Solutions& currentPt) { CholmodSpace& cholmodSpace = currentPt.cholmodSpace; int nDim = cholmodSpace.LP_nBlock; current = 0.0; for (int l=0; l param.epsilonDash * 1.0e-2) { primal = currentRes.normPrimal / currentRes.initNormPrimal; } else { primal = 0.0; } if (currentRes.initNormDual > param.epsilonDash * 1.0e-2) { dual = currentRes.normDual / currentRes.initNormDual; } else { dual = 0.0; } } void RatioInitResCurrentRes::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"theta.primal = %8.3e\n",primal); fprintf(fpout,"theta.dual = %8.3e\n",dual); } //--------------------------------------------------- SolveInfo::SolveInfo() { rho = 0.0; etaPrimal = 0.0; etaDual = 0.0; objValPrimal = 0.0; objValDual = 0.0; } SolveInfo::SolveInfo(InputData& inputData, Solutions& currentPt, double mu0, double omegaStar) { initialize(inputData,currentPt,mu0,omegaStar); } SolveInfo::~SolveInfo() { // Nothing needs. } void SolveInfo::initialize(InputData& inputData, Solutions& currentPt, double mu0, double omegaStar) { int nDim = currentPt.nDim; Vector& b = inputData.b; CompSpace& C = inputData.C; CholmodSpace& cholmodSpace = currentPt.cholmodSpace; rho = 1.0; etaPrimal = omegaStar * nDim * mu0; etaDual = omegaStar * nDim * mu0; cholmodSpace.getInnerProductAX(objValPrimal, C, currentPt.order); #if 0 C.display(); cholmodSpace.display(); rMessage("objValPrimal = " << objValPrimal); #endif Lal::let(objValDual,'=',b,'.',cholmodSpace.yVec); } void SolveInfo::update(InputData& inputData, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, RatioInitResCurrentRes& theta, Parameter& param) { CholmodSpace& cholmodSpace = currentPt.cholmodSpace; // Lal::let(objValPrimal,'=',C,'.',currentPt.xMat); objValPrimal = 0.0; cholmodSpace.getInnerProductAX(objValPrimal, inputData.C, currentPt.order); Lal::let(objValDual,'=',inputData.b,'.',cholmodSpace.yVec); int nDim = cholmodSpace.LP_nBlock; for (int l=0; lncol; for (int j=0; j < ncol; ++j) { const int diag_row = ((int*)Z->p)[j]; x0zMat += ((double*)Z->x)[diag_row]; } } x0zMat *= lambda; // Lal::let(xMatz0,'=',currentPt.xMat,'.',initPt_zMat); double xMatz0 = 0.0; for (int l=0; l accuracy && currentRes.normDual <= accuracy) { rho = primal*x0zMat / ((primal+(1.0-primal)*omega)*etaDual + xMatzMat); } // primal is feasible and dual is infeasible if (currentRes.normPrimal <= accuracy && currentRes.normDual > accuracy) { rho = dual*xMatz0 / ((dual+(1.0-dual)*omega)* etaPrimal + xMatzMat); } // primal and dual are infeasible if (currentRes.normPrimal > accuracy && currentRes.normDual > accuracy) { rho = (dual*xMatz0+primal*x0zMat) / ((primal*dual + omega *(primal*(1.0-dual) + (1.0-primal)*dual))* x0z0 + xMatzMat); } // rMessage("eta Primal = " << etaPrimal); // rMessage("eta Dual = " << etaDual); } // 2007/09/13 kazuhide nakata // print information of ObjVal, residual, gap, complementarity // b^T y + R \bullet X = value, norm(r), norm(Z) // C \bullet X + r^T y = value, norm(R), norm(X) // gap gap, mu * nDim void SolveInfo::check(InputData& inputData, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, RatioInitResCurrentRes& theta, Parameter& param) { rMessage("This function is not implemented in SDPA-C"); #if 0 double tmp,tmp1p,tmp1d,tmp2p,tmp2d,tmp3p,tmp3d,tmp4,tmp5p,tmp5d; Lal::let(tmp,'=',inputData.b,'.',currentPt.yVec); tmp1p = - tmp; printf("Primal: %9.1e",tmp1p); Lal::let(tmp,'=',currentRes.dualMat,'.',currentPt.xMat); tmp2p = -tmp; printf(" + %9.1e",tmp2p); tmp3p = tmp1p + tmp2p; printf(" = %9.1e",tmp3p); printf(", residual:%-9.1e",currentRes.normDualMat); tmp5p = currentRes.computeMaxNorm(currentPt.zMat); printf(" norm:%-9.1e\n",tmp5p); Lal::let(tmp,'=',inputData.C,'.',currentPt.xMat); tmp1d = - tmp; printf("Dual: %9.1e",tmp1d); Lal::let(tmp,'=',currentRes.primalVec,'.',currentPt.yVec); tmp2d = -tmp; printf(" + %9.1e",tmp2d); tmp3d = tmp1d + tmp2d; printf(" = %9.1e",tmp3d); printf(", residual:%-9.1e", currentRes.normPrimalVec); tmp5d = currentRes.computeMaxNorm(currentPt.xMat); printf(" norm:%-9.1e\n",tmp5d); tmp4 = tmp1p - tmp1d; printf("P-D: %9.1e",tmp4); tmp4 = tmp3p - tmp3d; printf(" %9.1e",tmp4); tmp4 = mu.current * currentPt.nDim; printf(", mu * n:%-9.1e\n",tmp4); #endif } void SolveInfo::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"rSolveInfo.rho = %8.3e\n",rho); fprintf(fpout,"rSolveInfo.etaPrimal = %8.3e\n",etaPrimal); fprintf(fpout,"rSolveInfo.etaDual = %8.3e\n",etaDual); fprintf(fpout,"rSolveInfo.objValPrimal = %8.3e\n",objValPrimal); fprintf(fpout,"rSolveInfo.objValDual = %8.3e\n",objValDual); } // ---------------------------------------------------- Phase::Phase() { nDim = 0; value = SolveInfo::noINFO; } Phase::~Phase() { // Nothing needs. } bool Phase::initialize(Residuals& currentRes, SolveInfo& solveInfo, Parameter& param, int nDim) { this->nDim = nDim; return updateCheck(currentRes, solveInfo, param); } bool Phase::updateCheck(Residuals& currentRes, SolveInfo& solveInfo, Parameter& param) { const double NONZERO = 1.0e-6; double accuracy = param.epsilonDash; value = SolveInfo::noINFO; if (currentRes.normPrimal <= accuracy) { if (currentRes.normDual <= accuracy) { value = SolveInfo::pdFEAS; } else { value = SolveInfo::pFEAS; } } if (value==SolveInfo::noINFO && currentRes.normDual <= accuracy) { value = SolveInfo::dFEAS; } if (value==SolveInfo::pdFEAS) { double mean = (fabs(solveInfo.objValPrimal)+ fabs(solveInfo.objValDual)) / 2.0; double PDgap = fabs(solveInfo.objValPrimal - solveInfo.objValDual); double dominator; if (mean < 1.0) { dominator = 1.0; } else { dominator = mean; } #if 0 rMessage("PDgap = " << PDgap); rMessage("dominator = " << dominator); rMessage("PDgap/dominator = " << PDgap/dominator); #endif if (PDgap/dominator <= param.epsilonStar) { value = SolveInfo::pdOPT; return false; } } if (value == SolveInfo::noINFO && solveInfo.rho > 1.0+NONZERO) { rMessage("pdINF criteria"); value = SolveInfo::pdINF; return false; } if (value == SolveInfo::pFEAS) { #if REVERSE_PRIMAL_DUAL if (solveInfo.objValPrimal<=-param.upperBound) { rMessage("pUNBD criteria"); value = SolveInfo::pUNBD; return false; } #else if (solveInfo.objValPrimal<=param.lowerBound) { rMessage("pdINF criteria"); value = SolveInfo::pUNBD; return false; } #endif if (solveInfo.rho > 1.0+NONZERO) { rMessage("pFEAS_dINF criteria"); value = SolveInfo::pFEAS_dINF; return false; } } if (value == SolveInfo::dFEAS) { #if REVERSE_PRIMAL_DUAL if (solveInfo.objValDual>=-param.lowerBound) { rMessage("dUNBD criteria"); value = SolveInfo::dUNBD; return false; } #else if (solveInfo.objValDual>=param.upperBound) { rMessage("dUNBD criteria"); value = SolveInfo::dUNBD; return false; } #endif if (solveInfo.rho > 1.0+NONZERO) { rMessage("pINF_dFEAD criteria"); value = SolveInfo::pINF_dFEAS; return false; } } #if 0 rMessage("phase ="); display(); #endif return true; } void Phase::reverse() { #if REVERSE_PRIMAL_DUAL switch (value) { case SolveInfo::noINFO : ; break; case SolveInfo::pFEAS : value = SolveInfo::dFEAS ; break; case SolveInfo::dFEAS : value = SolveInfo::pFEAS ; break; case SolveInfo::pdFEAS : ; break; case SolveInfo::pdINF : ; break; case SolveInfo::pFEAS_dINF: value = SolveInfo::pINF_dFEAS; break; case SolveInfo::pINF_dFEAS: value = SolveInfo::pFEAS_dINF; break; case SolveInfo::pdOPT : ; break; case SolveInfo::pUNBD : value = SolveInfo::dUNBD ; break; case SolveInfo::dUNBD : value = SolveInfo::pUNBD ; break; default: break; } #else // do nothing #endif } void Phase::display(FILE* fpout) { if (fpout == NULL) { return; } char* str; switch (value) { case SolveInfo::noINFO : str = (char *)"noINFO "; break; case SolveInfo::pFEAS : str = (char *)"pFEAS "; break; case SolveInfo::dFEAS : str = (char *)"dFEAS "; break; case SolveInfo::pdFEAS : str = (char *)"pdFEAS "; break; case SolveInfo::pdINF : str = (char *)"pdINF "; break; case SolveInfo::pFEAS_dINF: str = (char *)"pFEAS_dINF"; break; case SolveInfo::pINF_dFEAS: str = (char *)"pINF_dFEAS"; break; case SolveInfo::pdOPT : str = (char *)"pdOPT "; break; case SolveInfo::pUNBD : str = (char *)"pUNBD "; break; case SolveInfo::dUNBD : str = (char *)"dUNBD "; break; default: str = (char *)"phase error"; rMessage("rPhase:: phase error"); break; } fprintf(fpout,"phase.value = %s\n",str); } } // end of namespace 'sdpa'