suifmath/named_sc_fm.cc: don't include sys/times.h
[suif.git] / src / baseparsuif / suifmath / coeff.cc
blobc968601424bcf0bcf0ab025e0147ffda1604d11e
1 /* file "coeff.cc" */
3 /* Copyright (c) 1994 Stanford University
5 All rights reserved.
7 This software is provided under the terms described in
8 the "suif_copyright.h" include file. */
10 #include <suif_copyright.h>
12 #define _MODULE_ "libsuifmath.a"
13 #pragma implementation "coeff.h"
15 #include <suif1.h>
16 #include "suifmath.h"
17 #include <string.h>
19 coeff *coeff::copy() const {
20 coeff *new_coeff = new coeff;
22 new_coeff->constant = new int[m];
23 new_coeff->vars = new int[n*m];
24 new_coeff->n = n; new_coeff->m = m;
25 memcpy(new_coeff->constant, constant, m*sizeof(int));
26 memcpy(new_coeff->vars, vars, n*m*sizeof(int));
28 return new_coeff;
31 void coeff::print(FILE * fp) const
33 for(int i=0; i<m; i++) {
34 fprintf(fp, "%3d", constant[i]);
35 for(int j=0; j<n; j++)
36 fprintf(fp, "%3d", vars[i*n+j]);
37 fprintf(fp,"\n");