search for: my_func

Displaying 20 results from an estimated 31 matches for "my_func".

2017 Sep 19
2
symbolic computing example with Ryacas
...(d1) d2=diff(U/(1+exp(-(x-x0)/C)),x,2); pretty(d2) solx2 = solve(d2 == 0, x, 'Real', true) pretty(solx2) slope2=subs(d1,solx2) I have tried the following : library(Ryacas) x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C") my_func <- function(x,U,x0,C) { return (U/(1+exp(-(x-x0)/C)))} FirstDeriv <- deriv(my_func(x,U,x0,C), x) PrettyForm(FirstDeriv) slope <- yacas("Subst(x,x0),deriv(my_func(x,U,x0,C), x)") PrettyForm(slope) I don't understand how I should use the Subst command. I want the slope...
2017 Sep 19
1
symbolic computing example with Ryacas
...hanks for the response. Yes, I did study the vignette but did not understand it fully. Anyway, I have tried once again now. I am happy to say that I have got what I wanted. library(Ryacas) x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C") my_func <- function(x,U,x0,C) { return (U/(1+exp(-(x-x0)/C)))} FirstDeriv <- deriv(my_func(x,U,x0,C), x) PrettyForm(FirstDeriv) #slope <- yacas("Subst(x,x0),deriv(my_func(x,U,x0,C), x)") slope <- Subst(FirstDeriv,x,x0) #PrettyForm(slope) - gives errors PrettyForm(Simplify(slope)) I...
2017 Sep 19
0
symbolic computing example with Ryacas
...2 = solve(d2 == 0, x, 'Real', true) > > pretty(solx2) > > slope2=subs(d1,solx2) > > > I have tried the following : > > library(Ryacas) > > x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C") > > my_func <- function(x,U,x0,C) { > > return (U/(1+exp(-(x-x0)/C)))} > > FirstDeriv <- deriv(my_func(x,U,x0,C), x) > > PrettyForm(FirstDeriv) > > slope <- yacas("Subst(x,x0),deriv(my_func(x,U,x0,C), x)") > > PrettyForm(slope) > > > I don't under...
2013 Feb 02
2
Question: write an R script with help information available to the user
...n on how to incorporate into an R script help information for the user. I vaguely recall that I saw some instructions on an R manual, but am not able to figure them out. Hereunder is the basic setting: 1. I finished writing an R script, my_script.r, that is a function (the function is named "my_func") for a statistical procedure. This means that the user only needs to: source("directory_of_script\my_script.r"), then run, my_func(arg1, arg2, ..), to execute the procedure. 2. I would like to add some lines into "my_script.r", so that a user can get information on this f...
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
...her module and delete the original, blockaddress disappears and is replaced by inttoptr (i32 1 to i8*). Please compile and run the attached program to see the demo of this problem. Right after linking modules, blockaddress still exists: @switch.bbs = internal global [3 x i8*] [i8* blockaddress(@my_func, %switch.body.begin), i8* blockaddress(@my_func, %switch.body.begin1), i8* inttoptr (i32 1 to i8*)] But once the original module is deleted, the same line in destination is replaced by the one with inttoptr: @switch.bbs = internal global [3 x i8*] [i8* inttoptr (i32 1 to i8*), i8* inttoptr (i32...
2017 Nov 05
2
What pattern string corresponds to CopyToReg?
...; source_filename = "return.c" >> target datalayout = >> "E-m:e-p:16:16:16-i1:16:16-i8:16:16-i16:16:16-i32:16:16-i64:16:16-S16-n16" >> target triple = "tms9900" >> >> ; Function Attrs: noinline nounwind optnone >> define signext i16 @my_func() #0 { >> entry: >> ret i16 127 >> } >> >> ------- debug output -------- >> >> Optimized legalized selection DAG: BB#0 'my_func:entry' >> SelectionDAG has 5 nodes: >> t0: ch = EntryToken >> t3: ch,glue = CopyToReg t0, Regis...
2011 May 21
1
'apply' with additional class variable
...ke this: carmake<-c("Toyota","Ford","Chevy") x<-matrix(1:12,nrow=4) colnames(x)<-c("Car1","Car2","Car3") rownames(x)<-c("Horsepower","TopSpeed","Weight","Cost") res<-apply(my_matrix,2,my_func,carmake) The obvious problem with this is that I cannot know which column 'my_func' is working on, in order to know which column to get the car make from. I then thought I could try and match on column name, but when the column is passed into 'my_func' it loses the column name. An...
2020 Apr 28
5
llvm-objdump: failed to parse debug information
...-objdump does not complain when run on each file individually and the disassembly output shows file/line information). In order to identify where the ELF file is lacking debug info, I added some debug traces to llvm-objdump and it seems the following symbol is the culprit: __ThumbV7PILongThunk_<my_func> Is this expected behavior? How to fix it? LLVM version is llvmorg-11-init-12683-g54b3f91d205 but AFAICT anything above 10.0 behaves the same. Thanks, -- Jerome
2005 Apr 22
1
Beginner in R
...struct$a <- a_value my_struct$b <- another_value my_struct$c <- one_more_value and a function with two args : the first is a instance of the structure, and the second is any component of the structure (here $a, $b or $c) and the function will do some transformations on this component : my_func <- function(a_struct, a_comp) { a_comp <- transformationFunct(a_comp) a_result <- someComputation(a_struct) return(a_result) } In reallity, the structure have lot of components (+/- 40) who are input parameters for a time discret model and this function is to do se...
2017 Nov 05
2
What pattern string corresponds to CopyToReg?
...BTW, the function is: ; ModuleID = 'return.c' source_filename = "return.c" target datalayout = "E-m:e-p:16:16:16-i1:16:16-i8:16:16-i16:16:16-i32:16:16-i64:16:16-S16-n16" target triple = "tms9900" ; Function Attrs: noinline nounwind optnone define signext i16 @my_func() #0 { entry: ret i16 127 } ------- debug output -------- Optimized legalized selection DAG: BB#0 'my_func:entry' SelectionDAG has 5 nodes: t0: ch = EntryToken t3: ch,glue = CopyToReg t0, Register:i16 %R5, Constant:i16<127> t4: ch = TMS9900ISD::Ret t3, Register:i16 %R5, t3...
2009 Oct 22
1
tapply with multiple arguments that are not part of the same data frame
...gt;fitness_data name height weight country rob 5.8 200 usa nancy 5.5 140 germany jen 5.6 150 usa clark 5.10 210 germany matt 5.9 280 canada ralph 6 270 canada ... ... Now let us say I have a function, my_func(h, w, noise, dir), which takes as input: (1) a vector of heights (2) a vector of weights (3) a user-input numeric "noise" value (4) a user-input string "dir" for the directory to output the end result of the function to This function does some calculations on the input data and...
2006 Jun 06
0
[LLVMdev] Re: global variable
...the call? I don't know >> what you're trying to do, so I can't help without more details. >> >> No, Gv is not used as an argument to the call. The return value of the call >> is to be assigned to Gv. For example, I want > %Gv = global uint0; > %Gv = call my_func(Args); > > But now, I can only get: > %Gv = global uint 0; > %my_func = call %my_func(Args); You need to emit a store instruction. globals are memory, accessed with load/store instructions. Try something like this: V = new CallInst(...) new StoreInst(V, GV); -Chris -- http://non...
2017 Nov 05
2
What pattern string corresponds to CopyToReg?
So there's a DAG that looks like this in the debug output: Selecting: t3: ch,glue = CopyToReg t0, Register:i16 %R5, Constant:i16<127> In the instruction selection phase, what pattern would that match? I've constructed this so far: (??? REG16:$dst, i16imm:$src) but the problem is, I can't determine what to use as ???. There is an ISD::CopyToReg enum value, but I don't
2011 Aug 24
0
[LLVMdev] v3.0 type system rewrite question
...y defined in a given Module (global context). However, I don't have much experience with the LLVM internals so there's a good chance that I'm not fully understanding the new changes ;) For Example: This works fine (via ParseAssemblyString): "%my_type = type double define double @my_func(%my_type %a) { entry: %return = fmul %my_type %a, 5.0 ret %my_type %return }" However splitting this into two independent calls results in a parser error. So this ... "%my_type = type double" followed at a later date by ... "define double @my_func(%my_type %a) { entry...
2012 Nov 13
1
[LLVMdev] Inserting pthread_create call into sequential code
Hi, I was working on multithreading a cross iteration loop. I want to insert a pthread_create function call and use other pthread functions into my LLVM IR. Issue is how do i get these functions using module->getOrInsertFunction("pthread_create"), since the function might not be there in IR and then insert function calls to these functions. So, crux is how do i call pthread
2007 Oct 19
3
Stubbing a Kernel method?
Is it possible to stub a Kernel method? I''m specifically interested in the ''open'' method to test some code using open-uri. I''ve tried: Kernel.should_receive(:open).with(''filename'').and_return(''data'') However, this doesn''t seem to work. Any suggestions would be appreciated. --Paul
2012 Aug 15
0
[LLVMdev] clang promoting local to global
...gt;>> What does your testcase look like? > >>> > >>> -Eli > >> > >> > > > #define other_def(x, tab, vf, rf, c) (x ^ tab[0][x ^ c0 ^ vf ^ rf ^ c) #define my_def(y,x,k,c) defs(y,c) = (k}[c] ^ other_def(x, it_tab, inv_var, rf1, c) void my_func() { #define r10(p,q,r,s) 0x##s##r##q##p #undef r #define r r10 const word it_tab[4][256] = { r(const, const, const, const), r(.......), r(.......) ....... }; } You prefer bottom posting? Ok. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://l...
2012 Nov 06
0
[LLVMdev] Bug in SelectionDAG visitTargetIntrinsic
void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I, - unsigned Intrinsic) { - bool HasChain = !I.doesNotAccessMemory(); - bool OnlyLoad = HasChain && I.onlyReadsMemory(); + unsigned Intrinsic) { + // Info is set by getTgtMemInstrinsic + TargetLowering::IntrinsicInfo Info; + bool
2014 Oct 13
3
[LLVMdev] RFC: variable names
...;lower_case" names. > > This also happens to be the vastly most common pattern across all C++ coding > styles and C-based language coding styles I have seen. STL has "lower_case" functions, and exposes far fewer variables. I can't really recall which of myFunc/my_var or my_func/myVar I've seen more elsewhere though. Tim. (Not advocating anything in particular yet).
2012 Aug 15
2
[LLVMdev] clang promoting local to global
On Wed, Aug 15, 2012 at 3:17 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > So there are some #define (defined outside the function scope) that use > it_tab that are used inside the function, is this why it is promoting it to > a global? Macros shouldn't matter. Please give a complete testcase and steps to reproduce. And please don't top-post. -Eli > > On Wed,