-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsdpa_io.h
68 lines (48 loc) · 4.18 KB
/
sdpa_io.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* -------------------------------------------------------------
This file is a component of SDPA
Copyright (C) 2004 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__
#include <sdpa_parts.h>
#define lengthOfString 256
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, int nBlock, int *blockStruct);
static void read(FILE *fpData, Vector &b);
static void read(FILE *fpData, DenseLinearSpace &xMat, Vector &yVec, DenseLinearSpace &zMat, bool inputSparse);
static void read(FILE *fpData, int m, int SDP_nBlock, int *SDP_blockStruct, int SOCP_nBlock, int *SOCP_blockStruct, int LP_nBlock, int nBlock, int *blockStruct, int *blockType, int *blockNumber, InputData &inputData, bool isDataSparse);
// 2008/02/27 kazuhide nakata
// not use
static void read(FILE *fpData, int m, int SDP_nBlock, int *SDP_blockStruct, int *SDP_CNonZeroCount, int *SDP_ANonZeroCount, int SOCP_nBlock, int *SOCP_blockStruct, int *SOCP_CNonZeroCount, int *SOCP_ANonZeroCount, int LP_nBlock, bool *LP_CNonZeroCount, bool *LP_ANonZeroCount, int nBlock, int *blockStruct, int *blockType, int *blockNumber, bool isDataSparse);
// 2008/02/27 kazuhide nakata
// not use
static void read(FILE *fpData, InputData &inputData, int m, int SDP_nBlock, int *SDP_blockStruct, int SOCP_nBlock, int *SOCP_blockStruct, int LP_nBlock, int nBlock, int *blockStruct, int *blockType, int *blockNumber, long position, bool isDataSparse);
// 2008/02/27 kazuhide nakata
// without LP_ANonZeroCount
static void setBlockStruct(FILE *fpData, InputData &inputData, int m, int SDP_nBlock, int *SDP_blockStruct, int SOCP_nBlock, int *SOCP_blockStruct, int LP_nBlock, int nBlock, int *blockStruct, int *blockType, int *blockNumber, long position, bool isDataSparse);
// 2008/02/27 kazuhide nakata
// without LP_ANonZeroCount
static void setElement(FILE *fpData, InputData &inputData, int m, int SDP_nBlock, int *SDP_blockStruct, int SOCP_nBlock, int *SOCP_blockStruct, int LP_nBlock, int nBlock, int *blockStruct, int *blockType, int *blockNumber, 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 ¤tRes, Phase &phase, Solutions ¤tPt, double cputime, InputData &inputData, WorkVariables &work, ComputeTime &com, Parameter ¶m, FILE *fpout, FILE *Display, bool printTime = true);
static void printLastInfo(int pIteration, AverageComplementarity &mu, RatioInitResCurrentRes &theta, SolveInfo &solveInfo, StepLength &alpha, DirectionParameter &beta, Residuals ¤tRes, Phase &phase, Solutions ¤tPt, double cputime, int nBlok, int *blockStruct, int *blockType, int *blockNumber, InputData &inputData, WorkVariables &work, ComputeTime &com, Parameter ¶m, FILE *fpout, FILE *Display, bool printTime = true);
static void displayDenseLinarSpaceLast(DenseLinearSpace &aMat, int nBlock, int *blockStruct, int *blockType, int *blockNumber, const char *printFormat, FILE *fpout);
};
} // namespace sdpa
#endif // __sdpa_io_h__