/[ascend]/trunk/base/generic/compiler/rel_common.c
ViewVC logotype

Contents of /trunk/base/generic/compiler/rel_common.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 669 - (show annotations) (download) (as text)
Wed Jun 21 07:00:45 2006 UTC (13 years, 2 months ago) by johnpye
File MIME type: text/x-csrc
File size: 1711 byte(s)
Merged changes from DAE branch (revisions 702 to 819) back into trunk.
This adds the Integration API to the ASCEND solver (in base/generic).
Also provides pre-alpha support for 'IDA' from the SUNDIALS suite, a DAE solver.
Many other minor code clean-ups, including adoption of new 'ASC_NEW' and friends (to replace 'ascmalloc')
Added some very sketchy stuff providing 'DIFF(...)' syntax, although it is anticipated that this will be removed.
1 /*
2 * Common Relation construction routines
3 * Version: $Revision: 1.6 $
4 * Version control file: $RCSfile: rel_common.c,v $
5 * Date last modified: $Date: 1997/07/18 12:33:07 $
6 * Last modified by: $Author: mthomas $
7 *
8 * This file is part of the Ascend Language Interpreter.
9 *
10 * Copyright (C) 1997 Carnegie Mellon University
11 *
12 * The Ascend Language Interpreter is free software; you can redistribute
13 * it and/or modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
16 *
17 * The Ascend Language Interpreter is distributed in hope that it will be
18 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with the program; if not, write to the Free Software Foundation,
24 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
25 * COPYING.
26 *
27 */
28
29 #include<math.h>
30 #include <utilities/ascConfig.h>
31 #include "compiler.h"
32 #include "fractions.h"
33 #include "dimen.h"
34 #include "functype.h"
35 #include "expr_types.h"
36 #include "exprs.h"
37 #include "rel_common.h"
38
39
40 int CmpP(CONST char *c1, CONST char *c2)
41 {
42 if (c1 > c2) return 1;
43 if (c1 < c2) return -1;
44 return 0;
45 }
46
47
48 void Swap(unsigned long int *p1, unsigned long int *p2)
49 {
50 unsigned long temp;
51 temp = *p1;
52 *p1 = *p2;
53 *p2 = temp;
54 }
55
56
57 CONST struct Expr *FindLastExpr(register CONST struct Expr *ex)
58 {
59 assert(ex!=NULL);
60 while(NextExpr(ex)!=NULL) ex = NextExpr(ex);
61 return ex;
62 }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22