| 1053 | **********************************************************************/ |
| 1054 | |
| 1055 | static boole CVAllocVectors(CVodeMem cv_mem, integer neq, int maxord, |
| 1056 | void *machEnv) |
| 1057 | { |
| 1058 | int i, j; |
| 1059 | |
| 1060 | /* Allocate ewt, acor, tempv, ftemp */ |
| 1061 | |
| 1062 | ewt = N_VNew(neq, (machEnvType)machEnv); |
| 1063 | if (ewt == NULL) return(FALSE); |
| 1064 | acor = N_VNew(neq, (machEnvType)machEnv); |
| 1065 | if (acor == NULL) { |
| 1066 | N_VFree(ewt); |
| 1067 | return(FALSE); |
| 1068 | } |
| 1069 | tempv = N_VNew(neq, (machEnvType)machEnv); |
| 1070 | if (tempv == NULL) { |
| 1071 | N_VFree(ewt); |
| 1072 | N_VFree(acor); |
| 1073 | return(FALSE); |
| 1074 | } |
| 1075 | ftemp = N_VNew(neq, (machEnvType)machEnv); |
| 1076 | if (ftemp == NULL) { |
| 1077 | N_VFree(tempv); |
| 1078 | N_VFree(ewt); |
| 1079 | N_VFree(acor); |
| 1080 | return(FALSE); |
| 1081 | } |
| 1082 | |
| 1083 | /* Allocate zn[0] ... zn[maxord] */ |
| 1084 | |
| 1085 | for (j=0; j <= maxord; j++) { |
| 1086 | zn[j] = N_VNew(neq, (machEnvType)machEnv); |
| 1087 | if (zn[j] == NULL) { |
| 1088 | N_VFree(ewt); |
| 1089 | N_VFree(acor); |
| 1090 | N_VFree(tempv); |
| 1091 | N_VFree(ftemp); |
| 1092 | for (i=0; i < j; i++) N_VFree(zn[i]); |
| 1093 | return(FALSE); |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | /* Set solver workspace lengths */ |
| 1098 | |
| 1099 | lrw = (maxord + 5)*neq; |
| 1100 | liw = 0; |
| 1101 | |
| 1102 | return(TRUE); |
| 1103 | } |
| 1104 | |
| 1105 | /***************** CVFreeVectors ********************************* |
| 1106 |
no test coverage detected