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

« back to all changes in this revision

Viewing changes to macros/m2sci/sci_files/sci_uint16.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:
 
1
function [tree]=sci_uint16(tree)
 
2
// File generated from sci_PROTO9.g: PLEASE DO NOT EDIT !
 
3
// Copyright INRIA
 
4
// M2SCI function
 
5
// Conversion function for Matlab uint16()
 
6
// Input: tree = Matlab funcall tree
 
7
// Ouput: tree = Scilab equivalent for tree
 
8
// Emulation function: mtlb_uint16()
 
9
// V.C.
 
10
 
 
11
// %c_uint16 and %b_uint16 are not defined in Scilab
 
12
x = getrhs(tree)
 
13
 
 
14
// Matlab uint16() can return Boolean type value
 
15
if or(x.vtype==[Boolean,Unknown]) then
 
16
  vtype=Unknown
 
17
else
 
18
  vtype=Int
 
19
end
 
20
 
 
21
x = convert2double(x)
 
22
 
 
23
tree.rhs=Rhs(x)
 
24
 
 
25
if is_complex(x) then
 
26
  set_infos("Scilab uint16() does not work with Complex values: uint16() call IGNORED !",2);
 
27
  if typeof(x)=="operation" then
 
28
    x.out=tree.lhs
 
29
  elseif typeof(x)=="funcall" then
 
30
    x.lhs=tree.lhs
 
31
  end
 
32
  tree=x
 
33
elseif ~is_real(x) then
 
34
  set_infos("Scilab uint16() does not work with Complex values: uint16() call IGNORED !",2);
 
35
  repl_poss(x,tree,x,"is real")
 
36
  if typeof(x)=="operation" then
 
37
    x.out=tree.lhs
 
38
  elseif typeof(x)=="funcall" then
 
39
    x.lhs=tree.lhs
 
40
  end
 
41
  tree=x
 
42
else
 
43
  tree.name="mtlb_uint16"
 
44
  tree.lhs(1).dims=x.dims
 
45
  tree.lhs(1).type=x.type
 
46
end
 
47
 
 
48
endfunction