00001 /*=========================================================================== 00002 NetEvo Foundation Library 00003 Copyright (C) 2009, 2010 Thomas E. Gorochowski <tgorochowski@me.com> 00004 Bristol Centre for Complexity Sciences, University of Bristol, Bristol, UK 00005 ---------------------------------------------------------------------------- 00006 NetEvo is a computing framework designed to allow researchers to investigate 00007 evolutionary aspects of dynamical complex networks. By providing tools to 00008 easily integrate each of these factors in a coherent way, it is hoped a 00009 greater understanding can be gained of key attributes and features displayed 00010 by complex systems. 00011 00012 NetEvo is open-source software released under the Open Source Initiative 00013 (OSI) approved Non-Profit Open Software License ("Non-Profit OSL") 3.0. 00014 Detailed information about this licence can be found in the COPYING file 00015 included as part of the source distribution. 00016 00017 This library is distributed in the hope that it will be useful, but 00018 WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 ============================================================================*/ 00021 00022 00023 #include "ne_sim.h" 00024 00025 00026 void ne_sim_fprint_array (double t, double *y, int size, FILE *file) 00027 { 00028 int i; 00029 fprintf(file, "%f,", t); 00030 for (i=0; i<size-1; i++) { 00031 fprintf(file, "%.8f,", y[i]); 00032 } 00033 fprintf(file, "%.8f\n", y[size-1]); 00034 } 00035 00036 00037 void ne_sim_fprint_dyn_vec (ne_dyn_vec_t *dyn, FILE *file) 00038 { 00039 int i, j; 00040 double *cur; 00041 for (i=0; i<dyn->curSize; i++) { 00042 cur = dyn->data[i]; 00043 for (j=0; j<dyn->dataSize-1; j++) { 00044 fprintf(file, "%.8f,", cur[j]); 00045 } 00046 fprintf(file, "%.8f\n", cur[dyn->dataSize-1]); 00047 } 00048 }