Skip to content
Snippets Groups Projects
Gmsh.tab.cpp 426 KiB
Newer Older
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));
  }
  fullMatrix<double> mat(M, N);
  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);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
      mat(i, j) = val;
Christophe Geuzaine's avatar
Christophe Geuzaine committed
  for(int i = 0; i < List_Nbr(list); i++)
    List_Delete(*(List_T**)List_Pointer(list, i));
  List_Delete(list);
Christophe Geuzaine's avatar
Christophe Geuzaine committed
void yyerror(const char *s)
  Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname.c_str(), gmsh_yylineno - 1,
             s, gmsh_yytext);
Christophe Geuzaine's avatar
 
Christophe Geuzaine committed
  gmsh_yyerrorstate++;
void yymsg(int level, const char *fmt, ...)
Christophe Geuzaine's avatar
Christophe Geuzaine committed
  char tmp[1024];
  va_start(args, fmt);
  vsprintf(tmp, fmt, args);
  va_end(args);
    Msg::Error("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);
    Msg::Warning("'%s', line %d : %s", gmsh_yyname.c_str(), gmsh_yylineno - 1, tmp);