Skip to content
Snippets Groups Projects
Select Git revision
  • 2bcacf23da1468e7fc820c20550ae0476a701982
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

dgRungeKuttaMultirate.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    List.cpp 9.53 KiB
    // $Id: List.cpp,v 1.13 2001-01-09 19:40:56 remacle Exp $
    
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <sys/types.h>
    
    #include "Malloc.h"
    #include "List.h"
    #include "Message.h"
    
    static char *startptr;
    
    
    List_T *List_Create(int n, int incr, int size)
    {
      List_T *liste;
    
      if (n <= 0)  n = 1 ;
      if (incr <= 0) incr = 1;
    
      liste = (List_T *)Malloc(sizeof(List_T));
    
      liste->nmax    = 0;
      liste->incr    = incr;
      liste->size    = size;
      liste->n       = 0;
      liste->isorder = 0;
      liste->array   = NULL;
    
      List_Realloc(liste,n);
      return(liste);
    }
    
    void List_Delete(List_T *liste)
    {
      if(!liste) return ;
      Free(liste->array);
      Free(liste);
    }
    
    void List_Realloc(List_T *liste,int n)
    {
      if (n <= 0) return;
    
      if (liste->array == NULL) {
        liste->nmax = ((n - 1) / liste->incr + 1) * liste->incr;
        liste->array = (char *)Malloc(liste->nmax * liste->size);
      }
      else
        if (n > liste->nmax) {
          liste->nmax = ((n - 1) / liste->incr + 1) * liste->incr;
          liste->array = (char *)Realloc(liste->array,
                             liste->nmax * liste->size);
        }
    }
    
    void List_Add(List_T *liste, void *data)
    {
      liste->n++;
    
      List_Realloc(liste,liste->n);
      liste->isorder = 0;
      memcpy(&liste->array[(liste->n - 1) * liste->size],data,liste->size);
    }
    
    int List_Nbr(List_T *liste)
    {
      return (liste)? liste->n : 0 ;
    }