 
 
 
 
 
 
Problems using Compile[]
- To: mathgroup at smc.vnet.net
- Subject: [mg8017] Problems using Compile[]
- From: Rob McElrath <mcelrath at isp.nwu.edu>
- Date: Sat, 2 Aug 1997 22:32:28 -0400
- Organization: Northwestern University, Evanston, IL, US
- Sender: owner-wri-mathgroup at wolfram.com
I wish to create a compiled function (implemented using Block[]) which takes
several parameters, one of which is a rank two list.  From the Mathematica
3.0 documentation, I believe the following to be the correct syntax to do
this:
  Fun[scalarparam_, listparam_] := Block[{ },(scalarparam)];
  FunC := Compile[{scalarparam, {listparam, _Real, 2}}, 
            Fun[scalarparam, listparam]]
However, when I attempt to run this:
  FunC[4, {{1}}]
I get the following error message:
CompiledFunction::"ccts": 
    "Expression \!\(4\) should be a machine-size tensor with correct rank 
	and type."
CompiledFunction::"cfex": 
    "External evaluation error at instruction \!\(4\); proceeding with 
	uncompiled evaluation."
What does the error message "X should be a machine-size tensor with correct
rank and type" mean, and how do I create such a function?
thanks in advance,
-- Rob
  ./'^`\._./'~`\._./'~`\._./'~`\._./'#`\._./'~`\._./'~`\._./'~`\._./'^`\.
 / \~|~/ "All generalizations are false" -- bumper sticker  _/_/_/_/_/_/ \
|  |=#=| "A road followed precisely to its end leads      _/           _/ |
|  /_|_\ precisely nowhere" -- Bene Gesserit proverb    _/   0     0   _/ |
| Rob McElrath (wraith at nwu.edu)  Meyers-Briggs: ENTP   _/       /     _/  |
| School: Northwestern University, Senior             _/  \________/ _/   |
|_ Majors: PHYSICS, Integrated Science Program, Math  _/         U _/    _|
  \ Measurements: 79.8% nerd, 65% weird, 53.4% pure    _/_/_/_/_/_/     / 
   \._________________________________________________________________./

