~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/calpol/lcm.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
//such that  p.*fact=pp*ones(p)
5
5
//!
6
6
// Copyright INRIA
7
 
[m,n]=size(p),
8
 
p=matrix(p,m*n,1),
9
 
p0=p(1);fact=1;
10
 
for l=2:m*n,
11
 
  [u,v]=simp(p0,p(l)),
12
 
  p0=p0*v,
13
 
  fact=[v*fact,u],
14
 
end,
15
 
fact=matrix(fact,m,n),
16
 
p=p0;
17
 
 
18
 
 
 
7
  if type(p)==8 then 
 
8
    if argn(1)==2 then [p,fact]=%i_lcm(p),else p=%i_lcm(p),end
 
9
    return,
 
10
  end
 
11
 
 
12
  [m,n]=size(p),
 
13
  p=matrix(p,m*n,1),
 
14
  p0=p(1);fact=1;
 
15
  for l=2:m*n,
 
16
    [u,v]=simp(p0,p(l)),
 
17
    p0=p0*v,
 
18
    fact=[v*fact,u],
 
19
  end,
 
20
  fact=matrix(fact,m,n),
 
21
  p=p0;
 
22
endfunction