00001 #include "dsdpdatamat_impl.h"
00002 #include "dsdpsys.h"
00007 static int ZDestroy(void*);
00008 static int ZView(void*);
00009 static int ZVecVec(void*, double[], int, double *);
00010 static int ZDot(void*, double[], int, int,double *);
00011 static int ZGetRank(void*, int*,int);
00012 static int ZFactor(void*);
00013 static int ZGetEig(void*, int, double*, double[], int,int[],int*);
00014 static int ZAddRowMultiple(void*, int, double, double[], int);
00015 static int ZAddMultiple(void*, double, double[], int,int);
00016 static int ZRowNnz(void*, int, int[], int*, int);
00017
00018 static struct DSDPDataMat_Ops zeromatops;
00019 static int ZeroMatopsInitialize(struct DSDPDataMat_Ops*);
00020
00021 int DSDPGetZeroDataMatOps(struct DSDPDataMat_Ops** zops){
00022 int info;
00023 info=ZeroMatopsInitialize(&zeromatops); if (info){return info;}
00024 if (zops){*zops=&zeromatops;}
00025 return info;
00026 }
00027
00028 static int ZFactor(void *A){
00029 return 0;
00030 }
00031
00032 static int ZGetRank(void*A,int*rank,int n){
00033 *rank=0;
00034 return 0;
00035 }
00036
00037 static int ZGetEig(void*A,int neig, double *eig, double v[], int n,int indx[],int*nind){
00038 *eig=0.0;
00039 *nind=0;
00040 return 0;
00041 }
00042
00043 static int ZDot(void*A, double x[], int nn, int n, double *sum){
00044 *sum=0.0;
00045 return 0;
00046 }
00047
00048 static int ZVecVec(void*A, double x[], int n, double *sum){
00049 *sum=0.0;
00050 return 0;
00051 }
00052
00053 static int ZAddMultiple(void*A, double dd, double row[], int nn, int n){
00054 return 0;
00055 }
00056
00057 static int ZAddRowMultiple(void*A, int nrow, double dd, double row[], int n){
00058 return 0;
00059 }
00060
00061 static int ZRowNnz(void*A, int row, int nz[], int *nnz, int n){
00062 *nnz=0;
00063 return 0;
00064 }
00065
00066 static int ZDestroy(void*A){
00067 return 0;
00068 }
00069
00070 static int ZNorm2(void*A,int n,double *v){
00071 *v=0;
00072 return 0;
00073 }
00074
00075 static int ZView(void*A){
00076 printf("All zeros\n");
00077 return 0;
00078 }
00079
00080 static const char* datamatname="MATRIX OF ZEROS";
00081
00082 static int ZeroMatopsInitialize(struct DSDPDataMat_Ops* sops){
00083 int info;
00084 if (sops==NULL) return 0;
00085 info=DSDPDataMatOpsInitialize(sops); if (info){ return info;}
00086 sops->matfactor1=ZFactor;
00087 sops->matgetrank=ZGetRank;
00088 sops->matgeteig=ZGetEig;
00089 sops->matvecvec=ZVecVec;
00090 sops->matdot=ZDot;
00091 sops->matfnorm2=ZNorm2;
00092 sops->matrownz=ZRowNnz;
00093 sops->mataddrowmultiple=ZAddRowMultiple;
00094 sops->mataddallmultiple=ZAddMultiple;
00095 sops->matdestroy=ZDestroy;
00096 sops->matview=ZView;
00097 sops->id=10;
00098 sops->matname=datamatname;
00099 return 0;
00100 }
00101
00102
00103