DSDP
zeromat.c
Go to the documentation of this file.
1#include "dsdpdatamat_impl.h"
2#include "dsdpsys.h"
7static int ZDestroy(void*);
8static int ZView(void*);
9static int ZVecVec(void*, double[], int, double *);
10static int ZDot(void*, double[], int, int,double *);
11static int ZGetRank(void*, int*,int);
12static int ZFactor(void*);
13static int ZGetEig(void*, int, double*, double[], int,int[],int*);
14static int ZAddRowMultiple(void*, int, double, double[], int);
15static int ZAddMultiple(void*, double, double[], int,int);
16static int ZRowNnz(void*, int, int[], int*, int);
17
18static struct DSDPDataMat_Ops zeromatops;
19static int ZeroMatopsInitialize(struct DSDPDataMat_Ops*);
20
21int DSDPGetZeroDataMatOps(struct DSDPDataMat_Ops** zops){
22 int info;
23 info=ZeroMatopsInitialize(&zeromatops); if (info){return info;}
24 if (zops){*zops=&zeromatops;}
25 return info;
26}
27
28static int ZFactor(void *A){
29 return 0;
30}
31
32static int ZGetRank(void*A,int*rank,int n){
33 *rank=0;
34 return 0;
35}
36
37static int ZGetEig(void*A,int neig, double *eig, double v[], int n,int indx[],int*nind){
38 *eig=0.0;
39 *nind=0;
40 return 0;
41}
42
43static int ZDot(void*A, double x[], int nn, int n, double *sum){
44 *sum=0.0;
45 return 0;
46}
47
48static int ZVecVec(void*A, double x[], int n, double *sum){
49 *sum=0.0;
50 return 0;
51}
52
53static int ZAddMultiple(void*A, double dd, double row[], int nn, int n){
54 return 0;
55}
56
57static int ZAddRowMultiple(void*A, int nrow, double dd, double row[], int n){
58 return 0;
59}
60
61static int ZRowNnz(void*A, int row, int nz[], int *nnz, int n){
62 *nnz=0;
63 return 0;
64}
65
66static int ZDestroy(void*A){
67 return 0;
68}
69
70static int ZNorm2(void*A,int n,double *v){
71 *v=0;
72 return 0;
73}
74
75static int ZView(void*A){
76 printf("All zeros\n");
77 return 0;
78}
79
80static const char* datamatname="MATRIX OF ZEROS";
81
82static int ZeroMatopsInitialize(struct DSDPDataMat_Ops* sops){
83 int info;
84 if (sops==NULL) return 0;
85 info=DSDPDataMatOpsInitialize(sops); if (info){ return info;}
86 sops->matfactor1=ZFactor;
87 sops->matgetrank=ZGetRank;
88 sops->matgeteig=ZGetEig;
89 sops->matvecvec=ZVecVec;
90 sops->matdot=ZDot;
91 sops->matfnorm2=ZNorm2;
92 sops->matrownz=ZRowNnz;
93 sops->mataddrowmultiple=ZAddRowMultiple;
94 sops->mataddallmultiple=ZAddMultiple;
95 sops->matdestroy=ZDestroy;
96 sops->matview=ZView;
97 sops->id=10;
98 sops->matname=datamatname;
99 return 0;
100}
101
102
103
int DSDPDataMatOpsInitialize(struct DSDPDataMat_Ops *dops)
Initialize the table of function pointers for SDP Data matrices.
Definition dsdpdatamat.c:47
Structure of function pointers that each SDP data matrix type (sparse, dense, constant,...
Error handling, printing, and profiling.
Table of function pointers that operate on the data matrix.