similar to: Operator overloading for custom classes

Displaying 20 results from an estimated 200 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 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 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)
2005 Aug 05
2
Phone interface hardware
--- Raja Chidambaram <raja_chidambaram82@yahoo.com> wrote: > Date: Wed, 3 Aug 2005 06:27:05 -0700 (PDT) > From: Raja Chidambaram > <raja_chidambaram82@yahoo.com> > Subject: Phone interface hardware > To: Asterisk-Users@lists.digium.com > > Hello All, > > We are in the process of putting together an asterix > based phone network in our office. The
2006 Aug 07
0
Overloading ''find''
How would I overload find? I got some excellent help on mixins for my classes using lib/, but it doesn''t allow find to be overloaded. I''m testing with the example method below: module myModule def find(*args) options = extract_options_from_args!(args) validate_find_options(options) set_readonly_option!(options) case args.first
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
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 Nov 01
0
Overloading #initialize in a model
I''m using WhinyProtectedAttributes: http://henrik.nyh.se/2007/10/whiny-protected-attributes Say I have this model: class Person < ActiveRecord::Base attribute_accessible :name end If I then create a Person with an invalid attribute, an exception is raised. For example: Person.new :name => ''Bob'', :asdf => ''asdf'' What I''d like to
2011 Jul 12
1
[LLVMdev] Overloading intrinsic with pointer to pointer
Hi, I've noticed that if I try to overload an intrinsic with a pointer to pointer my call to Intrinsic::getDeclaration, for example with an i8** type. Ultimately, this is because Intrinsic::getName (lib/VMCore/Function.cpp#338) only removes one level of indirection from the passed pointer type, so calls getEVTString on a pointer type resulting an in Invalid EVT assertion
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 Feb 13
1
Problem with overloading add type casts of numeric strings in PHP bindings
Overloaded methods are mapped in PHP to their implementation (_SWIG_0, _SWIG_1, ..) based on the types and number of arguments the user supplies. However, if one overload accept a string and another an integer the bindings fail to separate them since PHP treats numeric strings much the same as integers. The problem is illustrated in WritableDatabase_replace_document() which takes either the
2006 Oct 27
1
Overloading functions
Hi Everyone I have a function f which does something using a function g. Function f is in a library and g has a default stub in the library but will be mainly overloaded in a later R script. For example: ########## In a compiled package 'P' ################# g <- function() { cat("Original function g"); } f <- function( newGsource=NULL ) { if(
2008 Mar 16
1
Overloading %*%
Hi, Is it possible to supply a new method for the %*% operator? I need to provide a new method for working on variables of a newly defined class, "ad". I've had no problems overloading +, * etc.., using code such as: "+.ad" <- function(a,b = NULL) { # further code here } I've tried to do the same thing with %*%: "%*%.ad" <- function(a,b) { #
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
2010 Oct 28
1
overloading the generic primitive functions "+" and "["
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101028/d7e0cc89/attachment.pl>
2010 Oct 30
1
overloading "[" and "[<-" using S3 classes
How can I overload the "[" and "[<-" operators using S3 classes? Something like '['.{class} did not work or at least I do not know how to define it properly. For S4 it is straightforward: setMethod("[", signature(x = "myClass", i = "numeric"), function (x, i, j, ..., drop){ ... some operations }) How to do the same for S3? TIA!
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
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
2013 Jan 21
1
Overloading IMAP Server
Hi All, I am having an issue with dovecot IMAP reading and writing to one specific mailbox. I have a check email delivery script that sends out a email and then logs into dovecot to check if the mailbox that the message has been delivered to. However, the servers that send these messages send them in bunches depending on how many postfix spools it is checking. So I could get 60