similar to: new package multipol

Displaying 20 results from an estimated 3000 matches similar to: "new package multipol"

2008 Feb 04
2
a != a*1 != a+0 != +a
hits=1.0 tests=MANY_EXCLAMATIONS X-USF-Spam-Flag: NO Hi I am writing a package for multivariate polynomials ('multipols') using S3 methods. The package includes a Ops.multipol() function for the arithmetic methods; I would like to define some sort of user-specified Boolean option which, if set, would force results to be simplified as they are produced. Call this option
2008 Jan 07
2
S3 vs S4 for a simple package
I am writing a package and need to decide whether to use S3 or S4. I have a single class, "multipol"; this needs methods for "[" and "[<-" and I also need a print (or show) method and methods for arithmetic +- */^. In S4, an object of class "multipol" has one slot that holds an array. Objects of class "multipol" require specific arithmetic
2011 Jan 26
0
Bivariate polynomials in R
Have you ever worked in R with bivariate polynomials? How did you implement simple operators like addition/multiplication? I found a package called multipol that seems to support these kinds of operators but I do keep receiving error. Check for example the following snippet of code (you can copy & paste) require('orthopolynom') require('polynom') require('multipol')
2008 May 07
1
optional setValidity()
Hi Suppose I have an S4 class "foo" and a validity checking function ".checkfoo()": setClass("foo", representation=representation("numeric")) setValidity("foo" , .checkfoo) is fine; in my application, .checkfoo() verifies that a bunch of necessary conditions are met. But .checkfoo() is very time consuming and I want to give users the option
2008 Jan 14
2
as.function()
Hi [this after some considerable thought as to R-help vs R-devel] I want to write a (S3) method for as.function(); toy example follows. Given a matrix "a", I need to evaluate trace(ax) as a function of (matrix) "x". Here's a trace function: tr <- function (a) { i <- seq_len(nrow(a)) return(sum(a[cbind(i, i)])) } How do I accomplish the following:
2007 Dec 19
3
array addition
Hi suppose I have two arrays x1,x2 of dimensions a1,b1,c1 and a2,b2,c2 respectively. I want x = x1 "+" x2 with dimensions c(max(a1,a2), max(b1,b2),max (c1,c2)) with x[a,b,c] = x1[a1,b1,c1] + x2[a2,b2,c2] if a <=min(a1,a2) , b<=min (b1,b2), c<=min(c1,c2) and the other bits either x1 or x2 or zero according to whether the coordinates are "in range" for
2008 Feb 11
0
PDF with computationally expensive normalizing constant
Hi I am writing some functionality for a multivariate PDF. One problem is that evaluating the normalizing constant (NC) is massively computationally intensive [one recent example took 4 hours and bigger examples would take much much longer] and it would be good allow for this in the design of the package somehow. For example, the likelihood function doesn't need the NC but (eg) the
2007 Dec 18
0
branch cuts of log() and sqrt()
Dear developers Neither Math.Rd nor Log.Rd mention the branch cuts that appear for complex arguments. I think it's important to include such information. Please find following two context diffs for Log.Rd and Math.Rd. [The pedants amongst us will observe that both sqrt() and log() have a branch point at complex infinity, which is not mentioned in the patch. Comments anyone?] rksh
2008 Mar 26
5
S4 slot with NA default
Hi How do I specify an S4 class with a slot that is potentially numeric, but NA by default? I want the slot to be NA until I calculate its value (an expensive operation, not needed for all applications). When its value is known, I will create a new object with the correct value inserted in the slot. I want "NA" to signify "not known". My attempt fails because
2008 Apr 02
1
"[<-" plus drop-type extra argument
Hello I am writing a replacement method for an S4 class and want to pass an additional argument to "[<-"() along the lines of "["()'s "drop" argument. Specifically, I have an S4 class, call it "foo", with a slot 'x' that is a vector and a slot 'NC' that is a scalar. I want to be able to pass a Boolean argument to the
2007 Nov 02
1
vignettes and papers
Hello everyone Lots of my packages have been the subject of journal articles either in JSS or Rnews or (in one case) elsewhere. I would like to add these articles to my packages as vignettes. Reproducing the papers exactly requires a number of files [such as style files or PDFs] to be included in the inst/doc directory to pass R CMD check. A vanilla .Rnw file seems to be a good idea, but
2006 Aug 30
1
setMethod() and log()
Hi I am having difficulty with setMethod(). I have a "brob" class of objects whose representation has two slots: "x" and "positive". Slot "x" (double) holds the log of a number and slot "positive" (logical) its sign. The idea is that large numbers can be handled. I'm trying to implement a log() method using an analogue of the
2004 Nov 18
0
Fwd: Re: 3d scatter plot with drop line
Hi try this: p3dpairs <- function(x,x1, xlim=NULL,ylim=NULL,zlim=NULL,col=par("col"), pch=par("pch"), cex=par("cex"), ...){ if(is.matrix(x)){ z <- x[,3] y <- x[,2] x <- x[,1] } if(is.matrix(x1)){ z1 <- x1[,3] y1 <- x1[,2] x1 <- x1[,1] } if(missing(zlim)) { z.grid <-
2005 Jan 07
1
Visualizing complex analytic functions using domain coloring
Hi has anyone coded up domain colouring for visualizing complex analytic functions (such as elliptic functions)? [ the idea is to depict a complex function f(z) using a filled.contour() variant in which the hue is given by Arg(f(z)), and the saturation by Mod(f(z)). ] -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel
2005 Apr 29
1
accuracy of test cases
Hi I have several methods for evaluating a function. The methods are algebraically identical but use different numerical techniques. The different methods work better (converge faster, etc) in different parts of the function's domain. I am compiling a test suite for a package, and would like to verify that the different methods return approximately identical results. Toy example
2005 Jul 04
1
prototypes for z_sin() and z_cos()
Hi I have been looking at complex.c and want to access z_cos() and z_sin () from C in one of my packages. There doesn't seem to be a corresponding header file: there is no complex.h file. Where are the prototypes of z_sin() and z_cos() for these functions? grepping didn't help me: find ~/downloads/R-2.1.1/ -name "*.h " | xargs egrep "z_cos"
2005 Sep 01
1
generic function S3 consistency warning advice
Hi section 6.1 of R-exts suggests that a package can take over a function in the base package and make it generic. I want to do this with Re() and have the following lines in my R code: "Re" <- function(x){UseMethod("Re" )} "Re.default" <- get("Re" ,pos=NULL,mode="function") "Re.octonion" <- function(x){give.comp(x,1)}
2006 Jul 26
2
largest acceptable lookup table in a package
Hi One of my packages needs a look-up table of pre-calculated numbers in the data directory. I would like to have the matrix as large as possible. What is the largest size matrix that would be an acceptable datafile in an R package? [ The table is a square, upper triangular matrix consisting of logs of Stirling numbers calculated by Maple. As discussed on the List a few days ago (thanks
2006 Sep 01
1
setMethod("Logic", ...)
Hi In V&R the "polynomial" class is explicitly specified to have no logical operators: setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop ("...")}) I too have a class of objects for which I want to specify that Logic operators do not work, but executing setClass("brob", representation = representation
2007 Jun 27
1
inherits() and virtual classes
Hi How do I test for an object having a particular virtual class? In the following, "onion" is a virtual class, and "octonion" is a non-virtual class contained in onion. The last call to inherits() gives FALSE [R-2.5.0], when inherits.Rd led me to expect TRUE. setClass("onion", representation = "VIRTUAL" )