How to define functions with composite arguments ?

  • Permalink
  • submit to reddit
  • Email
  • Follow


Am trying to call a self-defined function from a program running under the parallel computing toolkit. This function has composite arguments. If I define the function call in the usual way, I get the error message, "??? Undefined function or method '<function name>' for input arguments of type 'Composite'."

How to I pass codistributed (composite) arguments to a function? How does such a function have to be defined? 

Spent quite some time reading documentation but was unable to find a solution.

Thank you for whatever insights you can offer.
0
Reply Peter 3/18/2011 9:15:20 AM

See related articles to this posting

comp.soft-sys.matlab 203507 articles. 529 followers. Post

0 Replies
257 Views

Similar Articles

[PageSpeed] 51


Reply:

Similar Artilces:

How to configure a call library function node for a function whose argument is a data type defined in windows API
I want to configure call library function node for a function which has the argument of type HANDLE which is a data type defined in the windows API. The function prototype is&nbsp; void CanGetReceiveEvent(int handle, HANDLE *hevent); &nbsp; &nbsp; &nbsp; HANDLE is&nbsp;declared as &nbsp; typedef PVOID HANDLE; &nbsp; and PVOID is pointer to any type and is declared as &nbsp; typedef void *PVOID; &nbsp; &nbsp; &nbsp; can&nbsp;the call library function node be configured for such data types. hi Vandana, &nbsp; Can U tell us what Dll are U tr...

Function '>=' is not defined for arguments of type 'date' and 'integer'. Explicitly convert its arguments to the desired type(s)
Hi all, I'm getting the following error message while comparing dates in Ingres database Function '>=' is not defined for arguments of type 'date' and 'integer'. Explicitly convert its arguments to the desired type(s) I feel that it has to do something with table definition. Here is my query: Select * from my_table where valid_date >= another_date; Can any one throw light on this. Thanks, Sen "Sen" <senthil.dhanapal@gmail.com> wrote > Hi all, > > I'm getting the following error message while comparing...

Defining a new function by composition
Hi. I would like to add a method to the Array class, say Array#pop! which is actually split!(-1). But then, I can think of a more general problem: define a new function by composition of two or more functions. In Haskell, I can do something like f :: a -> b -> c f x y = something g::b -> c g = f some_value What is the Ruby equivalent of this? Regards, Ed "Edgardo Hames" <ehames@gmail.com> schrieb im Newsbeitrag news:478c16ae0408061209424c2032@mail.gmail.com... > Hi. > > I would like to add a method to the Array class, say Array#pop! which > is actu...

Semi-defined Function arguments???
Hi, I have simplified the situation a lot so hopefully this still makes sense... Say I have a number of functions that work on any individual element of an array. I want to create a function "doOnAll" that will call ANY of those functions on EVERY element of the array. e.g. void doOnAll (int x) { for (i=0;i<n;i++) { if (x==0) { returnValue(i); } else if (x==1) { returnIndex(i); } else if (x==2) { returnCost(i); } } } No problem, but say each of the singular functions had different types of arguments instead of all being 'i' as they are ab...

user defined functions with optional arguments?
I have a function that has two arguents, however depending on the value of the first argument, the second one may or may not be needed. If I only input the first argument when calling the function, PHP returns a warning. many built in php functions have optional arguments, is there a way to make arguments in user defined functions optional as well? Thanks. On Wed, 17 Aug 2005 14:27:45 -0700, Exyle <usenet.qwest@reg.exyled.net> wrote: >is there a way to make arguments in user defined functions optional http://uk2.php.net/manual/en/functions.arguments.php -- Andy Hassall / &l...

Define a matrix function with size as argument
Dear all, I am quite new to Mathematica and I have the following problem I could not find track of both in the Forum and in the documentation. I need to define a matrix function with size of the matrix as an argument. The function produces a tridiagonal matrix: Q[w_] := MatrixForm[SparseArray[ {i_, j_} /; Abs[i - j] <= 1 -> Which[i < j, a[i - 1]*(1 - (i - 1)/(2*w)), i > j, (a[-i + 2*w + 1]*(i - 1))/(2*w), i == j, (-(1 - (i - 1)/(2*w)))*a[i - 1] - (a[-i + 2*w + 1]*(i - 1))/(2*w) + 1], {2*w, 2*w}]] dum = Q[2] the problem is that...

Defining variable between function argument list and {}
Variables of a C function is usually defined inside the {} of the function. But I also see some variables being defined between the function argument list and {}, such like below. int unzip(in, out) int in, out; /* input and output file descriptors */ { ... } What's the purpose of defining the variables here? Thanks. On Nov 6, 7:36=A0pm, Kuhl <chen_zhi...@yahoo.com> wrote: > Variables of a C function is usually defined inside the {} of the > function. But I also see some variables being defined between the > function argument list and {}, such like below. > >...

Composite Type Argument Construction to a Function
create type my_type (my_test text, my_int integer); create function my_function(my_type) returns timestamp as 'begin return (current_timestamp); end; ' language 'plpgsql'; In 7.3.5, we are trying to get around the 32 argument limit of the functions WITHOUT re-compiling with a greater func_max_args (due to operational reasons). My question is - HOW do I construct the argument to my_function(my_type) so that the function recognises that I am passing into it composite data? NB: The example function is just "junque" to test passing a composite ty...

Defining a Function with an Indeterminate Number of Arguments
Hello - I am trying to define a function with the following two properties : (A) The function should be able to take an indeterminate number of arguments without using the List structure (like the Which or StringJoin functions in Mathematica). (B) The function should have the capability of defining and using options in the usual way (i.e. using the Options function outside the package definition to define the option default values and using OptionValue within the function definition to retrieve the options with locally defined option values overriding the default values). ...

undefined input argument of a user defined function
i'm using the following code to create a function:: function [z]=maxtheta(A0,A1,h) m=size(A0); n=size(h); t1=0; for j=1:n(2); t2=t1+h(j); for i=1:m(1); a0=A0(i,j); a1=A1(i,j); z=feval(maxii,a0,a1,t1,t2); end t1=t1+t2; end end where maxii is a function created by me and works fine with numerical values...now maxtheta suppose to take A0,A1,h as matrix inputs...but after defining A0,A1,h in command line when i am trying to run this function this is giving error message :: input argument h is not defined, input argument a0(not A...

Excel.WorksheetFunction Argument in User-Defined Function
I'd like to use the Excel.WorksheetFunction library to compute median and percentiles in a user-defined function. Rather than creating a SQL dataset in the function, I'd like to use the data from the calling report as the function argument. Example: The report's Record Source is a query that fetches salaries from a database, "SELECT JobID, JobTitle, BaseSalary ORDER BY JobTitle". The report groups BaseSalary by JobTitle. I have a textbox with Control Source of "=Avg([BaseSalary])" I have another textbox with Control Source of "=Perc25([BaseSalary])"...

Re: Define a matrix function with size as argument
On 11/15/06 at 6:45 AM, sgiannerini@gmail.com (Simone Giannerini) wrote: >I am quite new to Mathematica and I have the following problem I >could not find track of both in the Forum and in the documentation. >I need to define a matrix function with size of the matrix as an >argument. The function produces a tridiagonal matrix: >Q[w_] := MatrixForm[SparseArray[ >{i_, j_} /; Abs[i - j] <= 1 -> Which[i < j, >a[i - 1]*(1 - (i - 1)/(2*w)), i > j, >(a[-i + 2*w + 1]*(i - 1))/(2*w), i == j, >(-(1 - (i - 1)/(2*w)))*a[i - 1] - >(a[-i + 2*w + 1]*...

Write a Simulink user-defined function with multiple arguments
Hello, I'm a Simulink newbie. I want to create a block that does a mathematical operation on multiple arguments. This is easy to do in the case of one argument: just create a "user-defined function" that takes in u and ouputs y. However, I want it to take in multiple values, for instance p, q, and r, and output y. My function would be something like y=cos(p)+1/(sin(q)+exp(r)). It seems I can do this using the S-function builder, but it looks like I'd have to write the code in C if I did that, and I'd prefer to write the function's code in good old Matlab. Can this be...

Class Template Defining Typedef For Member Function of Class Argument
Hi All, My apologies for the strange title. I am not sure how else to say what I am trying to do: I have a class Bar that contains a bunch of member functions that are essentially identical in form - they all return bool and take by const reference an object whose type is the same as the class of which they are members: class Bar { bool is_greater_than (const Bar &) const; bool is_less_than (const Bar &) const; } ; I have a wrapper class template that I will apply to Bar (or classes that are similar to Bar). In the wrapper, there will be many places where I need the type of...

Passing report results as the argument in a custom/user-defined function
I'd like to use the Excel.WorksheetFunction library to compute median and percentiles in a user-defined function. I'd like to use the data from the calling report as the function argument. Example: The report's Record Source is a query that fetches salaries from a database, "SELECT JobID, JobTitle, BaseSalary ORDER BY JobTitle". The report groups BaseSalary by JobTitle. I have a textbox with Control Source of "=Avg([BaseSalary])" I have another textbox with Control Source of "=Perc25([BaseSalary])", where Perc25 is the custom function that calls Ex...

c++0x: user-defined types as constexpr function arguments.
Hello. I would like to know if it's possible (g++ 4.6 shows an error) to use constexpr functions with user-defined types as arguments, as long as these types have constexpr constructors. Reading the standard draft I don't see if that's possible (I think a literal is needed, but I'm not sure). Something like this: template <class T> struct MyType { .... public: constexpr MyType() .. }; template <class T> constexpr bool saySomethingAboutMyType(MyType<T> t) { return true; } This does not work, it shows an error about MyType<T&...

Help! PDA un-defined error 120168006 and 134429006. Bad input argument to function.
Hi, does anyone have an idea of what the two errors mean? I&nbsp;'m able to compile and&nbsp;run my PDA application but eventually the program crashes with these errors. ( 120168006 more oftenly) And the error message came up on the screen is "App Failed. Error code 120168006. Bad input argument to function." &nbsp; I have looked up everywhere on ni 's website, only found&nbsp;few articles related to my problem and didn't really help. They are <a href="http://digital.ni.com/public.nsf/allkb/7937b4762938c33986256d33007a3e34" target="_blan...

Functions can't access strings defined outside unless they're arguments can they?
I've found that I can define: $W = '<img src="'.$Path.'R_Images/Marks/WhiteBall.gif" width="14" height="14">'; ....and can reference this within any PHP code, but I *can't* reference it from within a PHP function, unless it's been passed as an argument. I can't find this documented anywhere, but it appears to fit all of the observations. If *not* true, can someone tell me how to reference such a string from within a function *without* passing it as an argument? Thanks. John Kopf "John O. Kopf" <kopf...

Function pointers, variable argument functions calling other variable-argument functions (sort of)
Hi I have been searching the web and comp.lang.c of a method of using variable-argument function pointers and the like. And some of the questions arising in this post are answered partly in these posts, but I ask mainly for a way to found a way to solve this problem. I'm a hobbyist so there might be an alltogether better solution to the problem, so please come with any solution you might think of. I'm open to ideas. --- And i'm not bound by C. Suggestions from C++ are welcome. I need an extensible multithreaded application (i'm thinking windows here since I have no experience...

Getting function not defined error after defining the function
Hi, I include this Javascript at the top of my page just below the <head> and <title> elements ... <script type="text/javascript"> function reloadIfUnavailable() { if (document.title.indexOf('Page Unavailable') > -1) { window.location.reload(); } else { setTimeout('reloadIfUnavilable()', 500); } // if } // reloadIfUnavailable setTimeout('reloadIfUnavailable()', 500); </script> However, get an error on Firefox (using 3.6 on Mac 10.6.3) ... reloadIfUnavilable is not defined setTimeo...

function argument dependent on another function argument?
I would like to do: def foo(self,x,y=self.a) where the default value for y=self.a. Since this is not possible, I wind up doing def foo(self,x,y=None) if not y: y=self.a but that seems kind of clumsy. Is there a better way to do this? Thanks in advance On Jan 18, 8:19=A0am, Reckoner <recko...@gmail.com> wrote: > I =A0would like to do: > > def foo(self,x,y=3Dself.a) > > where the default value for y=3Dself.a. Since this is not possible, I > wind up doing > > def foo(self,x,y=3DNone) > =A0 if not y: > =A0 =A0 y=3Dself.a > > but that seems ...

Passing a function as an argument and using the evaluated function as an argument
Since you can pass a function to a ... erm...... function.... how to you use the result of a function as the argument for another function instead of passing the actual function to it. i.e. function foo2(){} function foo(func){} foo(foo2); This passes foo2 to foo, can I do foo(foo2()) ? i.e. is the difference between whether a function is passed or evaluated dependent on whether you use "()" after the function name? User1014 wrote: > Since you can pass a function to a ... erm...... function.... > > how to you use the result of a function as the argument for anothe...

About typedef -- define the function pointer or define function model?
What's the difference between these two declarations ? 1) typedef void (*pf)(void); 2) typedef void f(void); the first declaration is define a function pointer, what is the second ? define a function model? And can use the second declaration to define a function pointer as follow: typedef void f(void); f *pf; Whether the two declarations of pf1 are both pointer to a function? 1) typedef void (*pf)(void); pf pf1; 2) typedef void f(void); f *pf1; if yes, which is better? and I saw many codes used the second declaration, what is its' advantage or disa...

how to pass a function name and its arguments inside the arguments of other function?
I need something like this: 1: superfoo( non-keyword-args, keyword-args, methodname, *kargs, *kwargs): 2: """non-keyword-args and keyword-args are arguments that 3: apply to superfoo, while *kargs and **kwargs are arguments 4: that apply to methodname. See below""" 5: object=someClass() 6: result=getattr(object,methodname)(*kargs,**kwargs) 7: return result The problem is: how can I pass both arguments for superfoo and methodname in line 1: ? Is it possible? -Jose On Sat, 03 Nov 2007 02:21:30 +0000, jmborr wrote: ...