~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/metanet/qassign.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [crit,order]=qassign(c,f,d)
 
2
// Copyright INRIA
 
3
[lhs,rhs]=argn(0)
 
4
if (rhs <> 3) then error(39), end
 
5
n=size(c,1);n1=size(c,2);
 
6
if(n<>n1)  then
 
7
  error('Bad dimensions of input arrays')
 
8
end;
 
9
n=size(f,1);n1=size(f,2);
 
10
if(n<>n1)  then
 
11
  error('Bad dimensions of input arrays')
 
12
end;
 
13
df=sum(diag(f));
 
14
if(df<>0)  then
 
15
  error('Diagonal of second input array must be zero')
 
16
end;
 
17
dd=sum(diag(d));
 
18
if(dd<>0)  then
 
19
  error('Diagonal of third input must be zero')
 
20
end;
 
21
n=size(d,1);n1=size(d,2);
 
22
if(n<>n1)  then
 
23
  error('Bad dimensions of input arrays')
 
24
end;
 
25
n3=n+n+n;n4=n3+n;
 
26
[a,b]=m6permuto(n,n3,n4,c,f,d)
 
27
crit=a;
 
28
order=b(1:n);