search for: my_function

Displaying 20 results from an estimated 39 matches for "my_function".

2012 Dec 14
5
A question on list and lapply
Dear all, let say I have following list: Dat <- vector("list", length = 26) names(Dat) <- LETTERS My_Function <- function(x) return(rnorm(5)) Dat1 <- lapply(Dat, My_Function) However I want to apply my function 'My_Function' for all elements of 'Dat' except the elements having 'names(Dat) == "P"'. Here I have specified the name "P" just for illustration...
2011 May 04
3
Error in .Fortran Call
I have the following FORTRAN code converted to a DLL: ! my_xmean.f90 ! ! FUNCTIONS/SUBROUTINES exported from my_function.dll: ! my_function - subroutine ! subroutine my_xmean(X,N,XMEAN) ! Expose subroutine my_function to users of this DLL ! !DEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'my_xmean_'::my_xmean ! Body of my_function DOUBLE PRECISION X(N) XMEAN=0D0 DO J=1,N XMEAN=XMEAN+X(J) END DO XMEAN=XMEAN...
2008 Aug 19
7
[LLVMdev] Please help with LLVM C++ integration
...ot;); ExistingModuleProvider* MP = new ExistingModuleProvider(M); ExecutionEngine* EE = ExecutionEngine::create(MP, false); std::vector<const Type *> func_args; func_args.push_back(Type::Int32Ty); FunctionType * func_type = FunctionType::get(Type::Int32Ty, func_args, false); Function * my_function = Function::Create( func_type, Function::ExternalLinkage, "some_test_func", M ); EE->addGlobalMapping( my_function, (void*)&some_test_func ); Function *FooF = cast<Function>(M->getOrInsertFunction("foo", Type::Int32Ty, (Type *)0)); BasicBlock * BB = BasicBloc...
2001 Sep 05
0
Re: [S] dyn.load
...> I need to translate a function of Splus in to R. The function calls a DLL library using the instruction dll.load. In R exists the function 'dyn.load' and I get the following results dll.load is not in the current S-PLUS Windows version, BTW. > > dyn.load("c:/windows/system/my_function.dll") > > is.loaded("my_function") > [1] TRUE > > but I have problems when I use the '.Fortran' function. I get the following message: > > > .Fortran("my_function",.....) > Error in .Fortran("my_function") : C/Fortran function...
2019 Jun 29
2
storage class 0 symbol is generated for a double constant in COFF-x86-64 object file
Hi, I am using the llvm codegen facility (version 7.0.1) to translate LLVM IR for different platforms. I have this error particularly in win64 platform. In my IR code I have such code snippet: %50 = call i8* @my_function(i8* %48, double 2.000000e+00, double 2.000000e+00) ... declare dllimport i8* @my_function(i8*, double, double) By passing it to llc.exe, I find following symbol is declared in object file's symbol table. [10](sec 5)(fl 0x00)(ty 0)(scl 0) (nx 0) 0x00000000 __real at 4000000000000000 whic...
2019 Jul 02
2
storage class 0 symbol is generated for a double constant in COFF-x86-64 object file
...xe -filetype=obj -O0 sim_0.ll -o sim_0.obj Reid Kleckner <rnk at google.com> 于2019年7月1日周一 下午1:45写道: > I can't speak for what past versions of LLVM used to do, but I can see > that today for this IR, we generate an external symbol __real at 40...: > > declare dllimport void @my_function(double, double) > define i32 @main() { > call void @my_function(double 2.000000e+00, double 2.000000e+00) > ret i32 0 > } > > $ dumpbin -symbols t.o > ... > 006 00000000 SECT4 notype Static | .rdata > Section length 8, #relocs 0, #linenums 0,...
2012 Jan 12
1
[LLVMdev] A question of Sparc assembly generated by llc
...%g0, 5, %l1 st %l0, [%fp+-4] st %l1, [%fp+-8] st %l1, [%fp+-12] sethi %hi(.L.str), %l1 ld [%fp+-8], %o1 add %l1, %lo(.L.str), %l1 or %g0, %l1, %o0 call printf nop ld [%fp+-12], %o2 ld [%fp+-8], %l2 sethi %hi(.L.strQ521), %l3 add %l3, %lo(.L.strQ521), %o0 or %g0, %l2, %o1 call MY_FUNCTION nop or %g0, 1, %i0 (subcc %l1, 0, %l1 ! This line is added by me. It was not there) bne .LBB0_2 nop ! BB#1: subcc %l2, 0, %l2 or %g0, %l0, %i0 .LBB0_2: ....... I am not an expert on Sparc assembly, but I read from somewhere that branching instructi...
2011 Jan 27
3
how to divide each element of a matrix by a specific value per column
...I'd like to divide each element of a matrix by a specific value per column. These specific values are stored in a list. For example: > x <- c(1,2,3,4,5) > y <- matrix(c(1:30), nrow = 6) Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have tried this > my_function <- function(data, ind) data/ind > apply(y, 2, my_function, x) [,1] [,2] [,3] [,4] [,5] [1,] 1 7.0 13.0 19.0 25.0 [2,] 1 4.0 7.0 10.0 13.0 [3,] 1 3.0 5.0 7.0 9.0 [4,] 1 2.5 4.0 5.5 7.0 [5,] 1 2.2 3.4 4.6 5.8 [6,] 6 12.0 18.0 24.0 30.0 Warning messages: 1:...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...t; ExecutionEngine* EE = ExecutionEngine::create(MP, false); > > std::vector<const Type *> func_args; > func_args.push_back(Type::Int32Ty); > FunctionType * func_type = FunctionType::get(Type::Int32Ty, > func_args, false); > Function * my_function = Function::Create( func_type, > Function::ExternalLinkage, "some_test_func", M ); > EE->addGlobalMapping( my_function, (void*)&some_test_func ); > > Function *FooF = cast<Function>(M->getOrInsertFunction("foo", > Type::Int32Ty, (Ty...
2006 Jun 07
3
function to be used in model
Where is the best place to put a function that will be used in both several controller and several models? -- Posted via http://www.ruby-forum.com/.
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
...); > ExecutionEngine* EE = ExecutionEngine::create(MP, false); > > std::vector<const Type *> func_args; > func_args.push_back(Type::Int32Ty); > FunctionType * func_type = FunctionType::get(Type::Int32Ty, func_args, false); > Function * my_function = Function::Create( func_type, > Function::ExternalLinkage, "some_test_func", M ); > EE->addGlobalMapping( my_function, (void*)&some_test_func ); > > Function *FooF = cast<Function>(M->getOrInsertFunction("foo", > Type::Int32Ty, (Ty...
2010 Jan 11
1
apply a function down each column
...be the different entries to be compared! dat= my data: for the first column: compare dat[(2x-1),1] with dat[(2x),1] and x would be 1:i, i=length(dat[,1]) I think the best way to do that is a loop: a <- as.character(dat[(2x-1),1]) b <- as.character(dat[(2x),1]) for (i in 1:length(dat[,1]) my_function(a, b)) Can somebody help me to apply a function with a loop in the way I want to a column? Is there a specification of "tapply" for that? Thank you very much, Laetitia ---------------------------------------------------------------------------- Laetitia G. Schmid Master Student of Ev...
2011 Nov 10
2
[LLVMdev] loop transformation: uniquely identifying a loop within a program
...certain loops that we want to transform. So far, we are working on a suggestion to transform the loops depending on which function they're run from in the program. Which will be something like this: ... Function *F = L -> getParent() -> getParent(); ... if(F->getName == "my_function") { //transform loops in my_function } The function name can easily be passed in from the command line and this would work fine for loops within that function only. But how can we extend this for nested loops for example? Thank you, tatenda -------------- next part -------------- An H...
2011 May 09
1
Fortran Symbol Name not in Load Table
...iven the FORTRAN declaration below: subroutine VALUEAHROPTIMIZE(AHR, & KW, & min_IHR_delta, & max_AHR_error, & AHR_out, & !! Output AHE array IHR_out, & !! Output IHR array Errors_out) ! Expose subroutine my_function to users of this DLL !DEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'VALUEAHROPTIMIZE_'::VALUEAHROPTIMIZE ! Body of my_function Implicit None Integer *4 IERR, iSum DOUBLE PRECISION min_IHR_delta, max_AHR_error logical switch_AHR_tuner character * 512 AHR_tuner_F...
2004 Aug 06
1
minor suggestions
> How did you do it without the pragma? I understood that the problem was a mismatch between the the declaration and definition in for some codebooks (exc_*_tables.c). > I saw you added the pragmas to disable the float/double warnings to misc.h > though that header isn't included by the files that generate the warnings. What are the offending files then? BTW, aside from the
2011 May 09
5
Fortran Symbol Name not in Load Table
...I have given the FORTRAN declaration below: subroutine VALUEAHROPTIMIZE(AHR, & KW, & min_IHR_delta, & max_AHR_error, & AHR_out, & !! Output AHE array IHR_out, & !! Output IHR array Errors_out) ! Expose subroutine my_function to users of this DLL !DEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'VALUEAHROPTIMIZE_'::VALUEAHROPTIMIZE ! Body of my_function Implicit None Integer *4 IERR, iSum DOUBLE PRECISION min_IHR_delta, max_AHR_error logical switch_AHR_tuner character * 512 AHR_tuner_FilePath...
2011 Jun 10
2
How do I make proper use of the by() function?
An embedded and charset-unspecified text was scrubbed... Name: inte tillg?nglig URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110610/b259a660/attachment.pl>
2012 Jan 12
2
is there an equivalent for #ifdef (C langage) in R
...ion(a, b) { #endif #ifdef DEBUG a = 1 b = 2 #endif c=a+b plot(c) #ifndef DEBUG return(c) } #endif my goal is to run my program WITHOUT calling my_addition(1, 2) (for debugging). The main problem : all variables do not exist when just running my _file.R , I have to call my_function if I want to see results. I use RStudio Thanks for your help -- View this message in context: http://r.789695.n4.nabble.com/is-there-an-equivalent-for-ifdef-C-langage-in-R-tp4289356p4289356.html Sent from the R help mailing list archive at Nabble.com.
2011 Mar 17
2
[LLVMdev] Operating on contents of virtual registers
...hould be the best function type to use so that I can pass this value as an argument to my function? For now, I am only concerned with load and store instructions and so (I suppose) I have to deal with pointers only. An easy way that I can think of is to directly insert the LLVM IR (e.g. call void @my_function(%old)) but because I am using Module::getOrInsertFunction(), I have to have a function type. So alternatively, is there a way to insert direct LLVM instructions (without going through the type hierarchy)? Thanks, Ashay --- Ashay Rane Research Associate The University of Texas at Austin http://w...
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
On Aug 19, 2008, at 13:36, kirill havok wrote: > I got very interested in LLVM project, and I decided to start > writing my own scripting language based on it. By studying the > documentation, I could not find how to call external function, > written in C. That is, I have a set of functions written in C/C++, I > generate code, using LLVM C++ interface, how can I call(or