|
GRASS Programmer's Manual
6.5.svn(2012)-r51648
|
00001 /* matprt.c CCMATH mathematics library source code. 00002 * 00003 * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. 00004 * This code may be redistributed under the terms of the GNU library 00005 * public license (LGPL). ( See the lgpl.license file for details.) 00006 * ------------------------------------------------------------------------ 00007 */ 00008 #include <stdio.h> 00009 void matprt(double *a, int n, int m, char *fmt) 00010 { 00011 int i, j; 00012 00013 double *p; 00014 00015 for (i = 0, p = a; i < n; ++i) { 00016 for (j = 0; j < m; ++j) 00017 printf(fmt, *p++); 00018 printf("\n"); 00019 } 00020 } 00021 00022 void fmatprt(FILE * fp, double *a, int n, int m, char *fmt) 00023 { 00024 int i, j; 00025 00026 double *p; 00027 00028 for (i = 0, p = a; i < n; ++i) { 00029 for (j = 0; j < m; ++j) 00030 fprintf(fp, fmt, *p++); 00031 fprintf(fp, "\n"); 00032 } 00033 }