similar to: : Operator overloading for custom classes

Displaying 20 results from an estimated 1100 matches similar to: ": Operator overloading for custom classes"

2010 Mar 23
1
Operator overloading for custom classes
Hi, I need some help to get some of the object orientation, specifically the methods that overload the basic arithmetic operations, from sample C++ code to R. I don't have experience with such advanced language features inside of R. So I was wondering if some of you could help me out in this regard. I have written a simple demonstration of a forward mode automatic differentiator in C++ and
2010 Mar 03
1
Mentor for GSOC '10: Symbolic Regression in R
Hi all, I am looking to extend the regression and data analysis capabilities of R through Symbolic Regression that can potentially find implicit equation relationships in the input data. You can find my project proposal at: http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010:syrfr I am looking for a mentor to guide me through the summer on the project under the Google Summer Of
2010 Apr 02
4
Derivative of a smooth function
Dear All, I've been?searching for?appropriate codes to compute the rate of change and the curvature?of ?nonparametric regression model whish was denoted by a smooth function?but?unfortunately?don't manage to?do?it. I presume that such characteristics from a smooth curve can be determined by the first and second derivative operators. The following are the example of fitting a
2010 Jun 19
2
Call by reference or suggest workaround
I have written code to compute multi-indices in R [1] and due to the recursive nature of the computation I need to pass around the *same* matrix object (where each row corresponds to one multi-index). As pass by reference wasn't the default behavior I declared a global matrix (mat) and used the <<- operator to write to the global matrix. So the usage would be to call genMultiIndices(3,2)
2012 May 03
1
* operator overloading & setOldClass
Dear R gurus, I am trying to overload some operators in order to let these work with the ff package by registering the S3 objects from the ff package and overloading the operators as shown below in a reproducible example where the "*" operator is overloaded. require(ff) setOldClass(Classes=c("ff_vector")) setMethod( f="*", signature = signature(e1 =
2008 Jul 10
1
Operator overloading
Hi! I was just wondering is there anyway to overload operator for custom class. For example: I have two matrices A and B with same dimensions. I want to overload operator '+' with my own function. Or even better can I create my own (new) operator. Example: A+-B where '+-' would be some function. bye, Tine
2011 Nov 02
1
overloading + operator for chars
Hello,   I would like to overload the "+" operator so that it can be used to concatenate two strings, e.g "John" + "Doe" = "JohnDoe". How can I 'unseal' the "+" method? > setMethod("+", signature(e1="character", e2="character"), function(e1, e2) paste(e1, e2, sep="") ) Error in
2012 Dec 03
0
[LLVMdev] operator overloading fails while debugging with gdb for i386
Hi, I was going through this issue along with the standards. What the standard states is(reference: http://www.sco.com/developers/devspecs/abi386-4.pdf): If a function returns a structure or union, then the caller provides space for the return value and places its address on the stack as argument word zero. In effect, this address becomes a ‘‘hidden’’ first argument. Having the caller supply the
2012 Dec 03
1
[LLVMdev] operator overloading fails while debugging with gdb for i386
On 3 December 2012 10:42, Mayur Pandey <mayurthebond at gmail.com> wrote: > So this seems to be the cause of the problem. I guess you're mixing two different problems. First, is the possible lack of conformance with the ABI you state, which I can't comment since I don't know that ABI very well. Second, is the fact that clang is not printing correct debug information (or is
2012 Dec 02
0
[LLVMdev] operator overloading fails while debugging with gdb for i386
Hi, As you told that function ends up returning void, I just confirmed it in the IR, the function is defined as: define *void* @_Z3sum2A1S_(*%struct.A1* noalias sret %agg.result*, %struct.A1* byval align 4 %one, %struct.A1* byval align 4 %two). But when i checked the register values in g++, eax contains an address of stack, which points to the value (object) returned by sum. That is if we
2012 Dec 01
0
[LLVMdev] operator overloading fails while debugging with gdb for i386
Problem seems not only with operator overloading, It occurs with struct value returning also. gdb while debugging expects the return value in eax, gcc does returns in eax, But Clang returns in edx(it can be checked in gdb by printing the contents of edx). Code(sample code) struct A1 { int x; int y; }; A1 sum(const A1 one, const A1 two) { A1 plus = {0,0}; plus.x = one.x + two.x; plus.y
2012 Dec 03
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
On 2 December 2012 08:12, Mayur Pandey <mayurthebond at gmail.com> wrote: > So is this just a coincidence for g++ that eax points to this address and > gdb prints the right value on the command print sum(one,two)?? The code is small, and the structure is probably set at the end of the block, so I think it's not that much of a coincidence. Regardless of the specific value on that
2012 Nov 29
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
For the given test: class A1 { int x; int y; public: A1(int a, int b) { x=a; y=b; } A1 operator+(const A1&); }; A1 A1::operator+(const A1& second) { A1 sum(0,0); sum.x = x + second.x; sum.y = y + second.y; return (sum); } int main (void) { A1 one(2,3); A1 two(4,5); return 0; } when the exectable of this code is debugged in gdb for i386, we dont get the
2012 Dec 01
2
[LLVMdev] operator overloading fails while debugging with gdb for i386
Hi, Structures are passed by pointer, so the return value is not actually in eax. That code gets transformed into something like: void sum(A1 *out, const A1 one, const A1 two) { out->x = one.x + two.x out->y = one.y + two.y } So actually the function ends up returning void and operating on a hidden parameter, so %eax is dead at the end of the function and should not be being relied
2010 Mar 24
0
R-help ordinal regression
Dear colleagues, i am carrying out an ordinal regression model. I try it on SPSS but I "flirt" with R as well. I have a few questions. 1. What is the most reliable/tested/trusted package for ordinal regression in the R world? 2. Also, I have a statistical question. What is the danger of having to many 'empty cells' in ordinal regression? How many empty cells are too many? Do
2010 Mar 08
1
application to mentor syrfr package development for Google Summer of Code 2010
Per http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010 -- and http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010:syrfr -- I am applying to mentor the "Symbolic Regression for R" (syrfr) package for the Google Summer of Code 2010. I propose the following test which an applicant would have to pass in order to qualify for the topic: 1. Describe each of the
2010 Mar 02
1
Reading data file with both fixed and tab-delimited fields
Hello R wizards, What is the best way to read a data file containing both fixed-width and tab-delimited files? (More detail follows.) _*Details:*_ The U.S. Bureau of Labor Statistics provides local area unemployment statistics at ftp://ftp.bls.gov/pub/time.series/la/, and the data are documented in the file la.txt <ftp://ftp.bls.gov/pub/time.series/la/la.txt>. Each data file has five
2004 May 26
1
Bindings and overloading
This is going to be a problem. I don't appear to be able to rename a method once it's declared. So if the core bindings file declares some overloaded operators, functions or constructors, it's impossible to move them out of the way in only some of the bindings. Since Python supports overloading, I can't think of any solution to this other than maintaining two different xapian.i
2006 Jan 12
1
Does rails support method overloading?
I''ve tried to have 2 methods of the same name (but with different parameter signatures) and it always seems like the later declaration tends to win out, does this mean that ruby does not support overloading? If so what aboutt the .new method? You can either call it as .new (with nothing) or .new(hash variable). Is it possible to override a specific instance of the zero parameter
2009 Oct 19
1
overloading base function
Hello, I am trying to write an R package for doing analysis of speaker recognition systems. The big thing in this line of research is a DET-plot (detection Error Trade-off, a ROC plot with qnorm() warped axes). My approach has been to make a class "det" and also a function "det()" that will prepare the data into the right class. Now loading the library doesn't like me