Newer
Older
}
int PrintListOfDouble(char *format, List_T *list, char *buffer)
{
// if format does not contain formatting characters, dump the list (useful for
// quick debugging of lists)
int numFormats = 0;

Christophe Geuzaine
committed
for(unsigned int i = 0; i < strlen(format); i++)
if(format[i] == '%') numFormats++;
if(!numFormats){
strcpy(buffer, format);
for(int i = 0; i < List_Nbr(list); i++){
double d;
List_Read(list, i, &d);
char tmp[256];
strcat(buffer, tmp);
}
return 0;
}
char tmp1[256], tmp2[256];
int j = 0, k = 0;
buffer[j] = '\0';
while(j < (int)strlen(format) && format[j] != '%') j++;
buffer[j] = '\0';
strcat(buffer, "%");
j++;
strncpy(tmp1, &(format[k]), j-k);
tmp1[j-k] = '\0';
strcat(buffer, tmp2);
return List_Nbr(list) - i;
}
if(j != (int)strlen(format))
return -1;
return 0;
}

Christophe Geuzaine
committed
fullMatrix<double> ListOfListOfDouble2Matrix(List_T *list)
{
int M = List_Nbr(list);
int N = 0;
for(int i = 0; i < M; i++){
List_T *line = *(List_T**)List_Pointer_Fast(list, i);
N = std::max(N, List_Nbr(line));
}
for(int i = 0; i < M; i++){
List_T *line = *(List_T**)List_Pointer_Fast(list, i);
for(int j = 0; j < List_Nbr(line); j++){
double val;
List_Read(line, j, &val);
}
}
for(int i = 0; i < List_Nbr(list); i++)
List_Delete(*(List_T**)List_Pointer(list, i));
List_Delete(list);
return mat;
}
Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname.c_str(), gmsh_yylineno - 1,
s, gmsh_yytext);
}
void yymsg(int level, const char *fmt, ...)
va_list args;
va_start(args, fmt);
vsprintf(tmp, fmt, args);
va_end(args);

Christophe Geuzaine
committed
if(level == 0){
Msg::Error("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);
gmsh_yyerrorstate++;
}
else
Msg::Warning("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);
}