sdpa-7.3.11/0000755000175000017500000000000013211530513012072 5ustar makotomakotosdpa-7.3.11/AUTHORS0000644000175000017500000000105013211530510013133 0ustar makotomakoto-------------------------------------------------- Copyright (C) 1995-2011 SDPA Project -------------------------------------------------- We appreciate your comments, suggestions, and questions about SDP and/or the SDPA software. We also consider questions such as "I can not install the SDPA on my computer," "I can not formulate my problem in SDPA format," "I found a bug in the software," etc. To contact SDPA project, refer the following Web page. https://sdpa.sourceforge.net/contact.html The member list of SDPA project is available there. sdpa-7.3.11/sdpa_dpotrf.cpp0000644000175000017500000001557713211530510015117 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*----------------------------------------------- rsdpa_dpotrf.cpp modification of ATL_dpotrfL for dealing with numerical error in diagonal elements. int rATL_dpotrfL(int N, double *A,int lda) modified by Makoto Yamshita 2002.07.11 -----------------------------------------------*/ #define POTRF_NONZERO (1.0e-14) #define POTRF_ASSIGN (1.0e+100) #define POTRF_LIMIT (-1.0e-6) /* * Automatically Tuned Linear Algebra Software v3.4.0 * (C) Copyright 1999 R. Clint Whaley * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions, and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the ATLAS group or the names of its contributers may * not be used to endorse or promote products derived from this * software without specific written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ATLAS GROUP OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include "sdpa_include.h" #include "sdpa_algebra.h" #if 0 #define CHOLESKY_ADJUST(val) rMessage("Choleksy adjust from " << val << " to " << POTRF_NONZERO); #else #define CHOLESKY_ADJUST(val) ; #endif namespace sdpa { extern "C" { static int potrf4(double* A,const int n) { double* A1 = A+n+1; double* A2 = A1+n+1; double* A3 = A2+n+1; double L11 = *A; double L21 = A[1], L22 = *A1; double L31 = A[2], L32 = A1[1], L33 = *A2; double L41 = A[3], L42 = A1[2], L43 = A2[1], L44 = *A3; if (L11 < POTRF_LIMIT) { return 1; } if (L11 < POTRF_NONZERO) { CHOLESKY_ADJUST(L11); L11 = POTRF_ASSIGN; } *A = L11 = sqrt(L11); L11 = 1.0/L11; L21 *= L11; L31 *= L11; L41 *= L11; L22 -= L21*L21; if (L22 < POTRF_LIMIT) { return 2; } if (L22 < POTRF_NONZERO) { CHOLESKY_ADJUST(L22); L22 = POTRF_ASSIGN; } *A1 = L22 = sqrt(L22); L22 = 1.0/L22; L32 = (L32 - L31*L21)*L22; L42 = (L42 - L41*L21)*L22; L33 -= L31*L31 + L32*L32; if (L33 < POTRF_LIMIT) { return 3; } if (L33 < POTRF_NONZERO) { CHOLESKY_ADJUST(L33); L33 = POTRF_ASSIGN; } *A2 = L33 = sqrt(L33); L43 = (L43-L41*L31-L42*L32)/L33; L44 -= L41*L41 + L42*L42 + L43*L43; if (L44 < POTRF_LIMIT) { return 4; } if (L44 < POTRF_NONZERO) { CHOLESKY_ADJUST(L44); L44 = POTRF_ASSIGN; } *A3 = sqrt(L44); A[1] = L21; A[2] = L31; A1[1] = L32; A[3] = L41; A1[2] = L42; A2[1] = L43; return 0; } static int potrf3(double* A,const int n) { double* A1 = A+n+1; double* A2 = A1+n+1; double L11 = *A; double L21 = A[1], L22 = *A1; double L31 = A[2], L32 = A1[1], L33 = *A2; if (L11 < POTRF_LIMIT) { return 1; } if (L11 < POTRF_NONZERO) { CHOLESKY_ADJUST(L11); L11 = POTRF_ASSIGN; } *A = L11 = sqrt(L11); L11 = 1.0/L11; L21 *= L11; L31 *= L11; L22 -= L21*L21; if (L22 < POTRF_LIMIT) { return 2; } if (L22 < POTRF_NONZERO) { CHOLESKY_ADJUST(L22); L22 = POTRF_ASSIGN; } L22 = sqrt(L22); L32 = (L32 - L31*L21)/L22; L33 -= L31*L31 + L32*L32; if (L33 < POTRF_LIMIT) { return 3; } if (L33 < POTRF_NONZERO) { CHOLESKY_ADJUST(L33); L33 = POTRF_ASSIGN; } *A2 = sqrt(L33); A[1] = L21; *A1 = L22; A[2] = L31; A1[1] = L32; return 0; } static int potrf2(double* A,const int n) { double* A1 = A+n+1; double L11 = *A; double L21 = A[1], L22 = *A1; if (L11 < POTRF_LIMIT) { return 1; } if (L11 < POTRF_NONZERO) { CHOLESKY_ADJUST(L11); L11 = POTRF_ASSIGN; } *A = L11 = sqrt(L11); L21 /= L11; L22 -= L21*L21; if (L22 < POTRF_LIMIT) { return 2; } if (L22 < POTRF_NONZERO) { CHOLESKY_ADJUST(L22); L22 = POTRF_ASSIGN; } *A = L11; A[1] = L21; *A1 = sqrt(L22); return 0; } int rATL_dpotrfL(int N, double *A,int lda) { double *An, *Ar; int Nleft, Nright, ierr; if (N > 4) { Nleft = N >> 1; #if 0 int nb = ilaenv_fc(&IONE, "DPOTRF", "L", &N, &IMONE,&IONE, &IMONE, strlen("DPOTRF"), strlen("L")); if (Nleft > nb<<1) Nleft = (Nleft/nb)*nb; #endif #if 0 if (Nleft > 64) { Nleft = 64; } #endif Nright = N - Nleft; ierr = rATL_dpotrfL(Nleft, A,lda); if (!ierr) { Ar = A + Nleft; An = Ar + lda * Nleft; dtrsm_fc ((char *)"R",(char *)"L",(char *)"T",(char *)"N", &Nright,&Nleft,&DONE,A,&lda, Ar, &lda, strlen("R"),strlen("L"), strlen("T"),strlen("N")); dsyrk_fc ((char *)"L",(char *)"N",&Nright,&Nleft,&DMONE, Ar, &lda, &DONE,An,&lda,strlen("L"),strlen("N")); ierr = rATL_dpotrfL(Nright, An,lda); if (ierr) return(ierr+Nleft); } else return(ierr); } else if (N==4) return(potrf4(A,lda)); else if (N==3) return(potrf3(A,lda)); else if (N==2) return(potrf2(A,lda)); else if (N==1) { if (*A < POTRF_LIMIT) { return 1; } if (*A < POTRF_NONZERO) { CHOLESKY_ADJUST(*A); *A = POTRF_ASSIGN; } *A = sqrt(*A); } return(0); } void rdpotrfl_(int* N, double *A,int* lda,int* info) { *info = rATL_dpotrfL(*N,A,*lda); } }; // end of extern "C" } // end of namespace 'sdpa' sdpa-7.3.11/sdpa_struct.cpp0000644000175000017500000012274713211530510015143 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_struct.h" #include "sdpa_algebra.h" namespace sdpa{ Vector::Vector() { nDim = 0; ele = NULL; } Vector::Vector(int nDim, double value) { ele = NULL; initialize(nDim,value); } Vector::~Vector() { terminate(); } void Vector::initialize(int nDim,double value) { // rMessage("Vector initialize"); if (nDim<=0) { rError("Vector:: nDim is nonpositive"); } if (this->nDim!=nDim) { DeleteArray(ele); } this->nDim = nDim; if (ele == NULL) { NewArray(ele,double,nDim); } sdpa_dset(nDim,value,ele,IONE); } void Vector::initialize(double value) { if (ele==NULL) { NewArray(ele,double,nDim); } sdpa_dset(nDim,value,ele,IONE); } void Vector::terminate() { DeleteArray(ele); } void Vector::setZero() { initialize(0.0); } void Vector::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,"{"); for (int j=0; j0) { fprintf(fpout,printFormat,ele[nDim-1]); fprintf(fpout,"}\n"); } else { fprintf(fpout," }\n"); } } void Vector::display(FILE* fpout,double scalar, char* printFormat) { if (fpout == NULL) { return; } if (strcmp(printFormat,NO_P_FORMAT) == 0) { fprintf(fpout,"%s\n",NO_P_FORMAT); return; } fprintf(fpout,"{"); for (int j=0; j0) { fprintf(fpout,printFormat,ele[nDim-1]*scalar); fprintf(fpout,"}\n"); } else { fprintf(fpout," }\n"); } } bool Vector::copyFrom(Vector& other) { if (this == &other) { return SDPA_SUCCESS; } if (other.nDim<=0) { rError("Vector:: nDim is nonpositive"); } if (nDim != other.nDim) { DeleteArray(ele); } nDim = other.nDim; if (ele==NULL) { NewArray(ele,double,nDim); } dcopy_fc(&nDim,other.ele,&IONE,ele,&IONE); return SDPA_SUCCESS; } BlockVector::BlockVector() { nBlock = 0; blockStruct = NULL; ele = NULL; } BlockVector::BlockVector(BlockStruct& bs, double value) { initialize(bs.SDP_nBlock,bs.SDP_blockStruct,value); } BlockVector::BlockVector(int nBlock, int* blockStruct, double value) { initialize(nBlock,blockStruct,value); } BlockVector::~BlockVector() { terminate(); } void BlockVector::initialize(BlockStruct& bs, double value) { initialize(bs.SDP_nBlock,bs.SDP_blockStruct,value); } void BlockVector::initialize(int nBlock, int* blockStruct, double value) { // rMessage("BlockVector initialize"); if (nBlock<=0) { rError("BlockVector:: nBlock is nonpositive"); } this->nBlock = nBlock; NewArray(this->blockStruct,int,nBlock); for (int l=0; lblockStruct[l] = blockStruct[l]; } NewArray(ele,Vector,nBlock); for (int l=0; l0 && blockStruct && ele) { for (int l=0; l=0) { for (int l=0; l0 && blockStruct && ele) { for (int l=0; l0 && blockStruct && ele) { for (int l=0; lnRow = nRow; this->nCol = nCol; this->type = type; this->DataStruct = DataStruct; int length; switch(type) { case SPARSE: this->NonZeroNumber = NonZeroNumber; this->NonZeroCount = 0; this->NonZeroEffect = 0; if (NonZeroNumber > 0) { if (DataStruct == DSarrays) { NewArray(row_index,int,NonZeroNumber); NewArray(column_index,int,NonZeroNumber); NewArray(sp_ele,double,NonZeroNumber); if (row_index==NULL || column_index==NULL || sp_ele==NULL) { rError("SparseMatrix:: memory exhausted"); } } else { NewArray(DataS, SparseElement, NonZeroNumber); if (DataS == NULL) { rError("SparseElement:: memory exhausted"); } } } break; case DENSE: this->NonZeroNumber = nRow*nCol; this->NonZeroCount = nRow*nCol; this->NonZeroEffect = nRow*nCol; NewArray(de_ele,double,NonZeroNumber); if (de_ele==NULL) { rError("SparseMatrix:: memory exhausted"); } length = nRow*nCol; sdpa_dset(length,DZERO,de_ele,IONE); // all elements are 0. break; } } void SparseMatrix::terminate() { DeleteArray(de_ele); if (DataStruct == DSarrays) { DeleteArray(row_index); DeleteArray(column_index); DeleteArray(sp_ele); } else { DeleteArray(DataS); } } void SparseMatrix::display(FILE* fpout, char* printFormat) { int i, j; double value; if (fpout == NULL) { return; } if (strcmp(printFormat,NO_P_FORMAT) == 0) { fprintf(fpout,"%s\n",NO_P_FORMAT); return; } switch(type) { case SPARSE: fprintf(fpout,"{"); for (int index=0; index1) { fprintf(fpout," {"); } for (int j=0; j1) { fprintf(fpout," }\n"); } else { fprintf(fpout,"\n"); } break; } } bool SparseMatrix::copyFrom(SparseMatrix& other) { if (type != other.type || nRow != other.nRow || nCol != other.nCol) { this->~SparseMatrix(); initialize(other.nRow,other.nCol,other.type, NonZeroNumber); NonZeroCount = other.NonZeroCount; NonZeroEffect = other.NonZeroEffect; int length; switch(type) { case SPARSE: for (int index = 0; index NonZeroNumber) { rError("SparseMatrix:: cannot store over NonZeroNumber"); // the number of Diagonal elements equals nCol. } NonZeroCount = nCol; NonZeroEffect = nCol; for (int index=0; index< NonZeroCount; ++index) { #if DATA_CAPSULE DataS[index].vRow = index; DataS[index].vCol = index; DataS[index].vEle = scalar; #else row_index[index] = index; column_index[index] = index; sp_ele[index] = scalar; #endif } break; case DENSE: length = nRow*nCol; sdpa_dset(length,DZERO,de_ele,IONE); step = nCol+1; sdpa_dset(nCol,scalar,de_ele,step); // only diagonal elements are set the value of scalar. break; } } bool SparseMatrix::sortSparseIndex(int& i, int& j) { // if this matrix is not symmetric, // return the index(i,j) whose values are not symmetric. i = -1; j = -1; const double tolerance = 1.0e-8; switch(type) { case SPARSE: // Make matrix as Upper Triangluar for (int i1=0; i1tmpj) { DataS[i1].vRow = tmpj; DataS[i1].vCol = tmpi; } #else int tmpi = row_index[i1]; int tmpj = column_index[i1]; if (tmpi>tmpj) { row_index [i1] = tmpj; column_index[i1] = tmpi; } #endif } // simple sort for (int i1=0; i1 tolerance) { // Here must not be symmetric if (i<0 || j<0) { i = DataS[i1].vRow; j = DataS[i1].vCol; } } // remove redudunt for (int i2 = i1+1; i2 tolerance) { // Here must not be symmetric if (i<0 || j<0) { i = row_index [i1]; j = column_index[i1]; } } // remove redudunt for (int i2 = i1+1; i2 tolerance) { return SDPA_FAILURE; } } } break; } return SDPA_SUCCESS; } DenseMatrix::DenseMatrix() { nRow = 0; nCol = 0; type = DENSE; de_ele = NULL; } DenseMatrix::DenseMatrix(int nRow, int nCol, DenseMatrix::Type type) { initialize(nRow, nCol, type); } DenseMatrix::~DenseMatrix() { terminate(); } void DenseMatrix::initialize(int nRow, int nCol, DenseMatrix::Type type) { // rMessage("DenseMatrix::initialize"); DenseMatrix(); if (nRow<=0 || nCol<=0) { rError("DenseMatrix:: Dimensions are nonpositive"); } int old_length = this->nRow*this->nCol; this->nRow = nRow; this->nCol = nCol; int length; switch(type) { case DENSE: length = nRow*nCol; if (de_ele && old_length!=length) { DeleteArray(de_ele); } if (de_ele==NULL) { NewArray(de_ele,double,length); } sdpa_dset(length,DZERO,de_ele,IONE); break; case COMPLETION: rError("DenseMatrix:: no support for COMPLETION"); break; } } void DenseMatrix::terminate() { DeleteArray(de_ele); } void DenseMatrix::display(FILE* fpout, char* printFormat) { if (fpout == NULL) { return; } switch(type) { case DENSE: fprintf(fpout,"{"); for (int i=0; i1) { fprintf(fpout," {"); } for (int j=0; j1) { fprintf(fpout," }\n"); } else { fprintf(fpout,"\n"); } break; case COMPLETION: rError("DenseMatrix:: no support for COMPLETION"); break; } } bool DenseMatrix::copyFrom(SparseMatrix& other) { int length; switch(other.type) { case SparseMatrix::SPARSE: type = DENSE; DeleteArray(de_ele); nRow = other.nRow; nCol = other.nCol; NewArray(de_ele,double,nRow*nCol); length = nRow*nCol; sdpa_dset(length,DZERO,de_ele,IONE); for (int index = 0; index 0){ SDP_sp_nBlock++; } } if (SDP_sp_nBlock > 0){ NewArray(SDP_sp_index,int,SDP_sp_nBlock); NewArray(SDP_sp_block,SparseMatrix,SDP_sp_nBlock); } counter = 0; for (int l=0; l 0){ SDP_sp_index[counter] = l; int size = SDP_blockStruct[l]; SDP_sp_block[counter].initialize(size,size,SparseMatrix::SPARSE, SDP_NonZeroNumber[l]); counter++; } } // for SOCP #if 0 for (int l=0; l 0){ SOCP_sp_nBlock++; } } if (SOCP_sp_nBlock > 0){ NewArray(SOCP_sp_index,int,SOCP_sp_nBLock); NewArray(SOCP_sp_block,SparseMatrix,SOCP_sp_nBLock); } counter = 0; for (int l=0; l 0){ SOCP_sp_index[counter] = l; int size = SOCP_blockStruct[l]; SOCP_sp_block[counter].initialize(size,size,SparseMatrix::SPARSE, SOCP_NonZeroNumber[l]); counter++; } } #endif // for LP for (int l=0; l 0){ NewArray(LP_sp_index,int,LP_sp_nBlock); NewArray(LP_sp_block,double,LP_sp_nBlock); } counter = 0; for (int l=0; lSDP_sp_nBlock = SDP_sp_nBlock; if (SDP_sp_nBlock > 0){ NewArray(this->SDP_sp_index,int,SDP_sp_nBlock); NewArray(this->SDP_sp_block,SparseMatrix,SDP_sp_nBlock); } for (int l=0; lSDP_sp_index[l] = SDP_sp_index[l]; int size = SDP_sp_blockStruct[l]; SDP_sp_block[l].initialize(size,size,SparseMatrix::SPARSE, SDP_sp_NonZeroNumber[l]); } // for SOCP #if 0 this->SOCP_sp_nBlock = SOCP_sp_nBlock; if (SOCP_sp_nBlock > 0){ NewArray(this->SOCP_sp_index,int,SOCP_sp_nBlock); NewArray(this->SOCP_sp_block,SparseMatrix,SOCP_sp_nBlock); } for (int l=0; lSOCP_sp_index[l] = SOCP_sp_index[l]; int size = SOCP_sp_blockStruct[l]; SOCP_sp_block[l].initialize(size,size,SparseMatrix::SPARSE, SOCP_sp_NonZeroNumber[l]); } #endif // for LP this->LP_sp_nBlock = LP_sp_nBlock; if (LP_sp_nBlock > 0){ NewArray(this->LP_sp_index,int,LP_sp_nBlock); NewArray(this->LP_sp_block,double,LP_sp_nBlock); } for (int l=0; lLP_sp_index[l] = LP_sp_index[l]; } } void SparseLinearSpace::terminate() { // for SDP if (SDP_sp_block && SDP_sp_index && SDP_sp_nBlock>=0) { for (int l=0; l=0) { for (int l=0; l=0) { DeleteArray(LP_sp_block); DeleteArray(LP_sp_index); } } void SparseLinearSpace::changeToDense(bool forceChange) { if (SDP_sp_nBlock>0 && SDP_sp_index && SDP_sp_block) { for (int l=0; l0 && SOCP_sp_index && SOCP_sp_block) { for (int l=0; l0 && SDP_sp_index && SDP_sp_block) { fprintf(fpout,"SDP part{\n"); for (int l=0; l0 && SOCP_sp_index && SOCP_sp_block) { fprintf(fpout,"SOCP part{\n"); for (int l=0; l0 && LP_sp_index && LP_sp_block) { fprintf(fpout,"LP part{\n"); for (int l=0; l 0 && SDP_sp_index==NULL ) { NewArray(SDP_sp_index,int,SDP_sp_nBlock); for (int l=0; l 0 && SDP_sp_block==NULL ) { NewArray(SDP_sp_block,SparseMatrix,SDP_sp_nBlock); } total_judge = SDPA_SUCCESS; for (int l=0; l 0 && SOCP_sp_index==NULL) { NewArray(SOCP_sp_index,int,SOCP_sp_nBlock); for (int l=0; l 0 && SOCP_sp_block==NULL) { NewArray(SOCP_sp_block,SparseMatrix,SOCP_sp_nBlock); } total_judge = SDPA_SUCCESS; for (int l=0; l 0 && LP_sp_index==NULL) { NewArray(LP_sp_index,int,LP_sp_nBlock); for (int l=0; l 0 && LP_sp_block==NULL) { NewArray(LP_sp_block,double,LP_sp_nBlock); } total_judge = SDPA_SUCCESS; for (int l=0; l= SDP_sp_block[l].NonZeroNumber){ rError("SparseLinearSpace::setElement NonZeroCount >= NonZeroNumber"); } if ((i >= SDP_sp_block[l].nRow) || (j >= SDP_sp_block[l].nCol)){ rError("out of range in input data"); } // set element int count = SDP_sp_block[l].NonZeroCount; #if DATA_CAPSULE SDP_sp_block[l].DataS[count].vRow = i; SDP_sp_block[l].DataS[count].vCol = j; SDP_sp_block[l].DataS[count].vEle = ele; #else SDP_sp_block[l].row_index[count] = i; SDP_sp_block[l].column_index[count] = j; SDP_sp_block[l].sp_ele[count] = ele; #endif SDP_sp_block[l].NonZeroCount++; if (i==j){ SDP_sp_block[l].NonZeroEffect++; } else { SDP_sp_block[l].NonZeroEffect += 2; } } void SparseLinearSpace::setElement_SOCP(int block, int i, int j, double ele) { rError("DenseLinearSpace:: current version does not support SOCP"); } void SparseLinearSpace::setElement_LP(int block, double ele) { int l; for (l=0; l0 && SDP_sp_index && SDP_sp_block) { for (int l=0; l0 && SOCP_sp_index && SOCP_sp_block) { for (int l=0; l0 && LP_sp_index && LP_sp_block) { for (int l=0; l0 && SDP_sp_index && SDP_sp_block) { for (int l=0; l0 && SOCP_sp_index && SOCP_sp_block) { for (int l=0; l0 && LP_sp_index && LP_sp_block) { for (int l=0; l0 && SDP_sp_index && SDP_sp_block) { for (int l_in=0; l_in0 && SOCP_sp_index && SOCP_sp_block) { for (int l_in=0; l_inSDP_nBlock = bs.SDP_nBlock; this->SOCP_nBlock = bs.SOCP_nBlock; this->LP_nBlock = bs.LP_nBlock; SDP_block = NULL; SOCP_block = NULL; LP_block = NULL; // rMessage("DenseLinearSpace::initialize"); if (SDP_nBlock + SOCP_nBlock + LP_nBlock <= 0) { rError("DenseLinearSpace:: SDP + SOCP + LP Block is nonpositive"); } // for SDP if (SDP_nBlock<0) { rError("DenseLinearSpace:: SDP_nBlock is negative"); } if (SDP_nBlock > 0) { NewArray(SDP_block,DenseMatrix,SDP_nBlock); } for (int l=0; l0) { SDP_block[l].initialize(size,size,DenseMatrix::DENSE); } else { rError("DenseLinearSpace:: SDP size is nonpositive"); } } // for SOCP this->SOCP_nBlock = 0; #if 0 if (SOCP_nBlock<0) { rError("DenseLinearSpace:: SOCP_nBlock is negative"); } if (SOCP_nBlock > 0) { NewArray(SOCP_block,DenseMatrix,SOCP_nBlock); } for (int l=0; l0) { SOCP_block[l].initialize(size,size,DenseMatrix::DENSE); } else { rError("DenseLinearSpace:: SOCP size is nonpositive"); } } #endif // for LP if (LP_nBlock<0) { rError("DenseLinearSpace:: LP_nBlock is negative"); } if (LP_nBlock > 0) { NewArray(LP_block,double,LP_nBlock); } for (int l=0; l0) { for (int l=0; l0) { for (int l=0; l0) { DeleteArray(LP_block); } } void DenseLinearSpace::display(FILE* fpout, char* printFormat) { if (fpout == NULL) { return; } if (strcmp(printFormat,NO_P_FORMAT) == 0) { fprintf(fpout,"%s\n",NO_P_FORMAT); return; } if (SDP_nBlock>0 && SDP_block) { fprintf(fpout,"SDP part{\n"); for (int l=0; l0 && SOCP_block) { fprintf(fpout,"SOCP part{\n"); for (int l=0; l0 && LP_block) { fprintf(fpout,"LP part{\n"); for (int l=0; l 0) { fprintf(fpout,printFormat,LP_block[start+size-1]); fprintf(fpout,"}\n"); } else { fprintf(fpout," }\n"); } } else { rError("io::displayDenseLinearSpaceLast not valid blockType"); } } fprintf(fpout,"}\n"); } bool DenseLinearSpace::copyFrom(DenseLinearSpace& other) { if (this == &other) { return SDPA_SUCCESS; } if (other.SDP_nBlock+other.SOCP_nBlock+other.LP_nBlock<=0) { rError("DenseLinearSpace:: SDP + SOCP + LP Block is nonpositive"); } bool total_judge = SDPA_SUCCESS; // for SDP if (other.SDP_nBlock<0) { rError("DenseLinearSpace:: SDP_nBlock is negative"); } if (SDP_nBlock!=other.SDP_nBlock) { DeleteArray(SDP_block); } SDP_nBlock = other.SDP_nBlock; if (SDP_nBlock > 0 && SDP_block == NULL) { NewArray(SDP_block,DenseMatrix,SDP_nBlock); } for (int l=0; l 0 && SOCP_block == NULL) { NewArray(SOCP_block,DenseMatrix,SOCP_nBlock); } for (int l=0; l 0) && (LP_block == NULL)) { LP_block = new double[LP_nBlock]; if (LP_block==NULL) { rError("DenseLinearSpace:: memory exhausted"); } } for (int l=0; l= SDP_nBlock){ rError("out of range in input data"); } if ((i >= SDP_block[block].nRow) || (j >= SDP_block[block].nCol)){ rError("out of range in input data"); } int nCol = SDP_block[block].nCol; SDP_block[block].de_ele[i + j * nCol] = ele; SDP_block[block].de_ele[j + i * nCol] = ele; } void DenseLinearSpace::setElement_SOCP(int block, int i, int j, double ele) { rError("DenseLinearSpace:: current version does not support SOCP"); } void DenseLinearSpace::setElement_LP(int block, double ele) { // check range if (block >= LP_nBlock){ rError("out of range in input data"); } LP_block[block] = ele; } void DenseLinearSpace::setZero() { // for SDP if (SDP_nBlock>0 && SDP_block) { for (int l=0; l0 && SOCP_block) { for (int l=0; l0 && LP_block) { for (int l=0; l0 && SDP_block) { for (int l=0; l0 && SOCP_block) { for (int l=0; l0 && LP_block) { for (int l=0; l 20 : Lanczos method // block size <= 20 : QR method static double getMinEigen(DenseLinearSpace& lMat, DenseLinearSpace& xMat, WorkVariables& work); // calculate the minimum eigen value of xMat by QR method. static double getMinEigen(DenseLinearSpace& xMat, WorkVariables& work); static bool getInvChol(DenseLinearSpace& invCholMat, DenseLinearSpace& aMat, DenseLinearSpace& workMat); static bool getInvCholAndInv(DenseLinearSpace& invCholMat, DenseLinearSpace& inverseMat, DenseLinearSpace& aMat, DenseLinearSpace& workMat); static bool multiply(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat, double* scalar = NULL); #if 0 // CAUTION!!! We don't initialize retMat to zero matrix for efficiently. static bool multiply(DenseLinearSpace& retMat, SparseLinearSpace& aMat, DenseLinearSpace& bMat, double* scalar = NULL); // CAUTION!!! We don't initialize retMat to zero matrix for efficiently. static bool multiply(DenseLinearSpace& retMat, DenseLinearSpace& aMat, SparseLinearSpace& bMat, double* scalar = NULL); #endif // retMat = L_{A} B = (A * B + B * A)/2 static bool jordan_product(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat); // retMat = A * B static bool ns_jordan_product(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat); // retMat = P_{A} B = A * B * A static bool jordan_quadratic_product(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat, DenseLinearSpace& work); // retMat = Q_{A,C} B = (A * B * C + C * B * A)/2 static bool jordan_triple_product(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat, DenseLinearSpace& cMat, DenseLinearSpace& work); // retMat = A * B * C static bool ns_jordan_triple_product(DenseLinearSpace& retMat, DenseLinearSpace& aMat, DenseLinearSpace& bMat, DenseLinearSpace& cMat, DenseLinearSpace& work); }; } // end of namespace 'sdpa' #endif // __sdpa_jordan_h__ sdpa-7.3.11/sdpa_block.cpp0000644000175000017500000001010213211530510014666 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_block.h" namespace sdpa { BlockStruct::BlockStruct() { nBlock = 0; blockStruct = NULL; blockNumber = NULL; blockType = NULL; SDP_nBlock = 0; SDP_blockStruct = NULL; SOCP_nBlock = 0; SOCP_blockStruct = NULL; LP_nBlock = 0; } BlockStruct::~BlockStruct() { terminate(); } void BlockStruct::initialize(int nBlock) { this->nBlock = nBlock; NewArray(blockStruct,int,nBlock); NewArray(blockType, BlockType, nBlock); NewArray(blockNumber,int,nBlock); SDP_nBlock = 0; SDP_blockStruct = NULL; SOCP_nBlock = 0; SOCP_blockStruct = NULL; LP_nBlock = 0; } void BlockStruct::terminate() { DeleteArray(blockStruct); DeleteArray(blockNumber); DeleteArray(blockType); DeleteArray(SDP_blockStruct); DeleteArray(SOCP_blockStruct); } void BlockStruct::makeInternalStructure() { SDP_nBlock = 0; SOCP_nBlock = 0; LP_nBlock = 0; for (int l=0; l Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. sdpa-7.3.11/example1.dat0000644000175000017500000000030613211530510014274 0ustar makotomakoto"Example 1: mDim = 3, nBLOCK = 1, {2}" 3 = mDIM 1 = nBLOCK 2 = bLOCKsTRUCT {48, -8, 20} { {-11, 0}, { 0, 23} } { { 10, 4}, { 4, 0} } { { 0, 0}, { 0, -8} } { { 0, -8}, {-8, -2} } sdpa-7.3.11/sdpa_linear.cpp0000644000175000017500000020665113211530510015066 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_linear.h" #include "sdpa_dataset.h" #include "sdpa_dpotrf.h" #include "sdpa_algebra.h" namespace sdpa { double Lal::getMinEigen(DenseMatrix& lMat, DenseMatrix& xMat, DenseMatrix& Q, Vector& out, Vector& b, Vector& r, Vector& q, Vector& qold, Vector& w, Vector& tmp, Vector& diagVec, Vector& diagVec2, Vector& workVec) { double alpha,beta,value; double min = 1.0e+51, min_old = 1.0e+52; double error = 1.0e+10; int nDim = xMat.nRow; int k = 0, kk = 0; diagVec.initialize(1.0e+50); diagVec2.setZero(); q.setZero(); r.initialize(1.0); beta = sqrt((double)nDim); // norm of "r" // nakata 2004/12/12 while (k 1.0e-16 && ( k<20 || fabs(min-min_old) > (1.0e-5)*fabs(min)+(1.0e-8) // && (fabs(min-min_old) > (1.0e-3)*fabs(min)+(1.0e-6) || fabs(error*beta) > (1.0e-2)*fabs(min)+(1.0e-6) ) ) { // rMessage("k = " << k); qold.copyFrom(q); value = 1.0/beta; Lal::let(q,'=',r,'*',&value); // w = (lMat^T)*q w.copyFrom(q); dtrmv_fc ((char *)"Lower",(char *)"Transpose", (char *)"NotUnit",&nDim, lMat.de_ele,&nDim,w.ele,&IONE, strlen("Lower"), strlen("Transpose"),strlen("NotUnit")); Lal::let(tmp,'=',xMat,'*',w); w.copyFrom(tmp); dtrmv_fc ((char *)"Lower",(char *)"NoTranspose", (char *)"NotUnit",&nDim, lMat.de_ele,&nDim,w.ele,&IONE, strlen("Lower"), strlen("NoTranspose"),strlen("NotUnit")); // w = lMat*xMat*(lMat^T)*q // rMessage("w = "); // w.display(); Lal::let(alpha,'=',q,'.',w); diagVec.ele[k] = alpha; Lal::let(r,'=',w,'-',q,&alpha); Lal::let(r,'=',r,'-',qold,&beta); // rMessage("r = "); // r.display(); if ( kk>=sqrt((double)k) || k==nDim-1 || k>sqrt((double)nDim+9) ) { kk = 0; out.copyFrom(diagVec); b.copyFrom(diagVec2); out.ele[nDim-1] = diagVec.ele[k]; b.ele[nDim-1] = 0.0; // rMessage("out = "); // out.display(); // rMessage("b = "); // b.display(); int info; int kp1 = k+1; dsteqr_fc ((char *)"I_withEigenvalues",&kp1,out.ele,b.ele, Q.de_ele, &Q.nRow, workVec.ele, &info, strlen("I_withEigenvalues")); if (info < 0) { rError(" rLanczos :: bad argument " << -info << " Q.nRow = " << Q.nRow << ": nDim = " << nDim << ": kp1 = " << kp1); } else if (info > 0) { rMessage(" rLanczos :: cannot converge " << info); break; } // rMessage("out = "); // out.display(); // rMessage("Q = "); // Q.display(); min_old = min; #if 0 min = 1.0e+50; error = 1.0e+10; for (int i=0; iout.ele[i]){ min = out.ele[i]; error = Q.de_ele[k+Q.nCol*i]; } } #else // out have eigen values with ascending order. min = out.ele[0]; error = Q.de_ele[k]; #endif } // end of 'if ( kk>=sqrt(k) ...)' // printf("\n"); Lal::let(value,'=',r,'.',r); beta = sqrt(value); diagVec2.ele[k] = beta; ++k; ++kk; } // end of while // rMessage("k = " << k); return min - fabs(error*beta); } double Lal::getMinEigenValue(DenseMatrix& aMat, Vector& eigenVec, Vector& workVec) { // aMat is rewritten. // aMat must be symmetric. // eigenVec is the space of eigen values // and needs memory of length aMat.nRow // workVec is temporary space and needs // 3*aMat.nRow-1 length memory. int N = aMat.nRow; int LWORK, info; switch (aMat.type) { case DenseMatrix::DENSE: LWORK = 3*N-1; // "N" means that we need not eigen vectors // "L" means that we refer only lower triangular. dsyev_fc((char *)"NonVectors",(char *)"Lower",&N,aMat.de_ele,&N, eigenVec.ele,workVec.ele,&LWORK,&info, strlen("NonVectors"), strlen("Lower")); if (info!=0) { if (info < 0) { rMessage("getMinEigenValue:: info is mistaken " << info); } else { rMessage("getMinEigenValue:: cannot decomposition"); } exit(0); return 0.0; } return eigenVec.ele[0]; // Eigen values are sorted by ascending order. break; case DenseMatrix::COMPLETION: rError("DenseMatrix:: no support for COMPLETION"); break; } return 0.0; } double Lal::getOneNorm(Vector& b) { double ret = 0.0; int nDim = b.nDim; for (int k=0; k= *n) { // Here is point. rdpotf2_(uplo, n, a, lda, info); } else { for (int j = 0; j < *n; j += nb) { int jb = min(nb,*n- j); dsyrk_fc((char *)"Lower", (char *)"No transpose", &jb, &j, &DMONE, &a[j], lda, &DONE, &a[j+nRow*j], lda, strlen("Lower"), strlen("No transpose")); // Here is point. rdpotf2_((char *)"Lower", &jb, &a[j+nRow*j], lda, info); if (*info != 0) { *info = *info + j - 1; return 0; } if (j + jb <= *n-1) { int i = *n - j - jb; dgemm_fc((char *)"No transpose", (char *)"Transpose", &i, &jb, &j, &DMONE, &a[j + jb], lda, &a[j], lda, &DONE, &a[(j + jb)+nRow*j], lda, strlen("No transpose"), strlen("Transpose")); dtrsm_fc((char *)"Right", (char *)"Lower", (char *)"Transpose", (char *)"Non-unit", &i, &jb, &DONE, &a[j+nRow*j], lda, &a[(j + jb)+nRow*j], lda, strlen("Right"), strlen("Lower"), strlen("Transpose"), strlen("Non-unit")); } } } return 0; } bool Lal::choleskyFactorWithAdjust(DenseMatrix& aMat) { int info=0; #if 1 // aMat.display(); TimeStart(START1); info = rATL_dpotrfL(aMat.nRow, aMat.de_ele,aMat.nRow); TimeEnd(END1); // rMessage("Schur colesky ::" << TimeCal(START1,END1)); // aMat.display(); #elif 1 dpotrf_fc("Lower",&aMat.nRow,aMat.de_ele,&aMat.nRow, &info,strlen("Lower")); #else rdpotrf_("Lower",&aMat.nRow,aMat.de_ele,&aMat.nRow,&info); #endif if (info < 0) { rMessage("cholesky argument is wrong " << -info); } else if (info > 0) { rMessage("cholesky miss condition :: not positive definite" << " :: info = " << info); rMessage("There are some possibilities."); rMessage("1. SDPA terminates due to inaccuracy of numerical error"); rMessage("2. The input problem may not have (any) interior-points"); rMessage("3. Input matrices are linearly dependent"); return SDPA_FAILURE; } return SDPA_SUCCESS; #if 0 double ZERO_DETECT = 1.0e-3; double NONZERO = 1.0e-7; // no idea version // if Cholesky factorization failed, then exit soon. int info = 1; // info == 0 means success int start = 0; while (start NONZERO*mishi) { // rMessage(" migi*migi > NONZERO*mishi "); migi = sqrt(NONZERO*mishi) * 0.99; shita = sqrt(NONZERO*mishi) * 0.99; } } } rMessage("cholesky adjust position " << start); } if (info < 0) { rError("argument is something wrong " << info); } return SDPA_SUCCESS; #endif } bool Lal::solveSystems(Vector& xVec, DenseMatrix& aMat, Vector& bVec) { // aMat must have done Cholesky factorized. if (aMat.nCol!=xVec.nDim || aMat.nRow!=bVec.nDim || aMat.nRow!=aMat.nCol) { rError("solveSystems:: different memory size"); } if (aMat.type!=DenseMatrix::DENSE) { rError("solveSystems:: matrix type must be DENSE"); } xVec.copyFrom(bVec); dtrsv_fc((char *)"Lower", (char *)"NoTranspose", (char *)"NonUnit", &aMat.nRow, aMat.de_ele, &aMat.nCol, xVec.ele,&IONE, strlen("Lower"), strlen("NoTranspose"), strlen("NonUnit")); dtrsv_fc((char *)"Lower", (char *)"Transpose", (char *)"NonUnit", &aMat.nRow, aMat.de_ele, &aMat.nCol, xVec.ele,&IONE, strlen("Lower"), strlen("Transpose"), strlen("NonUnit")); return SDPA_SUCCESS; } // nakata 2004/12/01 bool Lal::solveSystems(Vector& xVec, SparseMatrix& aMat, Vector& bVec) { #define TUNEUP 0 #if TUNEUP if (aMat.nCol!=xVec.nDim || aMat.nRow!=bVec.nDim || aMat.nRow!=aMat.nCol) { printf("A.row:%d A.col:%d x.row:%d b.row:%d\n", aMat.nCol,aMat.nRow,xVec.nDim ,bVec.nDim); rError("solveSystems(sparse):: different memory size"); } int length; int amari,shou,counter; switch(aMat.type) { case SparseMatrix::SPARSE: #endif // Attension: in SPARSE case, only half elements // are stored. And bMat must be DENSE case. // rMessage("aMat.NonZeroCount == " << aMat.NonZeroCount); xVec.copyFrom(bVec); #if TUNEUP shou = aMat.NonZeroCount / 4; amari = aMat.NonZeroCount % 4; int i,j; double value; for (int index=0; index> Makefile.inc; cd build; echo "IPORDDIR = "`pwd`"/PORD/include/" >> Makefile.inc; cd build; echo "AR = " ${AR} rv " " >> Makefile.inc; cd build; echo "RANLIB = " ${RANLIB} >> Makefile.inc; cd build ; ${MAKE} d clean: @echo "##########################################################" @echo "If you want to rebuild mumps dir, use 'make distclean'" @echo "##########################################################" ${MUMPS_TAR_FILE}: @echo "By wget command, downloading a file from" @echo "http://ftp.de.debian.org/debian/pool/main/m/mumps/${MUMPS_TAR_FILE}" @echo "If fail, you manually put the file into " `pwd` "directory." wget http://ftp.de.debian.org/debian/pool/main/m/mumps/${MUMPS_TAR_FILE} distclean: rm -rf build ${MUMPS_TAR_FILE} install: all uninstall: sdpa-7.3.11/example2.dat0000644000175000017500000000164213211530510014301 0ustar makotomakoto*Example 2: *mDim = 5, nBLOCK = 3, {2,3,-2} 5 = mDIM 3 = nBLOCK 2 3 -2 = bLOCKsTRUCT {1.1, -10, 6.6 , 19 , 4.1} { { { -1.4, -3.2 }, { -3.2,-28 } } { { 15, -12, 2.1 }, {-12, 16, -3.8 }, { 2.1, -3.8, 15 } } { 1.8, -4.0 } } { { { 0.5, 5.2 }, { 5.2, -5.3 } } { { 7.8, -2.4, 6.0 }, { -2.4, 4.2, 6.5 }, { 6.0, 6.5, 2.1 } } { -4.5, -3.5 } } { { { 1.7, 7.0 }, { 7.0, -9.3 } } { {-1.9, -0.9, -1.3 }, {-0.9, -0.8, -2.1 }, {-1.3, -2.1, 4.0 } } {-0.2, -3.7 } } { { { 6.3, -7.5 }, {-7.5, -3.3 } } { { 0.2, 8.8, 5.4 }, { 8.8, 3.4, -0.4 }, { 5.4, -0.4, 7.5 } } {-3.3, -4.0 } } { { { -2.4, -2.5 }, { -2.5, -2.9 } } { { 3.4, -3.2, -4.5 }, { -3.2, 3.0, -4.8 }, { -4.5, -4.8, 3.6 } } { 4.8 , 9.7 } } { { { -6.5, -5.4 }, { -5.4, -6.6 } } { { 6.7, -7.2, -3.6 }, { -7.2, 7.3, -3.0 }, { -3.6, -3.0, -1.4 } } { 6.1, -1.5 } } sdpa-7.3.11/sdpa_tool.cpp0000644000175000017500000000352013211530510014557 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*----------------------------------------- sdpa_tool.cpp -----------------------------------------*/ #include "sdpa_tool.h" #include #include #include #ifndef CLK_TCK #define CLK_TCK sysconf(_SC_CLK_TCK) #endif namespace sdpa { // These are constant. // Do Not Change . int IZERO = 0; int IONE = 1; int IMONE = -1; double DZERO = 0.0; double DONE = 1.0; double DMONE = -1.0; double Time::rGetUseTime() { #if PROCESS_TIME struct tms TIME; times(&TIME); return (double)TIME.tms_utime/(double)CLK_TCK; #else return 0.0; #endif } void Time::rSetTimeVal(struct timeval& targetVal) { static struct timezone tz; gettimeofday(&targetVal,&tz); } double Time::rGetRealTime(const struct timeval& start, const struct timeval& end) { const long int second = end.tv_sec - start.tv_sec; const long int usecond = end.tv_usec - start.tv_usec; return ((double)second) + ((double)usecond)*(1.0e-6); } } // end of namespace 'sdpa' sdpa-7.3.11/config.guess0000755000175000017500000012763713211530510014427 0ustar makotomakoto#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2009-12-30' # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sdpa-7.3.11/INSTALL0000644000175000017500000003062613211530510013127 0ustar makotomakoto SDPA 7.3.X Install Manual [Copyright (C) 2004-2017 SDPA Project] This text explains how to install SDPA. If you have questions on the installation, please contact us from http://sdpa.sourceforge.net/contact.html The user-manual of SDPA is available at https://sourceforge.net/projects/sdpa/files/sdpa/sdpa.7.1.1.manual.20080618.pdf/download Note: 20120803 To use the mex files, the library files should be assigned for full paths. In short, not "-L$(SOME_PATH) -lblas", but "$(SOME_PATH)/libblas.a". Otherwise, MATLAB will load its BLAS library before loading your assigned library. --- index ------------------------------------ 1. Install the SDPA 2. Compile callable-library example [optional] 3. Compile SDPA-M (for Matlab and Octave) [optional] including short manual for SDPA-M 4. Note for Mac OS X 5. Note for existing MUMPS package (for Ubuntu/Debian) 6. If you have some trouble ---------------------------------------------- 1. Install the SDPA (1) Download the SDPA from the SDPA Homepage; http://sdpa.sourceforge.net/download.html You can get the sdpa_7.3.X.tar.gz (2) configure && make You can select BLAS library from the three, OpenBLAS, ATLAS, and LAPACK/BLAS. The selection of BLAS library sometimes strongly affects the performance of SDPA. From our numerical experiments, GotoBLAS attains best performance. If you are allowed to use GotoBLAS (for the details, refer the GotoBLAS license), our suggestion is GotoBLAS. The LAPACK/BLAS is only for the case both ATLAS and Goto BLAS can not be compiled. If you install SDPA into **Mac OS X**, then first take a look this section before your compile. Then, you should read Section 4 ``Note for Mac OS X'' and return here. (2-1) SDPA linked against GotoBLAS library Assume that SDPA is installed into $HOME/sdpa/. # OpenBLAS $ mkdir -p $HOME/sdpa $ git clone https://github.com/xianyi/OpenBLAS.git $ cd OpenBLAS Depending on OS bit (64 or 32), $ make BINARY=64 CC=gcc FC=gfortran USE_OPENMP=0 NO_CBLAS=1 NO_WARMUP=1 libs netlib; or $ make BINARY=32 CC=gcc FC=gfortran USE_OPENMP=0 NO_CBLAS=1 NO_WARMUP=1 libs netlib; [If you are going to use mex files on Mac OS X with Matlab 2009a or earlier, we suggest you use 32bit (because Matlab 2009a on Mac OS X is 32bit)] # SDPA $ cd $HOME/sdpa $ tar xzf sdpa_7.3.X.tar.gz $ cd sdpa-7.3.X $ export CC=gcc $ export CXX=g++ $ export FC=gfortran $ export CFLAGS="-funroll-all-loops" $ export CXXFLAGS="-funroll-all-loops" $ export FFLAGS="-funroll-all-loops" $ ./configure --prefix=$HOME/sdpa --with-blas="${HOME}/sdpa/OpenBLAS/libopenblas.a" --with-lapack="${HOME}/sdpa/OpenBLAS/libopenblas.a" $ make $ make install (2-2) SDPA linked against ATLAS library Download the ATLAS library from the following web site; http://math-atlas.sourceforge.net/ Download the LAPACK library from the following web site; http://www.netlib.org/lapack/ Assume that SDPA and ATLAS/LAPACK library are installed into $HOME/sdpa/sdpa_7.3.X and $HOME/sdpa/lib respectively. # LAPACK $ tar xvzf lapack.tgz $ cd lapack-3.3.0 $ cp ./INSTALL/make.inc.gfortran make.inc $ make lapacklib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC" $ cp lapack_LINUX.a $HOME/sdpa/lib/liblapack.a # ATLAS $ cd $HOME/sdpa $ tar xvzf atlas3.x.x.tar.gz $ mkdir -p $HOME/sdpa/atlas-tmp $ cd $HOME/sdpa/atlas-tmp $ ../ATLAS/configure --prefix=$HOME/sdpa/atlas \ -Si cputhrchk 0 \ --with-netlib-lapack=$HOME/sdpa/lib/liblapack.a \ -C ic gcc -C if gfortran -Fa alg -fPIC If your OS is 64bit, you should configure exlicitly by adding '-b 64' as follows. $ ../ATLAS/configure --prefix=$HOME/sdpa/atlas \ -Si cputhrchk 0 \ --with-netlib-lapack=$HOME/sdpa/lib/liblapack.a \ -C ic gcc -C if gfortran -Fa alg -fPIC -b 64 $ make $ make install $ rm -rf $HOME/sdpa/atlas-tmp Note: On Mac OS X, 'make' or 'make install' of ATLAS sometimes fail. In this case, copy from the build directory as follow $ cp $HOME/sdpa/atlas-tmp/lib/lib*.a $HOME/sdpa/atlas/lib/ # SDPA $ cd $HOME/sdpa $ tar xzf sdpa_7.3.X.tar.gz $ cd sdpa-7.3.X $ export CC=gcc $ export CXX=g++ $ export FC=gfortran $ export CFLAGS="-funroll-all-loops" $ export CXXFLAGS="-funroll-all-loops" $ export FFLAGS="-funroll-all-loops" $ ./configure --prefix=$HOME/sdpa --with-blas="${HOME}/sdpa/atlas/lib/libptf77blas.a ${HOME}/sdpa/atlas/libptcblas.a ${HOME}/sdpa/atlas/lib/libatlas.a" --with-lapack="${HOME}/sdpa/lib/liblapack.a" Note: If your OS is Mac OS X, assign the full paths, $ ./configure --prefix=$HOME/sdpa --with-blas="${HOME}/sdpa/atlas/lib/libptf77blas.a ${HOME}/sdpa/atlas/lib/libatlas.a" --with-lapack="${HOME}/sdpa/lib/liblapack.a" $ make $ make install (2-3) SDPA linked against LAPACK/BLAS library Download the LAPACK/BLAS library from the following web site; http://www.netlib.org/lapack/ Assume that SDPA and LAPACK/BLAS library are installed into $HOME/sdpa/sdpa_7.3.X and $HOME/sdpa/lib respectively. # LAPACK/BLAS $ tar xvzf lapack.tgz $ cd lapack-3.3.0 $ make blaslib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC" $ make lapacklib OPTS="-O2 -fPIC" NOOPT="-O0 -fPIC" $ cp blas_LINUX.a $HOME/sdpa/lib/libblas.a $ cp lapack_LINUX.a $HOME/sdpa/lib/liblapack.a # SDPA $ cd $HOME/sdpa $ tar xzf sdpa_7.3.X.tar.gz $ cd sdpa-7.3.X $ export CC=gcc $ export CXX=g++ $ export FC=gfortran $ export CFLAGS="-funroll-all-loops" $ export CXXFLAGS="-funroll-all-loops" $ export FFLAGS="-funroll-all-loops" $ ./configure --with-blas="${HOME}/sdpa/lib/libblas.a" --with-lapack="${HOME}/sdpa/lib/liblapack.a" $ make $ make install (3) execute Try the following command to execute sdpa $ cd $HOME/sdpa/bin/ $ ./sdpa Then you will see message from SDPA and can check command line options. To solve input dat-s and write its result, $ ./sdpa $HOME/sdpa/share/sdpa/example/example1.dat-s example1.result If you specify the number of threads with the SDPA, set OMP_NUM_THREADS environment variable(ex. export OMP_NUM_THREADS=4). If you have dual-core or quad-core CPU, we strongly recommend that set $ export OMP_NUM_THREADS=2 or $ export OMP_NUM_THREADS=4 The details of the configure script option for each OS can be found in sdpa user manual. (https://sourceforge.net/projects/sdpa/files/sdpa/sdpa.7.1.1.manual.20080618.pdf/download) ---------------------------------------------- 2. Compile callable-library example (optional) To compile callable-library example, use 'make' command in 'libexample' directory $ cd $HOME/sdpa/share/sdpa/libexample $ make The details of callable-library can be found in SDPA user manual in $HOME/sdpa/share/sdpa/ ---------------------------------------------- 3. Compile SDPA-M (optional) To compile SDPA-M, use 'make' command in 'mex' directory $ cd $HOME/sdpa/share/sdpa/mex $ make If you use Octave instead of Matlab, then $ cd $HOME/sdpa/share/sdpa/mex $ make COMPILE_ENVIRONMENT=octave The make command automatically searches 'mex' command by invoking 'matlab' command. If this auto-search fails, you setup the full-path for 'mex' command in Makefile in the 'mex' directory and use 'make' command again. Since the usage of this new SDPA-M as SDPA-M 6.2.0, SDPA-M 6.2.0 manual is very useful. (https://sourceforge.net/projects/sdpa/files/sdpa-m/sdpamManual.pdf/download) In addition, the file 'mex/CommandList.txt' summarizes each command. When you have trouble with SDPA-M(Matlab environment), the following command will display useful messages. $ matlab -Dgdb [On gdb environment] (gdb) run -nodisplay [On Matlab environment] >> (Call SDPA-M by sdpam or sedumiwrap) If Matlab aborts, try the following command in gdb environment. (gdb) where The command 'where' will display what happened. To exit gdb environment, (gdb) quit In some case, the segmentation fault may be avoided by $ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libgfortran.so:$LD_PRELOAD $ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libstdc++.so:$LD_PRELOAD $ export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/4.4/libgcc_s.so:$LD_PRELOAD $ matlab In particular, when the gcc version is higher than the version Matlab assumes, Matlab sometimes can not load appropriate shared libraries. The command above load the libraries before Matlab launches. ---------------------------------------------- 4. Note for Mac OS X Since the installation of SDPA requires gfortran, we recommend the users install 'fink' system, which is a package manager for Mac OS X. (You need an administrator authority for your system). To install fink system, please refer http://www.finkproject.org/ and http://www.finkproject.org/download/index.php?phpLang=en In particular, the following URLs are useful when you have trouble with fink. http://www.finkproject.org/faq/upgrade-fink.php?phpLang=en http://www.finkproject.org/faq/index.php?phpLang=en (1-1) SDPA linked against ATLAS library Install atlas by the fink system. (You can install atlas by following Section 1 above; but the installation by the fink system is easier.) $ sudo fink install atlas The atlas package in the fink system also contains lapack library. If your system does not have gcc-4 or gfortran, the fink system automatically installs them before compiling the atlas package. You can check whether your system successfully installed gcc-4 and atlas by the following command. [To check gcc-4] $ /sw/bin/gcc-4 -v $ /sw/bin/g++-4 -v $ /sw/bin/gfortran -v [To check atlas] $ ls -l /sw/lib/libptf77blas.a $ ls -l /sw/lib/libptcblas.a $ ls -l /sw/lib/libatlas.a $ ls -l /sw/lib/liblapack.a To install SDPA, download the SDPA from the SDPA Homepage; http://sdpa.sourceforge.net/download.html You can get the sdpa_7.3.X.tar.gz Then the following commands will install SDPA. $ mkdir $HOME/sdpa $ cd $HOME/sdpa $ tar xzf sdpa_7.3.X.tar.gz $ cd sdpa-7.3.X $ export CC=/sw/bin/gcc-4 $ export CXX=/sw/bin/g++-4 $ export FC=/sw/bin/gfortran $ export CFLAGS="-funroll-all-loops" $ export CXXFLAGS="-funroll-all-loops" $ export FFLAGS="-funroll-all-loops" $ ./configure --prefix=$HOME/sdpa --with-blas="/sw/lib/libptf77blas.a /sw/lib/libptcblas.a /sw/lib/libatlas.a" --with-lapack="/sw/lib/liblapack.a" $ make $ make install (1-2) SDPA linked against GotoBLAS library or LAPACK/BLAS library In these cases, instead of installing atlas, you need to install gfortran into Mac OS X. You can install gfortran by the following command: $ fink install gcc43 After installing gfortran, go back to (2-2) of Section 2. (Even if you have already installed LAPACK into your computer by using fink system, it is inappropriate to link with GotoBLAS (since the LAPACK of the fink system has some ATLAS interface) and you need to install LAPACK by following (2-2) of Section 2.) (1-3) compile callable-library example and SDPA-M in Mac OS X To use callable library and SDPA-M, after using make install, you need to modify etc/make.inc to remove "-lcrt1.10.5" (due to a confliction between Mac OS X and Matlab). $ cd $HOME/sdpa/sdpa-7.3.X/etc $ sed -e 's/-lcrt1.10.5.o//g' -i .bak make.inc Then $ cd $HOME/sdpa/share/sdpa/libexample $ make $ cd $HOME/sdpa/share/sdpa/mex $ make Sometimes 'make' command in the 'mex' directory fails, since Matlab directory may depend on your environment. In the case, modify 'Makefile' in the 'mex' directory from MEX = /Applications/MATLAB_R2008b.app/bin/mex to (for example) MEX = /Applications/MATLAB_R2007b/bin/mex and use 'make' command again. In addition, some warning may be displayed due to a confliction between Mac OS X and Matlab. ------------------------------------------------------- 5. Note for existing MUMPS package (for Ubuntu/Debian) On Ubuntu/Debian, you can install a MUMPS package by $ sudo aptitude install libmumps-seq-dev If you have alredy a MUMPS package, you can use it by assiging it to configure script. For example, on Debian, the header file is '/usr/include/dmumps_c.h' and the library files '/usr/lib/libdmumps_seq.a /usr/lib/libmumps_common_seq.a /usr/lib/libmpiseq_seq.a /usr/lib/libpord_seq.a'. The library files should be assigned for full paths. In this case $ ./configure --prefix=$HOME/sdpa \ --with-blas=SOME_BLAS --with-lapack=SOME_LAPACK \ --with-mumps-include="-I/usr/include" \ --with-mumps-libs="/usr/lib/libdmumps_seq.a /usr/lib/libmumps_common_seq.a /usr/lib/libmpiseq_seq.a /usr/lib/libpord_seq.a" Then $ make $ make install ------------------------------------------------------- 6. If you have some trouble If some bugs are found or you encounter some trouble when you are compiling SDPA, please let us know from http://sdpa.sourceforge.net/contact.html In particular, attaching error messages and/or 'config.log' file is very useful to let us understand your situation. sdpa-7.3.11/bin/0000755000175000017500000000000013211530510012637 5ustar makotomakotosdpa-7.3.11/bin/param.sdpa0000644000175000017500000000117313211530510014612 0ustar makotomakoto100 unsigned int maxIteration; 1.0E-7 double 0.0 < epsilonStar; 1.0E2 double 0.0 < lambdaStar; 2.0 double 1.0 < omegaStar; -1.0E5 double lowerBound; 1.0E5 double upperBound; 0.1 double 0.0 <= betaStar < 1.0; 0.2 double 0.0 <= betaBar < 1.0, betaStar <= betaBar; 0.9 double 0.0 < gammaStar < 1.0; 1.0E-7 double 0.0 < epsilonDash; %+8.3e char* xPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* XPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* YPrint (default %+8.3e, NOPRINT skips printout) %+10.16e char* infPrint (default %+10.16e, NOPRINT skips printout) sdpa-7.3.11/sdpa_exe.cpp0000644000175000017500000002772413211530510014377 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 #include #include using namespace sdpa; #define USER_PARAMETER_FILE ((char *)"./param.sdpa") #define DEFAULT_PARAMETER_FILE ((char *)"/usr/share/sdpa/param.sdpa") // PARAMETER_FILE is decided by the following priority // 1: The file assigned by '-p' option of 'option type 2'. // For 'option type1', this is skipped. // 2: USER_PARAMETER_FILE // For 'option type2', this is skipped. // 3: DEFAULT_PARAMETER_FILE // 4: Default parameter static void message(char* argv0) { cout << endl; cout << "*** Please assign data file and output file.***" << endl; cout << endl; cout << "---- option type 1 ------------" << endl; cout << argv0 <<" DataFile OutputFile [InitialPtFile]" " [-pt parameters] [-dimacs] [-numThreads numThreads]"<< endl; cout << "parameters = 0 default, 1 fast (unstable)," " 2 slow (stable)" << endl; cout << " -dimacs : printout dimacs information incurring additional computation cost " << endl; cout << " -numThreads: Number of pthreads for internal computation" << endl; cout << "example1-1: " << argv0 << " example1.dat example1.result" << endl; cout << "example1-2: " << argv0 << " example1.dat-s example1.result" << endl; cout << "example1-3: " << argv0 << " example1.dat example1.result example1.ini" << endl; cout << "example1-4: " << argv0 << " example1.dat example1.result -pt 2" << endl; cout << "example1-5: " << argv0 << " example1.dat example1.result -dimacs" << endl; cout << "example1-6: " << argv0 << " example1.dat example1.result -numThreads 4" << endl; cout << endl; cout << "---- option type 2 ------------" << endl; cout << argv0 << " [option filename]+ " << endl; cout << " -dd : data dense :: -ds : data sparse " << endl; cout << " -id : init dense :: -is : init sparse " << endl; cout << " -o : output :: -p : parameter " << endl; cout << " -pt : parameters , 0 default, 1 fast (unstable)" << endl; cout << " 2 slow (stable) " << endl; cout << " -dimacs : printout dimacs information incurring additional computation cost " << endl; cout << " -numThreads: Number of pthreads for internal computation" << endl; cout << "example2-1: " << argv0 << " -o example1.result -dd example1.dat" << endl; cout << "example2-2: " << argv0 << " -ds example1.dat-s -o example1.result " << "-p param.sdpa" << endl; cout << "example2-3: " << argv0 << " -ds example1.dat-s -o example1.result " << "-pt 2" << endl; cout << "example2-4: " << argv0 << " -ds example1.dat-s -o example1.result " << "-dimacs" << endl; cout << "example2-5: " << argv0 << " -ds example1.dat-s -o example1.result " << "-numThreads 4" << endl; cout << endl; cout << "---- option type 3 ------------" << endl; cout << argv0 << " --version " << endl; cout << " to print out version and exit." << endl; cout << endl << endl; cout << "PARAMETER_FILE is decided by the following priority" << endl; cout << " 1: The file assigned by '-p' option of 'option type 2'." << endl; cout << " For 'option type1', this is skipped." << endl; cout << " 2: " << USER_PARAMETER_FILE << endl; cout << " For 'option type2', this is skipped." << endl; cout << " 3: " << DEFAULT_PARAMETER_FILE << endl; cout << " 4: Default parameter" << endl; exit(1); } static void argumentAnalysis(SDPA& Problem1, int argc, char** argv, char*& inputFileName, char*& resultFileName, char*& initFileName, char*& paramFileName, SDPA::SparseType& isInputSparse, SDPA::SparseType& isInitSparse, SDPA::ParameterType& parameterType, bool& isDimacs, int& numThreads) { if (argc == 1) { message(argv[0]); } if (strcmp(argv[1],"--version") == 0) { fprintf(stdout,"====\n"); fprintf(stdout,"SDPA (SemiDefinite Programming Algorithm) %s\n",sdpa_version); fprintf(stdout," %s\n",sdpa_right); fprintf(stdout,"====\n"); exit(0); } if (argv[1][0] == '-') { // rsdpa argument for (int index = 0; index < argc; ++index) { char* target = argv[index]; if (strcmp(target,"-dd")==0 && index+1 < argc) { inputFileName = argv[index+1]; isInputSparse = SDPA::DENSE; index++; continue; } if (strcmp(target,"-ds")==0 && index+1 < argc) { inputFileName = argv[index+1]; isInputSparse = SDPA::SPARSE; continue; } if (strcmp(target,"-id")==0 && index+1 < argc) { initFileName = argv[index+1]; isInitSparse = SDPA::DENSE; continue; } if (strcmp(target,"-is")==0 && index+1 < argc) { initFileName = argv[index+1]; isInitSparse = SDPA::SPARSE; index++; continue; } if (strcmp(target,"-o")==0 && index+1 < argc) { resultFileName = argv[index+1]; index++; continue; } if (strcmp(target,"-p")==0 && index+1 < argc) { paramFileName = argv[index+1]; index++; continue; } if (strcmp(target,"-k")==0 && index+1 < argc) { double KAPPA = atof(argv[index+1]); Problem1.setKappa(KAPPA); rMessage("Kappa = " << KAPPA); index++; continue; } if (strcmp(target,"-dimacs")==0) { isDimacs = true; continue; } if (strcmp(target,"-pt")==0 && index+1 < argc) { int tmp = atoi(argv[index+1]); switch (tmp) { case 0: parameterType = SDPA::PARAMETER_DEFAULT; break; case 1: parameterType = SDPA::PARAMETER_UNSTABLE_BUT_FAST; break; case 2: parameterType = SDPA::PARAMETER_STABLE_BUT_SLOW; break; default: parameterType = SDPA::PARAMETER_DEFAULT; } index++; paramFileName = NULL; continue; } if (strcmp(target,"-numThreads")==0 && index+1 < argc) { numThreads = atoi(argv[index+1]); index++; continue; } } } else { // SDPA argument inputFileName = argv[1]; int len = strlen(inputFileName); if (inputFileName[len-1] == 's' && inputFileName[len-2] == '-') { isInputSparse = SDPA::SPARSE; } resultFileName = argv[2]; paramFileName = USER_PARAMETER_FILE; for (int index=3; index #define SELECT_MUMPS_BEST 7 // MUMPS selects automatically when 7 #define SELECT_DENSE -1 // This value must be minus namespace sdpa { class Chordal { public: // condition of sparse computation // m_threshold < mDim, // b_threshold < nBlock, // aggregate_threshold >= aggrigated sparsity ratio // extend_threshold >= extended sparsity ratio int m_threshold; int b_threshold; double aggregate_threshold; double extend_threshold; int best; /* indicates the used ordering method */ /* -1: dense computation */ /* 7: sparse computation by MUMPS */ SparseMatrix* sparse_bMat_ptr; DMUMPS_STRUC_C mumps_id; bool mumps_usage; Chordal(void); ~Chordal(); void initialize(SparseMatrix* sparse_bMat_ptr); void terminate(); // merge array1 to array2 void mergeArray(int na1, int* array1, int na2, int* array2); void catArray(int na1, int* array1, int na2, int* array2); void slimArray(int i, int length, int* array, int& slimedLength); void makeGraph(InputData& inputData, int m); void ordering_bMat(int m, int nBlock, InputData& inputData, FILE* Display, FILE* fpOut); double analysisAndcountLowerNonZero(int m); bool factorizeSchur(int m, int* diagonalIndex, FILE* Display, FILE* fpOut); bool solveSchur(Vector& rhs); }; } // end of namespace 'sdpa' #endif // __sdpa_chordal_h__ sdpa-7.3.11/sdpa_jordan.cpp0000644000175000017500000002574013211530510015067 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_jordan.h" #include "sdpa_dataset.h" #include "sdpa_linear.h" #include "sdpa_algebra.h" namespace sdpa { double Jal::trace(DenseLinearSpace& aMat) { double ret = 0.0; for (int l=0; l 64 : Lanczos method // block size <= 64 : QR method // QR method: workVec is temporary space and needs // 3*xMat.nRow-1 length memory. double Jal::getMinEigen(DenseLinearSpace& lMat, DenseLinearSpace& xMat, WorkVariables& work) { double min = 1.0E50; double value; // for SDP for (int l=0; l 64){ // use Lanczos method value = Lal::getMinEigen(lMat.SDP_block[l], xMat.SDP_block[l], work.DLS1.SDP_block[l], work.SDP_BV1.ele[l], work.SDP_BV2.ele[l], work.SDP_BV3.ele[l], work.SDP_BV4.ele[l], work.SDP_BV5.ele[l], work.SDP_BV6.ele[l], work.SDP_BV7.ele[l], work.SDP_BV8.ele[l], work.SDP_BV9.ele[l], work.SDP2_BV1.ele[l]); } else { // use QR method Lal::let(work.DLS2.SDP_block[l], '=',xMat.SDP_block[l],'T',lMat.SDP_block[l]); Lal::let(work.DLS1.SDP_block[l], '=',lMat.SDP_block[l],'*',work.DLS2.SDP_block[l]); Lal::getMinEigenValue(work.DLS1.SDP_block[l], work.SDP_BV1.ele[l],work.SDP2_BV1.ele[l]); value = work.SDP_BV1.ele[l].ele[0]; } if (value < min) { min = value; } } // end of 'for (int l)' // for SOCP for (int l=0; l constraint[k][t] // A[i].block[k] <-> A[i].sp_block[blockIndex[k][t]] int SDP_nBlock; int* SDP_nConstraint; int** SDP_constraint; int** SDP_blockIndex; int SOCP_nBlock; int* SOCP_nConstraint; int** SOCP_constraint; int** SOCP_blockIndex; int LP_nBlock; int* LP_nConstraint; int** LP_constraint; int** LP_blockIndex; InputData(); ~InputData(); void initialize(BlockStruct& bs); void terminate(); void initialize_bVec(int m); void initialize_index_SDP(); void initialize_index_SOCP(); void initialize_index_LP(); void initialize_index(); // retVec_i := A_i bullet xMat (for i) void multi_InnerProductToA(DenseLinearSpace& xMat,Vector& retVec); // retMat := \sum_{i} A_i xVec_i void multi_plusToA(Vector& xVec, DenseLinearSpace& retMat); void display(FILE* fpout=stdout); void display_index(FILE* fpout=stdout); }; class Residuals { public: Vector primalVec; DenseLinearSpace dualMat; double normPrimalVec; double normDualMat; double centerNorm; Residuals(); Residuals(int m, BlockStruct& bs, InputData& inputData, Solutions& currentPt); ~Residuals(); void initialize(int m, BlockStruct& bs, InputData& inputData, Solutions& currentPt); void terminate(); void copyFrom(Residuals& other); double computeMaxNorm(Vector& primalVec); double computeMaxNorm(DenseLinearSpace& dualMat); void update(int m, InputData& inputData, Solutions& currentPt, ComputeTime& com); void compute(int m, InputData& inputData, Solutions& currentPt); void display(FILE* fpout = stdout); }; class WorkVariables { public: DenseLinearSpace DLS1; DenseLinearSpace DLS2; // Vector DV1; // Vector DV2; BlockVector SDP_BV1; BlockVector SDP_BV2; BlockVector SDP_BV3; BlockVector SDP_BV4; BlockVector SDP_BV5; BlockVector SDP_BV6; BlockVector SDP_BV7; BlockVector SDP_BV8; BlockVector SDP_BV9; BlockVector SDP2_BV1; WorkVariables(); WorkVariables(int m, BlockStruct& bs); ~WorkVariables(); void initialize(int m, BlockStruct& bs); void terminate(); }; } // end of namespace 'sdpa' #endif // __sdpa_dataset_h__ sdpa-7.3.11/mex/0000755000175000017500000000000013211530510012660 5ustar makotomakotosdpa-7.3.11/mex/SedumiToSDPA.m0000644000175000017500000001447513211530510015252 0ustar makotomakotofunction SedumiToSDPA(filename,A,b,c,K, accuracy); % SedumiToSDPA(filename,A,b,c,K); % % A converter from SeDuMi Input to SDPA sparse format % (C) SDPA Project 2008 % % filename : Filename for SDPA dat-s % A,b,c,K : SeDuMi Input % accuracy : printf format (e.g. %8.16e) % /* ------------------------------------------------------------- % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % ------------------------------------------------------------- */ if nargin < 6 || ~ischar(accuracy) accuracy = '%8.16e'; fprintf('Accuracy is set as "%s"\n', accuracy); end if accuracy(1) ~= '%' error('accuracy must start with %% (e.g. %8.16e) \n'); end bprint = sprintf('%s ', accuracy); eleprint = sprintf('%%d %%d %%d %%d %s\n', accuracy); % Note that primal-dual is reverse in SeDuMi c = -c; if isfield(K,'q') && ~isempty(K.q) error('Current Program cannot handle K.q'); end if isfield(K,'r') && ~isempty(K.r) error('Current Program cannot handle K.r'); end if size(b,2) ~= 1 b = b'; end m = size(b,1); if size(c,2) ~= 1 c = c'; end n = size(c,1); if size(A,1) ~= m A = A'; end fprintf('Size A[m=%d,n=%d], b[m=%d], c[n=%d] ::', ... size(A,1),size(A,2), m, n); fprintf('nnz(A) = %d, nnz(C) = %d\n', nnz(A), nnz(c)); if size(A,1) ~= m | size(A,2) ~= n error('Inconsistent Size'); end Kf = 0; if isfield(K,'f') && ~isempty(K.f) Kf = K.f; end Kl = 0; if isfield(K,'l') && ~isempty(K.l) Kl = K.l; end Ks = 0; if isfield(K,'s') && ~isempty(K.s) Ks = K.s; if size(Ks,2) ~= 1 Ks = Ks'; end else error('Cannot convert empty K.s problem'); end fprintf('K.f = %d, K.l = %d, sum(K.s .* K.s) = %d, #K.s = %d, max(K.s) = %d\n', Kf, Kl, ... sum(Ks.*Ks), length(K.s), max(K.s)); Ktotal = Kf + Kl + sum(Ks.*Ks); if Ktotal ~= n error('Inconsistent Size K and n\n'); end if Kf ~= 0 fprintf(['Free Variables are divided into positive and ' ... 'negative part of LP cone\n']); Af = A(:,1:Kf); Al = A(:,Kf+1:Kf+Kl); As = A(:,Kf+Kl+1:Kf+Kl+sum(Ks.*Ks)); Anew = [Af, -Af, Al, As]; cf = c(1:Kf,1); cl = c(Kf+1:Kf+Kl,1); cs = c(Kf+Kl+1:Kf+Kl+sum(Ks.*Ks),1); cnew = [cf; -cf; cl; cs]; Knew.f = 0; Knew.l = 2*Kf + Kl; Knew.s = K.s; A = Anew; c = cnew; K = Knew; end Kf = 0; Kl = 0; if isfield(K,'l') && ~isempty(K.l) Kl = K.l; end Ks = 0; if isfield(K,'s') && ~isempty(K.s) Ks = full(K.s); if size(Ks,2) ~= 1 Ks = Ks'; end end K.l = Kl; K.s = Ks; Ktotal = Kf + Kl + sum(Ks.*Ks); if Ktotal ~= size(A,2); error('Inconsistent Size K = %d and n = %d', Ktotal,size(A,2)); end At = A'; USE_MEX = 1; if USE_MEX if ~issparse(A) A = sparse(A); end if issparse(b) b = full(b); end if ~issparse(c) c = sparse(c); end fprintf('Writing data to %s\n', filename); mexWriteSedumiToSDPA(filename, At,b,c,K, accuracy); else fid = fopen(filename,'w'); fprintf('Writing data to %s\n', filename); fprintf(fid, '%d\n',m); if Kl == 0 isKl = 0; fprintf(fid, '%d\n',size(Ks,1)); else isKl = 1; fprintf(fid, '%d\n',1+size(Ks,1)); fprintf(fid, '-%d ', Kl); end fprintf(fid, '%d ', Ks); fprintf(fid, '\n'); fprintf(fid, bprint , full(b)); fprintf(fid, '\n'); % c if Kl ~= 0 cl = c(1:Kl); [i,j,v] = find(cl); if isempty(i) ~=1 kdummy = 0 * ones(size(i,1),1); ldummy = 1 * ones(size(i,1),1); ge = [kdummy, ldummy, i, i, v]'; fprintf(fid, eleprint ,ge); end end index = Kl; for l=1:size(Ks,1) cs = c(index+1:index+Ks(l)*Ks(l)); CS = reshape(cs,Ks(l),Ks(l)); [i,j,v] = find(tril(CS)); if isempty(i) ~=1 kdummy = 0 * ones(size(i,1),1); ldummy = (l+isKl) * ones(size(i,1),1); ge = [kdummy, ldummy, i, j, v]'; fprintf(fid, eleprint ,ge); end index = index + Ks(l) * Ks(l); end % A for k=1:m ak = At(:,k)'; if Kl ~= 0 akl = ak(1:Kl)'; [i,j,v] = find(akl); if isempty(i) ~=1 kdummy = k * ones(size(i,1),1); ldummy = 1 * ones(size(i,1),1); ge = [kdummy, ldummy, i, i, v]'; fprintf(fid, eleprint, ge); end end index = Kl; for l=1:size(Ks,1) aks = ak(index+1:index+Ks(l)*Ks(l)); AKS = reshape(aks,Ks(l),Ks(l)); [i,j,v] = find(tril(AKS)); if isempty(i) ~=1 kdummy = k * ones(size(i,1),1); ldummy = (l+isKl) * ones(size(i,1),1); ge = [kdummy, ldummy, i, j, v]'; fprintf(fid, eleprint, ge); end index = index + Ks(l) * Ks(l); end end end fprintf('Sucessfully converted\n'); end sdpa-7.3.11/mex/mexDisAggSDPsol.cpp0000644000175000017500000001074413211530510016327 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /* mexDisAggSol.cpp [x0] = mexDisAggSol(x1,K0s,Ks) */ // #include #include #include "mex.h" using namespace std; /* gateway function */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { /* [A,c,Ks] = mexAggregateSDPcone(A0,c0,K0s,Ks) */ /* ************************************************** */ /* Check for proper number of input and output arguments */ if (nrhs != 3) { mexErrMsgTxt("3 input arguments required."); } if(nlhs != 1){ mexErrMsgTxt("1 output argument required"); } /* ---> */ /* reading the dense column vector x1 */ const mxArray* x1_ptr = prhs[0]; if (mxIsSparse(x1_ptr) == 1) { mexErrMsgTxt("x1 must be a dense column vector."); } mwSize x1colSize = mxGetN(x1_ptr); if (x1colSize > 1) { mexErrMsgTxt("x1 must be a column vector."); } // mwSize x1Size = mxGetM(x1_ptr); double* x1pr = mxGetPr(x1_ptr); // std::cout << "x1pr = "; // for (mwSize j=0; j < x1Size; j++) // std::cout << x1pr[j] << " "; // std::cout << std::endl; /* reading the dense mex vector K0s */ const mxArray* K0s_ptr = prhs[1]; if (mxIsSparse(K0s_ptr) == 1) { mexErrMsgTxt("K0s must be a dense column vector."); } mwSize K0colSize = mxGetN(K0s_ptr); if (K0colSize > 1) { mexErrMsgTxt("K0s must be a column vector."); } mwSize K0sSize = mxGetM(K0s_ptr); double* K0spr = mxGetPr(K0s_ptr); // std::cout << "K0spr = "; // for (mwSize k0=0; k0 < K0sSize; k0++) // std::cout << K0spr[k0] << " "; // std::cout << std::endl; /* reading the dense mex vector K1s */ const mxArray* K1s_ptr = prhs[2]; if (mxIsSparse(K1s_ptr) == 1) { mexErrMsgTxt("K1s must be a dense column vector."); } mwSize K1colSize = mxGetN(K1s_ptr); if (K1colSize > 1) { mexErrMsgTxt("K1s must be a column vector."); } // mwSize K1sSize = mxGetM(K1s_ptr); double* K1spr = mxGetPr(K1s_ptr); // std::cout << "K1spr = "; // for (mwSize k1=0; k1 < K1sSize; k1++) // std::cout << K1spr[k1] << " "; // std::cout << std::endl; /* Constructing the dense column vector x0 */ /* the column size of x0 be constructed */ mwSize x0Size = 0; for (mwSize k0 = 0; k0 < K0sSize; k0++) x0Size += (mwSize)(K0spr[k0]*K0spr[k0]); // std::cout << "x0Size = " << x0Size << std::endl; plhs[0] = mxCreateDoubleMatrix(x0Size,1,mxREAL); double* x0pr = mxGetPr(plhs[0]); /* Construction of x0 */ int k1 = -1; int topNDblks = 0; int bottomNDblks = 0; mwSize c0colPt = 0; mwSize c1colPt = 0; for (mwSize k0 = 0; k0 < K0sSize; k0++) { bottomNDblks -= (int) K0spr[k0]; if (bottomNDblks < 0) { k1++; topNDblks = 0; bottomNDblks = (int) (K1spr[k1] - K0spr[k0]); } else { topNDblks += (int) K0spr[k0-1]; } // std::cout << " k0 = " << k0 << " topNDblks = " << topNDblks << " bottomNDblks = " << bottomNDblks << std::endl; for (mwSize j0 = 0; j0 < K0spr[k0]; j0++) { c1colPt += topNDblks; for (mwSize i0 = 0; i0 < K0spr[k0]; i0++) { x0pr[c0colPt+i0] = x1pr[c1colPt+i0]; } c0colPt += (int) K0spr[k0]; c1colPt += (int) (K0spr[k0]+bottomNDblks); } } // for (mwSize j=0; j < x0Size; j++) // std::cout << x0pr[j] << " "; // std::cout << std::endl; return; } sdpa-7.3.11/mex/sedumiwrap.m0000644000175000017500000002126713211530510015226 0ustar makotomakotofunction [x,y,info]=sedumiwrap(A,b,c,K,pars,OPTION); % % SeDuMi wrapper for SDPA % % [x,y,info]=sedumiwrap(A,b,c,K,pars,OPTION); % or % [x,y,info]=sedumiwrap(A,b,c,K); % with SDPA-M default parameter % % Note : % 'A', in each SDP block, only upper triangle part is used. % 'K' can include only 'f'(free) 'l'(linear) 's'(SDP) cones. % 'pars' information is NOT used (just for SeDuMi compatibility) % 'OPTION' is option structure for SDPA-M (for details, try 'help param') % 'info' information is based on SDPA-M % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 7.3 $ t = cputime; fprintf('-SeDuMi Wrapper for SDPA Start-\n'); if (nargin < 4 || nargin > 6) error('incorrect number of input arguments') end if nargin >= 5 if isfield(OPTION,'print') && ~isempty(OPTION.print) fprintf('Note: pars information [5th argument] is not used\n'); end end if nargin < 6 OPTION = param; else OPTION = param(OPTION); end if isfield(K,'q') && ~isempty(K.q) error('Current Wrapper cannot handle K.q'); end if isfield(K,'r') && ~isempty(K.r) error('Current Wrapper cannot handle K.r'); end if size(b,2) ~= 1 % fprintf('Transposing b to a column vector'); b = b'; end if size(b,2) ~= 1 error('b must be a vector'); end if size(c,2) ~= 1 % fprintf('Transposing c to a column vector\n'); c = c'; end if size(c,2) ~= 1 error('c must be a vector'); end %%%%% % Constructing at least one SDP cone if necesary if (~isfield(K,'s')) || (isempty(K.s)) [K] = LPtoLP_SDP(K); end %%%%% totalLength = 0; Kf = 0; if isfield(K,'f') && ~isempty(K.f) totalLength = totalLength + K.f; Kf = K.f; end if isfield(K,'l') && ~isempty(K.l) totalLength = totalLength + K.l; else K.l = 0; end if isfield(K,'s') && ~isempty(K.s) if size(K.s,2) ~= 1 % fprintf('Transposing K.s to a column vector\n'); K.s = K.s'; end Ks = sum(K.s .* K.s); totalLength = totalLength + Ks; else error('Cannot handle empty K.s'); end m = size(b,1); n = size(c,1); [mA,nA] = size(A); if (m~=mA || n~=nA) && (m~=nA || n~=mA) fprintf('Inconsistent Size of A,b,c\n'); fprintf('size(A) = [%d,%d], size(b) = %d, size(c) = %d\n',... mA,nA, m,n); error('Cannot continue...'); end if (n~=totalLength) fprintf('Inconsistent Size of c and K\n'); fprintf('size(c) = %d, totalSize(K) = %d\n',... n, totalLength); error('Cannot continue...'); end if ~issparse(A) if isfield(OPTION,'print') && ~isempty(OPTION.print) fprintf('Converting A from dense to sparse\n'); end A = sparse(A); end if issparse(b) % fprintf('Converting b from sparse to dense\n'); b = full(b); end if ~issparse(c) % fprintf('Converting c from dense to sparse\n'); c = sparse(c); end if issparse(K.s) % fprintf('Converting K.s from sparse to dense\n'); K.s = full(K.s); end if Kf ~= 0 if isfield(OPTION,'print') && ~isempty(OPTION.print) fprintf(['Free Variables are divided into positive and ' ... 'negative part of LP cone\n']); end Af = A(:,1:Kf); Kl = K.l; Al = A(:,Kf+1:Kf+Kl); As = A(:,Kf+Kl+1:Kf+Kl+Ks); Anew = [Af, -Af, Al, As]; cf = c(1:Kf); cl = c(Kf+1:Kf+Kl); cs = c(Kf+Kl+1:Kf+Kl+Ks); cnew = [cf; -cf; cl; cs]; Knew.l = 2*Kf + Kl; Knew.s = K.s; A = Anew; c = cnew; K = Knew; clear Af; clear Al; clear As; clear Anew; clear cf; clear cl; clear cs; clear cnew; clear Knew; end if isfield(K,'s') && ~isempty(K.s) if size(K.s,2) ~= 1 K.s = Ks'; end end %%%%% % Aggregating small SDP cones into larger SDP cones aggSW = 0; minNoSDPcones = 3; if (isfield(OPTION,'aggConeSize')) && (~isempty(OPTION.aggConeSize)) && (isnumeric(OPTION.aggConeSize)) && ... ((OPTION.aggConeSize > 0)) && (length(K.s') > minNoSDPcones) && (length(find(K.s' < OPTION.aggConeSize)) > minNoSDPcones) fprintf('OPTION.aggConeSize = %d\n',OPTION.aggConeSize) K0 = K; aggSW = 1; [A,c,K1] = aggSDPcones(A,c,K,OPTION.aggConeSize); A = sparse(A); c = sparse(c); K = K1; end %%%%% % A should be transposed when passed to mex [mA,nA] = size(A); if mA ~= K.l + sum(K.s.*K.s) A = A'; end % fprintf('size(A) = (%d,%d)\n',size(A,2),size(A,1)); % fprintf('length(K.s) = %d\n',length(K.s)); [x,y,info] = mexSedumiWrap(A,b,c,K,OPTION); %%%%% % Retrieving the origianl primal SDP cone variables if aggSW == 1 if (isfield(K,'l')) && (~isempty(K.l)) && (K.l > 0) xSDP = x(K.l+1:size(x,1),1); xLP = x(1:K.l,1); [xSDP] = mexDisAggSDPsol(xSDP,K0.s,K1.s); x = [xLP; xSDP]; else [x] = mexDisAggSDPsol(x,K0.s,K1.s); end end %%%%% if Kf ~=0 xlength = size(x); xnew = x(1:Kf) - x(Kf+1:Kf+Kf); xnew = [xnew; x(Kf+Kf+1:xlength)]; x = xnew; end info.cpusec = cputime-t; % if isfield(OPTION,'print') && ~isempty(OPTION.print) fprintf('-SeDuMi Wrapper for SDPA End-\n'); % end % End of File %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [K] = LPtoLP_SDP(K) if isfield(K,'q') && ~isempty(K.q) error('Current Wrapper cannot handle K.q'); end if isfield(K,'r') && ~isempty(K.r) error('Current Wrapper cannot handle K.r'); end if isfield(K,'s') && ~isempty(K.s) return; elseif ~isfield(K,'l') || isempty(K.l) error('Both LP and SDP cones are empty, so the problem can not be solved'); else K.l = K.l-1; if K.l == 0 K.l = []; end K.s = 1; end return %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [A1,c1,K1] = aggSDPcones(A,c,K0,aggConeSize) % % [A1,c1,K1] = aggSDPcones(A,c,K0,aggConeSize) % Input : SeDuMi format % aggConeSize : the block size into which small blocks are converted % Output: Sedumi format with larger SDP cone matrices % if (size(K0.s,2) > 1) K0.s = K0.s'; end if size(A,1) > size(A,2) A = A'; end % if size(c,1) < size(c,2) % c = c'; % end [m,n] = size(A); % if ~isfield(K0,'f') || isempty(K0.f) fDim = 0; else fDim = K0.f; end % if ~isfield(K0,'l') || isempty(K0.l) ellDim = 0; else ellDim = K0.l; end % if ~isfield(K0,'q') qDim = 0; else if size(K0.q,1) > size(K0.q,2) K0.q = K0.q'; % a row vector end qDim = sum(K0.q); end % if ~isfield(K0,'s') || isempty(K0.s) K1 = K0; A1 = A; c1 = c; return else if size(K0.s,2) > size(K0.s,1) K0.s = K0.s'; % a column vector end sDim = sum(K0.s .* K0.s); end nonSDim = fDim+ellDim+qDim; if nonSDim == 0 cNonSDP = []; AnonSDP = []; c0SDP = c; A0SDP = A; else cNonSDP = c(1:nonSDim,1); AnonSDP = A(:,1:nonSDim); c0SDP = c(nonSDim+1:n,1); A0SDP = A(:,nonSDim+1:n); end K1s = []; coneSize = 0; for p=1:length(K0.s) if (K0.s(p) > aggConeSize) if coneSize > 0 K1s = [K1s; coneSize; K0.s(p)]; coneSize = 0; else K1s = [K1s; K0.s(p)]; coneSize = 0; end elseif ((coneSize + K0.s(p) > aggConeSize)) K1s = [K1s; coneSize]; coneSize = K0.s(p); elseif ((coneSize + K0.s(p) == aggConeSize)) K1s = [K1s; coneSize + K0.s(p)]; coneSize = 0; else coneSize = coneSize + K0.s(p); end end if (coneSize > 0) K1s = [K1s; coneSize]; end K0s = K0.s; % K0.s is a column vector K1 = K0; K1.s = K1s; % K1s is a column vector tStart = tic; % C0SDP, K0s and K1s need to be clolumn vector [A1SDP,c1SDP] = mexAggSDPcones(A0SDP,c0SDP',K0s,K1s); tElapsed = toc(tStart); fprintf('Original SDP: the max cone size, the number of cones = %3d, %3d\n',full(max(K0.s)),length(K0.s)); fprintf('Transformed SDP: the max cone size, the number of cones = %3d, %3d\n',full(max(K1.s)),length(K1.s)); % fprintf('Elapsed time for transformation = %6.2e\n',tElapsed); c1SDP = c1SDP'; A1 = sparse([AnonSDP, A1SDP]); c1 = sparse([cNonSDP;c1SDP]); % checkData(A1,b1,c1,K1); % sedumi(A1,b1,c1,K1); return sdpa-7.3.11/mex/mexAggSDPcones.cpp0000644000175000017500000001705313211530510016201 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /* mexAggSDPcones.cpp [A1,c1] = mexAggSDPcones(A0,c0,K0s,Ks) */ #include #include #include "mex.h" using namespace std; /* gateway function */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { /* [A,c,Ks] = mexAggregateSDPcone(A0,c0,K0s,Ks) */ /* ************************************************** */ /* Check for proper number of input and output arguments */ if (nrhs != 4) { mexErrMsgTxt("4 input arguments required."); } if(nlhs != 2){ mexErrMsgTxt("2 output arguments required"); } /* ---> */ /* reading the sparse mex matrix A0 */ const mxArray* A0_ptr = prhs[0]; if (mxIsSparse(A0_ptr) == 0) { mexErrMsgTxt("A0 must be a sparse matrix."); } // mwSize A0colSize = mxGetN(A0_ptr); // std::cout << "A0colSize = " << A0colSize << std::endl; mwSize A0rowSize = mxGetM(A0_ptr); // std::cout << "A0rowSize = " << A0rowSize << std::endl; mwIndex A0nnz = mxGetNzmax(A0_ptr); // std::cout << "A0nnz = " << A0nnz << std::endl; mwIndex* A0jc = mxGetJc(A0_ptr); // std::cout << "A0jc = "; // for (mwSize j=0; j <= A0colSize; j++) // std::cout << A0jc[j] << " "; // std::cout << std::endl; mwIndex* A0ir = mxGetIr(A0_ptr); // std::cout << "A0ir = "; // for (mwSize i=0; i < A0nnz; i++) // std::cout << A0ir[i] << " "; // std::cout << std::endl; double* A0pr = mxGetPr(A0_ptr); // std::cout << "A0pr = "; // for (mwSize i=0; i < A0nnz; i++) // std::cout << A0pr[i] << " "; // std::cout << std::endl; /* reading the sparse mex matrix c0 --- a row vector */ /* vector c0: Mex */ const mxArray* c0_ptr = prhs[1]; if (mxIsSparse(c0_ptr) == 0) { mexErrMsgTxt("c0 must be sparse."); } mwSize c0colSize = mxGetN(c0_ptr); // std::cout << "c0colSize = " << c0colSize << std::endl; if (c0colSize <= 1) { mexErrMsgTxt("c0 must be a row vector."); } mwSize c0rowSize = mxGetM(c0_ptr); // = 1 // std::cout << "c0rowSize = " << c0rowSize << std::endl; if (c0rowSize > 1) { mexErrMsgTxt("c0 must be a row vector."); } mwIndex c0nnz = mxGetNzmax(c0_ptr); // std::cout << "c0nnz = " << c0nnz << std::endl; mwIndex* c0jc = mxGetJc(c0_ptr); // std::cout << "c0jc = "; // for (mwSize j=0; j <= c0colSize; j++) // std::cout << c0jc[j] << " "; // std::cout << std::endl; mwIndex* c0ir = mxGetIr(c0_ptr); // std::cout << "c0ir = "; // for (mwSize i=0; i < c0nnz; i++) // std::cout << c0ir[i] << " "; // std::cout << std::endl; double* c0pr = mxGetPr(c0_ptr); // std::cout << "c0pr = "; // for (mwSize i=0; i < c0nnz; i++) // std::cout << c0pr[i] << " "; // std::cout << std::endl; /* reading the dense mex vector K0s */ const mxArray* K0s_ptr = prhs[2]; if (mxIsSparse(K0s_ptr) == 1) { mexErrMsgTxt("K0s must be a dense column vector."); } mwSize K0colSize = mxGetN(K0s_ptr); if (K0colSize > 1) { mexErrMsgTxt("K0s must be a column vector."); } mwSize K0sSize = mxGetM(K0s_ptr); double* K0spr = mxGetPr(K0s_ptr); // std::cout << "K0spr = "; // for (mwSize k0=0; k0 < K0sSize; k0++) // std::cout << K0spr[k0] << " "; // std::cout << std::endl; /* reading the dense mex vector K1s */ const mxArray* K1s_ptr = prhs[3]; if (mxIsSparse(K1s_ptr) == 1) { mexErrMsgTxt("K1s must be a dense column vector."); } mwSize K1colSize = mxGetN(K1s_ptr); if (K1colSize > 1) { mexErrMsgTxt("K1s must be a column vector."); } mwSize K1sSize = mxGetM(K1s_ptr); double* K1spr = mxGetPr(K1s_ptr); // std::cout << "K1spr = "; // for (mwSize k1=0; k1 < K1sSize; k1++) // std::cout << K1spr[k1] << " "; // std::cout << std::endl; /* Constructing the sparse mex matrix A1 */ /* the column size of A1 be constructed = the column size of c1 to be constructed */ mwSize A1colSize = 0; for (mwSize k1 = 0; k1 < K1sSize; k1++) A1colSize += (mwSize)(K1spr[k1]*K1spr[k1]); // std::cout << "A1colSize = " << A1colSize << std::endl; /* the row size of A1 be constructed */ mwSize A1rowSize = A0rowSize; mwIndex A1nnz = A0nnz; plhs[0] = mxCreateSparse(A1rowSize,A1colSize,A1nnz,mxREAL); mwIndex* A1jc = mxGetJc(plhs[0]); mwIndex* A1ir = mxGetIr(plhs[0]); double* A1pr = mxGetPr(plhs[0]); mwSize c1colSize = A1colSize; mwSize c1rowSize = c0rowSize; mwIndex c1nnz = c0nnz; plhs[1] = mxCreateSparse(c1rowSize,c1colSize,c1nnz,mxREAL); mwIndex* c1jc = mxGetJc(plhs[1]); mwIndex* c1ir = mxGetIr(plhs[1]); double* c1pr = mxGetPr(plhs[1]); int k1 = -1; int topNDblks = 0; int bottomNDblks = 0; mwSize A0colPt = 0; mwSize A1colPt = 0; A1jc[A1colPt] = 0; c1jc[A1colPt] = 0; for (mwSize k0 = 0; k0 < K0sSize; k0++) { bottomNDblks -= (int) K0spr[k0]; if (bottomNDblks < 0) { k1++; topNDblks = 0; bottomNDblks = (int) (K1spr[k1] - K0spr[k0]); } else { topNDblks += (int) K0spr[k0-1]; } // std::cout << " k0 = " << k0 << " topNDblks = " << topNDblks << " bottomNDblks = " << bottomNDblks << std::endl; for (mwSize j0 = 0; (int) j0 < K0spr[k0]; j0++) { if (topNDblks > 0) { for (mwSize k1 = 0; (int) k1 < topNDblks; k1++) { A1jc[A1colPt+1] = A1jc[A1colPt]; c1jc[A1colPt+1] = c1jc[A1colPt]; A1colPt++; } } for (mwSize i0 = 0; i0 < K0spr[k0]; i0++) { A1jc[A1colPt+1] = A0jc[A0colPt+1]; c1jc[A1colPt+1] = c0jc[A0colPt+1]; A1colPt++; A0colPt++; } if (bottomNDblks > 0) { for (mwSize k1 = 0; (int) k1 < bottomNDblks; k1++) { A1jc[A1colPt+1] = A1jc[A1colPt]; c1jc[A1colPt+1] = c1jc[A1colPt]; A1colPt++; } } } } // std::cout << "A1jc = "; // for (mwSize k1 = 0; k1 <= A1colSize; k1++) // std::cout << A1jc[k1] << " "; // std::cout << std::endl; /* A1ir = A0ir and A1pr = A0pr */ for (mwSize p=0; p < A0nnz; p++) { A1ir[p] = A0ir[p]; A1pr[p] = A0pr[p]; } /* c1ir = c0ir and c1pr = c0pr */ for (mwSize p=0; p < c0nnz; p++) { c1ir[p] = c0ir[p]; c1pr[p] = c0pr[p]; } return; } sdpa-7.3.11/mex/initial_point.m0000644000175000017500000001024013211530510015675 0ustar makotomakotofunction [x0,X0,Y0] = initial_point(filename,mDIM,nBLOCK,bLOCKsTRUCT) % % Read in a sparse initial point file % % [x0,X0,Y0] = initial_point(fname, mDIM, nBLOCK, bLOCKsTRUCT) % % % - filename : string ; filename of initial point file % - mDIM : integer; number of primal variables % - nBLOCK : integer; number of blocks of F % - bLOCKsTRUCT: vector ; represetns the block structure of F % % % - x0: vector ; initial point of x % - X0: cell array; initial point of X % - Y0: cell array; initial point of Y % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 6.2 $ % $Id: initial_point.m,v 6.2 2005/05/28 02:36:40 drophead Exp $ % check the validity of arguments if nargin ~= 4 error('input arguments must be 4.'); else if ~ischar(filename) error('1st argument must be a filename.'); end end % identify whether a file is sparse format or not. bsparse=0; len=length(filename); if len >= 2 str=filename(end-1:end); if strncmp(str,'-s',2) bsparse=1; end end % disp(sprintf('sparse=%d',bsparse)); fid=fopen(filename,'r'); if fid == -1 error(sprintf('Cannot open %s',filename)); end x0=zeros(mDIM,1); X0=cell(nBLOCK,1); Y0=cell(nBLOCK,1); % read initial point x0 for idx=1:mDIM x0(idx)=fscanf(fid,'%*[^0-9+-]%lg',1); end % read initial points X0, Y0 if bsparse % sparse format case while 1 [k,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [l,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [i,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [j,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt if k == 1 % X0 if isempty(X0{l}) size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) < 0 X0{l}=sparse(zeros(size,1)); else X0{l}=sparse(zeros(size)); end end if bLOCKsTRUCT(l) < 0 X0{l}(i)=value; else if i < j X0{l}(i,j)=value; X0{l}(j,i)=value; elseif i == j X0{l}(i,j)=value; end end elseif k==2 % Y0 if isempty(Y0{l}) size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) < 0 Y0{l}=sparse(zeros(size,1)); else Y0{l}=sparse(zeros(size)); end end if bLOCKsTRUCT(l) < 0 Y0{l}(i)=value; else if i < j Y0{l}(i,j)=value; Y0{l}(j,i)=value; elseif i == j Y0{l}(i,j)=value; end end end else break; end end else % dense format case % X0 for l=1:nBLOCK size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) > 0 X0{l}=zeros(size); for i=1:size for j=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt X0{l}(i,j)=value; else error(sprintf('Failed to read an element X0 at %d %d %d'),... l,i,j); end end end else X0{l}=zeros(size,1); for i=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt X0{l}(i)=value; else error(sprintf('Failed to read an element X0 at %d %d %d'),... l,i,i); end end end end % Y0 for l=1:nBLOCK size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) > 0 Y0{l}=zeros(size); for i=1:size for j=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt Y0{l}(i,j)=value; else error(sprintf('Failed to read an element Y0 at %d %d %d'),... l,i,j); end end end else Y0{l}=zeros(size,1); for i=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt Y0{l}(i)=value; else error(sprintf('Failed to read an element Y0 at %d %d %d'),... l,i,i); end end end end end fclose(fid); % End of File sdpa-7.3.11/mex/mexFprintf.c0000644000175000017500000000556213211530510015156 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 #include #include #include #include #define BUF_LENGTH 4096 int fprintf(FILE *stream, const char *format, ...) { va_list arg; va_start(arg,format); int return_size = 0; if (stream == stdout) { char tmp_buf[BUF_LENGTH]; vsprintf(tmp_buf,format,arg); #if 0 printf("tmp_buf = %s",tmp_buf); #endif mexPrintf(tmp_buf); mexEvalString("drawnow;"); /* to dump string.*/ return_size = strlen(tmp_buf); if ( return_size >= BUF_LENGTH ) { mexPrintf("Too Long Message To PrintOut " "(some part might be truncated)"); } } else { return_size = vfprintf(stream,format,arg); } va_end(arg); return return_size; } static int internal_fprintf(FILE *stream, const char *format, ...) { va_list arg; va_start(arg,format); int return_size = 0; return_size = vfprintf(stream,format,arg); va_end(arg); return return_size; } size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) { #if 1 fprintf(stream,"%s",(const char*)ptr); #else // internal_fprintf does not work well here internal_fprintf(stream, (const char*) internal_fprintf); #endif return 1; } int fputc(int c, FILE* fp) { if (fp == stdout) { mexPrintf("%c",(unsigned char)c); } else { internal_fprintf(fp,"%c",c); /* fprintf(fp,"%c ",c);*/ } return c; } #ifdef __GNUC__ /*Only GNU, to avoid warning: 'noreturn' function does return */ static void internal_exit() __attribute__ ((noreturn)); extern void mexErrMsgTxt(const char*) __attribute__ ((noreturn)); void exit() __attribute__ ((noreturn)); void abort() __attribute__ ((noreturn)); #endif static void internal_exit() { mexWarnMsgTxt("SDPA exits with some error."); mexWarnMsgTxt("Matlab should be reboot to clear up memory space."); mexErrMsgTxt("SDPA exits with some error."); } void exit(int status) { internal_exit(); } void abort(void) { internal_exit(); } sdpa-7.3.11/mex/mexReadOutput.cpp0000644000175000017500000001722613211530510016202 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*--------------------------------------------------- function [objVal,x,X,Y,INFO] = read_output(filename,mDIM,nBLOCK,bLOCKsTRUCT); ---------------------------------------------------*/ #include #include #include #include #include #include using namespace std; #define lengthOfString 10240 #define MX_CALLOC 0 #define MX_DEBUG 0 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { mwSize mwsize; mxArray *field_ptr = NULL; mxArray *cell_ptr = NULL; char str[lengthOfString]; double *tmp_ptr = NULL; const mxArray* filename_ptr = prhs[0]; const mxArray* m_ptr = prhs[1]; const mxArray* nBlock_ptr = prhs[2]; const mxArray* blockStruct_ptr = prhs[3]; char* filename = NULL; mwsize = mxGetM(filename_ptr)*mxGetN(filename_ptr)+1; filename = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(filename_ptr,filename,mwsize); mwSize m = 0; mwSize nBlock = 0; double* m_ele = mxGetPr(m_ptr); m = (mwSize) m_ele[0]; double* nBlock_ele = mxGetPr(nBlock_ptr); nBlock = (mwSize) nBlock_ele[0]; double* blockStruct_ele = mxGetPr(blockStruct_ptr); #if MX_DEBUG mexPrintf("blockStruct = ["); for (mwSize l=0; l % - filename : string ; generated filename % - mDIM : integer ; number of decision variables % - nBLOCK : integer ; number of blocks of F % - bLOCKsTRUCT: vector ; represetns the block structure of F % - c : vector ; coefficient vector % - F : cell array; coefficient matrices % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 6.2 $ % $Id: gensdpafile.m,v 6.2 2005/05/28 02:36:40 drophead Exp $ % check the validity of arguments if nargin ~= 6 error('input arguments must be 6.'); elseif ~ischar(filename) error('1st argument must be a filename.'); end % open file fid=fopen(filename, 'w'); if fid == -1 error(sprintf('Failed to open %s.', filename)); end % comment stamp=clock; fprintf(fid,... '"Generated by gensdpafile() %04d/%02d/%02d %02d:%02d:%02d"\n',... stamp(1),stamp(2),stamp(3),stamp(4),stamp(5),fix(stamp(6))); % mDIM fprintf(fid, '%d\n', mDIM); % nBLOCK fprintf(fid, '%d\n', nBLOCK); % bLOCKsTRUCT for l=1:nBLOCK if l~= nBLOCK fprintf(fid,'%d,', bLOCKsTRUCT(l)); else fprintf(fid,'%d\n', bLOCKsTRUCT(l)); end end % cost vector c for k=1:mDIM if k ~= mDIM fprintf(fid,'%g,', c(k)); else fprintf(fid,'%g\n', c(k)); end end % coefficient matrices F => Sparse format for k=1:mDIM+1 for l=1:nBLOCK dim=abs(bLOCKsTRUCT(l)); tmpF=F{l,k}; if isempty(tmpF) continue; end [m,n]=size(tmpF); if m == dim & n == dim & bLOCKsTRUCT(l) > 0 % normal block for i=1:dim for j=1:dim if (i <= j & tmpF(i,j) ~= 0) % upper triangle part only fprintf(fid, '%d,%d,%d,%d,%g\n',k-1,l,i,j,tmpF(i,j)); end end end elseif ( m==1 | n==1 ) & m*n==dim & bLOCKsTRUCT(l) < 0 % diagonal block with vector for i=1:dim if tmpF(i) ~= 0 fprintf(fid, '%d,%d,%d,%d,%g\n',k-1,l,i,i,tmpF(i)); end end elseif m == dim & n == dim & bLOCKsTRUCT(l) < 0 % diagonal block with matrix for i=1:dim if tmpF(i,i) ~= 0 fprintf(fid, '%d,%d,%d,%d,%g\n',k-1,l,i,i,tmpF(i,i)); end end else error(sprintf('Inconsistent data at F{%d,%d}',l,k)); fclose(fid); return; end end end % close file fclose(fid); % End of Filesdpa-7.3.11/mex/mexSedumiWrap.cpp0000644000175000017500000004124313211530510016162 0ustar makotomakoto/* * This file is a component of SDPA * Copyright (C) 2004-2017 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 * * SDPA-M: 7.3 * mexsdpa.cpp */ #include /* * SDPA header files */ #include #include using namespace sdpa; extern void _main(); void sdpasolver(mxArray* At_ptr, mxArray* b_ptr, mxArray* c_ptr, mxArray* K_ptr, mxArray* OPTION_ptr, mxArray* x_ptr, mxArray* y_ptr, mxArray* info_ptr) { time_t ltime; time(<ime); char string_time[1024]; strcpy(string_time,ctime(<ime)); string_time[strlen(string_time)-1]='\0'; SDPA sdpa; int maxIteration = 0; double param = 0.0; /* mxArray pointer */ mxArray *field_ptr = NULL; int nSymmChk = 0; int nDimacs = 0; /* strings for phase value */ const char *szPhase[] = { "noINFO", "pFEAS", "dFEAS", "pdFEAS", "pdINF", "pFEAS_dINF", "pINF_dFEAS", "pdOPT", "pUNBD", "dUNBD"}; /* output file */ char *outfile = NULL; FILE *fp = NULL; FILE *fpResult = NULL; int nOutfile = 0; mwSize mDIM; mwSize nBLOCK; /* temporary variables */ mwIndex k; int size; mwSize mwsize; double *tmp_ptr = NULL; char* tmpPrint = NULL; TimeStart(SDPA_START); TimeStart(SDPA_CONVERT_START); /*** Set SDPA parameters by OPTIONS ***/ /* Max Iteration */ field_ptr = mxGetField(OPTION_ptr, 0, "maxIteration"); if( field_ptr != NULL ){ maxIteration = (int)mxGetScalar(field_ptr); // mexPrintf("maxIteration = %d\n",maxIteration); sdpa.setParameterMaxIteration(maxIteration); } /* epsilonStar */ field_ptr = mxGetField(OPTION_ptr, 0, "epsilonStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterEpsilonStar(param); } /* lambdaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "lambdaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterLambdaStar(param); } /* omegaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "omegaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterOmegaStar(param); } /* lowerBound */ field_ptr = mxGetField(OPTION_ptr, 0, "lowerBound"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterLowerBound(param); } /* upperBound */ field_ptr = mxGetField(OPTION_ptr, 0, "upperBound"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterUpperBound(param); } /* betaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "betaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterBetaStar(param); } /* betaBar */ field_ptr = mxGetField(OPTION_ptr, 0, "betaBar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterBetaBar(param); } /* gammaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "gammaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterGammaStar(param); } /* epsilonDash */ field_ptr = mxGetField(OPTION_ptr, 0, "epsilonDash"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterEpsilonDash(param); } /* xPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "xPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintXVec(tmpPrint); mxFree(tmpPrint); } /* XPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "XPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintXMat(tmpPrint); mxFree(tmpPrint); } /* YPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "YPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintYMat(tmpPrint); mxFree(tmpPrint); } /* infPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "infPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintInformation(tmpPrint); mxFree(tmpPrint); } /* isSymmetric */ field_ptr = mxGetField(OPTION_ptr, 0, "isSymmetric"); if( field_ptr != NULL ){ nSymmChk = (int)mxGetScalar(field_ptr); } /* isDimacs */ field_ptr = mxGetField(OPTION_ptr, 0, "isDimacs"); if( field_ptr != NULL ){ nDimacs = (int)mxGetScalar(field_ptr); } /* print */ field_ptr = mxGetField(OPTION_ptr, 0, "print"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; if (mwsize == 1) { // mexPrintf("display is NULL\n"); fp = NULL; } else { outfile = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, outfile, mwsize); if( strncmp("display", outfile, mwsize - 1) == 0 ){ fp = stdout; } else if( strncmp("no", outfile, mwsize - 1) == 0 ){ fp = NULL; } else { fp = fopen(outfile, "at"); if( fp == NULL ){ mexPrintf("Failed to open %s\n", outfile); fp = stdout; } else { nOutfile = 1; } } mxFree(outfile); } } else { /* default setting is displaying information to stdout */ fp = stdout; } sdpa.setDisplay(fp); /* resultFile */ field_ptr = mxGetField(OPTION_ptr, 0, "resultFile"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; if (mwsize == 1) { // mexPrintf("resultFile is NULL\n"); } else { outfile = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, outfile, mwsize); if ( strncmp("no", outfile, mwsize - 1) == 0 ) { mexPrintf("resultFile is NULL\n"); } else { fpResult = fopen(outfile, "w"); if ( fpResult == NULL ) { mexPrintf("Failed to open %s\n", outfile); mexPrintf("Skip the detail file\n"); } else { sdpa.setResultFile(fpResult); } } mxFree(outfile); } } if (fp) { fprintf(fp,"SDPA start at [%s]\n",string_time); } if (fpResult) { fprintf(fpResult,"SDPA start at [%s]\n",string_time); } /* NumThreads */ field_ptr = mxGetField(OPTION_ptr, 0, "NumThreads"); if( field_ptr != NULL ){ sdpa.setNumThreads((int)mxGetScalar(field_ptr)); } /*** initialize SDPA class members ***/ /* mDIM */ mDIM = mxGetN(At_ptr); sdpa.inputConstraintNumber(mDIM); /* nBLOCK */ nBLOCK = 0; mwSize K_l = 0; int isK_l = 0; // 1 (K_l > 0) or 0 (K_l == 0) field_ptr = mxGetField(K_ptr, 0, "l"); if (field_ptr != NULL) { K_l = (mwSize)((mxGetPr(field_ptr))[0]); #if 0 mexPrintf("K_l = %zd\n", K_l); #endif if (K_l > 0) { isK_l = 1; nBLOCK++; } } mwSize* K_s = NULL; mwSize* K_sdpConeStart = NULL; int K_sdpNoCones = 0; field_ptr = mxGetField(K_ptr, 0, "s"); if (field_ptr != NULL) { K_sdpNoCones = (int) mxGetM(field_ptr); K_s = (mwSize*) mxCalloc(K_sdpNoCones, sizeof(mwSize)); K_sdpConeStart = (mwSize*) mxCalloc(K_sdpNoCones+1, sizeof(mwSize)); K_sdpConeStart[0] = 0; for (int l=0; l 0) { sdpa.inputBlockSize(1, K_l); sdpa.inputBlockType(1, SDPA::LP); } for (int l=0; l 0) { size = sdpa.getBlockSize(1); tmp_ptr = sdpa.getResultYMat(1); for (int index = 0; index < size; ++index) { x[index] = tmp_ptr[index]; } } for (int l=0; l % - filename: string; filename of the SDPA output % - m : integer; number of dual variables (that is, length(b)) % - K : struct; cone information of SeDuMi % % % - x,y : vector ; optimal solutions % - info : structure ; infomation of the solution % % /* ------------------------------------------------------------- % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % ------------------------------------------------------------- */ nBlock = 0; blockStruct = []; if (~isfield(K,'l')) || (isempty(K.l)) K.l = 0; else nBlock = 1; blockStruct = [-K.l]; end if isfield(K,'s') && ~isempty(K.s) if size(K.s,2) ~= 1 % fprintf('Transposing K.s to a column vector\n'); K.s = K.s'; end nBlock = nBlock + length(K.s); blockStruct = [blockStruct; K.s]; end [objValo,xo,Xo,Yo,INFOo] = read_output(filename,m,nBlock, ... blockStruct); if isempty(INFOo) == 1 fprintf('Output [x,y,info] will be empty'); x = []; y = []; info = []; end info.primal = -objValo(1); info.dual = -objValo(2); info.phaseValue = INFOo.phasevalue; info.iter = INFOo.iteration; info.cpusec = INFOo.cpusec; y = -xo; x = []; coneIndex = 1; if K.l > 0 x = [x; reshape(Yo{1},K.l,1)]; coneIndex = coneIndex + 1; end while coneIndex <= length(blockStruct) blk = blockStruct(coneIndex); x = [x; reshape(Yo{coneIndex},blk*blk,1)]; coneIndex = coneIndex + 1; end sdpa-7.3.11/mex/param.m0000644000175000017500000002003213211530510014133 0ustar makotomakotofunction OPTION=param(OPTION) % % Create SDPA parameters. % If there is no argument, default parameters are returned. % % OPTION=param % for default parameter % or % OPTION=param(field1,value1,field2,value2,....) % % % - field?: string : field name % - value?: numeric or string : % % % - OPTION: structure data: each field is as follows: % * maxIteration : The maximum number of iterations. % * epsilonStar : The accuracy of an approximate optimal solution % for primal and dual SDP. % * lambdaStar : An initial point. % * omegaStar : The search region for an optimal solution. % * lowerBound : Lower bound of the minimum objective value of % the primal SDP. % * upperBound : Upper bound of the maximum objective value of % the dual SDP % * betaStar : The parameter for controlling the search direction % if the current point is feasible. % * betaBar : The parameter for controlling the search direction % if the current point is infeasible. % * gammaStar : A reduction factor for the primal and dual step % lengths. % * epsilonDash : The relative accuracy of an approximate optimal % solution between primal and dual SDP. % * isSymmetric : The flag for the checking the symmetricity of input % matrices. (0 => no check, 1=> check) % * isDimacs : The flag to compute DIMACS ERROR % (0 => no computation, 1=> computation) % * xPrint : (default %+8.3e, NOPRINT skips printout) % * XPrint : (default %+8.3e, NOPRINT skips printout) % * YPrint : (default %+8.3e, NOPRINT skips printout) % * infPrint : (default %+10.16e, NOPRINT skips printout) % * print : Destination of file output. the default setting is % stdout by 'display'. % If print is set 'no' or empty, no message % is print out % * resultFile : Destination of detail file output % * NumThreads : Number of Threads for internal computation % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 6.2 $ % $Id: param.m,v 6.2 2005/05/28 02:36:40 drophead Exp $ % create default OPTION OPTION0.maxIteration = 100; OPTION0.epsilonStar = 1.0E-7; OPTION0.lambdaStar = 1.0E2; OPTION0.omegaStar = 2.0; OPTION0.lowerBound = -1.0E5; OPTION0.upperBound = 1.0E5; OPTION0.betaStar = 0.1; OPTION0.betaBar = 0.2; OPTION0.gammaStar = 0.9; OPTION0.epsilonDash = 1.0E-7; OPTION0.isSymmetric = 0; OPTION0.isDimacs = 0; OPTION0.xPrint = '%+8.3e'; OPTION0.XPrint = '%+8.3e'; OPTION0.YPrint = '%+8.3e'; OPTION0.infPrint = '%+16.10e'; OPTION0.print = 'display'; OPTION0.resultFile = ''; try OPTION0.NumThreads = maxNumCompThreads; % Max Avialable Number catch fprintf(['Function maxNumCompThreads is not found, NumThreads ' ... 'is set as 1.\n']); OPTION0.NumThreads = 1; end OPTION0.aggConeSize = []; if (nargin == 0) || isempty(OPTION) OPTION = OPTION0; return else if ~isfield(OPTION,'maxIteration') OPTION.maxIteration=OPTION0.maxIteration; elseif ~isnumeric(OPTION.maxIteration) error('OPTION.maxIteration must be numeric.'); end % if ~isfield(OPTION,'epsilonStar') OPTION.epsilonStar=OPTION0.epsilonStar; elseif ~isnumeric(OPTION.epsilonStar) error('epsilonStar must be numeric.'); end % if ~isfield(OPTION,'lambdaStar') OPTION.lambdaStar=OPTION0.lambdaStar; elseif ~isnumeric(OPTION.lambdaStar) error('OPTION.lambdaStar must be numeric.'); end % if ~isfield(OPTION,'omegaStar') OPTION.omegaStar=OPTION0.omegaStar; elseif ~isnumeric(OPTION.omegaStar) error('OPTION.omegaStar must be numeric.'); end % if ~isfield(OPTION,'lowerBound') OPTION.lowerBound=OPTION0.lowerBound; elseif ~isnumeric(OPTION.lowerBound) error('OPTION.lowerBound must be numeric.'); end % if ~isfield(OPTION,'upperBound') OPTION.upperBound=OPTION0.upperBound; elseif ~isnumeric(OPTION.upperBound) error('OPTION.upperBound must be numeric.'); end % if ~isfield(OPTION,'betaStar') OPTION.betaStar=OPTION0.betaStar; elseif ~isnumeric(OPTION.betaStar) error('OPTION.beaStar must be numeric.'); end % if ~isfield(OPTION,'betaBar') OPTION.betaBar=OPTION0.betaBar; elseif ~isnumeric(OPTION.betaBar) error('OPTION.betaBar must be numeric.'); end % if ~isfield(OPTION,'gammaStar') OPTION.gammaStar=OPTION0.gammaStar; elseif ~isnumeric(OPTION.gammaStar) error('OPTION.gammaStar must be numeric.'); end % if ~isfield(OPTION,'epsilonDash') OPTION.epsilonDash=OPTION0.epsilonDash; elseif ~isnumeric(OPTION.epsilonDash) error('OPTION.epsilonDash must be numeric.'); end % if isfield(OPTION,'searchDir') disp('Parameter *searchDir* is no longer supported.'); disp('HRVW/KSH/M is automatically used.'); end % if ~isfield(OPTION,'isSymmetric') OPTION.isSymmetric=OPTION0.isSymmetric; elseif ~isnumeric(OPTION.isSymmetric) || ((OPTION.isSymmetric~=0) && (OPTION.isSymmetric~=1)) error('OPTION.isSymmetric must be 0 or 1.'); end % if ~isfield(OPTION,'isDimacs') OPTION.isDimacs=OPTION0.isDimacs; elseif ~isnumeric(OPTION.isDimacs) || ((OPTION.isDimacs~=0) && (OPTION.isDimacs~=1)) error('OPTION.isDimacs must be 0 or 1.'); end % if ~isfield(OPTION,'XPrint') OPTION.XPrint=OPTION0.XPrint; elseif ~ischar(OPTION.XPrint) error('OPTION.XPrint must be string.'); end % if ~isfield(OPTION,'YPrint') OPTION.YPrint=OPTION0.YPrint; elseif ~ischar(OPTION.YPrint) error('OPTION.YPrint must be string for printf.'); end % if ~isfield(OPTION,'infPrint') OPTION.infPrint=OPTION0.infPrint; elseif ~ischar(OPTION.infPrint) error('OPTION.infPrint must be string for printf.'); end % if isfield(OPTION,'print') && ... (isempty(OPTION.print) || length(OPTION.print) == 0) OPTION.print = 'no'; end if ~isfield(OPTION,'print') OPTION.print=OPTION0.print; elseif ~ischar(OPTION.print) disp('*** OPTION.print must be string for FILE. ***'); disp(' "display" is for stdout.'); disp(' "no" or empty is for skip message.'); disp(' filename is filename in which message will be written.'); error('*** OPTION.print must be string for FILE. ***'); end % if ~isfield(OPTION,'resultFile') || isempty(OPTION.resultFile) OPTION.resultFile=OPTION0.resultFile; elseif ~ischar(OPTION.resultFile) error('OPTION.resultFile must be string.'); end % if ~isfield(OPTION,'NumThreads') OPTION.NumThreads=OPTION0.NumThreads; elseif ~isnumeric(OPTION.NumThreads) error('OPTION.NumThreads must be positive integer.'); end if ~isfield(OPTION,'aggConeSize') OPTION.aggConeSize = OPTION0.aggConeSize; elseif (~isempty(OPTION.aggConeSize)) && ... ((~isnumeric(OPTION.aggConeSize)) || (OPTION.aggConeSize <=0)) error('OPTION.aggConeSize must be a positive integer.'); end end return % End of File sdpa-7.3.11/mex/read_data.m0000644000175000017500000000740713211530510014752 0ustar makotomakotofunction [mDIM,nBLOCK,bLOCKsTRUCT,c,F]=read_data(filename); % % Read a problem in SDPA sparse format. % % [mDIM,nBLOCK,bLOCKsTRUCT,c,F] = read_data(fname) % % % - filename: string; filename of the SDP data with SDPA foramt. % % % - mDIM : integer; number of primal variables % - nBLOCK : integer; number of blocks of F % - bLOCKsTRUCT: vector; represetns the block structure of F % - c : vector; coefficient vector % - F : cell array; coefficient matrices % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 6.2 $ % $Id: read_data.m,v 6.2 2005/05/28 02:36:40 drophead Exp $ % check the validity of the arguments if ( nargin ~= 1 | ( nargin == 1 & ~ischar(filename) ) ) error('input argument must be a filename'); end % identify whether a file is sparse format or not. bsparse=0; len=length(filename); if len >= 2 str=filename(end-1:end); if strncmp(str,'-s',2) bsparse=1; end end fid=fopen(filename,'r'); if fid == -1 error(sprintf('Cannot open %s',filename)); end % skip comment and after it, read a number of decision variables (mDIM) while 1 str=fgetl(fid); if( str(1)~='*' & str(1) ~='"' ) mDIM=sscanf(str,'%d',1); break; end end %disp(sprintf('mDIM=%d',mDIM)); % read a number of blocks (nBLOCK) nBLOCK=fscanf(fid,'%d',1); %disp(sprintf('nBLOCK=%d',nBLOCK)); % read each size of blocks (bLOCKsTRUCT) bLOCKsTRUCT=zeros(nBLOCK,1); for idx=1:nBLOCK bLOCKsTRUCT(idx)=fscanf(fid,'%*[^0-9+-]%d',1); if bLOCKsTRUCT(idx) == 1 bLOCKsTRUCT(idx) = -1; end end % read cost vector (c) c=zeros(mDIM,1); for idx=1:mDIM c(idx)=fscanf(fid,'%*[^0-9+-]%lg',1); end % read coefficient matrices (F) F=cell(nBLOCK,mDIM+1); if bsparse % sparse format case while 1 [k,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [l,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [i,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [j,cnt]=fscanf(fid,'%*[^0-9+-]%d',1); [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt if isempty(F{l,k+1}) size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) < 0 F{l,k+1}=sparse(zeros(size,1)); else F{l,k+1}=sparse(zeros(size)); end end if bLOCKsTRUCT(l) < 0 F{l,k+1}(i)=value; else if j < i tmpj = j; j = i; i = tmpj; end if i < j F{l,k+1}(i,j)=value; F{l,k+1}(j,i)=value; elseif i == j F{l,k+1}(i,j)=value; end end else break; end end else % dense format case for k=1:mDIM+1 for l=1:nBLOCK size=abs(bLOCKsTRUCT(l)); if bLOCKsTRUCT(l) > 0 F{l,k}=zeros(size); for i=1:size for j=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt F{l,k}(i,j)=value; else error(sprintf('Failed to read an element at %d %d %d %d'),... k-1,l,i,j); end end end else F{l,k}=zeros(size,1); for i=1:size [value,cnt]=fscanf(fid,'%*[^0-9+-]%lg',1); if cnt F{l,k}(i)=value; else error(sprintf('Failed to read an element at %d %d %d %d'),... k-1,l,i,i); end end end end end end fclose(fid); % End of File sdpa-7.3.11/mex/mexWriteSedumiToSDPA.cpp0000644000175000017500000001477613211530510017331 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*---------------------------------------------------------- function mexWriteSedumiToSDPA(filename,At,b,c,K,accuracy) Note:: c must be set as (-c) and K.f must be processed before entering this routine. ----------------------------------------------------------*/ #include #include #include using namespace std; void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { mwSize mwsize; mxArray *field_ptr = NULL; mxArray* filename_ptr = (mxArray*) prhs[0]; mxArray* At_ptr = (mxArray*) prhs[1]; mxArray* b_ptr = (mxArray*) prhs[2]; mxArray* c_ptr = (mxArray*) prhs[3]; mxArray* K_ptr = (mxArray*) prhs[4]; mxArray* accuracy_ptr = (mxArray*) prhs[5]; // Get filename char* filename = NULL; mwsize = mxGetM(filename_ptr)*mxGetN(filename_ptr)+1; filename = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(filename_ptr,filename,mwsize); FILE* fp; if ((fp = fopen(filename,"w")) == NULL) { mexPrintf("Cannot Open %s\n",filename); return; } char* accuracy = NULL; mwsize = mxGetM(accuracy_ptr)*mxGetN(accuracy_ptr)+1; accuracy = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(accuracy_ptr,accuracy,mwsize); // mexPrintf("accuracy = %s\n", accuracy); mwSize mDIM = mxGetN(At_ptr); fprintf(fp, PRINTF_INT_STYLE "\n", mDIM); /* nBLOCK */ mwSize nBLOCK = 0; mwSize K_l = 0; int isK_l = 0; // 1 (K_l > 0) or 0 (K_l == 0) field_ptr = mxGetField(K_ptr, 0, "l"); if (field_ptr != NULL) { K_l = (mwSize)((mxGetPr(field_ptr))[0]); #if 0 mexPrintf("K_l = " PRINT_INT_STYLE "\n", K_l); #endif if (K_l > 0) { isK_l = 1; nBLOCK++; } } mwSize* K_s = NULL; mwSize* K_sdpConeStart = NULL; int K_sdpNoCones = 0; field_ptr = mxGetField(K_ptr, 0, "s"); if (field_ptr != NULL) { K_sdpNoCones = (int) mxGetM(field_ptr); K_s = (mwSize*) mxCalloc(K_sdpNoCones, sizeof(mwSize)); K_sdpConeStart = (mwSize*) mxCalloc(K_sdpNoCones+1, sizeof(mwSize)); K_sdpConeStart[0] = 0; #if 0 mexPrintf("K_sdpNoCones = " PRINTF_INT_STYLE "\n", K_sdpNoCones); #endif for (int l=0; l= 1) { fprintf(fp, PRINTF_INT_STYLE "\n", K_s[K_sdpNoCones-1]); } else { fprintf(fp,"\n"); } double* b = mxGetPr(b_ptr); for(mwSize k = 0; k < mDIM-1; ++k){ fprintf(fp, accuracy, b[k]); fprintf(fp, " "); } fprintf(fp, accuracy, b[mDIM-1]); fprintf(fp, "\n"); /* F_0 = - C */ if (mxIsEmpty(c_ptr) || mxGetNzmax(c_ptr) == 0 || (mxGetJc(c_ptr))[1] == 0) { mexPrintf("c = empty\n"); } else { mwIndex* C_row = mxGetIr(c_ptr); mwIndex* C_column = mxGetJc(c_ptr); double* C_ele = mxGetPr(c_ptr); mwIndex C_length = C_column[1]; int currentSdpCone = 0; for (mwSize index = 0; index 0) { mxFree(K_s); mxFree(K_sdpConeStart); } return; } sdpa-7.3.11/mex/mexReadSDPAToSedumi.cpp0000644000175000017500000002302313211530510017073 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*---------------------------------------------------------- function [At,b,c,K,blockStruct] = SDPAToSedumi(filename); ----------------------------------------------------------*/ #include #include #include #include #include using namespace std; #define lengthOfString 10240 #define MX_CALLOC 0 #define MX_DEBUG 0 enum BlockType {btSDP, btLP}; class LIJV { public: int l,i,j; int index; double value; LIJV() { i = j = l = index = 0; value = 0.0; } static bool compare(LIJV* a, LIJV* b) { // if (a < b) return true; // if (a >= b) return false; if ( a[0].index < b[0].index ) { return true; } else if ( a[0].index > b[0].index ) { return false; } return false; // a == b } }; void printData(vector* A,int m) { mexPrintf("------------------------\n"); for (int k=0; kl, ele->i, ele->j, ele->value, ele->index); } } mexPrintf("------------------------\n"); } void readLIJV(vector* A,FILE* fpData) { int i,j,k,l; double value; while (true) { if (fscanf(fpData,"%*[^0-9+-]%d",&k)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&l)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&i)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&j)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%lf",&value)<=0) { break; } if (value == 0.0 || value == -0.0) { continue; } LIJV* ele = NULL; #if MX_CALLOC ele = (LIJV*)mxCalloc(1, sizeof(LIJV)); #else try { ele = new LIJV; } catch (bad_alloc){ mexPrintf("Memory Exhausted (bad_alloc)"); } catch(...){ mexPrintf("Fatal Error (related memory allocation)"); } #endif ele->i = i; ele->j = j; ele->l = l; ele->value = value; A[k].push_back(ele); } } void pushNonSymmetric(vector* A, int m) { for (int k=0; ki != ele1->j) { LIJV* ele2 = NULL; #if MX_CALLOC ele2 = (LIJV*)mxCalloc(1, sizeof(LIJV)); #else try { ele2 = new LIJV; } catch(bad_alloc){ mexPrintf("Memory Exhausted (bad_alloc)"); } catch(...){ mexPrintf("Fatal Error (related memory allocation"); } #endif ele2->i = ele1->j; ele2->j = ele1->i; ele2->l = ele1->l; ele2->value = ele1->value; A[k].push_back(ele2); } } } } void changeIndex(vector* A, int m, int nBlock, BlockType* blockType, int* blockStart, int* blockStruct) { for (int k=0; kl-1; const int i = ele->i-1; const int j = ele->j-1; int index2 = i; if (blockType[l] == btSDP) { index2 = i*blockStruct[l]+j; } ele->index = index2 + blockStart[l]; } } for (int k=0; k* A; A = (vector*) mxCalloc(m+1, sizeof(vector)); readLIJV(A,fpData); #if MX_DEBUG printData(A,m); #endif pushNonSymmetric(A,m); #if MX_DEBUG printData(A,m); #endif changeIndex(A, m, nBlock, blockType, blockStart, blockStruct); #if MX_DEBUG printData(A,m); #endif mwSize Annz = 0; for (int k=1; kindex; At_ele[cIndex] = ele->value; cIndex++; } } mwIndex* c_row = mxGetIr(c_ptr); mwIndex* c_column = mxGetJc(c_ptr); double* c_ele = mxGetPr(c_ptr); c_column[0] = 0; c_column[1] = A[0].size(); cIndex = 0; for (mwSize index2 = 0; index2 < (mwSize) A[0].size(); ++index2) { LIJV* ele = A[0].at(index2); c_row[cIndex] = ele->index; // Note that 'c' must be negative c_ele[cIndex] = -(ele->value); cIndex++; } double* b_ele = mxGetPr(b_ptr); for (int k=0; k> [mDIM,nBLOCK,bLOCKsTRUCT,c,F] = read_data('example1.dat-s'); will read 'example1.dat-s' into the SDPA-M structures. (2) param.m >> OPTION=param; will prepare default parameter. You can change the parameter by this OPTION structure. (3) sdpam.m >> [objVal,x,X,Y,INFO] = sdpam(mDIM,nBLOCK,bLOCKsTRUCT,c,F); or >> [objVal,x,X,Y,INFO] = sdpam(mDIM,nBLOCK,bLOCKsTRUCT,c,F,OPTION); will solve the SDP. (4) gensdpafile.m >> gensdpafile('myexample.dat-s',mDIM,nBLOCK,bLOCKsTRUCT,c,F); will output the SDPA-M structure into 'myexample.dat-s'. (5) initial_point.m >> [x0,X0,Y0] = initial_point('example1.ini-s', mDIM, nBLOCK, bLOCKsTRUCT); will read an initial point from 'example1.ini-s'. You need to prepare mDIM, nBLOCK, bLOCKsTRUCT by read_data.m (6) SDPAToSedumi.m >> [At,b,c,K,blockStruct] = SDPAToSedumi('example1.dat-s'); will read 'example1.dat-s' into SeDuMi structures with an additional structure 'blockStruct'. (7) sedumiwrap.m >> [x,y,info]=sedumiwrap(A,b,c,K,pars,OPTION); will solve the SDP given in SeDuMi strucutres. The 5th argument 'pars' will be ignored and the 6th argument can be prepared by param.m (8) SedumiToSDPA.m >> SedumiToSDPA('myexample.dat-s',A,b,c,K,'%8.16e'); will output SeDuMi structures into 'myexample.dat-s'. '%8.16' determines the output style by printf-format. (9) read_output.m >> [objVal,x,X,Y,INFO] = read_output('example1.result',mDIM,nBLOCK,bLOCKsTRUCT); will read the result file generated by SDPA. If you solve 'example1.dat-s' by $ ./sdpa example1.dat-s example1.result then this result can be read by >> [mDIM,nBLOCK,bLOCKsTRUCT,c,F] = read_data('example1.dat-s'); >> [objVal,x,X,Y,INFO] = read_output('example1.result',mDIM,nBLOCK,bLOCKsTRUCT); (10) read_outputSedumi.m >> [x,y,info] = read_outputSedumi('example1.result',m,K); will read the result file generated by SDPA. If you solve 'example1.dat-s' by $ ./sdpa example1.dat-s example1.result then this result can be read by >> [At,b,c,K,blockStruct] = SDPAToSedumi('example1.dat-s'); >> [x,y,info] = read_outputSedumi('example1.result',m,K); sdpa-7.3.11/mex/mexsdpa.cpp0000644000175000017500000005110713211530510015031 0ustar makotomakoto/* * This file is a component of SDPA * Copyright (C) 2004-2017 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 * * SDPA-M: 7.3 * mexsdpa.cpp */ #include /* * SDPA header files */ #include extern void _main(); void sdpasolver(double *mDIM_ptr, double *nBLOCK_ptr, double *bLOCKsTRUCT_ptr, double *c_ptr, mxArray *F_ptr, double *x0_ptr, mxArray *X0_ptr, mxArray *Y0_ptr, mxArray *OPTION_ptr, int IniPt, double *objVal_ptr, double *x_ptr, mxArray *X_ptr, mxArray *Y_ptr, mxArray *INFO_ptr) { time_t ltime; time(<ime); char string_time[1024]; strcpy(string_time,ctime(<ime)); string_time[strlen(string_time)-1]='\0'; SDPA sdpa; int maxIteration = 0; double param = 0.0; /* mxArray pointer */ mxArray *field_ptr = NULL; mxArray *cell_ptr = NULL; int nSymmChk = 0; int nDimacs = 0; /* strings for phase value */ const char *szPhase[] = { "noINFO", "pFEAS", "dFEAS", "pdFEAS", "pdINF", "pFEAS_dINF", "pINF_dFEAS", "pdOPT", "pUNBD", "dUNBD"}; /* output file */ char *outfile = NULL; FILE *fp = NULL; FILE *fpResult = NULL; int nOutfile = 0; mwSize mDIM; mwSize nBLOCK; /* temporary variables */ mwIndex i,j,k,l; int size; mwSize mwsize; mwIndex idx, startidx, endidx; mwSize sizeM, sizeN; mwIndex *subscript = NULL; mwIndex *dims = NULL; int cell_index = 0; mwIndex *ir_ptr = NULL; mwIndex *jc_ptr = NULL; double *tmp_ptr = NULL; double *result_ptr = NULL; char* tmpPrint = NULL; /*** Set SDPA parameters by OPTIONS ***/ /* Max Iteration */ field_ptr = mxGetField(OPTION_ptr, 0, "maxIteration"); if( field_ptr != NULL ){ maxIteration = (int)mxGetScalar(field_ptr); sdpa.setParameterMaxIteration(maxIteration); } /* epsilonStar */ field_ptr = mxGetField(OPTION_ptr, 0, "epsilonStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterEpsilonStar(param); } /* lambdaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "lambdaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterLambdaStar(param); } /* omegaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "omegaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterOmegaStar(param); } /* lowerBound */ field_ptr = mxGetField(OPTION_ptr, 0, "lowerBound"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterLowerBound(param); } /* upperBound */ field_ptr = mxGetField(OPTION_ptr, 0, "upperBound"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterUpperBound(param); } /* betaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "betaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterBetaStar(param); } /* betaBar */ field_ptr = mxGetField(OPTION_ptr, 0, "betaBar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterBetaBar(param); } /* gammaStar */ field_ptr = mxGetField(OPTION_ptr, 0, "gammaStar"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterGammaStar(param); } /* epsilonDash */ field_ptr = mxGetField(OPTION_ptr, 0, "epsilonDash"); if( field_ptr != NULL ){ param = *mxGetPr(field_ptr); sdpa.setParameterEpsilonDash(param); } /* xPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "xPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintXVec(tmpPrint); mxFree(tmpPrint); } /* XPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "XPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintXMat(tmpPrint); mxFree(tmpPrint); } /* YPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "YPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintYMat(tmpPrint); mxFree(tmpPrint); } /* infPrint */ field_ptr = mxGetField(OPTION_ptr, 0, "infPrint"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; tmpPrint = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, tmpPrint, mwsize); sdpa.setParameterPrintInformation(tmpPrint); mxFree(tmpPrint); } /* isSymmetric */ field_ptr = mxGetField(OPTION_ptr, 0, "isSymmetric"); if( field_ptr != NULL ){ nSymmChk = (int)mxGetScalar(field_ptr); } /* isDimacs */ field_ptr = mxGetField(OPTION_ptr, 0, "isDimacs"); if( field_ptr != NULL ){ nDimacs = (int)mxGetScalar(field_ptr); } /* print */ field_ptr = mxGetField(OPTION_ptr, 0, "print"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; if (mwsize == 1) { // mexPrintf("display is NULL\n"); fp = NULL; } else { outfile = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, outfile, mwsize); if( strncmp("display", outfile, mwsize - 1) == 0 ){ fp = stdout; } else if( strncmp("no", outfile, mwsize - 1) == 0 ){ fp = NULL; } else { fp = fopen(outfile, "at"); if( fp == NULL ){ mexPrintf("Failed to open %s\n", outfile); fp = stdout; } else { nOutfile = 1; } } mxFree(outfile); } } else { /* default setting is displaying information to stdout */ fp = stdout; } sdpa.setDisplay(fp); /* resultFile */ field_ptr = mxGetField(OPTION_ptr, 0, "resultFile"); if( field_ptr != NULL ){ mwsize = mxGetM(field_ptr) * mxGetN(field_ptr) + 1; if (mwsize == 1) { // mexPrintf("resultFile is NULL\n"); } else { outfile = (char*)mxCalloc(mwsize, sizeof(char)); mxGetString(field_ptr, outfile, mwsize); fpResult = fopen(outfile, "w"); if( fpResult == NULL ){ mexPrintf("Failed to open %s\n", outfile); mexPrintf("Skip the detail file\n"); } else { sdpa.setResultFile(fpResult); } mxFree(outfile); } } if (fp) { fprintf(fp,"SDPA start at [%s]\n",string_time); } if (fpResult) { fprintf(fpResult,"SDPA start at [%s]\n",string_time); } /* NumThreads */ field_ptr = mxGetField(OPTION_ptr, 0, "NumThreads"); if( field_ptr != NULL ){ sdpa.setNumThreads((int)mxGetScalar(field_ptr)); } /*** initialize SDPA class members ***/ /* mDIM */ mDIM = (mwSize)(*mDIM_ptr); sdpa.inputConstraintNumber(mDIM); /* nBLOCK */ nBLOCK = (mwSize)(*nBLOCK_ptr); sdpa.inputBlockNumber(nBLOCK); /* bLOCKsTRUCT */ for(i = 0; i < nBLOCK; i++){ int bs = (int)(bLOCKsTRUCT_ptr[i]); sdpa.inputBlockSize(i+1,bs); if (bs < 0 || bs == 1) { sdpa.inputBlockType(i+1,SDPA::LP); } else { sdpa.inputBlockType(i+1,SDPA::SDP); } } /* Execute initializeUpperTriangleSpace() */ sdpa.initializeUpperTriangleSpace(); /* cVECT */ for(i = 0; i < mDIM; i++){ sdpa.inputCVec(i+1, c_ptr[i]); } /*** Count NonZeroNumber in coefficience matrices ***/ // Do nothing for SDPA 7 /*** Set coefficience matrices value ***/ subscript = (mwIndex*)mxCalloc(2,sizeof(mwIndex)); dims = (mwIndex*)mxGetDimensions(F_ptr); for(l = 0; l < dims[0]; l++){ for(k = 0; k < dims[1]; k++){ subscript[0]=l; subscript[1]=k; cell_index = mxCalcSingleSubscript(F_ptr, 2, subscript); cell_ptr = mxGetCell(F_ptr, cell_index); // mxGetDimensions at the next line is redundant, // but this is necessary to octave dims = (mwIndex*)mxGetDimensions(F_ptr); if( cell_ptr == NULL || mxIsEmpty(cell_ptr) ){ /* If the cell is empty, we assume this cell as zero matrix */ continue; } sizeM = mxGetM(cell_ptr); sizeN = mxGetN(cell_ptr); tmp_ptr = mxGetPr(cell_ptr); if( mxIsSparse(cell_ptr) ){ /* Sparse Matrix */ ir_ptr = mxGetIr(cell_ptr); jc_ptr = mxGetJc(cell_ptr); if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } sdpa.inputElement( k, l+1, j+1, j+1, tmp_ptr[startidx]); } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ endidx = jc_ptr[sizeN]; for(idx = 0; idx < endidx; idx++){ i = ir_ptr[idx]; sdpa.inputElement( k, l+1, i+1, i+1, tmp_ptr[idx]); } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } for(idx = startidx; idx < endidx; idx++){ i = ir_ptr[idx]; if( i <= j ){ sdpa.inputElement( k, l+1, i+1, j+1, tmp_ptr[idx]); } } } } } else { /* Dense Matrix */ if( sdpa.getBlockType(l+1)==SDPA::SDP ){ /* Full Matrix */ for(j = 0; j < sizeN; j++){ for(i = 0; i < sizeM; i++){ if( i <= j ){ if( tmp_ptr[j * sizeN + i] != 0 ){ sdpa.inputElement(k, l+1, i+1, j+1, tmp_ptr[j * sizeN + i]); } } } } } else { /* Diagonal Matrix */ if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j] != 0 ){ sdpa.inputElement( k, l+1, j+1, j+1, tmp_ptr[j]); } } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ for(i = 0; i < sizeM; i++){ if( tmp_ptr[i] != 0 ){ sdpa.inputElement( k, l+1, i+1, i+1, tmp_ptr[i]); } } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j * sizeN + j] != 0 ){ sdpa.inputElement( k, l+1, j+1, j+1, tmp_ptr[j * sizeN + j]); } } } } } } } /*** Check the consistence of F, c ***/ if( nSymmChk ){ sdpa.initializeUpperTriangle(true); } else { sdpa.initializeUpperTriangle(false); } /*** Check initial point ***/ if( IniPt == 1 ){ sdpa.setInitPoint(true); /* initial value for xVec */ for(k = 0; k < mDIM; k++){ sdpa.inputInitXVec( k+1, x0_ptr[k]); } /* initial value for XMat */ cell_index = 0; for(l = 0; l < nBLOCK; l++){ cell_ptr = mxGetCell(X0_ptr, cell_index); if( cell_ptr == NULL || mxIsEmpty(cell_ptr) ){ /* If the cell is empty, we assume this cell as zero matrix */ continue; } sizeM = mxGetM(cell_ptr); sizeN = mxGetN(cell_ptr); tmp_ptr = mxGetPr(cell_ptr); if( mxIsSparse(cell_ptr) ){ /* Sparse Matrix */ ir_ptr = mxGetIr(cell_ptr); jc_ptr = mxGetJc(cell_ptr); if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } sdpa.inputInitXMat(l+1, j+1, j+1, tmp_ptr[startidx]); } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ endidx = jc_ptr[sizeN]; for(idx = 0; idx < endidx; idx++){ i = ir_ptr[idx]; sdpa.inputInitXMat(l+1, i+1, i+1, tmp_ptr[idx]); } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } for(idx = startidx; idx < endidx; idx++){ i = ir_ptr[idx]; if( i <= j ){ sdpa.inputInitXMat( l+1, i+1, j+1, tmp_ptr[idx]); } } } } } else { /* Dense Matrix */ if( sdpa.getBlockType(l+1) == SDPA::SDP ){ /* Full Matrix */ for(j = 0; j < sizeN; j++){ for(i = 0; i < sizeM; i++){ if( i <= j ){ if( tmp_ptr[j * sizeN + i] != 0 ){ sdpa.inputInitXMat( l+1, i+1, j+1, tmp_ptr[j * sizeN + i]); } } } } } else { /* Diagonal Matrix */ if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j] != 0 ){ sdpa.inputInitXMat( l+1, j+1, j+1, tmp_ptr[j]); } } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ for(i = 0; i < sizeM; i++){ if( tmp_ptr[i] != 0 ){ sdpa.inputInitXMat( l+1, i+1, i+1, tmp_ptr[i]); } } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j * sizeN + j] != 0 ){ sdpa.inputInitXMat( l+1, j+1, j+1, tmp_ptr[j * sizeN + j]); } } } } } cell_index++; } /* initial value for YMat */ cell_index = 0; for(l = 0; l < nBLOCK; l++){ cell_ptr = mxGetCell(Y0_ptr, cell_index); if( cell_ptr == NULL || mxIsEmpty(cell_ptr) ){ /* If the cell is empty, we assume this cell as zero matrix */ continue; } sizeM = mxGetM(cell_ptr); sizeN = mxGetN(cell_ptr); tmp_ptr = mxGetPr(cell_ptr); if( mxIsSparse(cell_ptr) ){ /* Sparse Matrix */ ir_ptr = mxGetIr(cell_ptr); jc_ptr = mxGetJc(cell_ptr); if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } sdpa.inputInitYMat( l+1, j+1, j+1, tmp_ptr[startidx]); } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ endidx = jc_ptr[sizeN]; for(idx = 0; idx < endidx; idx++){ i = ir_ptr[idx]; sdpa.inputInitYMat( l+1, i+1, i+1, tmp_ptr[idx]); } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ startidx = jc_ptr[j]; endidx = jc_ptr[j+1]; if( startidx == endidx ){ continue; } for(idx = startidx; idx < endidx; idx++){ i = ir_ptr[idx]; if( i <= j ){ sdpa.inputInitYMat( l+1, i+1, j+1, tmp_ptr[idx]); } } } } } else { /* Dense Matrix */ if( sdpa.getBlockType(l+1) == SDPA::SDP ){ /* Full Matrix */ for(j = 0; j < sizeN; j++){ for(i = 0; i < sizeM; i++){ if( i <= j ){ if( tmp_ptr[j * sizeN + i] != 0 ){ sdpa.inputInitYMat( l+1, i+1, j+1, tmp_ptr[j * sizeN + i]); } } } } } else { /* Diagonal Matrix */ if( sizeM == 1 && sizeN != 1 ){ /* Row Vector Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j] != 0 ){ sdpa.inputInitYMat( l+1, j+1, j+1, tmp_ptr[j]); } } } else if( sizeM != 1 && sizeN == 1 ){ /* Column Vector Case */ for(i = 0; i < sizeM; i++){ if( tmp_ptr[i] != 0 ){ sdpa.inputInitYMat( l+1, i+1, i+1, tmp_ptr[i]); } } } else { /* Matrix Case */ for(j = 0; j < sizeN; j++){ if( tmp_ptr[j * sizeN + j] != 0 ){ sdpa.inputInitYMat( l+1, j+1, j+1, tmp_ptr[j * sizeN + j]); } } } } } cell_index++; } } /*** Solve SDP ***/ sdpa.initializeSolve(); sdpa.solve(); /*** Dimacs Error Information ****/ if (nDimacs != 0) { field_ptr = mxCreateNumericMatrix(6,1,mxDOUBLE_CLASS,mxREAL); double dimacs_error[7]; sdpa.getDimacsError(dimacs_error); double* dimacs_store = mxGetPr(field_ptr); for (int i=1; i<=6; i++) { dimacs_store[i-1] = dimacs_error[i]; } mxSetField(INFO_ptr, 0, "dimacs", field_ptr); } /**** Set output values to arguments ****/ /* Optimal value of Primal objective */ objVal_ptr[0] = sdpa.getPrimalObj(); /* Optimal value of Dual objective */ objVal_ptr[1] = sdpa.getDualObj(); /* Optimal value for xVec */ tmp_ptr = sdpa.getResultXVec(); if( tmp_ptr != NULL ){ for(k = 0; k < mDIM; k++){ x_ptr[k] = tmp_ptr[k]; } } /* Optimal value for XMat */ cell_index = 0; for(l = 0; l < nBLOCK; l++){ size = sdpa.getBlockSize(l+1); if( sdpa.getBlockType(l+1) == SDPA:: SDP){ sizeM = size; sizeN = size; } else { sizeM = 1; sizeN = abs(size); } cell_ptr = mxCreateDoubleMatrix(sizeM, sizeN, mxREAL); tmp_ptr = mxGetPr(cell_ptr); idx = 0; result_ptr = sdpa.getResultXMat(l+1); if( size >= 0 ){ for(j = 0; j < sizeN; j++){ for(i = 0; i < sizeM; i++){ tmp_ptr[idx++] = result_ptr[j + sizeN * i]; } } } else { for(idx = 0; idx < sizeN; idx++){ tmp_ptr[idx] = result_ptr[idx]; } } mxSetCell(X_ptr, cell_index++, mxDuplicateArray(cell_ptr)); } /* Optimal value for YMat */ cell_index = 0; for(l = 0; l < nBLOCK; l++){ size = sdpa.getBlockSize(l+1); if( sdpa.getBlockType(l+1) == SDPA:: SDP){ sizeM = size; sizeN = size; } else { sizeM = 1; sizeN = abs(size); } cell_ptr = mxCreateDoubleMatrix(sizeM, sizeN, mxREAL); tmp_ptr = mxGetPr(cell_ptr); idx = 0; result_ptr = sdpa.getResultYMat(l+1); if( size >= 0 ){ for(j = 0; j < sizeN; j++){ for(i = 0; i < sizeM; i++){ tmp_ptr[idx++] = result_ptr[j + sizeN * i]; } } } else { for(idx = 0; idx < sizeN; idx++){ tmp_ptr[idx] = result_ptr[idx]; } } mxSetCell(Y_ptr, cell_index++, mxDuplicateArray(cell_ptr)); } /* Phase information */ field_ptr = mxCreateString(szPhase[sdpa.getPhaseValue()]); mxSetField(INFO_ptr, 0, "phasevalue", field_ptr); /* Iteration */ field_ptr = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL); *mxGetPr(field_ptr) = (double)sdpa.getIteration(); mxSetField(INFO_ptr, 0, "iteration", field_ptr); /* close output file */ time(<ime); strcpy(string_time,ctime(<ime)); string_time[strlen(string_time)-1]='\0'; if (fp) { fprintf(fp,"SDPA end at [%s]\n",string_time); } if (fpResult) { fprintf(fpResult,"SDPA end at [%s]\n",string_time); } if( nOutfile ){ fclose(fp); } if (fpResult != NULL) { fclose(fpResult); } /*** Free allocated memory ****/ mxFree(subscript); sdpa.terminate(); return; } /* * Matlab gateway function */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Decleration of variables */ double *mDIM_ptr, *nBLOCK_ptr, *bLOCKsTRUCT_ptr, *c_ptr, *x_ptr, *objVal_ptr, *x0_ptr; mxArray *F_ptr, *X_ptr, *Y_ptr, *X0_ptr, *Y0_ptr, *OPTION_ptr, *INFO_ptr; int IniPt; const char *fnames[] = { "phasevalue", "iteration", "dimacs", "cpusec" }; /* * check arguments */ if( nrhs != 9 ){ mexErrMsgTxt("Input arguments must be 9."); } /* Get the pointer of input variables */ mDIM_ptr = mxGetPr(prhs[0]); nBLOCK_ptr = mxGetPr(prhs[1]); bLOCKsTRUCT_ptr = mxGetPr(prhs[2]); c_ptr = mxGetPr(prhs[3]); F_ptr = (mxArray*)prhs[4]; x0_ptr = mxGetPr(prhs[5]); X0_ptr = (mxArray*)prhs[6]; Y0_ptr = (mxArray*)prhs[7]; OPTION_ptr = (mxArray*)prhs[8]; if( mxIsEmpty(prhs[5]) /* x0 */ || mxIsEmpty(prhs[6]) /* X0 */ || mxIsEmpty(prhs[7]) /* Y0 */ ){ /* nouse of Initial Point*/ IniPt = 0; } else { /* use of Initial Point */ IniPt = 1; /* check of argument dimensions */ /* if(*mDIM_ptr != mxGetM(prhs[5]) || !mxIsDouble(prhs[5])) mexErrMsgTxt("x0 must be (mDIM x 1) column vector of double"); if( *nBLOCK_ptr != sizeM_X0 || 1 != sizeN_X0 || !mxIsCell(prhs[6])) mexErrMsgTxt("X0 must be (nBLOCK x 1) cell array"); if( *nBLOCK_ptr != sizeM_Y0 || 1 != sizeN_Y0 || !mxIsCell(prhs[7])) mexErrMsgTxt("Y0 must be (nBLOCK x 1) cell array");*/ } /* Create cellarrays for the output variables */ plhs[0] = mxCreateDoubleMatrix(1,2,mxREAL); plhs[1] = mxCreateDoubleMatrix((int) *mDIM_ptr,1,mxREAL); plhs[2] = mxCreateCellMatrix((int) *nBLOCK_ptr,1); plhs[3] = mxCreateCellMatrix((int) *nBLOCK_ptr,1); plhs[4] = mxCreateStructMatrix(1,1,4,fnames); //Get the pointer of output variables objVal_ptr = mxGetPr(plhs[0]); x_ptr = mxGetPr(plhs[1]); X_ptr = plhs[2]; Y_ptr = plhs[3]; INFO_ptr = plhs[4]; /* Call sdpasolver here */ sdpasolver(mDIM_ptr, nBLOCK_ptr, bLOCKsTRUCT_ptr, c_ptr, F_ptr, x0_ptr, X0_ptr, Y0_ptr, OPTION_ptr, IniPt, objVal_ptr, x_ptr, X_ptr, Y_ptr, INFO_ptr); return; } /* * End of File */ sdpa-7.3.11/mex/Makefile0000644000175000017500000001337513211530510014331 0ustar makotomakoto# # SDPA-M: $Revision: 7.3 $ # # For Matlab # $ make # For Octave # $ make COMPILE_ENVIRONMENT=octave # after "make install", you can find # 'make.inc' in 'share/sdpa' sub-directory under the installed directory # For example # make MAKE_INCLUDE_DIR=/usr/share/sdpa # or # make MAKE_INCLUDE_DIR=/usr/local/share/sdpa # In addition, for Octave, you should try # make MAKE_INCLUDE_DIR=/usr/local/share/sdpa COMPILE_ENVIRONMENT=octave # To compile with mingw, the following command is a sample. # Your need to modify directory names and compiler names. # make MEX="i586-mingw32msvc-g++ -shared" COMPILE_ENVIRONMENT=octave \ # PRINTF_INT_STYLE=-DPRINTF_INT_STYLE=\\\"%zd\\\" \ # OUTPUT_FORMAT="-o \$@.mexw32" \ # MATLAB_INCLUDE="-Imatlab-extern/include" \ # MATLAB_LIBS="-I/matlab-extern/microsoft/libmx.lib -I/matlab-extern/microsoft/libmex.lib" \ # for only SDPA-Project members # set DEVELOPEMENT_STAGE=1 to compile without 'make install' # For example # make MAKE_INCLUDE_DIR=../etc DEVELOPEMENT_STAGE=1 # In addition, for Octave, you should try # make MAKE_INCLUDE_DIR=../etc DEVELOPEMENT_STAGE=1 COMPILE_ENVIRONMENT=octave # This file is a component of SDPA # Copyright (C) 2004-2017 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 MAKE_INCLUDE_DIR=.. -include ${MAKE_INCLUDE_DIR}/make.inc # after "make install", you can find # 'make.inc' in 'share/sdpa' sub-directory under the installed directory # For example # make MAKE_INCLUDE_DIR=/usr/share/sdpa # or # make MAKE_INCLUDE_DIR=/usr/local/share/sdpa # Set manually the following MEX full path MEX = "auto" # for Linux (depends on version) #MEX = /usr/local/matlab/MatlabR2008b/bin/mex # for Mac (depends on version) OS = $(shell uname) ifeq ($(OS),Darwin) MEX = /Applications/MATLAB_R2008b.app/bin/mex endif # ---- USUALLY just 'mex' is used MEX = mex # Automatic search MEX full path by invoking matlab ifeq ($(MEX),"auto") MEX = ${shell matlab -nodisplay -r "s=matlabroot; fprintf('%s\n',s);exit" | tail -2 | head -1 }/bin/mex endif MATLAB_LAPACK = -lmwlapack -lmwblas DEF_FPIC = -fPIC ARCH = $(shell uname -m) CXXFLAGSOPTIONS = CXXFLAGS="-Wall ${DEF_FPIC}" -O -DNDEBUG CC=${CC} CXX=${CXX} LARGEARRAYOPTION = -largeArrayDims SDPA_INCLUDE = -I${SDPA_DIR}/include ifeq ($(DEVELOPEMENT_STAGE),1) SDPA_INCLUDE = -I.. SDPA_LIB = ../libsdpa.a endif ALL_INCLUDE = ${SDPA_INCLUDE} ${MUMPS_INCLUDE} ${PTHREAD_INCLUDE} # ALL_LIBS = ${SDPA_LIB} ${MUMPS_LIBS} ${MATLAB_LAPACK} ${FCLIBS} ALL_LIBS = ${SDPA_LIB} ${MUMPS_LIBS} ${LAPACK_LIBS} ${BLAS_LIBS} ${PTHREAD_LIBS} ${FCLIBS} PRINTF_INT_STYLE = -DPRINTF_INT_STYLE=\\\"%zd\\\" # Output format is usually automatically set by mex command. OUTPUT_FORMAT = ifeq ($(COMPILE_ENVIRONMENT),octave) MEX = CC=${CC} CXX=${CXX} CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" mkoctfile --mex CXXFLAGSOPTIONS = LARGEARRAYOPTION = PRINTF_INT_STYLE = -DPRINTF_INT_STYLE=\\\"%d\\\" endif ALL_OPTION = ${CXXFLAGSOPTIONS} ${LARGEARRAYOPTION} ${PRINTF_INT_STYLE} all: mexsdpa mexSedumiWrap mexAggSDPcones mexDisAggSDPsol mexWriteSedumiToSDPA mexReadSDPAToSedumi mexReadOutput # all: mexSedumiWrap mexBinaryCheck: @echo "---------------------------------------------" @echo "Mex Compilation Start " @echo "---------------------------------------------" @if [ -f $(MEX) ]; then \ echo "---------------------------------------------" ;\ echo " We use " ;\ echo " " $(MEX) ;\ echo " for Mex compilaton " ;\ echo "---------------------------------------------" ;\ else \ echo "---------------------------------------------" ;\ echo "Automatic search is failed, " ;\ echo " Set the full path for mex command mannually " ;\ echo " in "`pwd`"/Makekefile" ;\ echo " and try 'make' in `pwd` " ;\ echo "---------------------------------------------" ;\ false ;\ fi mexsdpa: ${MEX} ${ALL_OPTION} \ ${OUTPUT_FORMAT} \ ${ALL_INCLUDE} ${MATLAB_INCLUDE} \ mexsdpa.cpp mexFprintf.c \ ${MATLAB_LIBS} ${ALL_LIBS} mexSedumiWrap: ${MEX} ${ALL_OPTION} \ ${OUTPUT_FORMAT} \ ${ALL_INCLUDE} ${MATLAB_INCLUDE} \ mexSedumiWrap.cpp mexFprintf.c \ ${MATLAB_LIBS} ${ALL_LIBS} mexAggSDPcones: ${MEX} \ ${OUTPUT_FORMAT} \ ${ALL_OPTION} ${MATLAB_INCLUDE} \ mexAggSDPcones.cpp mexFprintf.c ${MATLAB_LIBS} mexDisAggSDPsol: ${MEX} \ ${OUTPUT_FORMAT} \ ${ALL_OPTION} ${MATLAB_INCLUDE} \ mexDisAggSDPsol.cpp mexFprintf.c ${MATLAB_LIBS} mexWriteSedumiToSDPA: ${MEX} \ ${OUTPUT_FORMAT} \ ${ALL_OPTION} ${MATLAB_INCLUDE} \ mexWriteSedumiToSDPA.cpp ${MATLAB_LIBS} mexReadSDPAToSedumi: ${MEX} \ ${OUTPUT_FORMAT} \ ${ALL_OPTION} ${MATLAB_INCLUDE} \ mexReadSDPAToSedumi.cpp ${MATLAB_LIBS} mexReadOutput: ${MEX} \ ${OUTPUT_FORMAT} \ ${ALL_OPTION} ${MATLAB_INCLUDE} \ mexReadOutput.cpp ${MATLAB_LIBS} # clean all generated files clean: rm -f *~ rm -f mexsdpa.mex* mexSedumiWrap.mex* rm -f mexAggSDPcones.mex* mexDisAggSDPsol.mex* rm -f mexFprintf.mex* rm -f mexWriteSedumiToSDPA.mex* rm -f mexReadSDPAToSedumi.mex* mexReadOutput.mex* distclean: clean # # End of File # sdpa-7.3.11/mex/read_output.m0000644000175000017500000000365113211530510015376 0ustar makotomakotofunction [objVal,x,X,Y,INFO] = read_output(filename,mDIM,nBLOCK,bLOCKsTRUCT); % % Read results from SDPA output file % % [objVal,x,X,Y,INFO] = read_output(filename,mDIM,nBLOCK,bLOCKsTRUCT); % % % - filename: string; filename of the SDPA output % - mDIM : integer; number of primal variables % - nBLOCK : integer; number of blocks of F % - bLOCKsTRUCT: vector; represetns the block structure of F % % % - objVal: [objValP objValD]; optimal value of P and D % - x : vector ; optimal solution % - X,Y : cell arrray ; optimal solutions % - INFO : structure ; infomation of the solution % % /* ------------------------------------------------------------- % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % ------------------------------------------------------------- */ if (nargin~=4) error('incorrect number of input arguments'); end if max(size(bLOCKsTRUCT)) ~= nBLOCK error('Inconsinstent between nBLOCK and bLOCKsTRUCT'); end % for filename starting with '~' if filename(1) == '~' filename = strcat(getenv('HOME'),filename(2:length(filename))); end [objVal,x,X,Y,INFO] = ... mexReadOutput(filename,full(mDIM),full(nBLOCK),full(bLOCKsTRUCT)); sdpa-7.3.11/mex/sdpam.m0000644000175000017500000000536613211530510014154 0ustar makotomakotofunction [objVal,x,X,Y,INFO]=sdpam(mDIM,nBLOCK,bLOCKsTRUCT,c,F,... x0,X0,Y0,OPTION) % % Compute the solution of standard SDP. % Since some of input arguments are optional, sdpam can be % overloaded as below. % % [objVal,x,X,Y,INFO] = sdpam(mDIM,nBLOCK,bLOCKsTRUCT,c,F, % x0,X0,Y0,OPTION); % % % - mDIM : integer ; number of primal variables % - nBLOCK : integer ; number of blocks of F % - bLOCKsTRUCT: vector ; represetns the block structure of F % - c : vector ; coefficient vector % - F : cell array; coefficient matrices % - x0,X0,Y0 : cell array; initial point % - OPTION : structure ; options % % % - objVal: [objValP objValD]; optimal value of P and D % - x : vector ; optimal solution % - X,Y : cell arrray ; optimal solutions % - INFO : structure ; infomation of the solution % % This file is a component of SDPA % Copyright (C) 2004-2017 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 % % SDPA-M: $Revision: 6.2 $ % $Id: sdpam.m,v 6.2 2005/05/28 02:36:40 drophead Exp $ t = cputime; if (nargin < 5 | nargin > 9) error('incorrect number of input arguments') elseif nargin == 5 % make initial points empty x0=[];X0=[];Y0=[]; % load default parameters OPTION=param; % solve by SDPA [objVal,x,X,Y,INFO]=mexsdpa(mDIM,nBLOCK,bLOCKsTRUCT,... c,F,x0,X0,Y0,OPTION); elseif nargin == 6 % use OPTION given by arguments OPTION=param(x0); % make initial points empty x0=[];X0=[];Y0=[]; [objVal,x,X,Y,INFO]=mexsdpa(mDIM,nBLOCK,bLOCKsTRUCT,... c,F,x0,X0,Y0,OPTION); elseif nargin == 8 % load default parameters OPTION=param; %solve by SDPA [objVal,x,X,Y,INFO]=mexsdpa(mDIM,nBLOCK,bLOCKsTRUCT,... c,F,x0,X0,Y0,OPTION); elseif nargin == 9 OPTION=param(OPTION); % solve by SDPA [objVal,x,X,Y,INFO]=mexsdpa(mDIM,nBLOCK,bLOCKsTRUCT,... c,F,x0,X0,Y0,OPTION); end INFO.cpusec = cputime-t; % End of File sdpa-7.3.11/ChangeLog0000644000175000017500000001354213211530510013646 0ustar makotomakotoSDPA 7.3.11 from SDPA 7.3.10 / 2017-12-06 Makoto Yamashita * Add SDPA::resetParameters() function (provided by Tristan Gally) SDPA 7.3.10 from SDPA 7.3.9 / 2017-10-01 Makoto Yamashita * Remove small bugs * Change MUMPS from 4.9.10 to 5.1.1 * Fix some spell miss SDPA 7.3.9 from SDPA 7.3.8 / 2013-07-07 Makoto Yamashita * Assign the library files to link by full paths * Rename configure.in to configure.ac * Add CPPFLAGS to configure.ac SDPA 7.3.8 from SDPA 7.3.7 / 2012-04-07 Makoto Yamashita * Fix inside 'index' to 'index2' in changeIndex of mexReadSDPAToSedumi.cpp SDPA 7.3.7 from SDPA 7.3.6 / 2012-03-12 Makoto Yamashita * Fix some spell-miss * Modify sdpa.1 to remove the warning hyphen-used-as-minus-sign SDPA 7.3.6 from SDPA 7.3.5 / 2012-02-01 Makoto Yamashita * Print error messages for reading errors * Fix bugs for some SDPs * Fix some spell-miss * Delete DIMACS_PRINT macro (already replaced by --dimacs option) SDPA 7.3.5 from SDPA 7.3.4 / 2011-05-06 Makoto Yamashita * Change official homepage to sourceforge * Add option --version * Fix bugs for some SDPs * Remove MUMPS tar.gz file SDPA 7.3.4 from SDPA 7.3.3 / 2010-12-06 Makoto Yamashita * Change the configure script for mingw envrionment SDPA 7.3.3 from SDPA 7.3.2 / 2010-11-23 Makoto Yamashita * Change the configure script for MUMPS * Change INSTALL * Fix bugs for some architectures * Change source files for mingw-compatibility * Add some matlab source codes in mex directory SDPA 7.3.2 from SDPA 7.3.1 / 2010-11-12 Makoto Yamashita * Release Debian package SDPA 7.3.1 from SDPA 7.3.0 / 2009-07-29 Makoto Yamashita * Introduce multiple threading * Change data structures for input data matrices * Add sedumiwrap.m (SeDuMi wrapper for SDPA-M) [For details, try 'help sedumiwrap' in Matlab after installation] * Remove small bugs **************************************************************** Before git management change log **************************************************************** 2008-05-21 Kazuhide Nakata * Add correction routin for Sparse Cholesky decomposition * Add "#include " in sdpa_io.cpp * Modify IO::displayDenseLinarSpaceLast * Move "#define P_FORMAT "%+8.3e" from sdpa_struct.cpp to sdpa_struct.h 2008-03-12 Kazuhide Nakata * Modify algorithm of preconditioning for moderate sparse SDP making graph, fill-in, etc. in sdpa_chrdal.cpp initialization of newton class in sdpa_newton.cpp 2008-02-29 Kazuhide Nakata * Initialize block index of SparseLinearSpace without huge array SDP_CNonZeroCount, SDP_ANonZeroCount, SOCP_CNonZeroCount, SOCP_ANonZeroCount, LP_CNonZeroCount, LP_ANonZeroCount. 2008-02-15 Maho Nakata * SDPA 705 RC8. * Change the order of LAPACK and BLAS libs at configure. It will become a problem when an incomplete liblapack.a exists at the BLAS directory (usually caused by the normal ATLAS installation). 2008-02-13 Maho Nakata * SDPA 705 RC7. * Change archive name and directory to the standard ones. * Add dummy variable in sdpa_io.cpp to workaround gcc-3.3 optimization bug. * Parameters are now accord with the manual. PARAMETER_AGGRESSIVE -> PARAMETER_UNSTABLE_BUT_FAST PARAMETER_STABLE -> PARAMETER_STABLE_BUT_SLOW 2008-02-09 Maho Nakata * SDPA 705 RC6 * Cleanups. 2008-02-08 Maho Nakata * SDPA 705 RC4 * the last fix was not included; submmitted by K. Nakata. 2008-02-08 Maho Nakata * SDPA 705 RC3 sdpa_main.cpp:static double KAPPA = 2.2; -> static double KAPPA = 7.0; 2008-02-07 Kazuhide Nakata * Support DIMACS errors * SDPA 705 RC2 2008-02-07 Maho Nakata * SDPA 705 RC1. 2008-01-22 Maho Nakata * Pass -O2 -funroll-all-loops to compilers. 2007-12-10 Maho Nakata * Include spooles archive. * Three useMetis to UseMetis (From Kazuhide Nakata). * Disable Metis by default. * Support MacOSX. Tested on MacOSX Tiger Intel & PPC. 2007-11-29 Kazuhide Nakata * Support multiple LP block * Remove METIS library * Add check routin in SparseLinearSpace::setElement_SDP, DenseLinearSpace::setElement_SDP 2007-10-16 Kazuhide Nakata * Support zero matrix and LP problem * Modify SparseLinearSpace::copyFrom, SparseLinearSpace::initialize * workVariables::initialize 2007-09-18 Kazuhide Nakata * Modify stopping criteria and step length. * Add SolveInfo::check (print various information of current point) 2007-06-29 Kazuhide Nakata * Modify algorithm in sdpa::UTSpMat::Form_Aggregate. * Fix memory leaks via valgrind. * Change type of variable "LP_NonZeroNumber" from int to bool. * Modify variable names in sdpa::SparseLinearSpace::SparseLinearSpace. 2007-06-27 Maho Nakata * Remove GPL.txt. We have COPYING instead, and it is newer. 2007-06-04 Maho Nakata * Reorder LAPACK/BLAS at linker (submitted by Makoto Yamashita). 2007-06-01 Maho Nakata * Initial support for configure script. /*------------------------------------------ Major Versions SDPA 1 (1995) C++ implementation of the primal-dual interior-point method using the HKM search direction SDPA 2 (1996) Implementation of the Mehrotra type predictor- & corrector method SDPA 3 (1997) Novel formula to compute the Schur complement matrix SDPA 4 (1998) Full implementation of the formula or all block matrices, callable library SDPA 5 (1996) Fast step-size computation using the bisection method to approximate minimum eigenvalues SDPA 6 (2002,CodeName Rosemary) Replacing meschach with BLAS/ATLAS and LAPACK SDPA 7 (2008,CodeName Margaret) Improvements on sparse sata structures. Multi-Thread computing. ------------------------------------------*/ sdpa-7.3.11/compile0000755000175000017500000001624513211530510013455 0ustar makotomakoto#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sdpa-7.3.11/install-sh0000755000175000017500000002202113211530510014070 0ustar makotomakoto#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: sdpa-7.3.11/example1.dat-s0000644000175000017500000000026113211530510014534 0ustar makotomakoto"Example 1: mDim = 3, nBLOCK = 1, {2}" 3 = mDIM 1 = nBLOCK 2 = bLOCKsTRUCT 48, -8, 20 0 1 1 1 -11 0 1 2 2 23 1 1 1 1 10 1 1 1 2 4 2 1 2 2 -8 3 1 1 2 -8 3 1 2 2 -2 sdpa-7.3.11/sdpa_call.h0000644000175000017500000001740013211530510014164 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*-------------------------------------------------- sdpa_call.h --------------------------------------------------*/ /*************************************************** In this header file, Do NOT use 'using namespace sdpa;'. Otherwise, if users define their OWN 'sdpa' namespace, it would be trouble. ***************************************************/ #ifndef __sdpa_call_h__ #define __sdpa_call_h__ #include #include #include #include #include #include #include #include /* The class list is generated by the following command $ grep class *.h | grep -v \; | grep -v SDPA | tr ':' ' ' | \ awk '{print $2 " " $3 ";"}' */ namespace sdpa { class BlockStruct; class Chordal; class Solutions; class InputData; class Residuals; class WorkVariables; class IO; class Jal; class Lal; class Newton; class ComputeTime; class Parameter; class StepLength; class DirectionParameter; class Switch; class AverageComplementarity; class RatioInitResCurrentRes; class SolveInfo; class Phase; class Vector; class BlockVector; class SparseMatrix; class DenseMatrix; class SparseLinearSpace; class DenseLinearSpace; class Time; // internal class of SDPA class IndexLIJv { public: int l,i,j; double value; IndexLIJv(); ~IndexLIJv(); static bool compare(IndexLIJv* a, IndexLIJv* b); }; }; class SDPA { public: enum PhaseType {noINFO, pFEAS,dFEAS,pdFEAS,pdINF, pFEAS_dINF,pINF_dFEAS,pdOPT,pUNBD,dUNBD}; enum ParameterType {PARAMETER_DEFAULT, PARAMETER_UNSTABLE_BUT_FAST, PARAMETER_STABLE_BUT_SLOW}; enum ConeType {SDP, SOCP, LP}; // SOCP is not implemented in the current version. enum SparseType {AUTO, SPARSE, DENSE}; // when AUTO is set, the type is analyzed by the file extenstion. SDPA(); ~SDPA(); void setParameterType(ParameterType type = PARAMETER_DEFAULT); void setParameterMaxIteration(int maxIteration); void setParameterEpsilonStar (double epsilonStar); void setParameterLambdaStar (double lambdaStar); void setParameterOmegaStar (double omegaStar); void setParameterLowerBound (double lowerBound); void setParameterUpperBound (double upperBound); void setParameterBetaStar (double betaStar); void setParameterBetaBar (double betaBar); void setParameterGammaStar (double gammaStar); void setParameterEpsilonDash (double epsilonDash); void setParameterPrintXVec(char* xPrint); void setParameterPrintXMat(char* XPrint); void setParameterPrintYMat(char* YPrint); void setParameterPrintInformation(char* infPrint); void setDisplay(FILE* Display = stdout); void setResultFile(FILE* fpout = stdout); void setInitPoint(bool isInitPoint); void setNumThreads(int NumThreads=0); ParameterType getParameterType(); int getParameterMaxIteration(); double getParameterEpsilonStar (); double getParameterLambdaStar (); double getParameterOmegaStar (); double getParameterLowerBound (); double getParameterUpperBound (); double getParameterBetaStar (); double getParameterBetaBar (); double getParameterGammaStar (); double getParameterEpsilonDash (); char* getParameterPrintXVec(); char* getParameterPrintXMat(); char* getParameterPrintYMat(); char* getParameterPrintInformation(); FILE* getDisplay(); FILE* getResultFile(); bool getInitPoint(); int getNumThreads(); void inputConstraintNumber(int m); void inputBlockNumber(int nBlock); void inputBlockSize(int l, int size); void inputBlockType(int l, ConeType coneType); void inputCVec(int k, double value); void inputElement(int k, int l, int i, int j, double value, bool inputCheck = false); void inputInitXVec(int k, double value); void inputInitXMat(int l, int i, int j, double value); void inputInitYMat(int l, int i, int j, double value); void initializeUpperTriangleSpace(); void initializeUpperTriangle(bool inputTwiceCheck = false); void initializeSolve(); void resetParameters(); void solve(); double* getResultXVec(); double* getResultXMat(int l); double* getResultYMat(int l); double getPrimalObj(); double getDualObj(); double getPrimalError(); double getDualError(); double getDigits(); int getIteration(); double getMu(); double getDualityGap(); PhaseType getPhaseValue(); void getPhaseString(char* str); double getSolveTime(); int getConstraintNumber(); int getBlockNumber(); int getBlockSize(int l); ConeType getBlockType(int l); void getDimacsError(double* DimacsError); void printDimacsError(double* DimacsError, char* printFormat, FILE* fp = stdout); void printResultXVec(FILE* fp = stdout); void printResultXMat(FILE* fp = stdout); void printResultYMat(FILE* fp = stdout); void printComputationTime(FILE* fp = stdout); void printParameters(FILE* fp = stdout); static void printSDPAVersion(FILE* fp = stdout); void readInput(char* filename, FILE* fpout = NULL, SparseType type = AUTO); void readInit(char* filename, FILE* fpout = NULL, SparseType type = AUTO); void readParameter(char* filename, FILE* fpout = NULL); void writeInputSparse(char* filename, char* printFormat); void writeInitSparse(char* filename, char* printFormat); void terminate(); void copyCurrentToInit(); // setKappa is for only SDPA developers void setKappa(double KAPPA); // // for debugging, private is replaced by public // public: private: double KAPPA; int m; int nBlock; FILE* Display; FILE* fpout; bool isInitPoint; ParameterType typeParameter; int pIteration; sdpa::ComputeTime com; sdpa::Parameter param; sdpa::BlockStruct bs; sdpa::InputData inputData; sdpa::Newton newton; sdpa::Chordal chordal; sdpa::Solutions currentPt; sdpa::WorkVariables work; sdpa::DenseLinearSpace initPt_xMat; sdpa::DenseLinearSpace initPt_zMat; sdpa::Residuals initRes; sdpa::Residuals currentRes; sdpa::StepLength alpha; sdpa::DirectionParameter beta; sdpa::Switch reduction; sdpa::AverageComplementarity mu; sdpa::RatioInitResCurrentRes theta; sdpa::SolveInfo solveInfo; sdpa::Phase phase; // temporary space to store // upper trianguler part non-zeros. vector * NonZeroElements; void printNonZeroElements(FILE* fpout = stdout); void sortNonZeroElements(); void checkNonZeroElements(); void setNonZeroBlockStruct(); void setNonZeroElements(); void writeSparseLinearSpace(FILE* fp, char* printFormat, sdpa::SparseLinearSpace& A, int k); void writeDenseLinearSpace(FILE* fp, char* printFormat, sdpa::DenseLinearSpace& X, int k); }; #endif // __sdpa_call_h__ sdpa-7.3.11/sdpa_call.cpp0000644000175000017500000007553713211530510014536 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*-------------------------------------------------- sdpa_call.cpp --------------------------------------------------*/ #include "sdpa_call.h" #include "sdpa_io.h" #include "sdpa_linear.h" using namespace sdpa; #define LengthOfBuffer 1024 IndexLIJv::IndexLIJv() { // nothing is needed } IndexLIJv::~IndexLIJv() { // nothing is needed } bool IndexLIJv::compare(IndexLIJv* a, IndexLIJv* b) { // if (a < b) return true; // if (a >= b) return false; if ( a[0].l < b[0].l ) { return true; } else if ( a[0].l > b[0].l ) { return false; } if ( a[0].i < b[0].i ) { return true; } else if ( a[0].i > b[0].i ) { return false; } if ( a[0].j < b[0].j ) { return true; } else if ( a[0].j > b[0].j ) { return false; } return false; // a == b } SDPA::SDPA() { KAPPA = 1.5; m = 0; nBlock = 0; fpout = NULL; Display = NULL; isInitPoint = false; typeParameter = PARAMETER_DEFAULT; param.setDefaultParameter(Parameter::PARAMETER_DEFAULT); } SDPA::~SDPA() { terminate(); } void SDPA::setParameterType(ParameterType type) { if (type == PARAMETER_DEFAULT) { param.setDefaultParameter(Parameter::PARAMETER_DEFAULT); } else if (type == PARAMETER_UNSTABLE_BUT_FAST) { param.setDefaultParameter(Parameter::PARAMETER_UNSTABLE_BUT_FAST); } else if (type == PARAMETER_STABLE_BUT_SLOW) { param.setDefaultParameter(Parameter::PARAMETER_STABLE_BUT_SLOW); } typeParameter = type; } void SDPA::setParameterMaxIteration(int maxIteration) { param.maxIteration = maxIteration; } void SDPA::setParameterEpsilonStar (double epsilonStar) { param.epsilonStar = epsilonStar; } void SDPA::setParameterLambdaStar (double lambdaStar) { param.lambdaStar = lambdaStar; } void SDPA::setParameterOmegaStar (double omegaStar) { param.omegaStar = omegaStar; } void SDPA::setParameterLowerBound (double lowerBound) { param.lowerBound = lowerBound; } void SDPA::setParameterUpperBound (double upperBound) { param.upperBound = upperBound; } void SDPA::setParameterBetaStar (double betaStar) { param.betaStar = betaStar; } void SDPA::setParameterBetaBar (double betaBar) { param.betaBar = betaBar; } void SDPA::setParameterGammaStar (double gammaStar) { param.gammaStar = gammaStar; } void SDPA::setParameterEpsilonDash (double epsilonDash) { param.epsilonDash = epsilonDash; } void SDPA::setParameterPrintXVec(char* xPrint) { strncpy(param.xPrint,xPrint,PRINT_DEFAULT_LENGTH); } void SDPA::setParameterPrintXMat(char* XPrint) { strncpy(param.XPrint,XPrint,PRINT_DEFAULT_LENGTH); } void SDPA::setParameterPrintYMat(char* YPrint) { strncpy(param.YPrint,YPrint,PRINT_DEFAULT_LENGTH); } void SDPA::setParameterPrintInformation(char* infPrint) { strncpy(param.infPrint,infPrint,PRINT_DEFAULT_LENGTH); } void SDPA::setDisplay(FILE* Display) { this->Display = Display; } void SDPA::setResultFile(FILE* fpout) { this->fpout = fpout; } void SDPA::setInitPoint(bool isInitPoint) { if (this->isInitPoint == false && isInitPoint == true) { initPt_xMat.initialize(bs); initPt_zMat.initialize(bs); } this->isInitPoint = isInitPoint; if (isInitPoint == false) { mu.initialize(param.lambdaStar); currentPt.initialize(m, bs, param.lambdaStar, com); } } void SDPA::setNumThreads(int NumThreads) { newton.setNumThreads(Display,fpout,NumThreads); } SDPA::ParameterType SDPA::getParameterType() { return typeParameter; } int SDPA::getParameterMaxIteration() { return param.maxIteration; } double SDPA::getParameterEpsilonStar() { return param.epsilonStar; } double SDPA::getParameterLambdaStar() { return param.lambdaStar; } double SDPA::getParameterOmegaStar() { return param.omegaStar; } double SDPA::getParameterLowerBound() { return param.lowerBound; } double SDPA::getParameterUpperBound() { return param.upperBound; } double SDPA::getParameterBetaStar() { return param.betaStar; } double SDPA::getParameterBetaBar() { return param.betaBar; } double SDPA::getParameterGammaStar() { return param.gammaStar; } double SDPA::getParameterEpsilonDash() { return param.epsilonDash; } char* SDPA::getParameterPrintXVec() { return param.xPrint; } char* SDPA::getParameterPrintXMat() { return param.XPrint; } char* SDPA::getParameterPrintYMat() { return param.YPrint; } char* SDPA::getParameterPrintInformation() { return param.infPrint; } FILE* SDPA::getDisplay() { return Display; } FILE* SDPA::getResultFile() { return fpout; } bool SDPA::getInitPoint() { return isInitPoint; } int SDPA::getNumThreads() { return newton.NUM_THREADS; } void SDPA::inputConstraintNumber(int m) { this->m = m; } void SDPA::inputBlockNumber(int nBlock) { this->nBlock = nBlock; bs.initialize(nBlock); } void SDPA::inputBlockSize(int l, int size) { bs.blockStruct[l-1] = size; } void SDPA::inputBlockType(int l, ConeType coneType) { if (coneType == SDPA::SDP) { bs.blockType[l-1] = BlockStruct::btSDP; } if (coneType == SDPA::SOCP) { bs.blockType[l-1] = BlockStruct::btSOCP; } if (coneType == SDPA::LP) { bs.blockType[l-1] = BlockStruct::btLP; } } void SDPA::inputCVec(int k, double value) { if (k > m || k <= 0) { rError("k exceeds ConstraintNumber or " "k is less than or equal to zero :: m= " << m << " : k= " << k); } inputData.b.ele[k-1] = value; } void SDPA::inputElement(int k, int l, int i, int j, double value, bool inputCheck) { if (inputCheck) { if (k > m || k < 0) { rError ("k exceeds ConstraintNumber or " "k is less than zero :: m= " << m << " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } if (l > nBlock || l <= 0) { rError ("l exceeds nBlock or " "l is less than or equal to zero :: nBlock= " << nBlock << " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } int dim = bs.blockStruct[l-1]; if (i > dim || i <= 0) { rError ("i exceeds dimension of the block or " "i is less than or equal to zero :: dim= " << dim << " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } if (j > dim || j <= 0) { rError ("j exceeds dimension of the block or " "j is less than or equal to zero :: dim= " << dim << " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } if (bs.blockType[l-1] == BlockStruct::btSDP) { if (i > j) { rMessage("Swap i and j [Only Upper Triangle]" " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } } if (bs.blockType[l-1] == BlockStruct::btLP) { if (i!=j) { rError("i should be j in LP block" " : k= " << k << " : l= " << l << " : i= " << i << " : j= " << j); } } } if (i > j) { int tmp = i; i = j; j = tmp; } IndexLIJv* indexLIJv; NewArray(indexLIJv,IndexLIJv,1); indexLIJv[0].l = l; indexLIJv[0].i = i; indexLIJv[0].j = j; indexLIJv[0].value = value; NonZeroElements[k].push_back(indexLIJv); } void SDPA::inputInitXVec(int k, double value) { if (k > m || k <= 0) { rError("k exceeds ConstraintNumber or " "k is less than or equal to zero :: m= " << m << " : k= " << k); } // Note reverse primal-dual currentPt.yVec.ele[k-1] = -value; } void SDPA::inputInitXMat(int l, int i, int j, double value) { if (l > nBlock || l <= 0) { rError ("l exceeds nBlock or " "l is less than or equal to zero :: nBlock= " << nBlock << " : l= " << l << " : i= " << i << " : j= " << j); } int dim = bs.blockStruct[l-1]; if (i > dim || i <= 0) { rError ("i exceeds dimension of the block or " "i is less than or equal to zero :: dim= " << dim << " : l= " << l << " : i= " << i << " : j= " << j); } if (j > dim || j <= 0) { rError ("j exceeds dimension of the block or " "j is less than or equal to zero :: dim= " << dim << " : l= " << l << " : i= " << i << " : j= " << j); } if (bs.blockType[l-1] == BlockStruct::btLP) { if (i!=j) { rError("i should be j in LP block" " : l= " << l << " : i= " << i << " : j= " << j); } } if (bs.blockType[l-1] == BlockStruct::btSDP) { int l2 = bs.blockNumber[l-1]; currentPt.zMat.setElement_SDP(l2,i-1,j-1,value); } else if (bs.blockType[l-1] == BlockStruct::btSOCP) { rError("io:: current version does not support SOCP"); int l2 = bs.blockNumber[l-1]; currentPt.zMat.setElement_SOCP(l2,i-1,j-1,value); } else if (bs.blockType[l-1] == BlockStruct::btLP) { currentPt.zMat.setElement_LP(bs.blockNumber[l-1]+i-1,value); } } void SDPA::inputInitYMat(int l, int i, int j, double value) { if (l > nBlock || l <= 0) { rError ("l exceeds nBlock or " "l is less than or equal to zero :: nBlock= " << nBlock << " : l= " << l << " : i= " << i << " : j= " << j); } int dim = bs.blockStruct[l-1]; if (i > dim || i <= 0) { rError ("i exceeds dimension of the block or " "i is less than or equal to zero :: dim= " << dim << " : l= " << l << " : i= " << i << " : j= " << j); } if (j > dim || j <= 0) { rError ("j exceeds dimension of the block or " "j is less than or equal to zero :: dim= " << dim << " : l= " << l << " : i= " << i << " : j= " << j); } if (bs.blockType[l-1] == BlockStruct::btLP) { if (i!=j) { rError("i should be j in LP block" " : l= " << l << " : i= " << i << " : j= " << j); } } if (bs.blockType[l-1] == BlockStruct::btSDP) { int l2 = bs.blockNumber[l-1]; currentPt.xMat.setElement_SDP(l2,i-1,j-1,value); } else if (bs.blockType[l-1] == BlockStruct::btSOCP) { rError("io:: current version does not support SOCP"); int l2 = bs.blockNumber[l-1]; currentPt.xMat.setElement_SOCP(l2,i-1,j-1,value); } else if (bs.blockType[l-1] == BlockStruct::btLP) { currentPt.xMat.setElement_LP(bs.blockNumber[l-1]+i-1,value); } } void SDPA::initializeUpperTriangleSpace() { bs.makeInternalStructure(); NewArray(NonZeroElements,vector,m+1); currentPt.initialize(m, bs, param.lambdaStar, com); inputData.initialize(bs); inputData.initialize_bVec(m); } void SDPA::printNonZeroElements(FILE* fp) { for (int k=0; k<=m; ++k) { int size = NonZeroElements[k].size(); for (int index = 0; index nBlock || l <= 0) { rError ("l exceeds nBlock or " "l is less than or equal to zero :: nBlock= " << nBlock << " : l= " << l); } if (bs.blockType[l-1] == BlockStruct::btSDP) { int l2 = bs.blockNumber[l-1]; return currentPt.zMat.SDP_block[l2].de_ele; } else if (bs.blockType[l-1] == BlockStruct::btSOCP) { rError("io:: current version does not support SOCP"); int l2 = bs.blockNumber[l-1]; return currentPt.zMat.SOCP_block[l2].de_ele; } else if (bs.blockType[l-1] == BlockStruct::btLP) { int start = bs.blockNumber[l-1]; return ¤tPt.zMat.LP_block[start]; } return NULL; } double* SDPA::getResultYMat(int l) { if (l > nBlock || l <= 0) { rError ("l exceeds nBlock or " "l is less than or equal to zero :: nBlock= " << nBlock << " : l= " << l); } if (bs.blockType[l-1] == BlockStruct::btSDP) { int l2 = bs.blockNumber[l-1]; return currentPt.xMat.SDP_block[l2].de_ele; } else if (bs.blockType[l-1] == BlockStruct::btSOCP) { rError("io:: current version does not support SOCP"); int l2 = bs.blockNumber[l-1]; return currentPt.xMat.SOCP_block[l2].de_ele; } else if (bs.blockType[l-1] == BlockStruct::btLP) { int start = bs.blockNumber[l-1]; return ¤tPt.xMat.LP_block[start]; } return NULL; } double SDPA::getPrimalObj() { // Note reverse primal-dual return -solveInfo.objValDual; } double SDPA::getDualObj() { // Note reverse primal-dual return -solveInfo.objValPrimal; } double SDPA::getPrimalError() { // Note reverse primal-dual return currentRes.normDualMat; } double SDPA::getDualError() { // Note reverse primal-dual return currentRes.normPrimalVec; } double SDPA::getDigits() { double mean = (fabs(solveInfo.objValPrimal) + fabs(solveInfo.objValDual)) / 2.0; double PDgap = getDualityGap(); double digits = -log10(fabs(PDgap/mean)); return digits; } int SDPA::getIteration() { return pIteration; } double SDPA::getMu() { return mu.current; } double SDPA::getDualityGap() { double PDgap = fabs(solveInfo.objValPrimal - solveInfo.objValDual); return PDgap; } SDPA::PhaseType SDPA::getPhaseValue() { // Note reverse primal-dual switch (phase.value) { case SolveInfo::noINFO : return noINFO ; break; case SolveInfo::pFEAS : return pFEAS ; break; case SolveInfo::dFEAS : return dFEAS ; break; case SolveInfo::pdFEAS : return pdFEAS ; break; case SolveInfo::pdINF : return pdINF ; break; case SolveInfo::pFEAS_dINF: return pINF_dFEAS; break; case SolveInfo::pINF_dFEAS: return pFEAS_dINF; break; case SolveInfo::pdOPT : return pdOPT ; break; case SolveInfo::pUNBD : return dUNBD ; break; case SolveInfo::dUNBD : return pUNBD ; break; default: break; } return noINFO; } void SDPA::getPhaseString(char* str) { switch (phase.value) { case SolveInfo::noINFO : strcpy(str,(char *)"noINFO "); break; case SolveInfo::pFEAS : strcpy(str,(char *)"pFEAS "); break; case SolveInfo::dFEAS : strcpy(str,(char *)"dFEAS "); break; case SolveInfo::pdFEAS : strcpy(str,(char *)"pdFEAS "); break; case SolveInfo::pdINF : strcpy(str,(char *)"pdINF "); break; case SolveInfo::pFEAS_dINF: strcpy(str,(char *)"pFEAS_dINF"); break; case SolveInfo::pINF_dFEAS: strcpy(str,(char *)"pINF_dFEAS"); break; case SolveInfo::pdOPT : strcpy(str,(char *)"pdOPT "); break; case SolveInfo::pUNBD : strcpy(str,(char *)"pUNBD "); break; case SolveInfo::dUNBD : strcpy(str,(char *)"dUNBD "); break; default: strcpy(str,(char *)"phase error"); break; } return; } double SDPA::getSolveTime() { return com.TotalTime; } int SDPA::getConstraintNumber() { return m; } int SDPA::getBlockNumber() { return nBlock; } int SDPA::getBlockSize(int l) { if (l<=0 || l>nBlock) { rMessage("out of range : getBlockSize " ": l = " << l << " should be between 1 and nBlock " << nBlock); } return bs.blockStruct[l-1]; } SDPA::ConeType SDPA::getBlockType(int l) { if (l<=0 || l>nBlock) { rMessage("out of range : getBlockSize " ": l = " << l << " should be between 1 and nBlock " << nBlock); } switch (bs.blockType[l-1]) { case BlockStruct::btSDP : return SDPA::SDP ; case BlockStruct::btSOCP : return SDPA::SOCP; case BlockStruct::btLP : return SDPA::LP ; } rError("Type Error in getBlockType "); return SDPA::SDP; // dummy return } void SDPA::getDimacsError(double* DimacsError) { IO::computeDimacs(DimacsError, solveInfo, currentRes, currentPt, inputData, work); } void SDPA::printDimacsError(double* DimacsError, char* printFormat, FILE* fpout) { IO::printDimacs(DimacsError,printFormat,fpout); } void SDPA::printResultXVec(FILE* fp) { // Note reverse primal-dual currentPt.yVec.display(fp,1.0,param.xPrint); } void SDPA::printResultXMat(FILE* fp) { // Note reverse primal-dual currentPt.zMat.displaySolution(bs,fp,param.XPrint); } void SDPA::printResultYMat(FILE* fp) { // Note reverse primal-dual currentPt.xMat.displaySolution(bs,fp,param.YPrint); } void SDPA::printComputationTime(FILE* fp) { com.display(fp); } void SDPA::printParameters(FILE* fp) { param.display(fp); } void SDPA::printSDPAVersion(FILE* fp) { if (fp) { fprintf(fp,"%s\n",(char*)sdpa_right); } } void SDPA::readInput(char* filename, FILE* fpout, SparseType type) { if (type == AUTO) { int len = strlen(filename); if (filename[len-1] =='s' && filename[len-2] == '-') { type = SPARSE; } else { type = DENSE; } } bool isDataSparse = true; if (type == DENSE) { isDataSparse = false; } TimeStart(FILE_READ_START1); FILE* fpinput = NULL; if ((fpinput = fopen(filename,"r")) == NULL) { rError("Cannot Open Data File " << filename); } if (fpout){ fprintf(fpout,"data is %s ", filename); if (isDataSparse) { fprintf(fpout," : sparse\n"); } else { fprintf(fpout," : dense\n"); } } char titleAndComment[LengthOfBuffer]; IO::read(fpinput,fpout,m,titleAndComment); IO::read(fpinput,nBlock); bs.initialize(nBlock); IO::read(fpinput,bs); bs.makeInternalStructure(); inputData.initialize(bs); IO::read(fpinput,m,bs,inputData,isDataSparse); // inputData.initialize_index(); fclose(fpinput); currentPt.initialize(m, bs, param.lambdaStar,com); TimeEnd(FILE_READ_END1); com.FileRead += TimeCal(FILE_READ_START1, FILE_READ_END1); com.TotalTime += TimeCal(FILE_READ_START1, FILE_READ_END1); return; } void SDPA::readInit(char* filename, FILE* fpout, SparseType type) { TimeEnd(FILE_READ_START2); if (type == AUTO) { int len = strlen(filename); if (filename[len-1] =='s' && filename[len-2] == '-') { type = SPARSE; } else { type = DENSE; } } bool isInitSparse = true; if (type == DENSE) { isInitSparse = false; } FILE* fpinit = NULL; if ((fpinit = fopen(filename,"r")) == NULL) { rError("Cannot Open Init File " << filename); } if (fpout) { fprintf(fpout,"initial is %s ", filename); if (isInitSparse) { fprintf(fpout," : sparse\n"); } else { fprintf(fpout," : dense\n"); } } IO::read(fpinit,currentPt.xMat,currentPt.yVec,currentPt.zMat, bs, isInitSparse); #if 0 rMessage("intial X = "); currentPt.xMat.display(); rMessage("intial Z = "); currentPt.zMat.display(); #endif fclose(fpinit); TimeEnd(FILE_READ_END2); com.FileRead += TimeCal(FILE_READ_START2, FILE_READ_END2); com.TotalTime += TimeCal(FILE_READ_START2, FILE_READ_END2); return; } void SDPA::readParameter(char* filename, FILE* fpout) { FILE* fp = NULL; if ((fp=fopen(filename,"r"))==NULL) { rError("Cannot Open parameter File " << filename); } if (fpout) { fprintf(fpout,"param is %s \n", filename); } param.readFile(fp); fclose(fp); return; } void SDPA::writeSparseLinearSpace(FILE* fp, char* printFormat, sdpa::SparseLinearSpace& A, int k) { // bs.display(); int SDP_sp_nBlock = A.SDP_sp_nBlock; // int SOCP_sp_nBlock = A.SOCP_sp_nBlock; int LP_sp_nBlock = A.LP_sp_nBlock; int* SDP_sp_index = A.SDP_sp_index; // int* SOCP_sp_index = A.SOCP_sp_index; int* LP_sp_index = A.LP_sp_index; for (int l=0; lKAPPA = KAPPA; } sdpa-7.3.11/example1.ini-s0000644000175000017500000000011213211530510014536 0ustar makotomakoto 0.0, -4.0, 0.0 1 1 1 1 11 1 1 2 2 9 2 1 1 1 5.9 2 1 1 2 -1.375 2 1 2 2 1 sdpa-7.3.11/sdpa_io.cpp0000644000175000017500000006032513211530510014217 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_io.h" #include "sdpa_linear.h" #include "sdpa_jordan.h" #include #include namespace sdpa { void IO::read(FILE* fpData, FILE* fpout, int& m, char* str) { while (true) { volatile int dummy=0; dummy++;//for gcc-3.3 bug fgets(str,lengthOfString,fpData); if (str[0]=='*' || str[0]=='"') { fprintf(fpout,"%s",str); } else { sscanf(str,"%d",&m); break; } } } void IO::read(FILE* fpData, int & nBlock) { fscanf(fpData,"%d",&nBlock); } void IO::read(FILE* fpData, BlockStruct& bs) { for (int l=0; l 0 ) { bs.blockType[l] = BlockStruct::btSDP; } if (bs.blockStruct[l] < 0 ) { bs.blockType[l] = BlockStruct::btLP; } } } void IO::read(FILE* fpData, Vector& b) { for (int k=0; k 0) { // if y[0] locates the first charcter in fpData // then we need the following line yVec.ele[k] = -tmp; // rMessage("yVec.ele[" << k << "] = " << -tmp); k++; } for (; k* SDP_index; NewArray(SDP_index,vector,m+1); vector* SOCP_index; NewArray(SOCP_index,vector,m+1); vector* LP_index; NewArray(LP_index,vector,m+1); // for SDP int SDP_sp_nBlock; int* SDP_sp_index; int* SDP_sp_blockStruct; int* SDP_sp_NonZeroNumber; NewArray(SDP_sp_index,int,bs.SDP_nBlock); NewArray(SDP_sp_blockStruct,int,bs.SDP_nBlock); NewArray(SDP_sp_NonZeroNumber,int,bs.SDP_nBlock); // for SOCP int SOCP_sp_nBlock; int* SOCP_sp_blockStruct; int* SOCP_sp_index; int* SOCP_sp_NonZeroNumber; // for LP int LP_sp_nBlock; int* LP_sp_index; NewArray(LP_sp_index,int,bs.LP_nBlock); if (isDataSparse) { int i,j,k,l; i=j=k=l = -1000; // dummy initialize double value; value = -1000; int lineNumber = 0; while (true) { lineNumber++; if (fscanf(fpData,"%*[^0-9+-]%d",&k)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&l)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&i)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%d",&j)<=0) { break; } if (fscanf(fpData,"%*[^0-9+-]%lf",&value)<=0) { break; } if (bs.blockType[l-1] == BlockStruct::btSDP) { int l2 = bs.blockNumber[l-1]; SDP_index[k].push_back(l2); } else if (bs.blockType[l-1] == BlockStruct::btSOCP) { rError("io:: current version does not support SOCP"); int l2 = bs.blockNumber[l-1];; SOCP_index[k].push_back(l2); } else if (bs.blockType[l-1] == BlockStruct::btLP) { if (i!=j){ printf("******** invalid data line %d, %d, %d, %d, %e ***\n", k,l,i,j,value); printf("Line number [%d] in 5-element-lines is invalid\n", lineNumber); printf("Check your input file\n"); printf("Note: -1000 may appear in the above invalid report line if the corresponding place is not read correctly.\n"); rError("IO::initializeLinearSpace"); } int l2 = bs.blockNumber[l-1]; LP_index[k].push_back(l2+i-1); } else { printf("******** invalid data line %d, %d, %d, %d, %e ***\n", k,l,i,j,value); printf("Line number [%d] in 5-element-lines is invalid\n", lineNumber); printf("Check your input file\n"); printf("Note: -1000 may appear in the above invalid report line if the corresponding place is not read correctly.\n"); rError("io::read not valid blockType"); } }// end of 'while (true)' } else { // isDataSparse == false // constant matrix for (int l=0; l - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, DimacsError[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } void IO::printSolution(BlockStruct& bs, Solutions& currentPt, Parameter& param, FILE* fpout) { if (fpout != NULL) { #if 1 #if REVERSE_PRIMAL_DUAL fprintf(fpout,"xVec = \n"); currentPt.yVec.display(fpout,1.0,param.xPrint); fprintf(fpout,"xMat = \n"); currentPt.zMat.displaySolution(bs,fpout,param.XPrint); fprintf(fpout,"yMat = \n"); currentPt.xMat.displaySolution(bs,fpout,param.YPrint); #else fprintf(fpout,"xMat = \n"); currentPt.xMat.displaySolution(bs,fpout,param.XPrint); fprintf(fpout,"yVec = \n"); currentPt.yVec.display(fpout,1.0,param.xPrint); fprintf(fpout,"zMat = \n"); currentPt.zMat.displaySolution(bs,fpout,param.YPrint); #endif #endif } } } // end of namespace 'sdpa' sdpa-7.3.11/sdpa_newton.h0000644000175000017500000002036613211530510014570 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ #ifndef __sdpa_newton_h__ #define __sdpa_newton_h__ #include "sdpa_chordal.h" #define SparseCholesky 1 #include // for multiple threading #ifdef GOTO_BLAS extern "C" { void goto_set_num_threads(int); }; #endif namespace sdpa { class Newton; class Solutions; class InputData; class Residuals; class WorkVariables; class ComputeTime; class Parameter; class StepLength; class DirectionParameter; class Switch; class RatioInitResCurrentRes; class SolveInfo; class Phase; class AverageComplementarity; class Newton { public: enum bMat_Sp_De {SPARSE, DENSE}; bMat_Sp_De bMat_type; SparseMatrix sparse_bMat; DenseMatrix bMat; // the coefficent of Schur complement Vector gVec; // the right hand side of Schur complement DenseLinearSpace DxMat; Vector DyVec; DenseLinearSpace DzMat; DenseLinearSpace r_zinvMat; DenseLinearSpace x_rd_zinvMat; enum FormulaType {F1,F2,F3}; FormulaType** useFormula; // Caution: // if SDPA doesn't use sparse bMat, following variables are indefinite. // // nBLock : number of block // nConstraint[k]: number of combination of nonzero matrices in k-th block // when A[k].block[i] and A[k].block[j] are nonzero matrices, // i <-> constraint1[k][t] // j <-> constraint2[k][t] // A[k].block[i] <-> A[k].sp_block[blockIndex1[k][t]] // A[k].block[j] <-> A[k].sp_block[blockIndex2[k][t]] // B_{ij} <-> sparse_bMat.sp_ele[location_sparse_bMat[k][t]] int SDP_nBlock; int* SDP_number; int** SDP_constraint1; int** SDP_constraint2; int** SDP_blockIndex1; int** SDP_blockIndex2; int** SDP_location_sparse_bMat; int SOCP_nBlock; int* SOCP_number; int** SOCP_constraint1; int** SOCP_constraint2; int** SOCP_blockIndex1; int** SOCP_blockIndex2; int** SOCP_location_sparse_bMat; int LP_nBlock; int* LP_number; int** LP_constraint1; int** LP_constraint2; int** LP_blockIndex1; int** LP_blockIndex2; int** LP_location_sparse_bMat; // from index of aggrigate sparsity pattern to index of sparse_bMat // B_{ii} <-> sparse_bMat[diagonalIndex[i]] int* diagonalIndex; // B_{ij} for all i is between diagonalIndex[j] and rowStartIndex[j+1] Newton(); Newton(int m, BlockStruct& bs); ~Newton(); void initialize(int m, BlockStruct& bs); void terminate(); void initialize_dense_bMat(int m); // 2008/03/12 kazuhide nakata void initialize_sparse_bMat(int m); // 2008/03/12 kazuhide nakata void initialize_bMat(int m, Chordal& chordal, InputData& inputData, FILE* Display, FILE* fpOut); int binarySearchIndex(int i, int j); void make_aggrigateIndex_SDP(InputData& inputData); void make_aggrigateIndex_SOCP(InputData& inputData); void make_aggrigateIndex_LP(InputData& inputData); void make_aggrigateIndex(InputData& inputData); void computeFormula_SDP(InputData& inputData, double DenseRatio,double Kappa); enum WHICH_DIRECTION {PREDICTOR, CORRECTOR}; void compute_rMat(WHICH_DIRECTION direction, AverageComplementarity& mu, DirectionParameter& beta, Solutions& cuurentPt, WorkVariables& work); void Make_gVec(Newton::WHICH_DIRECTION direction, InputData& inputData, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, DirectionParameter& beta, Phase& phase, WorkVariables& work, ComputeTime& com); void calF1(double& ret, DenseMatrix& G, SparseMatrix& Ai); void calF2(double& ret, DenseMatrix& F, DenseMatrix& G, DenseMatrix& invZ, SparseMatrix& Ai, bool& hasF2Gcal); void calF3(double& ret, DenseMatrix& X, DenseMatrix& invZ, SparseMatrix& Ai, SparseMatrix& Aj); // B_{i,j} = (X A_i Z^{-1}) \bullet A_j void compute_bMat_dense_SDP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_dense_SDP_thread(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); // B_{i,j} = (X A_i Z^{-1}) \bullet A_j void compute_bMat_sparse_SDP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_sparse_SDP_thread(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_dense_SOCP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_sparse_SOCP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_dense_LP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void compute_bMat_sparse_LP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); void Make_bMat(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com); bool compute_DyVec(Newton::WHICH_DIRECTION direction, int m, InputData& inputData, Chordal& chordal, Solutions& currentPt, WorkVariables& work, ComputeTime& com, FILE* Display, FILE* fpOut); void compute_DzMat(InputData& inputData, Residuals& currentRes, Phase& phase, ComputeTime& com); void compute_DxMat(Solutions& currentPt, WorkVariables& work, ComputeTime& com); bool Mehrotra(WHICH_DIRECTION direction, int m, InputData& inputData, Chordal& chordal, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, DirectionParameter& beta, Switch& reduction, Phase& phase, WorkVariables& work, ComputeTime& com, FILE* Display, FILE* fpOut); void display(FILE* fpout=stdout); void display_index(FILE* fpout=stdout); void display_sparse_bMat(FILE* fpout=stdout); static pthread_mutex_t job_mutex; static pthread_cond_t job_cond; static int Column_Number; static bool mutex_flag; static int Calc_F1; static void calF1_thread(double& ret, DenseMatrix& G, SparseMatrix& Aj); static void calF2_thread(double& ret, DenseMatrix& F, DenseMatrix& G, DenseMatrix& X, SparseMatrix& Aj, bool& hasF2Gcal); static void calF3_thread(double& ret, DenseMatrix& X, DenseMatrix& invZ, SparseMatrix& Ai, SparseMatrix& Aj); static void calF3_thread_1x1(double& ret, DenseMatrix& X, DenseMatrix& invZ, SparseMatrix& Ai, SparseMatrix& Aj); static void calF3_thread_2(double& ret, DenseMatrix& X, DenseMatrix& invZ, SparseMatrix& Ai, SparseMatrix& Aj); static void* compute_bMat_dense_SDP_thread_func(void *arg); static void* compute_bMat_sparse_SDP_thread_func(void *arg); int NUM_THREADS; int NUM_GOTOBLAS; void setNumThreads(FILE* Display, FILE* fpOut, int NumThreads=0); }; typedef struct _thread_arg { int Block_Number; int thread_num; int mDIM; int SDP_nBlock; int *SDP_number; int **SDP_constraint1; int **SDP_constraint2; int **SDP_blockIndex1; int **SDP_blockIndex2; int **SDP_location_sparse_bMat; DenseMatrix* bMat; SparseMatrix* sparse_bMat; Newton::FormulaType** useFormula; InputData* inputData; Solutions* currentPt; WorkVariables* work; ComputeTime* com; } thread_arg_t; } // end of namespace 'sdpa' #endif // __sdpa_newton_h__ sdpa-7.3.11/Makefile.in0000644000175000017500000021731113211530513014144 0ustar makotomakoto# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sdpa$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(include_HEADERS) \ $(am__nobase_mumps_HEADERS_DIST) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(datadir)" \ "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(libexampledir)" \ "$(DESTDIR)$(mexdir)" "$(DESTDIR)$(mumpsdir)" \ "$(DESTDIR)$(includedir)" "$(DESTDIR)$(mumpsdir)" LIBRARIES = $(lib_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libsdpa_a_AR = $(AR) $(ARFLAGS) libsdpa_a_LIBADD = am_libsdpa_a_OBJECTS = libsdpa_a-sdpa_block.$(OBJEXT) \ libsdpa_a-sdpa_call.$(OBJEXT) libsdpa_a-sdpa_chordal.$(OBJEXT) \ libsdpa_a-sdpa_dataset.$(OBJEXT) \ libsdpa_a-sdpa_dpotrf.$(OBJEXT) libsdpa_a-sdpa_io.$(OBJEXT) \ libsdpa_a-sdpa_jordan.$(OBJEXT) \ libsdpa_a-sdpa_linear.$(OBJEXT) \ libsdpa_a-sdpa_newton.$(OBJEXT) libsdpa_a-sdpa_parts.$(OBJEXT) \ libsdpa_a-sdpa_solve.$(OBJEXT) libsdpa_a-sdpa_struct.$(OBJEXT) \ libsdpa_a-sdpa_tool.$(OBJEXT) libsdpa_a_OBJECTS = $(am_libsdpa_a_OBJECTS) PROGRAMS = $(bin_PROGRAMS) am_sdpa_OBJECTS = sdpa-sdpa_exe.$(OBJEXT) sdpa_OBJECTS = $(am_sdpa_OBJECTS) am__DEPENDENCIES_1 = sdpa_DEPENDENCIES = ./libsdpa.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) sdpa_LINK = $(CXXLD) $(sdpa_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libsdpa_a_SOURCES) $(sdpa_SOURCES) DIST_SOURCES = $(libsdpa_a_SOURCES) $(sdpa_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) DATA = $(data_DATA) $(example_DATA) $(libexample_DATA) $(mex_DATA) \ $(nobase_mumps_DATA) am__nobase_mumps_HEADERS_DIST = mumps/build/include/dmumps_c.h \ mumps/build/include/dmumps_root.h \ mumps/build/include/dmumps_struc.h \ mumps/build/include/mumps_c_types.h \ mumps/build/include/mumps_compat.h HEADERS = $(include_HEADERS) $(nobase_mumps_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = etc mumps am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README compile config.guess config.sub depcomp \ install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ FCLIBS = @FCLIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LAPACK_LIBS = @LAPACK_LIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MUMPS_DIR = @MUMPS_DIR@ MUMPS_INCLUDE = @MUMPS_INCLUDE@ MUMPS_LIBS = @MUMPS_LIBS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PTHREAD_INCLUDE = @PTHREAD_INCLUDE@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = ${prefix}/share/@PACKAGE_NAME@ datarootdir = @datarootdir@ docdir = ${prefix}/share/@PACKAGE_NAME@/doc dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = ${prefix}/include infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @HAVE_PACKAGE_MUMPS_FALSE@SUBDIRS = etc mumps @HAVE_PACKAGE_MUMPS_TRUE@SUBDIRS = etc etcdir = ${prefix}/share/@PACKAGE_NAME@/etc exampledir = ${prefix}/share/@PACKAGE_NAME@/example libexampledir = ${prefix}/share/@PACKAGE_NAME@/libexample mexdir = ${prefix}/share/@PACKAGE_NAME@/mex man_MANS = sdpa.1 data_DATA = param.sdpa etc/make.inc include_HEADERS = sdpa_algebra.h sdpa_block.h \ sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \ sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \ sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h lib_LIBRARIES = libsdpa.a libsdpa_a_SOURCES = sdpa_block.cpp sdpa_call.cpp sdpa_chordal.cpp \ sdpa_dataset.cpp sdpa_dpotrf.cpp sdpa_io.cpp sdpa_jordan.cpp \ sdpa_linear.cpp sdpa_newton.cpp sdpa_parts.cpp sdpa_solve.cpp \ sdpa_struct.cpp sdpa_tool.cpp \ sdpa_algebra.h sdpa_block.h \ sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \ sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \ sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h libsdpa_a_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE) sdpa_SOURCES = sdpa_exe.cpp sdpa_LDADD = ./libsdpa.a $(MUMPS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PTHREAD_LIBS) $(FCLIBS) sdpa_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE) @HAVE_PACKAGE_MUMPS_FALSE@mumpsdir = ${prefix}/share/@PACKAGE_NAME@ @HAVE_PACKAGE_MUMPS_FALSE@nobase_mumps_HEADERS = mumps/build/include/dmumps_c.h \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/include/dmumps_root.h \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/include/dmumps_struc.h \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/include/mumps_c_types.h \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/include/mumps_compat.h @HAVE_PACKAGE_MUMPS_FALSE@nobase_mumps_DATA = mumps/build/lib/libdmumps.a \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/lib/libmumps_common.a \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/lib/libpord.a \ @HAVE_PACKAGE_MUMPS_FALSE@mumps/build/libseq/libmpiseq.a example_DATA = example1.dat-s example1.dat example1.ini \ example1.ini-s example2.dat libexample_DATA = libexample/Makefile \ libexample/example1.cpp libexample/example2.cpp \ libexample/example3.cpp libexample/example4.cpp \ libexample/example5.cpp libexample/example6.cpp mex_DATA = mex/Makefile mex/SDPAToSedumi.m mex/SedumiToSDPA.m \ mex/gensdpafile.m mex/initial_point.m mex/mexAggSDPcones.cpp \ mex/mexDisAggSDPsol.cpp mex/mexFprintf.c mex/mexReadOutput.cpp \ mex/mexReadSDPAToSedumi.cpp mex/mexSedumiWrap.cpp \ mex/mexWriteSedumiToSDPA.cpp mex/mexsdpa.cpp mex/param.m \ mex/read_data.m mex/read_output.m mex/read_outputSedumi.m \ mex/sdpam.m mex/sedumiwrap.m \ mex/CommandList.txt MOSTLYCLEANFILES = mex/*.mex* mex/*.o all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-libLIBRARIES: $(lib_LIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \ $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; } @$(POST_INSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ if test -f $$p; then \ $(am__strip_dir) \ echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \ ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \ else :; fi; \ done uninstall-libLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir) clean-libLIBRARIES: -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) libsdpa.a: $(libsdpa_a_OBJECTS) $(libsdpa_a_DEPENDENCIES) $(EXTRA_libsdpa_a_DEPENDENCIES) $(AM_V_at)-rm -f libsdpa.a $(AM_V_AR)$(libsdpa_a_AR) libsdpa.a $(libsdpa_a_OBJECTS) $(libsdpa_a_LIBADD) $(AM_V_at)$(RANLIB) libsdpa.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) sdpa$(EXEEXT): $(sdpa_OBJECTS) $(sdpa_DEPENDENCIES) $(EXTRA_sdpa_DEPENDENCIES) @rm -f sdpa$(EXEEXT) $(AM_V_CXXLD)$(sdpa_LINK) $(sdpa_OBJECTS) $(sdpa_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_block.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_call.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_chordal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_dataset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_dpotrf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_jordan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_linear.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_newton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_parts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_solve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_struct.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsdpa_a-sdpa_tool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdpa-sdpa_exe.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libsdpa_a-sdpa_block.o: sdpa_block.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_block.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_block.Tpo -c -o libsdpa_a-sdpa_block.o `test -f 'sdpa_block.cpp' || echo '$(srcdir)/'`sdpa_block.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_block.Tpo $(DEPDIR)/libsdpa_a-sdpa_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_block.cpp' object='libsdpa_a-sdpa_block.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_block.o `test -f 'sdpa_block.cpp' || echo '$(srcdir)/'`sdpa_block.cpp libsdpa_a-sdpa_block.obj: sdpa_block.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_block.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_block.Tpo -c -o libsdpa_a-sdpa_block.obj `if test -f 'sdpa_block.cpp'; then $(CYGPATH_W) 'sdpa_block.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_block.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_block.Tpo $(DEPDIR)/libsdpa_a-sdpa_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_block.cpp' object='libsdpa_a-sdpa_block.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_block.obj `if test -f 'sdpa_block.cpp'; then $(CYGPATH_W) 'sdpa_block.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_block.cpp'; fi` libsdpa_a-sdpa_call.o: sdpa_call.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_call.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_call.Tpo -c -o libsdpa_a-sdpa_call.o `test -f 'sdpa_call.cpp' || echo '$(srcdir)/'`sdpa_call.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_call.Tpo $(DEPDIR)/libsdpa_a-sdpa_call.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_call.cpp' object='libsdpa_a-sdpa_call.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_call.o `test -f 'sdpa_call.cpp' || echo '$(srcdir)/'`sdpa_call.cpp libsdpa_a-sdpa_call.obj: sdpa_call.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_call.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_call.Tpo -c -o libsdpa_a-sdpa_call.obj `if test -f 'sdpa_call.cpp'; then $(CYGPATH_W) 'sdpa_call.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_call.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_call.Tpo $(DEPDIR)/libsdpa_a-sdpa_call.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_call.cpp' object='libsdpa_a-sdpa_call.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_call.obj `if test -f 'sdpa_call.cpp'; then $(CYGPATH_W) 'sdpa_call.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_call.cpp'; fi` libsdpa_a-sdpa_chordal.o: sdpa_chordal.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_chordal.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_chordal.Tpo -c -o libsdpa_a-sdpa_chordal.o `test -f 'sdpa_chordal.cpp' || echo '$(srcdir)/'`sdpa_chordal.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_chordal.Tpo $(DEPDIR)/libsdpa_a-sdpa_chordal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_chordal.cpp' object='libsdpa_a-sdpa_chordal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_chordal.o `test -f 'sdpa_chordal.cpp' || echo '$(srcdir)/'`sdpa_chordal.cpp libsdpa_a-sdpa_chordal.obj: sdpa_chordal.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_chordal.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_chordal.Tpo -c -o libsdpa_a-sdpa_chordal.obj `if test -f 'sdpa_chordal.cpp'; then $(CYGPATH_W) 'sdpa_chordal.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_chordal.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_chordal.Tpo $(DEPDIR)/libsdpa_a-sdpa_chordal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_chordal.cpp' object='libsdpa_a-sdpa_chordal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_chordal.obj `if test -f 'sdpa_chordal.cpp'; then $(CYGPATH_W) 'sdpa_chordal.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_chordal.cpp'; fi` libsdpa_a-sdpa_dataset.o: sdpa_dataset.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_dataset.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_dataset.Tpo -c -o libsdpa_a-sdpa_dataset.o `test -f 'sdpa_dataset.cpp' || echo '$(srcdir)/'`sdpa_dataset.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_dataset.Tpo $(DEPDIR)/libsdpa_a-sdpa_dataset.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_dataset.cpp' object='libsdpa_a-sdpa_dataset.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_dataset.o `test -f 'sdpa_dataset.cpp' || echo '$(srcdir)/'`sdpa_dataset.cpp libsdpa_a-sdpa_dataset.obj: sdpa_dataset.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_dataset.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_dataset.Tpo -c -o libsdpa_a-sdpa_dataset.obj `if test -f 'sdpa_dataset.cpp'; then $(CYGPATH_W) 'sdpa_dataset.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_dataset.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_dataset.Tpo $(DEPDIR)/libsdpa_a-sdpa_dataset.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_dataset.cpp' object='libsdpa_a-sdpa_dataset.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_dataset.obj `if test -f 'sdpa_dataset.cpp'; then $(CYGPATH_W) 'sdpa_dataset.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_dataset.cpp'; fi` libsdpa_a-sdpa_dpotrf.o: sdpa_dpotrf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_dpotrf.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Tpo -c -o libsdpa_a-sdpa_dpotrf.o `test -f 'sdpa_dpotrf.cpp' || echo '$(srcdir)/'`sdpa_dpotrf.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Tpo $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_dpotrf.cpp' object='libsdpa_a-sdpa_dpotrf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_dpotrf.o `test -f 'sdpa_dpotrf.cpp' || echo '$(srcdir)/'`sdpa_dpotrf.cpp libsdpa_a-sdpa_dpotrf.obj: sdpa_dpotrf.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_dpotrf.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Tpo -c -o libsdpa_a-sdpa_dpotrf.obj `if test -f 'sdpa_dpotrf.cpp'; then $(CYGPATH_W) 'sdpa_dpotrf.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_dpotrf.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Tpo $(DEPDIR)/libsdpa_a-sdpa_dpotrf.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_dpotrf.cpp' object='libsdpa_a-sdpa_dpotrf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_dpotrf.obj `if test -f 'sdpa_dpotrf.cpp'; then $(CYGPATH_W) 'sdpa_dpotrf.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_dpotrf.cpp'; fi` libsdpa_a-sdpa_io.o: sdpa_io.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_io.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_io.Tpo -c -o libsdpa_a-sdpa_io.o `test -f 'sdpa_io.cpp' || echo '$(srcdir)/'`sdpa_io.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_io.Tpo $(DEPDIR)/libsdpa_a-sdpa_io.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_io.cpp' object='libsdpa_a-sdpa_io.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_io.o `test -f 'sdpa_io.cpp' || echo '$(srcdir)/'`sdpa_io.cpp libsdpa_a-sdpa_io.obj: sdpa_io.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_io.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_io.Tpo -c -o libsdpa_a-sdpa_io.obj `if test -f 'sdpa_io.cpp'; then $(CYGPATH_W) 'sdpa_io.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_io.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_io.Tpo $(DEPDIR)/libsdpa_a-sdpa_io.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_io.cpp' object='libsdpa_a-sdpa_io.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_io.obj `if test -f 'sdpa_io.cpp'; then $(CYGPATH_W) 'sdpa_io.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_io.cpp'; fi` libsdpa_a-sdpa_jordan.o: sdpa_jordan.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_jordan.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_jordan.Tpo -c -o libsdpa_a-sdpa_jordan.o `test -f 'sdpa_jordan.cpp' || echo '$(srcdir)/'`sdpa_jordan.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_jordan.Tpo $(DEPDIR)/libsdpa_a-sdpa_jordan.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_jordan.cpp' object='libsdpa_a-sdpa_jordan.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_jordan.o `test -f 'sdpa_jordan.cpp' || echo '$(srcdir)/'`sdpa_jordan.cpp libsdpa_a-sdpa_jordan.obj: sdpa_jordan.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_jordan.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_jordan.Tpo -c -o libsdpa_a-sdpa_jordan.obj `if test -f 'sdpa_jordan.cpp'; then $(CYGPATH_W) 'sdpa_jordan.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_jordan.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_jordan.Tpo $(DEPDIR)/libsdpa_a-sdpa_jordan.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_jordan.cpp' object='libsdpa_a-sdpa_jordan.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_jordan.obj `if test -f 'sdpa_jordan.cpp'; then $(CYGPATH_W) 'sdpa_jordan.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_jordan.cpp'; fi` libsdpa_a-sdpa_linear.o: sdpa_linear.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_linear.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_linear.Tpo -c -o libsdpa_a-sdpa_linear.o `test -f 'sdpa_linear.cpp' || echo '$(srcdir)/'`sdpa_linear.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_linear.Tpo $(DEPDIR)/libsdpa_a-sdpa_linear.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_linear.cpp' object='libsdpa_a-sdpa_linear.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_linear.o `test -f 'sdpa_linear.cpp' || echo '$(srcdir)/'`sdpa_linear.cpp libsdpa_a-sdpa_linear.obj: sdpa_linear.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_linear.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_linear.Tpo -c -o libsdpa_a-sdpa_linear.obj `if test -f 'sdpa_linear.cpp'; then $(CYGPATH_W) 'sdpa_linear.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_linear.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_linear.Tpo $(DEPDIR)/libsdpa_a-sdpa_linear.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_linear.cpp' object='libsdpa_a-sdpa_linear.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_linear.obj `if test -f 'sdpa_linear.cpp'; then $(CYGPATH_W) 'sdpa_linear.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_linear.cpp'; fi` libsdpa_a-sdpa_newton.o: sdpa_newton.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_newton.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_newton.Tpo -c -o libsdpa_a-sdpa_newton.o `test -f 'sdpa_newton.cpp' || echo '$(srcdir)/'`sdpa_newton.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_newton.Tpo $(DEPDIR)/libsdpa_a-sdpa_newton.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_newton.cpp' object='libsdpa_a-sdpa_newton.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_newton.o `test -f 'sdpa_newton.cpp' || echo '$(srcdir)/'`sdpa_newton.cpp libsdpa_a-sdpa_newton.obj: sdpa_newton.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_newton.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_newton.Tpo -c -o libsdpa_a-sdpa_newton.obj `if test -f 'sdpa_newton.cpp'; then $(CYGPATH_W) 'sdpa_newton.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_newton.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_newton.Tpo $(DEPDIR)/libsdpa_a-sdpa_newton.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_newton.cpp' object='libsdpa_a-sdpa_newton.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_newton.obj `if test -f 'sdpa_newton.cpp'; then $(CYGPATH_W) 'sdpa_newton.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_newton.cpp'; fi` libsdpa_a-sdpa_parts.o: sdpa_parts.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_parts.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_parts.Tpo -c -o libsdpa_a-sdpa_parts.o `test -f 'sdpa_parts.cpp' || echo '$(srcdir)/'`sdpa_parts.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_parts.Tpo $(DEPDIR)/libsdpa_a-sdpa_parts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_parts.cpp' object='libsdpa_a-sdpa_parts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_parts.o `test -f 'sdpa_parts.cpp' || echo '$(srcdir)/'`sdpa_parts.cpp libsdpa_a-sdpa_parts.obj: sdpa_parts.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_parts.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_parts.Tpo -c -o libsdpa_a-sdpa_parts.obj `if test -f 'sdpa_parts.cpp'; then $(CYGPATH_W) 'sdpa_parts.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_parts.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_parts.Tpo $(DEPDIR)/libsdpa_a-sdpa_parts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_parts.cpp' object='libsdpa_a-sdpa_parts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_parts.obj `if test -f 'sdpa_parts.cpp'; then $(CYGPATH_W) 'sdpa_parts.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_parts.cpp'; fi` libsdpa_a-sdpa_solve.o: sdpa_solve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_solve.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_solve.Tpo -c -o libsdpa_a-sdpa_solve.o `test -f 'sdpa_solve.cpp' || echo '$(srcdir)/'`sdpa_solve.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_solve.Tpo $(DEPDIR)/libsdpa_a-sdpa_solve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_solve.cpp' object='libsdpa_a-sdpa_solve.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_solve.o `test -f 'sdpa_solve.cpp' || echo '$(srcdir)/'`sdpa_solve.cpp libsdpa_a-sdpa_solve.obj: sdpa_solve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_solve.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_solve.Tpo -c -o libsdpa_a-sdpa_solve.obj `if test -f 'sdpa_solve.cpp'; then $(CYGPATH_W) 'sdpa_solve.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_solve.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_solve.Tpo $(DEPDIR)/libsdpa_a-sdpa_solve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_solve.cpp' object='libsdpa_a-sdpa_solve.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_solve.obj `if test -f 'sdpa_solve.cpp'; then $(CYGPATH_W) 'sdpa_solve.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_solve.cpp'; fi` libsdpa_a-sdpa_struct.o: sdpa_struct.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_struct.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_struct.Tpo -c -o libsdpa_a-sdpa_struct.o `test -f 'sdpa_struct.cpp' || echo '$(srcdir)/'`sdpa_struct.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_struct.Tpo $(DEPDIR)/libsdpa_a-sdpa_struct.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_struct.cpp' object='libsdpa_a-sdpa_struct.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_struct.o `test -f 'sdpa_struct.cpp' || echo '$(srcdir)/'`sdpa_struct.cpp libsdpa_a-sdpa_struct.obj: sdpa_struct.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_struct.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_struct.Tpo -c -o libsdpa_a-sdpa_struct.obj `if test -f 'sdpa_struct.cpp'; then $(CYGPATH_W) 'sdpa_struct.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_struct.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_struct.Tpo $(DEPDIR)/libsdpa_a-sdpa_struct.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_struct.cpp' object='libsdpa_a-sdpa_struct.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_struct.obj `if test -f 'sdpa_struct.cpp'; then $(CYGPATH_W) 'sdpa_struct.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_struct.cpp'; fi` libsdpa_a-sdpa_tool.o: sdpa_tool.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_tool.o -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_tool.Tpo -c -o libsdpa_a-sdpa_tool.o `test -f 'sdpa_tool.cpp' || echo '$(srcdir)/'`sdpa_tool.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_tool.Tpo $(DEPDIR)/libsdpa_a-sdpa_tool.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_tool.cpp' object='libsdpa_a-sdpa_tool.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_tool.o `test -f 'sdpa_tool.cpp' || echo '$(srcdir)/'`sdpa_tool.cpp libsdpa_a-sdpa_tool.obj: sdpa_tool.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -MT libsdpa_a-sdpa_tool.obj -MD -MP -MF $(DEPDIR)/libsdpa_a-sdpa_tool.Tpo -c -o libsdpa_a-sdpa_tool.obj `if test -f 'sdpa_tool.cpp'; then $(CYGPATH_W) 'sdpa_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_tool.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsdpa_a-sdpa_tool.Tpo $(DEPDIR)/libsdpa_a-sdpa_tool.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_tool.cpp' object='libsdpa_a-sdpa_tool.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsdpa_a_CXXFLAGS) $(CXXFLAGS) -c -o libsdpa_a-sdpa_tool.obj `if test -f 'sdpa_tool.cpp'; then $(CYGPATH_W) 'sdpa_tool.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_tool.cpp'; fi` sdpa-sdpa_exe.o: sdpa_exe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sdpa_CXXFLAGS) $(CXXFLAGS) -MT sdpa-sdpa_exe.o -MD -MP -MF $(DEPDIR)/sdpa-sdpa_exe.Tpo -c -o sdpa-sdpa_exe.o `test -f 'sdpa_exe.cpp' || echo '$(srcdir)/'`sdpa_exe.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sdpa-sdpa_exe.Tpo $(DEPDIR)/sdpa-sdpa_exe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_exe.cpp' object='sdpa-sdpa_exe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sdpa_CXXFLAGS) $(CXXFLAGS) -c -o sdpa-sdpa_exe.o `test -f 'sdpa_exe.cpp' || echo '$(srcdir)/'`sdpa_exe.cpp sdpa-sdpa_exe.obj: sdpa_exe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sdpa_CXXFLAGS) $(CXXFLAGS) -MT sdpa-sdpa_exe.obj -MD -MP -MF $(DEPDIR)/sdpa-sdpa_exe.Tpo -c -o sdpa-sdpa_exe.obj `if test -f 'sdpa_exe.cpp'; then $(CYGPATH_W) 'sdpa_exe.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_exe.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/sdpa-sdpa_exe.Tpo $(DEPDIR)/sdpa-sdpa_exe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='sdpa_exe.cpp' object='sdpa-sdpa_exe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sdpa_CXXFLAGS) $(CXXFLAGS) -c -o sdpa-sdpa_exe.obj `if test -f 'sdpa_exe.cpp'; then $(CYGPATH_W) 'sdpa_exe.cpp'; else $(CYGPATH_W) '$(srcdir)/sdpa_exe.cpp'; fi` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-dataDATA: $(data_DATA) @$(NORMAL_INSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \ done uninstall-dataDATA: @$(NORMAL_UNINSTALL) @list='$(data_DATA)'; test -n "$(datadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) install-exampleDATA: $(example_DATA) @$(NORMAL_INSTALL) @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(exampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(exampledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \ done uninstall-exampleDATA: @$(NORMAL_UNINSTALL) @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(exampledir)'; $(am__uninstall_files_from_dir) install-libexampleDATA: $(libexample_DATA) @$(NORMAL_INSTALL) @list='$(libexample_DATA)'; test -n "$(libexampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexampledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libexampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(libexampledir)" || exit $$?; \ done uninstall-libexampleDATA: @$(NORMAL_UNINSTALL) @list='$(libexample_DATA)'; test -n "$(libexampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libexampledir)'; $(am__uninstall_files_from_dir) install-mexDATA: $(mex_DATA) @$(NORMAL_INSTALL) @list='$(mex_DATA)'; test -n "$(mexdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(mexdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(mexdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(mexdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(mexdir)" || exit $$?; \ done uninstall-mexDATA: @$(NORMAL_UNINSTALL) @list='$(mex_DATA)'; test -n "$(mexdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(mexdir)'; $(am__uninstall_files_from_dir) install-nobase_mumpsDATA: $(nobase_mumps_DATA) @$(NORMAL_INSTALL) @list='$(nobase_mumps_DATA)'; test -n "$(mumpsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(mumpsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(mumpsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(mumpsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(mumpsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(mumpsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(mumpsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_mumpsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_mumps_DATA)'; test -n "$(mumpsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(mumpsdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nobase_mumpsHEADERS: $(nobase_mumps_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_mumps_HEADERS)'; test -n "$(mumpsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(mumpsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(mumpsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(mumpsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(mumpsdir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(mumpsdir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(mumpsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_mumpsHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_mumps_HEADERS)'; test -n "$(mumpsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(mumpsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(datadir)" "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(libexampledir)" "$(DESTDIR)$(mexdir)" "$(DESTDIR)$(mumpsdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(mumpsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dataDATA install-exampleDATA \ install-includeHEADERS install-libexampleDATA install-man \ install-mexDATA install-nobase_mumpsDATA \ install-nobase_mumpsHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-libLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA \ uninstall-exampleDATA uninstall-includeHEADERS \ uninstall-libLIBRARIES uninstall-libexampleDATA uninstall-man \ uninstall-mexDATA uninstall-nobase_mumpsDATA \ uninstall-nobase_mumpsHEADERS uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-binPROGRAMS \ clean-cscope clean-generic clean-libLIBRARIES cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dataDATA install-dvi install-dvi-am \ install-exampleDATA install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLIBRARIES install-libexampleDATA \ install-man install-man1 install-mexDATA \ install-nobase_mumpsDATA install-nobase_mumpsHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dataDATA uninstall-exampleDATA \ uninstall-includeHEADERS uninstall-libLIBRARIES \ uninstall-libexampleDATA uninstall-man uninstall-man1 \ uninstall-mexDATA uninstall-nobase_mumpsDATA \ uninstall-nobase_mumpsHEADERS .PRECIOUS: Makefile # each file of mumps is copied by 'nobase' option # due to sub-directory @HAVE_PACKAGE_MUMPS_TRUE@ # nothing to install # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: sdpa-7.3.11/sdpa.10000644000175000017500000000712013211530510013100 0ustar makotomakoto.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH SDPA 1 "July 28, 2011" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME SDPA \- High-performance software package for SemiDefinite Programs .SH SYNOPSIS .br .B sdpa .RB DataFile .RB OutputFile .RB [ \| InitialPtFile \| ] .RB [ \| \-pt .IR parameters \| ] .RB [ \| \-dimacs \| ] .RB [ \| \-numThreads .IR \ numThreads \|] .br .B sdpa .RI [ options ] " files" ... .br .B sdpa .RI --version .SH DESCRIPTION .B sdpa \- "SDPA (SemiDefinite Programming Algorithm)" is one of the most efficient and stable software packages for solving SDPs based on the primal-dual interior-point method. SDP (SemiDefinite Program) is used for financial engineering, machine learning, control theory, sensor network problem, quantum chemistry, quantum information, combinatorial optimizaiton, polynomial optimization, and so on. Further information on SDP and SDPA can be found at .br .B http://sdpa.sourceforge.net/ .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. .SH OPTIONS .B \-\-\-\- option type 1 \-\-\-\- .br .B sdpa DataFile OutputFile [InitialPtFile] [\-pt parameters] [\-dimacs] [\-numThreads numThreads] .br parameters = 0 default, 1 fast (unstable), 2 slow (stable) .br example1\-1: sdpa example1.dat example1.result .br example1\-2: sdpa example1.dat-s example1.result .br example1\-3: sdpa example1.dat example1.result example1.ini .br example1\-4: sdpa example1.dat example1.result \-pt 2 .br example1\-5: sdpa example1.dat example1.result \-dimacs .br example1\-6: sdpa example1.dat example1.result \-numThreads 4 .br .B \-\-\-\- option type 2 \-\-\-\- .br .B sdpa [option filename]+ .br \-dd : data dense :: \-ds : data sparse .br \-id : init dense :: \-is : init sparse .br \-o : output :: \-p : parameter .br \-pt : parameters , 0 default, 1 fast (unstable) .br 2 slow (stable) .br example2\-1: sdpa \-o example1.result \-dd example1.dat .br example2\-2: sdpa \-ds example1.dat\-s \-o example1.result \-p param.sdpa .br example2\-3: sdpa \-ds example1.dat\-s \-o example1.result \-pt 2 .br example2\-4: sdpa \-ds example1.dat-s \-o example1.result \-dimacs .br example2\-5: sdpa \-ds example1.dat-s \-o example1.result \-numThreads 4 .br .br .B \-\-\-\- option type 3 \-\-\-\- .br .B sdpa \-\-version .br .B to print out version and exit. .br .TP .B PARAMETER_FILE is decided by the following priority 1: The file assigned by '\-p' option of 'option type 2'. For 'option type1', this is skipped. 2: ./param.sdpa For 'option type2', this is skipped. 3: /usr/share/sdpa/param.sdpa 4: Default parameter .TP .B \-dimacs printout dimacs information incurring additional computation cost .TP .B \-numThreads number of pthreads for internal computation .br .SH AUTHOR SDPA was written by SDPA Project . .PP This manual page was written by Makoto Yamashita . sdpa-7.3.11/sdpa_newton.cpp0000644000175000017500000016566413211530510015136 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 #include "sdpa_newton.h" #include "sdpa_parts.h" #include "sdpa_jordan.h" #include "sdpa_linear.h" #include "sdpa_algebra.h" namespace sdpa { pthread_mutex_t Newton::job_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t Newton::job_cond = PTHREAD_COND_INITIALIZER; int Newton::Column_Number = 0; bool Newton::mutex_flag = false; int Newton::Calc_F1 = 0; Newton::Newton() { useFormula = NULL; bMat_type = DENSE; // Caution: if SDPA doesn't use sparse bMat, // following variables are indefinite. this->SDP_nBlock = -1; SDP_number = NULL; SDP_location_sparse_bMat = NULL; SDP_constraint1 = NULL; SDP_constraint2 = NULL; SDP_blockIndex1 = NULL; SDP_blockIndex2 = NULL; this->SOCP_nBlock = -1; SOCP_number = NULL; SOCP_location_sparse_bMat = NULL; SOCP_constraint1 = NULL; SOCP_constraint2 = NULL; SOCP_blockIndex1 = NULL; SOCP_blockIndex2 = NULL; this->LP_nBlock = -1; LP_number = NULL; LP_location_sparse_bMat = NULL; LP_constraint1 = NULL; LP_constraint2 = NULL; LP_blockIndex1 = NULL; LP_blockIndex2 = NULL; diagonalIndex = NULL; NUM_THREADS = 1; NUM_GOTOBLAS = 1; } Newton::Newton(int m, BlockStruct& bs) { initialize(m, bs); } Newton::~Newton() { terminate(); } void Newton::initialize(int m, BlockStruct& bs) { gVec.initialize(m); SDP_nBlock = bs.SDP_nBlock; SOCP_nBlock = bs.SOCP_nBlock; LP_nBlock = bs.LP_nBlock; DxMat.initialize(bs); DyVec.initialize(m); DzMat.initialize(bs); r_zinvMat.initialize(bs); x_rd_zinvMat.initialize(bs); // Memory allocation of useFormula is moved to computeFormula_SDP // NewArray(useFormula,FormulaType,m*SDP_nBlock); bMat_type = DENSE; // Caution: if SDPA doesn't use sparse bMat, // following variables are indefinite. this->SDP_nBlock = -1; SDP_number = NULL; SDP_location_sparse_bMat = NULL; SDP_constraint1 = NULL; SDP_constraint2 = NULL; SDP_blockIndex1 = NULL; SDP_blockIndex2 = NULL; this->SOCP_nBlock = -1; SOCP_number = NULL; SOCP_location_sparse_bMat = NULL; SOCP_constraint1 = NULL; SOCP_constraint2 = NULL; SOCP_blockIndex1 = NULL; SOCP_blockIndex2 = NULL; this->LP_nBlock = -1; LP_number = NULL; LP_location_sparse_bMat = NULL; LP_constraint1 = NULL; LP_constraint2 = NULL; LP_blockIndex1 = NULL; LP_blockIndex2 = NULL; diagonalIndex = NULL; } void Newton::terminate() { if (bMat_type == SPARSE){ if (SDP_location_sparse_bMat && SDP_constraint1 && SDP_constraint2 && SDP_blockIndex1 && SDP_blockIndex2) { for (int l=0; l 1){ if (sparse_bMat.row_index[target] < ii+1){ begin = target; target = (begin + end) / 2; } else if (sparse_bMat.row_index[target] > ii+1){ end = target; target = (begin + end) / 2; } else if (sparse_bMat.row_index[target] == ii+1) { t = target; break; } } if (t == -1){ if (sparse_bMat.row_index[begin] == ii+1){ t = begin; } else if (sparse_bMat.row_index[end] == ii+1){ t = end; } else { #if 0 int m = sparse_bMat.nRow; rMessage("Trouble ii = " << ii << " jj = " << j << " m = " << m); for (int k = 0; kj ) { up += inz; } #endif } upNonZeroCount[j][jb] = up; // rMessage("up = " << up); } } // Determine which formula double ff=0, ff1=0, ff2=0, ff3=0; Calc_F1 = 0; for (int l=0; l= jnz)) { //rMessage("line " << k << " is F3:1"); useFormula[j][jb] = F3; countf3++; ff += f3; } else { //rMessage("line " << k << " is F1"); useFormula[j][jb] = F1; countf1++; ff += f1; } } else if (f2 1) { goto_set_num_threads(-1); } #endif } void* Newton::compute_bMat_dense_SDP_thread_func(void *arg) { int l, m; int k1; DenseMatrix work1, work2; thread_arg_t *targ = (thread_arg_t *)arg; l = targ->Block_Number; m = targ->mDIM; // int SDP_nBlock; // SDP_nBlock = targ->SDP_nBlock; // printf("targ-> Block_Number = %d\n", targ-> Block_Number); // DenseMatrix& xMat = targ->currentPt->xMat.SDP_block[l]; // DenseMatrix& invzMat = targ->currentPt->invzMat.SDP_block[l]; work1.initialize(targ->work->DLS1.SDP_block[l].nRow, targ->work->DLS1.SDP_block[l].nCol, DenseMatrix::DENSE); work2.initialize(targ->work->DLS2.SDP_block[l].nRow, targ->work->DLS2.SDP_block[l].nCol, DenseMatrix::DENSE); while(1) { pthread_mutex_lock(&job_mutex); k1 = Column_Number++; pthread_mutex_unlock(&job_mutex); if (k1 >= targ->inputData->SDP_nConstraint[l]) break; int j = targ->inputData->SDP_constraint[l][k1]; int jb = targ->inputData->SDP_blockIndex[l][k1]; int jnz = targ->inputData->A[j].SDP_sp_block[jb].NonZeroEffect; SparseMatrix& Aj = targ->inputData->A[j].SDP_sp_block[jb]; FormulaType formula = targ->useFormula[j][jb]; TimeStart(B_NDIAG_START1); TimeStart(B_NDIAG_START2); bool hasF2Gcal = false; #if 0 printf("thread_num = %d, mutex_flag = %d\n", targ->thread_num, mutex_flag); #endif if (formula==F1) { pthread_mutex_lock(&job_mutex); Lal::let(work1,'=',targ->currentPt->xMat.SDP_block[l],'*',Aj); Lal::let(work2,'=',work1,'*',targ->currentPt->invzMat.SDP_block[l]); pthread_mutex_unlock(&job_mutex); } else if (formula==F2) { pthread_mutex_lock(&job_mutex); // Lal::let(work1,'=',Ai,'*',targ->currentPt->invzMat.SDP_block[l]); Lal::let(work1,'=',targ->currentPt->xMat.SDP_block[l],'*',Aj); pthread_mutex_unlock(&job_mutex); hasF2Gcal = false; } TimeEnd(B_NDIAG_END2); targ->com->B_PRE += TimeCal(B_NDIAG_START2,B_NDIAG_END2); for (int k2=targ->inputData->SDP_nConstraint[l]-1; k2 >= 0; k2--) { int i = targ->inputData->SDP_constraint[l][k2]; int ib = targ->inputData->SDP_blockIndex[l][k2]; int inz = targ->inputData->A[i].SDP_sp_block[ib].NonZeroEffect; SparseMatrix& Ai = targ->inputData->A[i].SDP_sp_block[ib]; if ((jnz < inz) || ( (inz == jnz) && (ithread_num); #endif if ((Ai.NonZeroCount == 1) && (Aj.NonZeroCount == 1)) calF3_thread_1x1(value, targ->currentPt->xMat.SDP_block[l], targ->currentPt->invzMat.SDP_block[l], Ai,Aj); else calF3_thread_2(value, targ->currentPt->xMat.SDP_block[l], targ->currentPt->invzMat.SDP_block[l], Ai,Aj); break; case F1: // rMessage("calF1"); #if DEBUG printf("F1 in %d\n", targ->thread_num); #endif calF1_thread(value,work2,Ai); break; case F2: // rMessage("calF2 "); #if DEBUG printf("F2 in %d\n", targ->thread_num); #endif calF2_thread(value,work1,work2, targ->currentPt->invzMat.SDP_block[l],Ai,hasF2Gcal); break; } // end of switch if (i!=j) { targ->bMat->de_ele[i+m*j] += value; targ->bMat->de_ele[j+m*i] += value; } else { targ->bMat->de_ele[i+m*i] += value; } } // end of 'for (int j)' TimeEnd(B_NDIAG_END1); double t = TimeCal(B_NDIAG_START1,B_NDIAG_END1); #if 0 // This part is not thread-safe // Do not use this part withouth thread locking switch (formula) { case F1: targ->com->B_F1 += t; break; case F2: targ->com->B_F2 += t; break; case F3: targ->com->B_F3 += t; break; } #endif } work1.terminate(); work2.terminate(); return NULL; } void Newton::compute_bMat_dense_SDP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com) { int m = currentPt.mDim; int SDP_nBlock = inputData.SDP_nBlock; for (int l=0; l 1) { goto_set_num_threads(NUM_GOTOBLAS); } #endif int m = currentPt.mDim; int SDP_nBlock = inputData.SDP_nBlock; for (int k=0; kBlock_Number; // int SDP_nBlock; // SDP_nBlock = targ->SDP_nBlock; // printf("targ-> Block_Number = %d\n", targ-> Block_Number); // DenseMatrix& xMat = targ->currentPt->xMat.SDP_block[l]; // DenseMatrix& invzMat = targ->currentPt->invzMat.SDP_block[l]; work1.initialize(targ->work->DLS1.SDP_block[l].nRow, targ->work->DLS1.SDP_block[l].nCol, DenseMatrix::DENSE); work2.initialize(targ->work->DLS2.SDP_block[l].nRow, targ->work->DLS2.SDP_block[l].nCol, DenseMatrix::DENSE); TimeStart(B_NDIAG_START1); while(1) { pthread_mutex_lock(&job_mutex); iter = Column_Number++; pthread_mutex_unlock(&job_mutex); if (iter >= targ->SDP_number[l]) break; int j = targ->SDP_constraint2[l][iter]; int jb = targ->SDP_blockIndex2[l][iter]; SparseMatrix& Aj = targ->inputData->A[j].SDP_sp_block[jb]; FormulaType formula = targ->useFormula[j][jb]; // rMessage("FormulaType = " << formula); if (j != previous_j){ TimeStart(B_NDIAG_START2); if (formula==F1) { pthread_mutex_lock(&job_mutex); Lal::let(work1,'=',targ->currentPt->xMat.SDP_block[l],'*',Aj); Lal::let(work2,'=',work1,'*',targ->currentPt->invzMat.SDP_block[l]); pthread_mutex_unlock(&job_mutex); } else if (formula==F2) { // Lal::let(work1,'=',Ai,'*',targ->currentPt->invzMat.SDP_block[l]); Lal::let(work1,'=',targ->currentPt->xMat.SDP_block[l],'*',Aj); } TimeEnd(B_NDIAG_END2); targ->com->B_PRE += TimeCal(B_NDIAG_START2,B_NDIAG_END2); } int i = targ->SDP_constraint1[l][iter]; int ib = targ->SDP_blockIndex1[l][iter]; SparseMatrix& Ai = targ->inputData->A[i].SDP_sp_block[ib]; double value; bool dummyHasF2Gcal = true; switch (formula) { case F3: // rMessage("calF3"); if ((Ai.NonZeroCount == 1) && (Aj.NonZeroCount == 1)) calF3_thread_1x1(value, targ->currentPt->xMat.SDP_block[l], targ->currentPt->invzMat.SDP_block[l], Ai,Aj); else calF3_thread_2(value, targ->currentPt->xMat.SDP_block[l], targ->currentPt->invzMat.SDP_block[l], Ai,Aj); break; case F1: // rMessage("calF1"); calF1_thread(value,work2,Ai); break; case F2: // rMessage("calF2 "); calF2_thread(value,work1,work2, targ->currentPt->invzMat.SDP_block[l],Ai,dummyHasF2Gcal); break; } // end of switch targ->sparse_bMat->sp_ele[targ->SDP_location_sparse_bMat[l][iter]] += value; previous_j = j; } #if 0 TimeEnd(B_NDIAG_END1); double t = TimeCal(B_NDIAG_START1,B_NDIAG_END1); switch (formula) { case F1: targ->com->B_F1 += t; break; case F2: targ->com->B_F2 += t; break; case F3: targ->com->B_F3 += t; break; } #endif work1.terminate(); work2.terminate(); return NULL; } void Newton::compute_bMat_sparse_SDP(InputData& inputData, Solutions& currentPt, WorkVariables& work, ComputeTime& com) { TimeStart(B_NDIAG_START1); TimeStart(B_NDIAG_START2); for (int l=0; l. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sdpa-7.3.11/sdpa_tool.h0000644000175000017500000000733013211530510014227 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*-------------------------------------------------- sdpa_tool.h --------------------------------------------------*/ #ifndef __sdpa_tool_h__ #define __sdpa_tool_h__ #include "sdpa_right.h" #include #include #include #include namespace sdpa { // Note : only GNU has the macro __PRETTY_FUNCTION__ #define USE_PRETTY_FUNCTION 0 #if USE_PRETTY_FUNCTION #define rMessage(message) \ { cout << message << " :: line " << __LINE__ \ << " in " << __FILE__ \ << " [ " << __PRETTY_FUNCTION__ << " ] " << endl; } #elif 1 #define rMessage(message) \ {cout << message << " :: line " << __LINE__ \ << " in " << __FILE__ << endl; } #else #define rMessage(message) ; #endif #if USE_PRETTY_FUNCTION #define rError(message) \ { cout << message << " :: line " << __LINE__ \ << " in " << __FILE__ \ << " [ " << __PRETTY_FUNCTION__ << " ] " << endl; \ exit(false);} #else #define rError(message) \ {cout << message << " :: line " << __LINE__ \ << " in " << __FILE__ << endl; \ exit(false);} #endif #if 1 #define NewArray(val,type,number) \ {val = NULL; \ try{ val = new type[number]; } \ catch(bad_alloc){ \ rMessage("Memory Exhausted (bad_alloc)"); abort(); } \ catch(...){ \ rMessage("Fatal Error (related memory allocation"); abort(); } \ } #else #define NewArray(val,type,number) \ {rMessage("New Invoked"); \ val = NULL; val = new type[number]; \ if (val==NULL) {rError("Over Memory");} \ } #endif #define DeleteArray(val) \ { if (val!=NULL) { \ delete[] val; \ val = NULL; \ } \ } #define REVERSE_PRIMAL_DUAL 1 // These are constant. Do NOT change extern int IZERO ; // = 0; extern int IONE ; // = 1; extern int IMONE ; // = -1; extern double DZERO; // = 0.0; extern double DONE ; // = 1.0; extern double DMONE; // = -1.0; class Time { public: static double rGetUseTime(); static void rSetTimeVal(struct timeval & targetVal); static double rGetRealTime(const struct timeval & start, const struct timeval & end); }; #define PROCESS_TIME 0 #if PROCESS_TIME // count time with process time #include #define TimeStart(START__) \ static double START__; START__ = Time::rGetUseTime() #define TimeEnd(END__) \ static double END__; END__ = Time::rGetUseTime() #define TimeCal(START__,END__) (END__ - START__) #else // count time with real time #define TimeStart(START__) \ static struct timeval START__; Time::rSetTimeVal(START__) #define TimeEnd(END__) \ static struct timeval END__; Time::rSetTimeVal(END__) #define TimeCal(START__,END__) Time::rGetRealTime(START__,END__) #endif #define sdpa_dset(dset_length,dset_value,dset_pointer,dset_step) \ for (int dset_i=0,dset_index = 0; dset_i sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR sdpa-7.3.11/libexample/0000755000175000017500000000000013211530510014211 5ustar makotomakotosdpa-7.3.11/libexample/example4.cpp0000644000175000017500000001476713211530510016453 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ // Here is the start of ``example4.cpp'' #include #include #include /* example1.dat: "Example 1: mDim = 3, nBLOCK = 1, {2}" 3 = mDIM 1 = nBLOCK 2 = bLOCKsTRUCT {48, -8, 20} { {-11, 0}, { 0, 23} } { { 10, 4}, { 4, 0} } { { 0, 0}, { 0, -8} } { { 0, -8}, {-8, -2} } */ void printVector(double* ele, int dim, char* printFormat, FILE* fpout); void printMatrix(double* ele, int dim, char* printFormat, FILE* fpout); void printDimacsError(double dimacs_error[7],char* printFormat, FILE* fpout); void printResult(SDPA& Problem1); int main () { SDPA::printSDPAVersion(stdout); SDPA Problem1; Problem1.setDisplay(stdout); // All parameteres are renewed Problem1.setParameterType(SDPA::PARAMETER_DEFAULT); // If necessary, each parameter can be set independently Problem1.setParameterEpsilonStar(1.0e-7); Problem1.printParameters(stdout); int mDIM = 3; int nBlock = 1; Problem1.inputConstraintNumber(mDIM); Problem1.inputBlockNumber(nBlock); Problem1.inputBlockSize(1,2); Problem1.inputBlockType(1,SDPA::SDP); Problem1.initializeUpperTriangleSpace(); Problem1.inputCVec(1,48); Problem1.inputCVec(2,-8); Problem1.inputCVec(3,20); Problem1.inputElement(0, 1, 1, 1, -11); Problem1.inputElement(0, 1, 2, 2, 23); Problem1.inputElement(1, 1, 1, 1, 10); Problem1.inputElement(1, 1, 1, 2, 4); Problem1.inputElement(2, 1, 2, 2, -8); Problem1.inputElement(3, 1, 1, 2, -8); Problem1.inputElement(3, 1, 2, 2, -2); Problem1.initializeUpperTriangle(); Problem1.initializeSolve(); // if necessary, dump input data and initial point // Problem1.writeInputSparse((char*)"tmp.dat-s",(char*)"%+8.3e"); // Problem1.writeInitSparse((char*)"tmp.ini-s",(char*)"%+8.3e"); Problem1.solve(); printResult(Problem1); // Solve the problem again with smaller epsilonStar Problem1.setParameterEpsilonStar(1.0e-8); Problem1.setInitPoint(true); Problem1.copyCurrentToInit(); Problem1.solve(); printResult(Problem1); Problem1.terminate(); exit(0); }; void printVector(double* ele, int dim, char* printFormat, FILE* fpout) { fprintf(fpout,"[ "); for (int k=0; k - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, dimacs_error[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } void printResult(SDPA& Problem1) { fprintf(stdout, "\nStop iteration = %d\n", Problem1.getIteration()); char phase_string[30]; Problem1.getPhaseString(phase_string); fprintf(stdout, "Phase = %s\n", phase_string); fprintf(stdout, "objValPrimal = %+10.6e\n", Problem1.getPrimalObj()); fprintf(stdout, "objValDual = %+10.6e\n", Problem1.getDualObj()); fprintf(stdout, "p. feas. error = %+10.6e\n", Problem1.getPrimalError()); fprintf(stdout, "d. feas. error = %+10.6e\n\n", Problem1.getDualError()); #if 0 fprintf(stdout, "xVec = \n"); // Problem1.printResultXVec(); printVector(Problem1.getResultXVec(), Problem1.getConstraintNumber(), (char*)"%+8.3e", stdout); fprintf(stdout, "xMat = \n"); // Problem1.printResultXMat(); for (int l=0; l #include #include /* example1.dat: "Example 1: mDim = 3, nBLOCK = 1, {2}" 3 = mDIM 1 = nBLOCK 2 = bLOCKsTRUCT {48, -8, 20} { {-11, 0}, { 0, 23} } { { 10, 4}, { 4, 0} } { { 0, 0}, { 0, -8} } { { 0, -8}, {-8, -2} } */ void printVector(double* ele, int dim, char* printFormat, FILE* fpout); void printMatrix(double* ele, int dim, char* printFormat, FILE* fpout); void printDimacsError(double dimacs_error[7],char* printFormat, FILE* fpout); int main () { SDPA::printSDPAVersion(stdout); SDPA Problem1; Problem1.setDisplay(stdout); // All parameteres are renewed Problem1.setParameterType(SDPA::PARAMETER_DEFAULT); // If necessary, each parameter can be set independently // Problem1.setParameterMaxIteration(100); // Problem1.setParameterEpsilonStar(1.0e-7); // Problem1.setParameterLambdaStar(1.0e+2); // Problem1.setParameterOmegaStar(2.0); // Problem1.setParameterLowerBound(-1.0e+5); // Problem1.setParameterUppwerBound(1.0e+5); // Problem1.setParameterBetaStar(0.1); // Problem1.setParameterBetaBar(0.2); // Problem1.setParameterGammaStar(0.9); // Problem1.setParameterEpsilonDash(1.0e-7); // Problem1.setParameterPrintXVec((char*)"%+8.3e" ); // Problem1.setParameterPrintXMat((char*)"%+8.3e" ); // Problem1.setParameterPrintYMat((char*)"%+8.3e" ); // Problem1.setParameterPrintInformation((char*)"%+10.16e"); Problem1.printParameters(stdout); int mDIM = 3; int nBlock = 1; Problem1.inputConstraintNumber(mDIM); Problem1.inputBlockNumber(nBlock); Problem1.inputBlockSize(1,2); Problem1.inputBlockType(1,SDPA::SDP); Problem1.initializeUpperTriangleSpace(); Problem1.inputCVec(1,48); Problem1.inputCVec(2,-8); Problem1.inputCVec(3,20); Problem1.inputElement(0, 1, 1, 1, -11); Problem1.inputElement(0, 1, 2, 2, 23); Problem1.inputElement(1, 1, 1, 1, 10); Problem1.inputElement(1, 1, 1, 2, 4); Problem1.inputElement(2, 1, 2, 2, -8); Problem1.inputElement(3, 1, 1, 2, -8); Problem1.inputElement(3, 1, 2, 2, -2); Problem1.initializeUpperTriangle(); Problem1.initializeSolve(); // if necessary, dump input data and initial point // Problem1.writeInputSparse((char*)"tmp.dat-s",(char*)"%+8.3e"); // Problem1.writeInitSparse((char*)"tmp.ini-s",(char*)"%+8.3e"); Problem1.solve(); fprintf(stdout, "\nStop iteration = %d\n", Problem1.getIteration()); char phase_string[30]; Problem1.getPhaseString(phase_string); fprintf(stdout, "Phase = %s\n", phase_string); fprintf(stdout, "objValPrimal = %+10.6e\n", Problem1.getPrimalObj()); fprintf(stdout, "objValDual = %+10.6e\n", Problem1.getDualObj()); fprintf(stdout, "p. feas. error = %+10.6e\n", Problem1.getPrimalError()); fprintf(stdout, "d. feas. error = %+10.6e\n\n", Problem1.getDualError()); fprintf(stdout, "xVec = \n"); // Problem1.printResultXVec(); printVector(Problem1.getResultXVec(), Problem1.getConstraintNumber(), (char*)"%+8.3e", stdout); fprintf(stdout, "xMat = \n"); // Problem1.printResultXMat(); for (int l=0; l - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, dimacs_error[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } sdpa-7.3.11/libexample/example5.cpp0000644000175000017500000000333213211530510016436 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ // Here is the start of ``example5.cpp'' #include #include #include int main(int argc, char** argv) { if (argc != 4) { fprintf(stderr, "%s [Input] [Output] [Param] \n", argv[0]); exit(EXIT_FAILURE); } SDPA Problem1; FILE* fpresult; if ((fpresult = fopen(argv[2],"w")) == NULL) { fprintf(stderr, "Cannot Open %s \n", argv[2]); } Problem1.setResultFile(fpresult); // fpresult records which file is read from argv[3] Problem1.readParameter(argv[3],fpresult); // Note that readParameter should be called before readInput // Otherwise initial point cannot be decided by lambdaStar Problem1.readInput(argv[1],fpresult,SDPA::AUTO); Problem1.initializeSolve(); // All results and intermediate log are written into fpresult Problem1.solve(); fclose(fpresult); Problem1.terminate(); exit(0); } sdpa-7.3.11/libexample/example3.cpp0000644000175000017500000001641413211530510016441 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ // Here is the start of ``example3.cpp'' #include #include #include /* example1.dat: "Example 1: mDim = 3, nBLOCK = 1, {2}" 3 = mDIM 1 = nBLOCK 2 = bLOCKsTRUCT {48, -8, 20} { {-11, 0}, { 0, 23} } { { 10, 4}, { 4, 0} } { { 0, 0}, { 0, -8} } { { 0, -8}, {-8, -2} } example1.ini: {0.0, -4.0, 0.0} { {11.0, 0.0}, {0.0, 9.0} } { {5.9, -1.375}, {-1.375, 1.0} } */ void printVector(double* ele, int dim, char* printFormat, FILE* fpout); void printMatrix(double* ele, int dim, char* printFormat, FILE* fpout); void printDimacsError(double dimacs_error[7],char* printFormat, FILE* fpout); int main () { SDPA::printSDPAVersion(stdout); SDPA Problem1; Problem1.setDisplay(stdout); // All parameteres are renewed Problem1.setParameterType(SDPA::PARAMETER_DEFAULT); // If necessary, each parameter can be set independently // Problem1.setParameterMaxIteration(100); // Problem1.setParameterEpsilonStar(1.0e-7); // Problem1.setParameterLambdaStar(1.0e+2); // Problem1.setParameterOmegaStar(2.0); // Problem1.setParameterLowerBound(-1.0e+5); // Problem1.setParameterUppwerBound(1.0e+5); // Problem1.setParameterBetaStar(0.1); // Problem1.setParameterBetaBar(0.2); // Problem1.setParameterGammaStar(0.9); // Problem1.setParameterEpsilonDash(1.0e-7); // Problem1.setParameterPrintXVec((char*)"%+8.3e" ); // Problem1.setParameterPrintXMat((char*)"%+8.3e" ); // Problem1.setParameterPrintYMat((char*)"%+8.3e" ); // Problem1.setParameterPrintInformation((char*)"%+10.16e"); Problem1.printParameters(stdout); int mDIM = 3; int nBlock = 1; Problem1.inputConstraintNumber(mDIM); Problem1.inputBlockNumber(nBlock); Problem1.inputBlockSize(1,2); Problem1.inputBlockType(1,SDPA::SDP); Problem1.initializeUpperTriangleSpace(); Problem1.inputCVec(1,48); Problem1.inputCVec(2,-8); Problem1.inputCVec(3,20); Problem1.inputElement(0, 1, 1, 1, -11); Problem1.inputElement(0, 1, 2, 2, 23); Problem1.inputElement(1, 1, 1, 1, 10); Problem1.inputElement(1, 1, 1, 2, 4); Problem1.inputElement(2, 1, 2, 2, -8); Problem1.inputElement(3, 1, 1, 2, -8); Problem1.inputElement(3, 1, 2, 2, -2); Problem1.initializeUpperTriangle(); Problem1.setInitPoint(true); Problem1.inputInitXVec(1, 0.0); Problem1.inputInitXVec(2,-4.0); Problem1.inputInitXVec(3, 0.0); Problem1.inputInitXMat(1,1,1, 11.0); Problem1.inputInitXMat(1,2,2, 9.0); Problem1.inputInitYMat(1,1,1, 5.9); Problem1.inputInitYMat(1,1,2, -1.375); Problem1.inputInitYMat(1,2,2, 1.0); Problem1.initializeSolve(); // if necessary, dump input data and initial point // Problem1.writeInputSparse((char*)"tmp.dat-s",(char*)"%+8.3e"); // Problem1.writeInitSparse((char*)"tmp.ini-s",(char*)"%+8.3e"); Problem1.solve(); fprintf(stdout, "\nStop iteration = %d\n", Problem1.getIteration()); char phase_string[30]; Problem1.getPhaseString(phase_string); fprintf(stdout, "Phase = %s\n", phase_string); fprintf(stdout, "objValPrimal = %+10.6e\n", Problem1.getPrimalObj()); fprintf(stdout, "objValDual = %+10.6e\n", Problem1.getDualObj()); fprintf(stdout, "p. feas. error = %+10.6e\n", Problem1.getPrimalError()); fprintf(stdout, "d. feas. error = %+10.6e\n\n", Problem1.getDualError()); fprintf(stdout, "xVec = \n"); // Problem1.printResultXVec(); printVector(Problem1.getResultXVec(), Problem1.getConstraintNumber(), (char*)"%+8.3e", stdout); fprintf(stdout, "xMat = \n"); // Problem1.printResultXMat(); for (int l=0; l - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, dimacs_error[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } sdpa-7.3.11/libexample/param.sdpa0000644000175000017500000000117313211530510016164 0ustar makotomakoto100 unsigned int maxIteration; 1.0E-7 double 0.0 < epsilonStar; 1.0E2 double 0.0 < lambdaStar; 2.0 double 1.0 < omegaStar; -1.0E5 double lowerBound; 1.0E5 double upperBound; 0.1 double 0.0 <= betaStar < 1.0; 0.2 double 0.0 <= betaBar < 1.0, betaStar <= betaBar; 0.9 double 0.0 < gammaStar < 1.0; 1.0E-7 double 0.0 < epsilonDash; %+8.3e char* xPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* XPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* YPrint (default %+8.3e, NOPRINT skips printout) %+10.16e char* infPrint (default %+10.16e, NOPRINT skips printout) sdpa-7.3.11/libexample/Makefile0000644000175000017500000000263213211530510015654 0ustar makotomakoto ############################################################# # List of examples for callable-library # # example1.cpp: Solve example1.dat-s using inputElements # example2.cpp: Solve example2.dat using inputElements # example3.cpp: Solve example1.dat-s with initial point # example4.cpp: Solve twice with smaller epsilonStar # example5.cpp: Solve problems reading from file # example6.cpp: Solve problems reading from file with initial point # ############################################################# .PHONY: all lib clean cleanall distclean .SUFFIXES: .exe # after "make install", you can find # 'make.inc' in 'share/sdpa' sub-directory under the installed directory # For example # make MAKE_INCLUDE_DIR=/usr/share/sdpa # or # make MAKE_INCLUDE_DIR=/usr/local/share/sdpa MAKE_INCLUDE_DIR=.. -include ${MAKE_INCLUDE_DIR}/make.inc # after "make install", you can find # 'make.inc' in 'share/sdpa' sub-directory under the installed directory # For example # make MAKE_INCLUDE_DIR=/usr/share/sdpa # or # make MAKE_INCLUDE_DIR=/usr/local/share/sdpa SRC = $(wildcard example?.cpp) EXE = $(subst .cpp,.exe,$(SRC)) all: ${EXE} %.exe: %.o ${CXX} ${CXXFLAGS} ${CPPFLAGS} -o $@ $< ${SDPA_LIBS} .cpp.o: ${CXX} -c ${CXXFLAGS} ${CPPFLAGS} \ -I${SDPA_DIR}/include ${MUMPS_INCLUDE} ${PTHREAD_INCLUDE} \ -o $@ $< clean: rm -f *.o *~ cleanall: clean rm -f *.exe distclean: cleanall install: all uninstall: sdpa-7.3.11/libexample/example6.cpp0000644000175000017500000001272013211530510016440 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ // Here is the start of ``example6.cpp'' #include #include #include void printVector(double* ele, int dim, char* printFormat, FILE* fpout); void printMatrix(double* ele, int dim, char* printFormat, FILE* fpout); void printDimacsError(double dimacs_error[7],char* printFormat, FILE* fpout); void printResult(SDPA& Problem1); int main(int argc, char** argv) { if (argc != 4) { fprintf(stderr, "%s [Input] [Init] [Param] \n", argv[0]); exit(EXIT_FAILURE); } SDPA Problem1; Problem1.setDisplay(stdout); Problem1.readParameter(argv[3],stdout); // Note that readParameter should be called before readInput // Otherwise initial point cannot be decided by lambdaStar Problem1.readInput(argv[1],stdout,SDPA::AUTO); Problem1.setInitPoint(true); Problem1.readInit(argv[2],stdout,SDPA::AUTO); Problem1.initializeSolve(); Problem1.solve(); printResult(Problem1); Problem1.terminate(); exit(0); } void printVector(double* ele, int dim, char* printFormat, FILE* fpout) { fprintf(fpout,"[ "); for (int k=0; k - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, dimacs_error[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } void printResult(SDPA& Problem1) { fprintf(stdout, "\nStop iteration = %d\n", Problem1.getIteration()); char phase_string[30]; Problem1.getPhaseString(phase_string); fprintf(stdout, "Phase = %s\n", phase_string); fprintf(stdout, "objValPrimal = %+10.6e\n", Problem1.getPrimalObj()); fprintf(stdout, "objValDual = %+10.6e\n", Problem1.getDualObj()); fprintf(stdout, "p. feas. error = %+10.6e\n", Problem1.getPrimalError()); fprintf(stdout, "d. feas. error = %+10.6e\n\n", Problem1.getDualError()); #if 0 fprintf(stdout, "xVec = \n"); // Problem1.printResultXVec(); printVector(Problem1.getResultXVec(), Problem1.getConstraintNumber(), (char*)"%+8.3e", stdout); fprintf(stdout, "xMat = \n"); // Problem1.printResultXMat(); for (int l=0; l #include #include /* *Example 2: *mDim = 5, nBLOCK = 3, {2,3,-2} 5 = mDIM 3 = nBLOCK 2 3 -2 = bLOCKsTRUCT {1.1, -10, 6.6 , 19 , 4.1} { { { -1.4, -3.2 }, { -3.2,-28 } } { { 15, -12, 2.1 }, {-12, 16, -3.8 }, { 2.1, -3.8, 15 } } { 1.8, -4.0 } } { { { 0.5, 5.2 }, { 5.2, -5.3 } } { { 7.8, -2.4, 6.0 }, { -2.4, 4.2, 6.5 }, { 6.0, 6.5, 2.1 } } { -4.5, -3.5 } } { { { 1.7, 7.0 }, { 7.0, -9.3 } } { {-1.9, -0.9, -1.3 }, {-0.9, -0.8, -2.1 }, {-1.3, -2.1, 4.0 } } {-0.2, -3.7 } } { { { 6.3, -7.5 }, {-7.5, -3.3 } } { { 0.2, 8.8, 5.4 }, { 8.8, 3.4, -0.4 }, { 5.4, -0.4, 7.5 } } {-3.3, -4.0 } } { { { -2.4, -2.5 }, { -2.5, -2.9 } } { { 3.4, -3.2, -4.5 }, { -3.2, 3.0, -4.8 }, { -4.5, -4.8, 3.6 } } { 4.8 , 9.7 } } { { { -6.5, -5.4 }, { -5.4, -6.6 } } { { 6.7, -7.2, -3.6 }, { -7.2, 7.3, -3.0 }, { -3.6, -3.0, -1.4 } } { 6.1, -1.5 } } */ void printVector(double* ele, int dim, char* printFormat, FILE* fpout); void printMatrix(double* ele, int dim, char* printFormat, FILE* fpout); void printDimacsError(double dimacs_error[7],char* printFormat, FILE* fpout); int main () { SDPA::printSDPAVersion(stdout); SDPA Problem1; Problem1.setDisplay(stdout); // All parameteres are renewed Problem1.setParameterType(SDPA::PARAMETER_DEFAULT); // Problem1.printParameters(stdout); int mDIM = 5; int nBlock = 3; Problem1.inputConstraintNumber(mDIM); Problem1.inputBlockNumber(nBlock); // bLOCKsTRUCT :: 2(SDP) 3(SDP) -2(LP) Problem1.inputBlockSize(1,2); Problem1.inputBlockSize(2,3); Problem1.inputBlockSize(3,-2); Problem1.inputBlockType(1,SDPA::SDP); Problem1.inputBlockType(2,SDPA::SDP); Problem1.inputBlockType(3,SDPA::LP); Problem1.initializeUpperTriangleSpace(); //cVECT = {1.1, -10, 6.6 , 19 , 4.1} Problem1.inputCVec(1,1.1); Problem1.inputCVec(2,-10); Problem1.inputCVec(3,6.6); Problem1.inputCVec(4,19); Problem1.inputCVec(5,4.1); // --------- Input F_0 -------------------- // 1st block // { { -1.4, -3.2}, // { -3.2, -28} } Problem1.inputElement(0, 1, 1, 1, -1.4); Problem1.inputElement(0, 1, 1, 2, -3.2); Problem1.inputElement(0, 1, 2, 2, -28); // 2nd block // { { 15, -12, 2.1 }, // {-12, 16, -3.8 }, // { 2.1, -3.8, 15 } } Problem1.inputElement(0, 2, 1, 1, 15); Problem1.inputElement(0, 2, 1, 2, -12); Problem1.inputElement(0, 2, 1, 3, 2.1); Problem1.inputElement(0, 2, 2, 2, 16); Problem1.inputElement(0, 2, 2, 3,-3.8); Problem1.inputElement(0, 2, 3, 3, 15); // 3rd block // { 1.8, -4.0 } Problem1.inputElement(0, 3, 1, 1, 1.8); Problem1.inputElement(0, 3, 2, 2,-4.0); // --------- Input F_1 -------------------- // 1st block // { { 0.5, 5.2}, // { 5.2, -5.3} } Problem1.inputElement(1, 1, 1, 1, 0.5); Problem1.inputElement(1, 1, 1, 2, 5.2); Problem1.inputElement(1, 1, 2, 2,-5.3); // 2nd block // { { 7.8, -2.4, 6.0 }, // {-2.4, 4.2, 6.5 }, // { 6.0, 6.5, 2.1 } } Problem1.inputElement(1, 2, 1, 1, 7.8); Problem1.inputElement(1, 2, 1, 2,-2.4); Problem1.inputElement(1, 2, 1, 3, 6.0); Problem1.inputElement(1, 2, 2, 2, 4.2); Problem1.inputElement(1, 2, 2, 3, 6.5); Problem1.inputElement(1, 2, 3, 3, 2.1); // 3rd block // { -4.5, -3.5 } Problem1.inputElement(1, 3, 1, 1, -4.5); Problem1.inputElement(1, 3, 2, 2, -3.5); // --------- Input F_2 -------------------- // 1st block // { { 1.7, 7.0}, // { 7.0,-9.3} } Problem1.inputElement(2, 1, 1, 1, 1.7); Problem1.inputElement(2, 1, 1, 2, 7.0); Problem1.inputElement(2, 1, 2, 2, -9.3); // 2nd block // { {-1.9, -0.9, -1.3 }, // {-0.9, -0.8, -2.1 }, // {-1.3, -2.1, 4.0 } } Problem1.inputElement(2, 2, 1, 1, -1.9); Problem1.inputElement(2, 2, 1, 2, -0.9); Problem1.inputElement(2, 2, 1, 3, -1.3); Problem1.inputElement(2, 2, 2, 2, -0.8); Problem1.inputElement(2, 2, 2, 3, -2.1); Problem1.inputElement(2, 2, 3, 3, 4.0); // 3rd block // { -0.2, -3.7 } Problem1.inputElement(2, 3, 1, 1, -0.2); Problem1.inputElement(2, 3, 2, 2, -3.7); // --------- Input F_3 -------------------- // 1st block // { { 6.3, -7.5}, // { -7.5, -3.3} } Problem1.inputElement(3, 1, 1, 1, 6.3); Problem1.inputElement(3, 1, 1, 2, -7.5); Problem1.inputElement(3, 1, 2, 2, -3.3); // 2nd block // { { 0.2, 8.8, 5.4 }, // { 8.8, 3.4, -0.4 }, // { 5.4, -0.4, 7.5 } } Problem1.inputElement(3, 2, 1, 1, 0.2); Problem1.inputElement(3, 2, 1, 2, 8.8); Problem1.inputElement(3, 2, 1, 3, 5.4); Problem1.inputElement(3, 2, 2, 2, 3.4); Problem1.inputElement(3, 2, 2, 3, -0.4); Problem1.inputElement(3, 2, 3, 3, 7.5); // 3rd block // { -3.3, -4.0 } Problem1.inputElement(3, 3, 1, 1, -3.3); Problem1.inputElement(3, 3, 2, 2, -4.0); // --------- Input F_4 -------------------- // 1st block // { { -2.4, -2.5}, // { -2.5, -2.9} } Problem1.inputElement(4, 1, 1, 1, -2.4); Problem1.inputElement(4, 1, 1, 2, -2.5); Problem1.inputElement(4, 1, 2, 2, -2.9); // 2nd block // { { 3.4, -3.2, -4.5 }, // { -3.2, 3.0, -4.8 }, // { -4.5, -4.8, 3.6 } } Problem1.inputElement(4, 2, 1, 1, 3.4); Problem1.inputElement(4, 2, 1, 2, -3.2); Problem1.inputElement(4, 2, 1, 3, -4.5); Problem1.inputElement(4, 2, 2, 2, 3.0); Problem1.inputElement(4, 2, 2, 3, -4.8); Problem1.inputElement(4, 2, 3, 3, 3.6); // 3rd block // { 4.8, 9.7 } Problem1.inputElement(4, 3, 1, 1, 4.8); Problem1.inputElement(4, 3, 2, 2, 9.7); // --------- Input F_5 -------------------- // 1st block // { { -6.5, -5.4}, // { -5.4, -6.6} } Problem1.inputElement(5, 1, 1, 1, -6.5); Problem1.inputElement(5, 1, 1, 2, -5.4); Problem1.inputElement(5, 1, 2, 2, -6.6); // 2nd block // { { 6.7, -7.2, -3.6 }, // { -7.2, 7.3, -3.0 }, // { -3.6, -3.0, -1.4 } } Problem1.inputElement(5, 2, 1, 1, 6.7); Problem1.inputElement(5, 2, 1, 2, -7.2); Problem1.inputElement(5, 2, 1, 3, -3.6); Problem1.inputElement(5, 2, 2, 2, 7.3); Problem1.inputElement(5, 2, 2, 3, -3.0); Problem1.inputElement(5, 2, 3, 3, -1.4); // 3rd block // { 6.1, -1.5 } Problem1.inputElement(5, 3, 1, 1, 6.1); Problem1.inputElement(5, 3, 2, 2,-1.5); Problem1.initializeUpperTriangle(); Problem1.initializeSolve(); // if necessary, dump input data and initial point // Problem1.writeInputSparse((char*)"tmp.dat-s",(char*)"%+8.3e"); // Problem1.writeInitSparse((char*)"tmp.ini-s",(char*)"%+8.3e"); Problem1.solve(); fprintf(stdout, "\nStop iteration = %d\n", Problem1.getIteration()); char phase_string[30]; Problem1.getPhaseString(phase_string); fprintf(stdout, "Phase = %s\n", phase_string); fprintf(stdout, "objValPrimal = %+10.6e\n", Problem1.getPrimalObj()); fprintf(stdout, "objValDual = %+10.6e\n", Problem1.getDualObj()); fprintf(stdout, "p. feas. error = %+10.6e\n", Problem1.getPrimalError()); fprintf(stdout, "d. feas. error = %+10.6e\n\n", Problem1.getDualError()); fprintf(stdout, "xVec = \n"); // Problem1.printResultXVec(); printVector(Problem1.getResultXVec(), Problem1.getConstraintNumber(), (char*)"%+8.3e", stdout); fprintf(stdout, "xMat = \n"); // Problem1.printResultXMat(); for (int l=0; l - ) / (1 + || + ||)]\n"); fprintf(fpout, "err6 = "); fprintf(fpout, printFormat, dimacs_error[6]); fprintf(fpout, " [ / (1 + || + ||)]\n"); fprintf(fpout, "\n"); } sdpa-7.3.11/sdpa_dataset.cpp0000644000175000017500000004066413211530510015241 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_dataset.h" #include "sdpa_parts.h" #include "sdpa_jordan.h" #include "sdpa_linear.h" #include "sdpa_newton.h" namespace sdpa { Solutions::Solutions() { // Nothings needs. } Solutions::~Solutions() { terminate(); } Solutions::Solutions(int m, BlockStruct& bs, double lambda,ComputeTime& com) { initialize(m, bs, lambda, com); } void Solutions::initialize(int m, BlockStruct& bs, double lambda, ComputeTime& com) { mDim = m; nDim = 0; for (int l=0; l cannot_move) || (alpha.dual > cannot_move))) { // undo iterative point TimeStart(START2_1); Lal::let(xMat,'=',xMat,'-',newton.DxMat,&alpha.primal); TimeEnd(END2_1); com.xMatTime += TimeCal(START2_1,END2_1); Lal::let(yVec,'=',yVec,'-',newton.DyVec,&alpha.dual); TimeStart(START2_2); Lal::let(zMat,'=',zMat,'-',newton.DzMat,&alpha.dual); TimeEnd(END2_2); com.zMatTime += TimeCal(START2_2,END2_2); // make step size smaller alpha.primal *= 0.8; alpha.dual *= 0.8; // new iterative point TimeStart(START3_1); Lal::let(xMat,'=',xMat,'+',newton.DxMat,&alpha.primal); TimeEnd(END3_1); com.xMatTime += TimeCal(START3_1,END3_1); Lal::let(yVec,'=',yVec,'+',newton.DyVec,&alpha.dual); TimeStart(START4_2); Lal::let(zMat,'=',zMat,'+',newton.DzMat,&alpha.dual); TimeEnd(END4_2); com.zMatTime += TimeCal(START4_2,END4_2); total_judge = computeInverse(work,com); } if (alpha.primal < cannot_move && alpha.dual < cannot_move) { rMessage("Step length is too small. "); return SDPA_FAILURE; } return total_judge; } void Solutions::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"dimension = %d\n",nDim); fprintf(fpout,"xMat = \n"); xMat.display(fpout); fprintf(fpout,"yVec = \n"); yVec.display(fpout); fprintf(fpout,"zMat = \n"); zMat.display(fpout); } InputData::InputData() { A = NULL; SDP_nBlock = 0; SDP_nConstraint = NULL; SDP_constraint = NULL; SDP_blockIndex = NULL; SOCP_nBlock = 0; SOCP_nConstraint = NULL; SOCP_constraint = NULL; SOCP_blockIndex = NULL; SDP_nBlock = 0; LP_nConstraint = NULL; LP_constraint = NULL; LP_blockIndex = NULL; } InputData::~InputData() { terminate(); } void InputData::initialize(BlockStruct& bs) { SDP_nBlock = bs.SDP_nBlock; SOCP_nBlock = bs.SOCP_nBlock; LP_nBlock = bs.LP_nBlock; } void InputData::initialize_bVec(int m) { b.initialize(m); } void InputData::terminate() { C.terminate(); if (A){ for (int k=0; k 0) { initialize_index_LP(); } } // retVec_i := A_i bullet xMat (for i) void InputData::multi_InnerProductToA(DenseLinearSpace& xMat, Vector& retVec) { double ip; retVec.setZero(); for (int i=0; i ret) { ret = tmp; } } return ret; } double Residuals::computeMaxNorm(DenseLinearSpace& dualMat) { int SDP_nBlock = dualMat.SDP_nBlock; int SOCP_nBlock = dualMat.SOCP_nBlock; int LP_nBlock = dualMat.LP_nBlock; double ret = 0.0; double tmp; for (int l=0; l ret) { ret = tmp; } } } for (int l=0; l ret) { ret = tmp; } } return ret; } void Residuals::update(int m, InputData& inputData, Solutions& currentPt, ComputeTime& com) { TimeStart(UPDATE_START); compute(m,inputData,currentPt); TimeEnd(UPDATE_END); com.updateRes += TimeCal(UPDATE_START,UPDATE_END); } void Residuals::compute(int m, InputData& inputData, Solutions& currentPt) { // p[k] = b[k] - A[k].X; inputData.multi_InnerProductToA(currentPt.xMat,primalVec); Lal::let(primalVec,'=',primalVec,'*',&DMONE); Lal::let(primalVec,'=',primalVec,'+',inputData.b); // D = C - Z - \sum A[k]y[k] inputData.multi_plusToA(currentPt.yVec, dualMat); Lal::let(dualMat,'=',dualMat,'*',&DMONE); Lal::let(dualMat,'=',dualMat,'+',inputData.C); Lal::let(dualMat,'=',dualMat,'-',currentPt.zMat); // rMessage("primal residual ="); // primalVec.display(); // rMessage("dual residual ="); // dualMat.display(); normPrimalVec = computeMaxNorm(primalVec); normDualMat = computeMaxNorm(dualMat); centerNorm = 0.0; } void Residuals::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout," currentRes.primalVec = \n"); primalVec.display(fpout); fprintf(fpout," currentRes.dualMat = \n"); dualMat.display(fpout); fprintf(fpout," currentRes.normPrimalVec = %8.3e\n", normPrimalVec); fprintf(fpout," currentRes.normDualMat = %8.3e\n", normDualMat); } WorkVariables::WorkVariables() { // Nothings needs. } WorkVariables::WorkVariables(int m, BlockStruct& bs) { initialize(m,bs); } WorkVariables::~WorkVariables() { terminate(); } void WorkVariables::initialize(int m, BlockStruct& bs) { DLS1.initialize(bs); DLS2.initialize(bs); // DV1.initialize(m); // DV2.initialize(m); if (bs.SDP_nBlock > 0){ SDP_BV1.initialize(bs); SDP_BV2.initialize(bs); SDP_BV3.initialize(bs); SDP_BV4.initialize(bs); SDP_BV5.initialize(bs); SDP_BV6.initialize(bs); SDP_BV7.initialize(bs); SDP_BV8.initialize(bs); SDP_BV9.initialize(bs); int* workStruct; NewArray(workStruct,int,bs.SDP_nBlock); for (int l=0; l #define PrintSparsity 1 #define PLUS_ADJUST_DIAGONAL (1.0e-10) // #define PLUS_ADJUST_DIAGONAL (m*1.0e-10) // For debug #define FORCE_SCHUR_DENSE 0 #define FORCE_SCHUR_SPARSE 0 #include "sdpa_chordal.h" #define MUMPS_JOB_INIT -1 #define MUMPS_JOB_END -2 #define MUMPS_JOB_ANALYSIS 1 #define MUMPS_JOB_FACTORIZE 2 #define MUMPS_JOB_SOLVE 3 #define MUMPS_USE_COMM_WORLD (-987654) namespace sdpa { Chordal::Chordal() { mumps_usage = false; sparse_bMat_ptr = NULL; best = 0; } Chordal::~Chordal() { terminate(); } void Chordal::initialize(SparseMatrix* sparse_bMat_ptr) { // condition of sparse computation // m_threshold < mDim, // b_threshold < nBlock, // aggregate_threshold >= aggrigated sparsity ratio // extend_threshold >= extended sparsity ratio m_threshold = 100; b_threshold = 5; aggregate_threshold = 0.70; extend_threshold = 0.80; #if FORCE_SCHUR_DENSE // DENSE computation for debugging m_threshold = 10000000; b_threshold = 1000000; aggregate_threshold = 0.0; extend_threshold = 0.0; #endif #if FORCE_SCHUR_SPARSE // SPARSE computation for debugging m_threshold = 0; b_threshold = 0; aggregate_threshold = 2.0; extend_threshold = 2.0; #endif // initialize by assuming Schur would be DENSE best = SELECT_DENSE; this->sparse_bMat_ptr = sparse_bMat_ptr; // initialize MUMPS mumps_id.job = MUMPS_JOB_INIT; mumps_id.comm_fortran = MUMPS_USE_COMM_WORLD; // rank 0 process participates factorizations mumps_id.par = 1; // Only symmetric positive definite matricies mumps_id.sym = 1; // No OUTPUTS mumps_id.icntl[1-1] = -1; mumps_id.icntl[2-1] = -1; mumps_id.icntl[3-1] = -1; mumps_id.icntl[4-1] = 0; // MUMPS selects ordering automatically mumps_id.icntl[7-1] = SELECT_MUMPS_BEST; // for Minumum Degree Ordering // mumps_id.icntl[7-1] = 0; dmumps_c(&mumps_id); mumps_usage = true; } void Chordal::terminate() { if (mumps_usage == true) { mumps_id.job = MUMPS_JOB_END; // No OUTPUTS mumps_id.icntl[1-1] = -1; mumps_id.icntl[2-1] = -1; mumps_id.icntl[3-1] = -1; mumps_id.icntl[4-1] = 0; dmumps_c(&mumps_id); mumps_usage = false; } if (sparse_bMat_ptr) { sparse_bMat_ptr->terminate(); } sparse_bMat_ptr = NULL; } // merge array1 to array2 void Chordal::mergeArray(int na1, int* array1, int na2, int* array2) { int ptr = na1 + na2 - 1; int ptr1 = na1-1; int ptr2 = na2-1; int idx1, idx2; while ((ptr1 >= 0) || (ptr2 >= 0)){ if (ptr1 >= 0){ idx1 = array1[ptr1]; } else { idx1 = -1; } if (ptr2 >= 0 ){ idx2 = array2[ptr2]; } else { idx2 = -1; } if (idx1 > idx2){ array2[ptr] = idx1; ptr1--; } else { array2[ptr] = idx2; ptr2--; } ptr--; } // error check if (ptr != -1){ rMessage("Chordal::mergeArray:: program bug"); } } void Chordal::catArray(int na1, int* array1, int na2, int* array2) { int ind1 = 0; for (int index=0; index initialize(m,m,SparseMatrix::SPARSE, nz,SparseMatrix::DSarrays); sparse_bMat_ptr -> NonZeroCount = nz; int indexNZ = 0; for (j=0; j row_index[indexNZ] = tmp[j][index_i]+1; sparse_bMat_ptr -> column_index[indexNZ] = j+1; sparse_bMat_ptr -> sp_ele[indexNZ] = 0.0; indexNZ++; } } DeleteArray(counter); for (j=0; jNonZeroCount; mumps_id.irn = sparse_bMat_ptr->row_index; mumps_id.jcn = sparse_bMat_ptr->column_index; mumps_id.a = sparse_bMat_ptr->sp_ele; // sparse_bMat_ptr->display(); // rMessage("m = " << m); // rMessage("NonZeroCount = " << sparse_bMat_ptr->NonZeroCount); // No OUTPUTS for analysis mumps_id.icntl[1-1] = -1; mumps_id.icntl[2-1] = -1; mumps_id.icntl[3-1] = -1; mumps_id.icntl[4-1] = 0; // strcpy(mumps_id.write_problem,"write_problem"); dmumps_c(&mumps_id); double lower_nonzeros = (double)mumps_id.infog[20-1]; // if lower_nonzeros is greater than 1.0e+6, // the value infog[20-1] is lower_nonzeros*(-1)/(1.0e+6). // we need to adjust the value. if (lower_nonzeros < 0) { lower_nonzeros *= (-1.0e+6); } #if 0 rMessage("lower_nonzeros = " << lower_nonzeros); rMessage("Schur density = " << lower_nonzeros/((m+1)*m/2)*100 << "%" ); #endif if (mumps_id.infog[1-1] != 0) { rError("MUMPS ERROR " << mumps_id.infog[1-1]); } return lower_nonzeros; } void Chordal::ordering_bMat(int m, int nBlock, InputData& inputData, FILE* Display, FILE* fpOut) { best = SELECT_MUMPS_BEST; #if 0 if ((m <= m_threshold)||(nBlock <= b_threshold)) { best = SELECT_DENSE; return; } #else if (m <= m_threshold) { best = SELECT_DENSE; return; } #endif #if 1 for (int b=0; b m * sqrt(aggregate_threshold)){ best = SELECT_DENSE; return; } } for (int b=0; b m * sqrt(aggregate_threshold)){ best = SELECT_DENSE; return; } } for (int b=0; b m * sqrt(aggregate_threshold)){ best = SELECT_DENSE; return; } } #endif makeGraph(inputData,m); // Here, we initialize sparse_bMat int NonZeroAggregate = sparse_bMat_ptr->NonZeroCount*2-m; if (NonZeroAggregate > aggregate_threshold * (double)m * (double) m) { best = SELECT_DENSE; return; } double lowerExtended = analysisAndcountLowerNonZero(m); double NonZeroExtended = lowerExtended*2 - m; double overM2 = 1.0/((double)m*(double)m)*100.0; #if PrintSparsity /* print sparsity information */ if (Display) { #if 0 fprintf(Display,"dense matrix :\t\t\t%14d elements\n", m*m); fprintf(Display,"aggregate sparsity pattern :\t\t\t%14d elements\n", NonZeroAggregate); fprintf(Display,"extended sparsity pattern :\t\t\t%14d elements\n", (int)NonZeroExtended); fprintf(Display,"Schur density = %.8lf%%\n", (double)NonZeroExtended*overM2); fprintf(Display,"Fill in = %e%%\n", (double)(NonZeroExtended-NonZeroAggregate)*overM2); fprintf(Display, "Estimated FLOPs for elimation process = %e\n", mumps_id.rinfog[1-1]); fprintf(Display, "Maximum Processor Memory Requirement = %d MB = %.2lf GB\n", mumps_id.infog[16-1],(double)mumps_id.infog[16-1]/1024); fprintf(Display, "Total Processors Memory Requirement = %d MB = %.2lf GB\n", mumps_id.infog[17-1],(double)mumps_id.infog[17-1]/1024); #else fprintf(Display, "Full Schur Elements %ld, %.2e\n", (long int)((double)m*m),(double)m*m); fprintf(Display, "Agg %d (%.2e%%)->Ext %d (%.2e%%)" " [Fill %d (%.2e%%)]\n", NonZeroAggregate, (double)NonZeroAggregate*overM2, (int)NonZeroExtended, (double)NonZeroExtended*overM2, (int)(NonZeroExtended-NonZeroAggregate), (double)(NonZeroExtended-NonZeroAggregate)*overM2); fprintf(Display, "Est FLOPs Elim = %.2e:", mumps_id.rinfog[1-1]); fprintf(Display, "MaxMem = %dMB = %.2lfGB:", mumps_id.infog[16-1],(double)mumps_id.infog[16-1]/1024); fprintf(Display, "TotMem = %dMB = %.2lfGB\n", mumps_id.infog[17-1],(double)mumps_id.infog[17-1]/1024); #endif } if (fpOut) { #if 0 fprintf(fpOut,"dense matrix :\t\t\t%14d elements\n", m*m); fprintf(fpOut,"aggregate sparsity pattern :\t\t\t%14d elements\n", NonZeroAggregate); fprintf(fpOut,"extended sparsity pattern :\t\t\t%14d elements\n", (int)NonZeroExtended); fprintf(fpOut,"Schur density = %.8lf%%\n", (double)NonZeroExtended*overM2); fprintf(fpOut,"Fill in = %e%%\n", (double)(NonZeroExtended-NonZeroAggregate)*overM2); fprintf(fpOut, "Estimated FLOPS for elimation process = %e\n", mumps_id.rinfog[1-1]); fprintf(fpOut, "Maximum Processor Memory Requirement = %d MB = %.2lf GB\n", mumps_id.infog[16-1],(double)mumps_id.infog[16-1]/1024); fprintf(fpOut, "Total Processors Memory Requirement = %d MB = %.2lf GB\n", mumps_id.infog[17-1],(double)mumps_id.infog[17-1]/1024); #else fprintf(fpOut, "Full Schur Elements Number %ld, %.2e\n", (long int)((double)m*m),(double)m*m); fprintf(fpOut, "Agg %d (%.2e%%)->Ext %d (%.2e%%)" " [Fill %d (%.2e%%)]\n", NonZeroAggregate, (double)NonZeroAggregate*overM2, (int)NonZeroExtended, (double)NonZeroExtended*overM2, (int)(NonZeroExtended-NonZeroAggregate), (double)(NonZeroExtended-NonZeroAggregate)*overM2); fprintf(fpOut, "Est FLOPs Elim = %.2e:", mumps_id.rinfog[1-1]); fprintf(fpOut, "MaxMem = %dMB = %.2lfGB:", mumps_id.infog[16-1],(double)mumps_id.infog[16-1]/1024); fprintf(fpOut, "TotMem = %dMB = %.2lfGB\n", mumps_id.infog[17-1],(double)mumps_id.infog[17-1]/1024); #endif } #endif if (NonZeroExtended > extend_threshold * m * m){ best = SELECT_DENSE; } double sparse_cost = mumps_id.rinfog[1-1] * 1.15; double dense_cost = 1.0/3.0 * (double)m * (double)m * (double) m; double sd_ratio = 0.85; // The ratio of (dense/sparse) // estimated by BbRosenB10.dat-s #if 0 rMessage("sparse_cost = " << sparse_cost << " : dense_cost = " << dense_cost << " : dense_cost * sd_ratio = " << (dense_cost * sd_ratio)); #endif #if !FORCE_SCHUR_SPARSE if (sparse_cost > dense_cost * sd_ratio) { best = SELECT_DENSE; } #endif } bool Chordal::factorizeSchur(int m, int* diagonalIndex, FILE* Display, FILE* fpOut) { // I need to adjust Schur before factorization // to loose Numerical Error Condition double adjustSize = PLUS_ADJUST_DIAGONAL; for (int i=0; isp_ele[diagonalIndex[i]] += adjustSize; } mumps_id.job = MUMPS_JOB_FACTORIZE; mumps_id.a = sparse_bMat_ptr->sp_ele; dmumps_c(&mumps_id); bool isSuccess = SDPA_SUCCESS; while (mumps_id.infog[1-1] == -9) { #if 0 rMessage("mumps icntl(14) = " << mumps_id.icntl[14-1]); rMessage("mumps icntl(23) = " << mumps_id.icntl[23-1]); #endif if (Display) { fprintf(Display,"MUMPS needs more memory space. Trying ANALYSIS phase once more\n"); } if (fpOut) { fprintf(fpOut, "MUMPS needs more memory space. Trying ANALYSIS phase once more\n"); } mumps_id.icntl[14-1] += 20; // More 20% working memory space analysisAndcountLowerNonZero(m); mumps_id.job = MUMPS_JOB_FACTORIZE; dmumps_c(&mumps_id); } if (mumps_id.infog[1-1] < 0) { isSuccess = SDPA_FAILURE; if (mumps_id.infog[1-1] == -10) { rMessage("Cholesky failed by NUMERICAL ERROR"); rMessage("There are some possibilities."); rMessage("1. SDPA terminates due to inaccuracy of numerical error"); rMessage("2. The input problem may not have (any) interior-points"); rMessage("3. Input matrices are linearly dependent"); } else { rMessage("Cholesky failed with Error Code " << mumps_id.infog[1-1]); } } return isSuccess; } bool Chordal::solveSchur(Vector& rhs) { mumps_id.job = MUMPS_JOB_SOLVE; mumps_id.rhs = rhs.ele; dmumps_c(&mumps_id); return SDPA_SUCCESS; } } // end of namespace 'sdpa' sdpa-7.3.11/param.sdpa0000644000175000017500000000117313211530510014042 0ustar makotomakoto100 unsigned int maxIteration; 1.0E-7 double 0.0 < epsilonStar; 1.0E2 double 0.0 < lambdaStar; 2.0 double 1.0 < omegaStar; -1.0E5 double lowerBound; 1.0E5 double upperBound; 0.1 double 0.0 <= betaStar < 1.0; 0.2 double 0.0 <= betaBar < 1.0, betaStar <= betaBar; 0.9 double 0.0 < gammaStar < 1.0; 1.0E-7 double 0.0 < epsilonDash; %+8.3e char* xPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* XPrint (default %+8.3e, NOPRINT skips printout) %+8.3e char* YPrint (default %+8.3e, NOPRINT skips printout) %+10.16e char* infPrint (default %+10.16e, NOPRINT skips printout) sdpa-7.3.11/sdpa_include.h0000644000175000017500000000251113211530510014671 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*-------------------------------------------------- sdpa_include.h --------------------------------------------------*/ #ifndef __sdpa_include_h__ #define __sdpa_include_h__ #include "sdpa_right.h" #include #include #include #include #include #include using namespace std; #define SDPA_SUCCESS true #define SDPA_FAILURE false #include "sdpa_tool.h" // #include "sdpa_algebra.h" #endif // __sdpa_include_h__ sdpa-7.3.11/configure0000755000175000017500000060324613211530513014014 0ustar makotomakoto#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for sdpa 7.3.11. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sdpa' PACKAGE_TARNAME='sdpa' PACKAGE_VERSION='7.3.11' PACKAGE_STRING='sdpa 7.3.11' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_PACKAGE_MUMPS_FALSE HAVE_PACKAGE_MUMPS_TRUE MUMPS_DIR MUMPS_LIBS MUMPS_INCLUDE LAPACK_LIBS BLAS_LIBS PTHREAD_LIBS PTHREAD_INCLUDE FCLIBS host_os host_vendor host_cpu host build_os build_vendor build_cpu build ac_ct_FC FCFLAGS FC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC RANLIB AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_pthread_include with_pthread_libs with_blas with_lapack with_mumps_include with_mumps_libs ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC FC FCFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures sdpa 7.3.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/sdpa] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of sdpa 7.3.11:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pthread-include Gives pthread include you use(e.g., "-I/usr/include") --with-pthread-libs Gives pthread name you use(e.g., "-lpthread") --with-blas Gives BLAS full name you use(e.g., "/usr/lib/liblblas.a") --with-lapack Gives LAPACK full name you use(e.g., "/usr/lib/liblapack.a") --with-mumps-include Gives MUMPS include you use(e.g., "-I/usr/include or -I/usr/lib/mumps/include") --with-mumps-libs Gives MUMPS library you use(e.g., "/usr/lib/libdmumps_seq.a /usr/lib/libmumps_common_seq.a /usr/lib/libmpiseq_seq.a /usr/lib/libpord_seq.a or /usr/lib/mumps/lib/libdmumps.a /usr/lib/mumps/lib/libmumps_common.a /usr/lib/mumps/lib/libpord.a /usr/lib/mumps/libseq/libmpiseq.a") Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags FC Fortran compiler command FCFLAGS Fortran compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF sdpa configure 7.3.11 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_fc_try_compile LINENO # --------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_fc_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_fc_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus extern "C" # endif int FC_DUMMY_MAIN() { return 1; } #endif #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by sdpa $as_me 7.3.11, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='sdpa' VERSION='7.3.11' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$FC"; then ac_cv_prog_FC="$FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FC=$ac_cv_prog_FC if test -n "$FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 $as_echo "$FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$FC" && break done fi if test -z "$FC"; then ac_ct_FC=$FC for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_FC"; then ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_FC=$ac_cv_prog_ac_ct_FC if test -n "$ac_ct_FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 $as_echo "$ac_ct_FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_FC" && break done if test "x$ac_ct_FC" = x; then FC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FC=$ac_ct_FC fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } if ${ac_cv_fc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_fc_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 $as_echo "$ac_cv_fc_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FCFLAGS=${FCFLAGS+set} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 $as_echo_n "checking whether $FC accepts -g... " >&6; } if ${ac_cv_prog_fc_g+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_cv_prog_fc_g=yes else ac_cv_prog_fc_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 $as_echo "$ac_cv_prog_fc_g" >&6; } if test "$ac_test_FCFLAGS" = set; then FCFLAGS=$ac_save_FCFLAGS elif test $ac_cv_prog_fc_g = yes; then if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-g -O2" else FCFLAGS="-g" fi else if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-O2" else FCFLAGS= fi fi if test $ac_compiler_gnu = yes; then GFC=yes else GFC= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $FC" >&5 $as_echo_n "checking how to get verbose linking output from $FC... " >&6; } if ${ac_cv_prog_fc_v+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_cv_prog_fc_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_verb" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $as_echo "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_fc_v_output="`echo $ac_fc_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_fc_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_fc_v_output=`echo $ac_fc_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_fc_v_output=`echo $ac_fc_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_fc_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_fc_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_fc_v"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $FC" >&5 $as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $FC" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 $as_echo "$as_me: WARNING: compilation failed" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_v" >&5 $as_echo "$ac_cv_prog_fc_v" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran libraries of $FC" >&5 $as_echo_n "checking for Fortran libraries of $FC... " >&6; } if ${ac_cv_fc_libs+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$FCLIBS" != "x"; then ac_cv_fc_libs="$FCLIBS" # Let the user override the test. else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FCFLAGS=$FCFLAGS FCFLAGS="$FCFLAGS $ac_cv_prog_fc_v" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_fc_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $as_echo "$ac_fc_v_output" >&5 FCFLAGS=$ac_save_FCFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_fc_v_output="`echo $ac_fc_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_fc_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_fc_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_fc_v_output=`echo $ac_fc_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_fc_v_output=`echo $ac_fc_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;; esac ac_cv_fc_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_fc_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" done else ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) case $host_os in *cygwin*) ;; *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" ;; esac ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_arg="$ac_arg $ac_j" ac_cv_fc_libs="$ac_cv_fc_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_fc_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg" ;; # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`$as_echo "$ac_fc_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_fc_libs="$ac_cv_fc_libs -Xlinker $ac_link_opt" done else ac_cv_fc_libs="$ac_cv_fc_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_libs" >&5 $as_echo "$ac_cv_fc_libs" >&6; } FCLIBS="$ac_cv_fc_libs" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran libraries" >&5 $as_echo_n "checking for dummy main to link with Fortran libraries... " >&6; } if ${ac_cv_fc_dummy_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_fc_dm_save_LIBS=$LIBS LIBS="$LIBS $FCLIBS" ac_fortran_dm_var=FC_DUMMY_MAIN ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # First, try linking without a dummy main: cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus extern "C" # endif int FC_DUMMY_MAIN() { return 1; } #endif #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=none else ac_cv_fortran_dummy_main=unknown fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define $ac_fortran_dm_var $ac_func #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus extern "C" # endif int FC_DUMMY_MAIN() { return 1; } #endif #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=$ac_func; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu ac_cv_fc_dummy_main=$ac_cv_fortran_dummy_main rm -rf conftest* LIBS=$ac_fc_dm_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_dummy_main" >&5 $as_echo "$ac_cv_fc_dummy_main" >&6; } FC_DUMMY_MAIN=$ac_cv_fc_dummy_main if test "$FC_DUMMY_MAIN" != unknown; then : if test $FC_DUMMY_MAIN != none; then cat >>confdefs.h <<_ACEOF #define FC_DUMMY_MAIN $FC_DUMMY_MAIN _ACEOF if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then $as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "linking to Fortran libraries from C fails See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran name-mangling scheme" >&5 $as_echo_n "checking for Fortran name-mangling scheme... " >&6; } if ${ac_cv_fc_mangling+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS LIBS="cfortran_test.$ac_objext $LIBS $FCLIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus extern "C" # endif int FC_DUMMY_MAIN() { return 1; } #endif #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success=yes; break 2 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done done ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus extern "C" # endif int FC_DUMMY_MAIN() { return 1; } #endif #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success_extra=yes; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test "$ac_success_extra" = "yes"; then ac_cv_fc_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_fc_mangling="$ac_cv_fc_mangling, no underscore" else ac_cv_fc_mangling="$ac_cv_fc_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_fc_mangling="$ac_cv_fc_mangling, no extra underscore" else ac_cv_fc_mangling="$ac_cv_fc_mangling, extra underscore" fi else ac_cv_fc_mangling="unknown" fi else ac_cv_fc_mangling="unknown" fi LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compile a simple Fortran program See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_mangling" >&5 $as_echo "$ac_cv_fc_mangling" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in "lower case, no underscore, no extra underscore") $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") $as_echo "#define FC_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") $as_echo "#define FC_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") $as_echo "#define FC_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") $as_echo "#define FC_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define FC_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 $as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Check whether --with-pthread-include was given. if test "${with_pthread_include+set}" = set; then : withval=$with_pthread_include; PTHREAD_INCLUDE=$withval fi # Check whether --with-pthread-libs was given. if test "${with_pthread_libs+set}" = set; then : withval=$with_pthread_libs; PTHREAD_LIBS=$withval fi # Check whether --with-blas was given. if test "${with_blas+set}" = set; then : withval=$with_blas; BLAS_LIBS=$withval fi # Check whether --with-lapack was given. if test "${with_lapack+set}" = set; then : withval=$with_lapack; LAPACK_LIBS=$withval fi # Check whether --with-mumps-include was given. if test "${with_mumps_include+set}" = set; then : withval=$with_mumps_include; MUMPS_INCLUDE=$withval fi # Check whether --with-mumps-libs was given. if test "${with_mumps_libs+set}" = set; then : withval=$with_mumps_libs; MUMPS_LIBS=$withval fi LIB="-lm" case "$host" in *-*-linux*|*-*-uclinux*) pthread_cflags="-D_REENTRANT" ;; esac CXXFLAGS="$CXXFLAGS $pthread_cflags" CFLAGS="$CFLAGS -Wall -fPIC -funroll-all-loops" CXXFLAGS="$CXXFLAGS -Wall -fPIC -funroll-all-loops" FCFLAGS="$FCFLAGS -Wall -fPIC -funroll-all-loops" HAVE_PTHREAD="" if test x"$PTHREAD_INCLUDE" = x; then PTHREAD_INCLUDE="-I/usr/include" fi if test x"$PTHREAD_LIBS" = x; then PTHREAD_LIBS="-lpthread" fi save_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_LIBS" checkLIBS=$LIBS ac_fn_c_check_func "$LINENO" "pthread_create" "ac_cv_func_pthread_create" if test "x$ac_cv_func_pthread_create" = xyes; then : HAVE_PTHREAD=yes fi LIBS="$save_LIBS" if test x"$HAVE_PTHREAD" != xyes; then echo "Pthread function (pthread_create) was compiled by" echo "( $CC $CXXFLAGS $PTHREAD_INCLUDE conftest.c $checkLIBS )" echo "but failed." echo "(1) Please verify config.log to check whether libraries are linked correctrly" as_fn_error $? "Pthread link failed" "$LINENO" 5 fi HAVE_BLAS="" if test x"$BLAS_LIBS" = x; then BLAS_LIBS="-lblas" fi save_LIBS="$LIBS" ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in upper*) ac_val="DGEMM" ;; lower*) ac_val="dgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dgemm="$ac_val" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$LIBS $BLAS_LIBS $FCLIBS $PTHREAD_LIBS" checkLIBS=$LIBS as_ac_var=`$as_echo "ac_cv_func_$dgemm" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$dgemm" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : HAVE_BLAS=yes fi LIBS="$save_LIBS" if test x"$HAVE_BLAS" != xyes; then echo "BLAS function (dgemm) was compiled by" echo "( $CC $CFLAGS conftest.c $checkLIBS )" echo "but failed." echo "(1) Please verify config.log to check whether libraries are linked correctrly" echo "(2) Please install one of your favorite BLAS" echo "OpenBLAS: http://xianyi.github.com/OpenBLAS/" echo "BLAS: http://www.netlib.org/blas/" echo "ATLAS: http://math-atlas.sourceforge.net/" as_fn_error $? "BLAS link failed" "$LINENO" 5 fi HAVE_LAPACK="" if test x"$LAPACK_LIBS" = x; then LAPACK_LIBS="-llapack" fi save_LIBS="$LIBS" ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in upper*) ac_val="DSYEV" ;; lower*) ac_val="dsyev" ;; *) ac_val="unknown" ;; esac case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dsyev="$ac_val" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$LIBS $LAPACK_LIBS $BLAS_LIBS $FCLIBS $PTHREAD_LIBS" checkLIBS=$LIBS as_ac_var=`$as_echo "ac_cv_func_$dsyev" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$dsyev" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : HAVE_LAPACK=yes fi LIBS="$save_LIBS" if test x"$HAVE_LAPACK" != xyes; then echo "LAPACK function (dsyev) was compiled by" echo "( $CC $CFLAGS conftest.c $checkLIBS )" echo "but failed." echo "Please verify config.log to check whether libraries are linked correctrly" echo "Please install LAPACK" echo "LAPACK: http://www.netlib.org/lapack/" as_fn_error $? "LAPACK link failed" "$LINENO" 5 fi HAVE_MUMPS="" if test x"$MUMPS_INCLUDE" = x; then MUMPS_INCLUDE="-I/usr/include" fi if test x"$MUMPS_LIBS" = x; then MUMPS_LIBS="/usr/lib/libdmumps_seq.a /usr/lib/libmumps_common_seq.a /usr/lib/libmpiseq_seq.a /usr/lib/libpord_seq.a" fi save_LIBS="$LIBS" ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu case $ac_cv_fc_mangling in upper*) ac_val="DMUMPS" ;; lower*) ac_val="dmumps" ;; *) ac_val="unknown" ;; esac case $ac_cv_fc_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dmumps="$ac_val" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="$LIBS $MUMPS_LIBS $LAPACK_LIBS $BLAS_LIBS $FCLIBS $PTHREAD_LIBS" checkLIBS=$LIBS as_ac_var=`$as_echo "ac_cv_func_$dmumps" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$dmumps" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : HAVE_MUMPS=yes fi LIBS="$save_LIBS" if test x"$HAVE_MUMPS" != xyes; then echo "MUMPS link failed" echo "MUMPS function (dmumps) was compiled by" echo "( $CC $CFLAGS $MUMPS_INCLUDE conftest.c $checkLIBS )" echo "but failed." echo "MUMPS packages will be downloaded by wget command." MUMPS_DIR=`pwd`/mumps/build MUMPS_INCLUDE="-I${MUMPS_DIR}/include" MUMPS_LIBS="-L${MUMPS_DIR}/lib -ldmumps -lmumps_common -lpord -L${MUMPS_DIR}/libseq -lmpiseq" fi if test x"$HAVE_MUMPS" = xyes; then HAVE_PACKAGE_MUMPS_TRUE= HAVE_PACKAGE_MUMPS_FALSE='#' else HAVE_PACKAGE_MUMPS_TRUE='#' HAVE_PACKAGE_MUMPS_FALSE= fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PACKAGE_MUMPS_TRUE}" && test -z "${HAVE_PACKAGE_MUMPS_FALSE}"; then as_fn_error $? "conditional \"HAVE_PACKAGE_MUMPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by sdpa $as_me 7.3.11, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ sdpa config.status 7.3.11 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi sdpa-7.3.11/sdpa_io.h0000644000175000017500000000620013211530510013654 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ #ifndef __sdpa_io_h__ #define __sdpa_io_h__ #define lengthOfString 256 #include "sdpa_block.h" #include "sdpa_parts.h" namespace sdpa { class IO { public: static void read(FILE* fpData, FILE* fpout, int& m, char* str); static void read(FILE* fpData, int& nBlock); static void read(FILE* fpData, BlockStruct& bs); static void read(FILE* fpData, Vector& b); static void read(FILE* fpData, DenseLinearSpace& xMat, Vector& yVec, DenseLinearSpace& zMat, BlockStruct& bs, bool inputSparse); static void read(FILE* fpData, int m, BlockStruct& bs, InputData& inputData, bool isDataSparse); // 2008/02/27 kazuhide nakata // without LP_ANonZeroCount static void setBlockStruct(FILE* fpData, InputData& inputData, int m, BlockStruct& bs, long position, bool isDataSparse); // 2008/02/27 kazuhide nakata // without LP_ANonZeroCount static void setElement(FILE* fpData, InputData& inputData, int m, BlockStruct& bs, long position, bool isDataSparse); static void printHeader(FILE* fpout, FILE* Display); static void printOneIteration(int pIteration, AverageComplementarity& mu, RatioInitResCurrentRes& theta, SolveInfo& solveInfo, StepLength& alpha, DirectionParameter& beta, FILE* fpout, FILE* Display); static void printLastInfo(int pIteration, AverageComplementarity& mu, RatioInitResCurrentRes& theta, SolveInfo& solveInfo, StepLength& alpha, DirectionParameter& beta, Residuals& currentRes, Phase & phase, Solutions& currentPt, InputData& inputData, WorkVariables& work, double cputime, ComputeTime& com, Parameter& param, FILE* fpout, FILE* Display, bool printTime = true); static void computeDimacs(double* dimacs_error, SolveInfo& solveInfo, Residuals& currentRes, Solutions& currentPt, InputData& inputData, WorkVariables& work); static void printDimacs(double* dimacs_error, char* printFormat, FILE* fpout); static void printSolution(BlockStruct& bs, Solutions& currentPt, Parameter& param, FILE* fpout); }; } // end of namespace 'sdpa' #endif // __sdpa_io_h__ sdpa-7.3.11/missing0000755000175000017500000001533113211530510013471 0ustar makotomakoto#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: sdpa-7.3.11/Makefile.am0000644000175000017500000000532513211530510014130 0ustar makotomakotoif HAVE_PACKAGE_MUMPS SUBDIRS = etc else SUBDIRS = etc mumps endif includedir = ${prefix}/include datadir = ${prefix}/share/@PACKAGE_NAME@ etcdir = ${prefix}/share/@PACKAGE_NAME@/etc docdir = ${prefix}/share/@PACKAGE_NAME@/doc exampledir = ${prefix}/share/@PACKAGE_NAME@/example libexampledir = ${prefix}/share/@PACKAGE_NAME@/libexample mexdir = ${prefix}/share/@PACKAGE_NAME@/mex man_MANS = sdpa.1 data_DATA = param.sdpa etc/make.inc include_HEADERS = sdpa_algebra.h sdpa_block.h \ sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \ sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \ sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h lib_LIBRARIES = libsdpa.a libsdpa_a_SOURCES = sdpa_block.cpp sdpa_call.cpp sdpa_chordal.cpp \ sdpa_dataset.cpp sdpa_dpotrf.cpp sdpa_io.cpp sdpa_jordan.cpp \ sdpa_linear.cpp sdpa_newton.cpp sdpa_parts.cpp sdpa_solve.cpp \ sdpa_struct.cpp sdpa_tool.cpp \ sdpa_algebra.h sdpa_block.h \ sdpa_call.h sdpa_chordal.h sdpa_dataset.h sdpa_dpotrf.h \ sdpa_include.h sdpa_io.h sdpa_jordan.h sdpa_linear.h sdpa_newton.h \ sdpa_parts.h sdpa_right.h sdpa_struct.h sdpa_tool.h libsdpa_a_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE) bin_PROGRAMS = sdpa sdpa_SOURCES = sdpa_exe.cpp sdpa_LDADD = ./libsdpa.a $(MUMPS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(PTHREAD_LIBS) $(FCLIBS) sdpa_CXXFLAGS = $(pthread_cflags) $(MUMPS_INCLUDE) $(PTHREAD_INCLUDE) # each file of mumps is copied by 'nobase' option # due to sub-directory if HAVE_PACKAGE_MUMPS # nothing to install else # install mumps mumpsdir = ${prefix}/share/@PACKAGE_NAME@ nobase_mumps_HEADERS = mumps/build/include/dmumps_c.h \ mumps/build/include/dmumps_root.h \ mumps/build/include/dmumps_struc.h \ mumps/build/include/mumps_c_types.h \ mumps/build/include/mumps_compat.h nobase_mumps_DATA = mumps/build/lib/libdmumps.a \ mumps/build/lib/libmumps_common.a \ mumps/build/lib/libpord.a \ mumps/build/libseq/libmpiseq.a endif # end of 'if HAVE_PACKAGE_MUMPS' example_DATA = example1.dat-s example1.dat example1.ini \ example1.ini-s example2.dat libexample_DATA = libexample/Makefile \ libexample/example1.cpp libexample/example2.cpp \ libexample/example3.cpp libexample/example4.cpp \ libexample/example5.cpp libexample/example6.cpp mex_DATA = mex/Makefile mex/SDPAToSedumi.m mex/SedumiToSDPA.m \ mex/gensdpafile.m mex/initial_point.m mex/mexAggSDPcones.cpp \ mex/mexDisAggSDPsol.cpp mex/mexFprintf.c mex/mexReadOutput.cpp \ mex/mexReadSDPAToSedumi.cpp mex/mexSedumiWrap.cpp \ mex/mexWriteSedumiToSDPA.cpp mex/mexsdpa.cpp mex/param.m \ mex/read_data.m mex/read_output.m mex/read_outputSedumi.m \ mex/sdpam.m mex/sedumiwrap.m \ mex/CommandList.txt MOSTLYCLEANFILES = mex/*.mex* mex/*.o sdpa-7.3.11/example1.ini0000644000175000017500000000011713211530510014303 0ustar makotomakoto{0.0, -4.0, 0.0} { {11.0, 0.0}, {0.0, 9.0} } { {5.9, -1.375}, {-1.375, 1.0} } sdpa-7.3.11/sdpa_parts.cpp0000644000175000017500000010367713211530510014751 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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_jordan.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; makegVecMul = 0.0; makegVec = 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 gVec Mul = %f, %f\n", makegVecMul, makegVecMul/MainLoop*100.0); fprintf(fpout, " Make gVec time = %f, %f\n", makegVec, makegVec/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.3; 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.2; 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() { terminate(); } void StepLength::initialize(double alphaP, double alphaD) { primal = alphaP; dual = alphaD; } void StepLength::terminate() { // 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; j= dual objective value if (phase.value == SolveInfo::pdFEAS){ // if (mu.current < 1.0){ double objValDual,objValPrimal,incDualObj,incPrimalObj,maxRatio; Lal::let(objValDual,'=',inputData.b,'.',currentPt.yVec); Lal::let(objValPrimal,'=',inputData.C,'.',currentPt.xMat); Lal::let(incDualObj,'=',b,'.',newton.DyVec); incDualObj *= dual; Lal::let(incPrimalObj,'=',C,'.',newton.DxMat); incPrimalObj *= primal; maxRatio = (objValDual - objValPrimal) / (incPrimalObj - incDualObj); if ((maxRatio > 0.0) && (maxRatio < 1.0)){ primal *= maxRatio; dual *= maxRatio; #if 0 printf("max stepsise ratio: %9.1e\n",maxRatio); printf("new stepsize primal:%9.1e, dual:%9.1Fe\n",primal,dual); #endif } } } 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::MehrotraPredictor(Phase& phase, Switch& reduction, Parameter& param) { const double nu = 2.0; if (phase.value == SolveInfo::pdFEAS) { value = 0.0; } else { value = param.betaBar; if (reduction.switchType==Switch::AFFINE) { value = nu; } } } void DirectionParameter:: MehrotraCorrector(Phase& phase,StepLength& alpha, Solutions& currentPt,Newton& newton, AverageComplementarity& mu,Parameter& param) { int nDim = currentPt.nDim; double xMatvMat; Lal::let(xMatvMat,'=',currentPt.xMat,'.',newton.DzMat); double uMatzMat; Lal::let(uMatzMat,'=',newton.DxMat,'.',currentPt.zMat); double uMatvMat; Lal::let(uMatvMat,'=',newton.DxMat,'.',newton.DzMat); double muTarget = mu.current + (alpha.primal*uMatzMat + alpha.dual*xMatvMat + alpha.primal*alpha.dual*uMatvMat) / nDim; // rMessage("muTarget : " << muTarget); // rMessage("muCurrent : " << mu.current); value = muTarget/mu.current; // rMessage("muValue : " << value); if (value < 1.0) { value = value*value; } if (phase.value==SolveInfo::pdFEAS) { // rMessage("MehrotraCorrector : pdFEAS" << value); if (value < param.betaStar) { value = param.betaStar; } if (value > 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::initialize(Solutions& initPt) { int nDim = initPt.nDim; Lal::let(initial,'=',initPt.xMat,'.',initPt.zMat); initial /= nDim; current = initial; } void AverageComplementarity::update(Solutions& currentPt) { int nDim = currentPt.nDim; Lal::let(current,'=',currentPt.xMat,'.',currentPt.zMat); current /= nDim; } void AverageComplementarity::display(FILE* fpout) { if (fpout == NULL) { return; } fprintf(fpout,"mu0 = %8.3e\n",initial); fprintf(fpout,"mu = %8.3e\n",current); } //-------------------------------------------------- RatioInitResCurrentRes::RatioInitResCurrentRes() { primal = 0.0; dual = 0.0; } RatioInitResCurrentRes::~RatioInitResCurrentRes() { // Nothing needs. } RatioInitResCurrentRes::RatioInitResCurrentRes(Parameter& param, Residuals& initRes) { initialize(param,initRes); } void RatioInitResCurrentRes::initialize(Parameter& param, Residuals& initRes) { double accuracy = param.epsilonDash; if (initRes.normPrimalVec < accuracy) { primal = 0.0; } else { primal = 1.0; } if (initRes.normDualMat < accuracy) { dual = 0.0; } else { dual = 1.0; } } void RatioInitResCurrentRes::update(Switch& reduction, StepLength& alpha) { if (reduction.switchType==Switch::CENTERING) { // At least one of primal or dual is infeasible primal = fabs((1.0-alpha.primal)*primal); dual = fabs((1.0-alpha.dual )*dual ); } } void RatioInitResCurrentRes::update_exact(Residuals& initRes, Residuals& currentRes, Parameter& param) { if (initRes.normPrimalVec > param.epsilonDash * 1.0e-2) { primal = currentRes.normPrimalVec / initRes.normPrimalVec; } else { primal = 0.0; } if (initRes.normDualMat > param.epsilonDash * 1.0e-2) { dual = currentRes.normDualMat / initRes.normDualMat; } 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; SparseLinearSpace& C = inputData.C; rho = 1.0; etaPrimal = omegaStar * nDim * mu0; etaDual = omegaStar * nDim * mu0; Lal::let(objValPrimal,'=',C,'.',currentPt.xMat); Lal::let(objValDual ,'=',b,'.',currentPt.yVec); } void SolveInfo::update(InputData& inputData, DenseLinearSpace& initPt_xMat, DenseLinearSpace& initPt_zMat, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, RatioInitResCurrentRes& theta, Parameter& param) { int nDim = currentPt.nDim; Vector& b = inputData.b; SparseLinearSpace& C = inputData.C; Lal::let(objValPrimal,'=',C,'.',currentPt.xMat); Lal::let(objValDual ,'=',b,'.',currentPt.yVec); double primal = theta.primal; double dual = theta.dual; double omega = param.omegaStar; rho = 0.0; double x0z0 = nDim*mu.initial; double xMatzMat = nDim*mu.current; double x0zMat = 0.0; double xMatz0 = 0.0; Lal::let(x0zMat,'=',initPt_xMat,'.',currentPt.zMat); Lal::let(xMatz0,'=',currentPt.xMat,'.',initPt_zMat); double accuracy = param.epsilonDash; if (currentRes.normPrimalVec <= accuracy) { // rMessage("primal accuracy"); if (xMatz0 < etaPrimal) { etaPrimal = xMatz0; } } if (currentRes.normDualMat <= accuracy) { // rMessage("dual accuracy"); if (x0zMat < etaDual) { etaDual = x0zMat; } } // primal is infeasible and dual is feasible if (currentRes.normPrimalVec > accuracy && currentRes.normDualMat <= accuracy) { rho = primal*x0zMat / ((primal+(1.0-primal)*omega)*etaDual + xMatzMat); } // primal is feasible and dual is infeasible if (currentRes.normPrimalVec <= accuracy && currentRes.normDualMat > accuracy) { rho = dual*xMatz0 / ((dual+(1.0-dual)*omega)* etaPrimal + xMatzMat); } // primal and dual are infeasible if (currentRes.normPrimalVec > accuracy && currentRes.normDualMat > 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); } void SolveInfo::update(double& lambda, InputData& inputData, Solutions& currentPt, Residuals& currentRes, AverageComplementarity& mu, RatioInitResCurrentRes& theta, Parameter& param) { int nDim = currentPt.nDim; Vector& b = inputData.b; SparseLinearSpace& C = inputData.C; Lal::let(objValPrimal,'=',C,'.',currentPt.xMat); Lal::let(objValDual ,'=',b,'.',currentPt.yVec); double primal = theta.primal; double dual = theta.dual; double omega = param.omegaStar; rho = 0.0; double x0z0 = nDim*mu.initial; double xMatzMat = nDim*mu.current; double x0zMat = 0.0; double xMatz0 = 0.0; for (int l=0; l accuracy && currentRes.normDualMat <= accuracy) { rho = primal*x0zMat / ((primal+(1.0-primal)*omega)*etaDual + xMatzMat); } // primal is feasible and dual is infeasible if (currentRes.normPrimalVec <= accuracy && currentRes.normDualMat > accuracy) { rho = dual*xMatz0 / ((dual+(1.0-dual)*omega)* etaPrimal + xMatzMat); } // primal and dual are infeasible if (currentRes.normPrimalVec > accuracy && currentRes.normDualMat > 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) { 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); } 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(Residuals& initRes, SolveInfo& solveInfo, Parameter& param, int nDim) { initialize(initRes,solveInfo,param,nDim); } Phase::~Phase() { // Nothing needs. } bool Phase::initialize(Residuals& initRes, SolveInfo& solveInfo, Parameter& param, int nDim) { this->nDim = nDim; return updateCheck(initRes,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.normPrimalVec <= accuracy) { if (currentRes.normDualMat <= accuracy) { value = SolveInfo::pdFEAS; } else { value = SolveInfo::pFEAS; } } if (value==SolveInfo::noINFO && currentRes.normDualMat <= 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' sdpa-7.3.11/README0000644000175000017500000000433513211530510012754 0ustar makotomakotoSDPA (SemiDefinite Programming Algorithm) High-performance software package for SemiDefinite Programs Copyright (C) 1995-2017 SDPA Project "SDPA (SemiDefinite Programming Algorithm)" is one of the most efficient and stable software packages for solving SDPs based on the primal-dual interior-point method. SDP (SemiDefinite Programs) is used for financial engineering, machine learning, control theory, sensor network problem, quantum chemistry, quantum information, combinatorial optimizaiton, polynomial optimization, and so on. If you have questions on the installation, please contact us from http://sdpa.sourceforge.net/contact.html More information can be found at [1] http://sdpa.sourceforge.net/contact.html About SDP (SemiDefinite Programs) and User Manual About SDPA and SDPA family [2] File 'INSTALL' To install SDPA by the three steps ./configure && make && make install The following is same as a part of debian/README in debian package. =============================================================== "SDPA (SemiDefinite Programming Algorithm)" is one of the most efficient and stable software packages for solving SDPs based on the primal-dual interior-point method. SDP (SemiDefinite Programs) is used for financial engineering, machine learning, control theory, sensor network problem, quantum chemistry, quantum information, combinatorial optimizaiton, polynomial optimization, and so on. The user-manual of SDPA is available at https://sourceforge.net/projects/sdpa/files/sdpa/sdpa.7.1.1.manual.20080618.pdf/download Note for numerical evaluations: SDPA debian package is usually linked with openblas-base package. This openblas-base package might not be optimized for your processor. To report computation time of SDPA in some article, you should install optimized BLAS and compile SDPA from its source code. SDPA-M: The user-manual of SDPA-M is available at https://sourceforge.net/projects/sdpa/files/sdpa-m/sdpamManual.pdf/download To compile the mex files with Matlab, $ cp -r /usr/share/sdpa/mex . $ cd mex $ make MAKE_INCLUDE_DIR=/usr/share/sdpa/ To compile the mex files with Octave, $ cp -r /usr/share/sdpa/mex . $ cd mex $ make MAKE_INCLUDE_DIR=/usr/share/sdpa/ COMPILE_ENVIRONMENT=octave sdpa-7.3.11/config.sub0000755000175000017500000010344513211530510014061 0ustar makotomakoto#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: sdpa-7.3.11/sdpa_solve.cpp0000644000175000017500000002077513211530510014745 0ustar makotomakoto/* ------------------------------------------------------------- This file is a component of SDPA Copyright (C) 2004-2017 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 ------------------------------------------------------------- */ /*-------------------------------------------------- sdpa_solve.cpp --------------------------------------------------*/ #include "sdpa_call.h" #include "sdpa_linear.h" #include "sdpa_io.h" using namespace sdpa; void SDPA::initializeSolve() { TimeStart(FILE_CHANGE_START1); // if possible , change C and A to Dense inputData.C.changeToDense(); for (int k=0; k thetamax*thetaMax*mu.initial break; } // rMessage("currentPt = "); currentPt.display(); // rMessage("updated"); theta.update(reduction,alpha); mu.update(currentPt); currentRes.update(m,inputData, currentPt, com); theta.update_exact(initRes,currentRes, param); if (isInitPoint) { solveInfo.update(inputData, initPt_xMat, initPt_zMat, currentPt, currentRes, mu, theta, param); } else { solveInfo.update(param.lambdaStar,inputData, currentPt, currentRes, mu, theta, param); } // 2007/09/18 kazuhide nakata // print information of ObjVal, residual, gap, complementarity // solveInfo.check(inputData, currentPt, // currentRes, mu, theta, param); pIteration++; } // end of MAIN_LOOP if (pIteration == param.maxIteration) { rMessage("maxIteration is reached"); } TimeEnd(MAIN_LOOP_END1); com.MainLoop = TimeCal(MAIN_LOOP_START1, MAIN_LOOP_END1); com.TotalTime += com.MainLoop; currentRes.compute(m,inputData,currentPt); #if REVERSE_PRIMAL_DUAL Lal::let(currentPt.yVec,'=',currentPt.yVec,'*',&DMONE); phase.reverse(); #endif IO::printLastInfo(pIteration, mu, theta, solveInfo, alpha, beta, currentRes, phase, currentPt, inputData, work, com.TotalTime, com, param, fpout, Display); IO::printSolution(bs, currentPt, param, fpout); // com.display(fpout); if (Display) { fprintf(Display, " main loop time = %.6f\n",com.MainLoop); fprintf(Display, " total time = %.6f\n",com.TotalTime); fprintf(Display, "file check time = %.6f\n",com.FileCheck); fprintf(Display, "file change time = %.6f\n",com.FileChange); fprintf(Display, "file read time = %.6f\n",com.FileRead); } if (fpout) { fprintf(fpout, " main loop time = %.6f\n",com.MainLoop); fprintf(fpout, " total time = %.6f\n",com.TotalTime); fprintf(fpout, " file check time = %.6f\n",com.FileCheck); fprintf(fpout, " file change time = %.6f\n",com.FileChange); fprintf(fpout, " file read time = %.6f\n",com.FileRead); } } sdpa-7.3.11/NEWS0000644000175000017500000000011313211530510012561 0ustar makotomakotoFor the latest news on SDPA, please refer to http://sdpa.sourceforge.net/