Overview
Comment:Documentation added
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: e556499ea0172ab2fb0491a7b354fa9983f9f7a0cb981361c966bb650bd94275
User & Date: gawthrop@users.sourceforge.net on 2003-03-24 10:19:42
Other Links: branch diff | manifest | tags
Context
2003-03-24
10:21:03
In-line resolution of CRs using gino.
-- lin only just now.
check-in: 6e74c1d340 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:19:42
Documentation added check-in: e556499ea0 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:09:52
Reformated to octave standard
Now writes variables in non-matrix form
check-in: 28603d680f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/m/mtt_resolve_cr.m version [16cc68a3d5].























































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function eqn = mtt_resolve_cr (eqn)
  ## usage:  eqn = mtt_resolve_cr (eqn)


  ###################################### 
  ##### Model Transformation Tools #####
  ######################################
  
  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.2  2001/07/03 22:59:10  gawthrop
  ## Fixed problems with argument passing for CRs
  ##
  ###############################################################

  ## Temporary version to resolve lin only!

  ## How many equations here?
  N = length(findstr(eqn,"="));
  EQNS = split(eqn,";");

  eqn = "";
  for i = 1:N
      
      ## Split equation
      EQN = split(EQNS(i,:),":=");
      LHS = deblank(EQN(1,:));
      RHS = deblank(EQN(2,:));

      if index(RHS,"lin(")>0	# lin cr is here

      RHS = sprintf("%s;", RHS); # Put back ;

      ## Make function into a list
      RHS = strrep(RHS,"lin(","{lin,");
      RHS = strrep(RHS,");","}");

      ## Convert "R" to R etc
      RHS = strrep(RHS,"\"","");
      
      
      RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$3,1}}", "{$2*$1}");
      RHS = g_subs(RHS, "{{lin,$6,$3,$1,$5,1,$2,$4,1}}", "{$2/$1}");
    endif

    eqn_i = sprintf("%s := %s;", LHS, RHS);
    eqn = sprintf("%s %s", eqn, eqn_i);
  endfor

endfunction
    


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]