找回密码
 注册
查看: 723|回复: 0

R语言 Rmpfr包 mpfr-class()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-27 19:01:57 | 显示全部楼层 |阅读模式
mpfr-class(Rmpfr)
mpfr-class()所属R语言包:Rmpfr

                                        Class "mpfr" of Multiple Precision Floating Point Numbers
                                         “MPFR类”多精度浮点数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

"mpfr" is the class of Multiple Precision Floatingpoint numbers with Reliable arithmetic.
"mpfr"是可靠的算法的多精度浮点数之类的。

For the high-level user, "mpfr" objects should behave as standard R's numeric vectors, just with prespecified (typically high) precision.
对于高级用户,"mpfr"对象的行为应该作为标准的Rnumeric向量,与预先设定的精度(通常为高)。


类对象----------Objects from the Class----------

Objects are typically created by mpfr(<number>, precBits).
创建的对象通常是mpfr(<number>, precBits)。


插槽----------Slots----------

Internally, "mpfr" objects just contain standard R lists where each list element is of class "mpfr1", representing one MPFR number, in a structure with four slots, very much parallelizing the C struc in the mpfr C library to which the Rmpfr package interfaces.
在内部,"mpfr"对象只包含标准的Rlist的列表,其中每个元素是类"mpfr1",代表一个的MPFR数,有四个插槽的结构,非常并行的Cstruc中mpfrC库Rmpfr的封装接口。

An object of class "mpfr1" has slots
一个对象的类"mpfr1"的插槽




prec: "integer" specifying the maxmimal
prec:"integer"指定的maxmimal的




exp: "integer" specifying the base-2
exp:"integer"指定的基2




sign: "integer", typically -1 or 1, specifying the sign (i.e. sign(.)) of the
sign:"integer",通常-1或1,指定的符号(即sign(.))




d: an "integer" vector (of 32-bit &ldquo;limbs&rdquo;) which corresponds to the full mantissa of the
d:"integer"矢量(32位的“四肢”),其对应于完整的尾数


方法----------Methods----------




abs signature(x = "mpfr"): ...
ABSsignature(x = "mpfr"):...




beta signature(a = "mpfr", b = "ANY"),
测试signature(a = "mpfr", b = "ANY"),




lbeta signature(a = "ANY", b = "mpfrArray"),
lbeta signature(a = "ANY", b = "mpfrArray"),




beta signature(a = "mpfr", b = "mpfr"), ..., etc: Compute the beta function B(a,b), using high precision, building on internal gamma or lgamma. See the help for R's base function beta for
测试signature(a = "mpfr", b = "mpfr"),...等计算的测试功能B(a,b),采用高精度,构建内部gamma或lgamma。请参阅帮助R的基本功能beta




dim<- signature(x = "mpfr"): Setting a dimension dim on an "mpfr" object makes it into an object of class "mpfrArray" or (more specifically) "mpfrMatrix" for a length-2 dimension, see their help page;
昏暗< -  signature(x = "mpfr"):设置一个尺寸dim"mpfr"对象使它成一个对象类"mpfrArray"或(更具体地说)"mpfrMatrix"长度-2尺寸,看到他们的帮助;




Ops signature(e1 = "mpfr", e2 = "ANY"): ...
行动signature(e1 = "mpfr", e2 = "ANY"):...




Ops signature(e1 = "ANY", e2 = "mpfr"): ...
行动signature(e1 = "ANY", e2 = "mpfr"):...




Arith signature(e1 = "mpfr", e2 = "missing"): ...
ARITH signature(e1 = "mpfr", e2 = "missing")...




Arith signature(e1 = "mpfr", e2 = "mpfr"): ...
ARITH signature(e1 = "mpfr", e2 = "mpfr")...




Arith signature(e1 = "mpfr", e2 = "integer"): ...
ARITH signature(e1 = "mpfr", e2 = "integer")...




Arith signature(e1 = "mpfr", e2 = "numeric"): ...
ARITH signature(e1 = "mpfr", e2 = "numeric")...




Arith signature(e1 = "integer", e2 = "mpfr"): ...
ARITH signature(e1 = "integer", e2 = "mpfr")...




Arith signature(e1 = "numeric", e2 = "mpfr"): ...
ARITH signature(e1 = "numeric", e2 = "mpfr")...




Compare signature(e1 = "mpfr", e2 = "mpfr"): ...
比较signature(e1 = "mpfr", e2 = "mpfr"):...




Compare signature(e1 = "mpfr", e2 = "integer"): ...
比较signature(e1 = "mpfr", e2 = "integer"):...




Compare signature(e1 = "mpfr", e2 = "numeric"): ...
比较signature(e1 = "mpfr", e2 = "numeric"):...




Compare signature(e1 = "integer", e2 = "mpfr"): ...
比较signature(e1 = "integer", e2 = "mpfr"):...




Compare signature(e1 = "numeric", e2 = "mpfr"): ...
比较signature(e1 = "numeric", e2 = "mpfr"):...




Logic signature(e1 = "mpfr", e2 = "mpfr"): ...
逻辑signature(e1 = "mpfr", e2 = "mpfr"):...




Summary signature(x = "mpfr"): The S4 Summary group functions, max, min, range, prod, sum, any, and all
摘要signature(x = "mpfr"):S4Summary组功能,max,min,range,prod,sum,<X >和any




Math signature(x = "mpfr"): All the S4 Math group functions are defined, using multiple precision (MPFR) arithmetic, from getGroupMembers("Math"), these are (in alphabetical order):
数学signature(x = "mpfr"):所有S4 Math组功能的定义,使用的多个精密(MPFR)的算术,getGroupMembers("Math"),这是(按英文字母顺序排列):

abs, sign, sqrt, ceiling, floor, trunc, cummax, cummin, cumprod, cumsum, exp, expm1, log, log10, log2, log1p, cos, cosh, sin, sinh, tan, tanh, acos, acosh, asin, asinh, atan, atanh, gamma, lgamma, digamma, and trigamma.
abs,sign,sqrt,ceiling,floor,trunc,cummax,cummin,cumprod,cumsum,exp,expm1,log,log10,log2,log1p,cos ,cosh,sin,sinh,tan,tanh,acos,acosh,asin, asinh,atan,atanh,gamma,lgamma,digamma和trigamma。

Currently, trigamma is not provided by the MPFR library and hence not yet implemented. <br>
目前,trigamma是不提供的MPFR库,因此尚未实施。参考




factorial signature(x = "mpfr"): this will round the result when x is integer valued. Note however that factorialMpfr(n) for integer n is slightly more efficient, using the MPFR function
因子signature(x = "mpfr"):这将round的结果时x整数值。但是请注意,这factorialMpfr(n)为整数n会更有效,使用MPFR功能




Math2 signature(x = "mpfr"): round(x,
MATH2signature(x = "mpfr")“:<CODE> ROUND(X,




as.numeric signature(x = "mpfr"): ...
as.numericsignature(x = "mpfr"):...




as.vector signature(x = "mpfrArray"): as for standard arrays, this &ldquo;drops&rdquo; the dim (and dimnames), i.e., transforms x into an "MPFR"
as.vectorsignature(x = "mpfrArray"):为array的,这个“滴”的的dim(dimnames),即转换x到 ; MPFR




[[ signature(x = "mpfr", i = "ANY"), and
[signature(x = "mpfr", i = "ANY"),




[ signature(x = "mpfr", i = "ANY", j = "missing", drop = "missing"):
[signature(x = "mpfr", i = "ANY", j = "missing", drop = "missing")方向:




format signature(x = "mpfr"), further arguments digits = NULL, scientific = NA, etc: returns character vector of same length as x; when digits is NULL, with enough digits to recreate x accurately.  For details, see
格式“signature(x = "mpfr"),进一步的论据digits = NULL, scientific = NA,等:返回character向量的长度相同的x,digits是NULL,用足够位数重新x准确。有关详细信息,请参阅




is.finite signature(x = "mpfr"): ...
is.finitesignature(x = "mpfr"):...




is.infinite signature(x = "mpfr"): ...
is.infinitesignature(x = "mpfr"):...




is.na signature(x = "mpfr"): ...
is.na signature(x = "mpfr")...




is.nan signature(x = "mpfr"): ...
is.nan signature(x = "mpfr")...




log signature(x = "mpfr"): ...
登录signature(x = "mpfr"):...




show signature(object = "mpfr"): ...
显示signature(object = "mpfr"):...




sign signature(x = "mpfr"): ...
签署signature(x = "mpfr"):...




all.equal signature(target = "mpfr", current = "mpfr"),
all.equalsignature(target = "mpfr", current = "mpfr"),




all.equal signature(target = "mpfr", current = "ANY"), and
all.equalsignature(target = "mpfr", current = "ANY"),




all.equal signature(target = "ANY", current = "mpfr"): methods for numerical (approximate) equality, all.equal of multiple precision numbers.  Note that the default tolerance (argument) is taken to correspond to the (smaller of the two) precisions when both main arguments are of class "mpfr", and hence can be considerably less than
all.equalsignature(target = "ANY", current = "mpfr"):数值(大约)平等,all.equal的多精度数的方法。需要注意的默认tolerance(参数)是对应的(小二)精度的主要论据是当两个类"mpfr",并因此可以大大低于




coerce signature(from = "numeric", to = "mpfr"): as(., "mpfr") coercion methods are available for character strings, numeric, integer, logical, and even raw.  Note however,
强迫signature(from = "numeric", to = "mpfr"):as(., "mpfr"),胁迫方法可用于character字符串,numeric,integer,logical,甚至raw。但是请注意,




coerce signature(from = "mpfr", to = "numeric"): ...
要挟signature(from = "mpfr", to = "numeric"):...




coerce signature(from = "mpfr", to = "character"): ...
要挟signature(from = "mpfr", to = "character"):...




unique signature(x = "mpfr"): and
独特的signature(x = "mpfr"):




duplicated signature(x = "mpfr"): just work as with numbers.
复制signature(x = "mpfr"):只是工作与数字。




t signature(x = "mpfr"): makes x into an n x 1 mpfrMatrix.
Tsignature(x = "mpfr"):让x到n x 1mpfrMatrix。


注意----------Note----------

Many more methods (&ldquo;functions&rdquo;) automagically work for "mpfr" number vectors (and matrices, see the mpfrMatrix class doc), notably sort, order, quantile, rank.
还有更多的方法(“函数”)自动地工作"mpfr"数向量(矩阵,看看mpfrMatrix类文档),著名的sort,order,<X >,quantile。


(作者)----------Author(s)----------


Martin Maechler



参见----------See Also----------

The "mpfrMatrix" class, which extends the "mpfr" one.
"mpfrMatrix"类,它扩展了"mpfr"1。

roundMpfr to change precision of an "mpfr" object; is.whole() etc.
roundMpfr改变的"mpfr"对象的精度; is.whole()等等。

Special mathematical functions such as some Bessel ones, e.g., jn; further, zeta(.) (= &zeta;(.)), Ei() etc. Bernoulli numbers and the Pochhammer function pochMpfr.
特殊的数学函数,如贝塞尔的,例如,jn;此外,zeta(.)(= &zeta;(.)),Ei()等Bernoulli号码和Pochhammer功能,<X >。


实例----------Examples----------


## 30 digit precision[第30位的精度]
str(x <- mpfr(c(2:3, pi), prec = 30 * log2(10)))
x^2
x[1] / x[2] # 0.66666... ~ 30 digits[0.66666 ... ~30位]

## indexing - as with numeric vectors[#索引 - 数字矢量]
stopifnot(identical(x[2], x[[2]]),
          ## indexing "outside" gives NA (well: "mpfr-NaN" for now):[#索引“外”给出了NA(得好:“MPFR-NAN”现在):]
          is.na(x[5]),
          ## whereas "[[" cannot index outside:[#而“[[”不能索引之外:]
          is(try(x[[5]]), "try-error"),
          ## and only select *one* element:[#只选择* 1 *元素:]
          is(try(x[[2:3]]), "try-error"))

## factorial() &amp; lfactorial would work automagically via [l]gamma(),[#阶乘()和lfactorial的[L]γ()会自动地通过,]
## but factorial() additionally has an "mpfr" method which rounds[#但阶乘()另外有一个“MPFR”这轮的方法]
f200 &lt;- factorial(mpfr(200, prec = 1500)) # need high prec.![需要高PREC。]
f200
as.numeric(log2(f200))# 1245.38 -- need precBits &gt;~ 1246 for full precision[1245.38  - 的需要precBits~1246全精度]

##--&gt; see  factorialMpfr() for more such computations.[# - >看到更多这样的计算factorialMpfr()。]

##--- "Underflow" **much** later -- exponents have 30(+1) bits themselves:[#---“下溢”**的**后 - 指数有30位(+1)自己:]

mpfr.min.exp2 <- - (2^30 + 1)
two <- mpfr(2, 55)
stopifnot(two ^ mpfr.min.exp2 == 0)
## whereas[#而]
two ^ (mpfr.min.exp2 * (1 - 1e-15))
## 2.38256490488795107e-323228497   ["typically"][#2.38256490488795107e-323228497“典型的”]

## Above, we mention {sort}, {order}, {quantile}, {rank}.[#上面,我们提到【分页} {以便},{位数},{排名}。]
p <- mpfr(rpois(12, lambda=500), precBits=128)^10


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-24 08:36 , Processed in 0.023476 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表