DSDP
src
solver
dsdpvec.h
Go to the documentation of this file.
1
#if !defined(__DSDP_VECTORS_H)
2
#define __DSDP_VECTORS_H
3
4
#include <math.h>
9
/* Define DSDP Vector Structure */
10
20
struct
DSDPVec_C{
21
int
dim;
22
double
*val;
23
};
24
25
typedef
struct
DSDPVec_C
DSDPVec
;
26
27
#define DSDPVecGetArray(a,b) 0;{ *(b)=((a).val); }
28
#define DSDPVecRestoreArray(a,b) 0;{ *(b)=0; }
29
#define DSDPVecGetSize(a,b) 0;{ *(b)=((a).dim); }
30
#define DSDPVecAddElement(a,b,c) 0;{ if (c){((a).val[b])+=(c);} }
31
#define DSDPVecSetElement(a,b,c) 0;{ {((a).val[b])=(c); } }
32
#define DSDPVecGetElement(a,b,c) 0;{ *(c)=((a).val[b]); }
33
#define DSDPVecSetR(a,b) 0;{ {((a).val[(a).dim-1])=(b); } }
34
#define DSDPVecAddR(a,b) 0;{ if(b){((a).val[(a).dim-1])+=(b); } }
35
#define DSDPVecGetR(a,b) 0;{ *(b)=((a).val[(a).dim-1]); }
36
#define DSDPVecSetC(a,b) 0;{ {((a).val[0])=(b); } }
37
#define DSDPVecAddC(a,b) 0;{ if(b){((a).val[0])+=(b); } }
38
#define DSDPVecGetC(a,b) 0;{ *(b)=((a).val[0]); }
39
#define DSDPVecCreateWArray(a,b,c) 0;{ (*(a)).val=(b); (*(a)).dim=(c);}
40
/*
41
extern int DSDPVecGetArray(DSDPVec, double **);
42
extern int DSDPVecRestoreArray(DSDPVec, double **);
43
extern int DSDPVecGetSize(DSDPVec, int *);
44
extern int DSDPVecAddElement(DSDPVec, int, double);
45
extern int DSDPVecSetElement(DSDPVec, int, double);
46
extern int DSDPVecGetElement(DSDPVec, int, double*);
47
extern int DSDPVecCreateWArray(DSDPVec*, double*, int);
48
*/
49
#ifdef __cplusplus
50
extern
"C"
{
51
#endif
52
53
extern
int
DSDPVecCreateSeq(
int
,
DSDPVec
*);
54
extern
int
DSDPVecDuplicate(
DSDPVec
,
DSDPVec
*);
55
extern
int
DSDPVecSet(
double
,
DSDPVec
);
56
extern
int
DSDPVecISet(
int
*,
DSDPVec
);
57
extern
int
DSDPVecZero(
DSDPVec
);
58
extern
int
DSDPVecNormalize(
DSDPVec
);
59
extern
int
DSDPVecSetValue(
DSDPVec
,
int
,
double
);
60
extern
int
DSDPVecSetBasis(
DSDPVec
,
int
);
61
extern
int
DSDPVecCopy(
DSDPVec
,
DSDPVec
);
62
extern
int
DSDPVecScale(
double
,
DSDPVec
);
63
extern
int
DSDPVecScaleCopy(
DSDPVec
,
double
,
DSDPVec
);
64
extern
int
DSDPVecAXPY(
double
,
DSDPVec
,
DSDPVec
);
65
extern
int
DSDPVecAYPX(
double
,
DSDPVec
,
DSDPVec
);
66
extern
int
DSDPVecWAXPY(
DSDPVec
,
double
,
DSDPVec
,
DSDPVec
);
67
extern
int
DSDPVecWAXPBY(
DSDPVec
,
double
,
DSDPVec
,
double
,
DSDPVec
);
68
extern
int
DSDPVecPointwiseMin(
DSDPVec
,
DSDPVec
,
DSDPVec
);
69
extern
int
DSDPVecPointwiseMax(
DSDPVec
,
DSDPVec
,
DSDPVec
);
70
extern
int
DSDPVecPointwiseMult(
DSDPVec
,
DSDPVec
,
DSDPVec
);
71
extern
int
DSDPVecPointwiseDivide(
DSDPVec
,
DSDPVec
,
DSDPVec
);
72
extern
int
DSDPVecReciprocalSqrt(
DSDPVec
);
73
extern
int
DSDPVecDot(
DSDPVec
,
DSDPVec
,
double
*);
74
extern
int
DSDPVecSum(
DSDPVec
,
double
*);
75
extern
int
DSDPVecNorm1(
DSDPVec
,
double
*);
76
extern
int
DSDPVecNorm2(
DSDPVec
,
double
*);
77
extern
int
DSDPVecNorm22(
DSDPVec
,
double
*);
78
extern
int
DSDPVecNormInfinity(
DSDPVec
,
double
*);
79
extern
int
DSDPVecAbsoluteValue(
DSDPVec
);
80
extern
int
DSDPVecShift(
double
,
DSDPVec
);
81
extern
int
DSDPVecView(
DSDPVec
);
82
extern
int
DSDPVecDestroy(
DSDPVec
*);
83
84
#ifdef __cplusplus
85
}
86
#endif
87
88
#endif
89
DSDPVec
struct DSDPVec_C DSDPVec
This object hold m+2 variables: a scaling of C, the y variables, and r.
Definition
dsdpvec.h:25
Generated by
1.9.7