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

R语言 spam包 spam operations()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 12:23:46 | 显示全部楼层 |阅读模式
spam operations(spam)
spam operations()所属R语言包:spam

                                        Basic Linear Algebra for Sparse Matrices
                                         稀疏矩阵的基本线性代数

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

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

Basic linear algebra operations for sparse matrices of class spam.  
基本线性代数运算稀疏矩阵类spam。


Details

详细信息----------Details----------

Linear algebra operations for matrices of class  spam are designed to behave exactly as for  regular matrices.  In particular, matrix multiplication, transpose, addition,  subtraction and various logical operations should work as with the conventional dense form of matrix storage, as does indexing, rbind, cbind, and diagonal assignment and extraction (see for example diag). Further functions with identical behavior are dim and thus nrow, ncol.
线性代数运算矩阵类spam的行为完全一样,定期矩阵。特别是,矩阵乘法,转置,此外,减法,各种逻辑运算应与常规的致密形式的矩阵存储,索引,rbind,CBIND,和对角线赋值和提取(例如,参见diag) 。更多功能相同的行为是dim,从而nrow,ncol。

The function norm calculates the (matrix-)norm of the argument. The argument type specifies the l1 norm, sup or max norm (default), or the Frobenius or Hilbert-Schmidt (frobenius/hs) norm. Partial matching can be used. For example, norm is used to check for symmetry in the function chol by computing the norm of the difference between the matrix and its transpose
函数norm计算(矩阵)规范的说法。参数type指定l1规范,sup或最大制式(默认),或弗罗贝纽斯或希尔伯特 - 施密特(frobenius/hs)规范。可以使用部分匹配。例如,norm被用来检查在函数chol:通过计算矩阵及其转置之间的差的范数的对称性

The operator %d*% efficiently multiplies a diagonal matrix (in vector form) and a sparse matrix and is used for compatibility with the package fields. More specifically, this method is used in the internal functions of Krig to make the code more readable. It avoids having a branch in the source code to handle the diagonal or nondiagonal cases.  Note that this operator is not symmetric: a vector in the left argument is interpreted as a diagonal matrix and a vector in the right argument is kept as a column vector.
运算符%d*%有效的一个对角矩阵(矢量形式中)和一个稀疏矩阵相乘,并用于与的包信息的兼容性。更特别的是,使用这种方法在Krig,使代码更具可读性的内部功能。它避免了在源代码中的一个分支处理的对角线或者非对情况。请注意,此操作符是对称的:一个在左边的参数向量被解释为对角矩阵,并保持在右边的参数是一个向量作为列向量。

The operator %d+% efficiently adds a diagonal matrix (in vector form) and a sparse matrix, similarly to the operator %d+%.
运算符%d+%有效地增加了一个对角矩阵(矢量形式中)和一个稀疏矩阵,同样地操作员%d+%。


参考文献----------References----------

http://www-users.cs.umn.edu/~saad/software/SPARSKIT/sparskit.html

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

spam for coercion and other class relations involving the sparse matrix classes.
spam胁迫和其他阶级关系的稀疏矩阵类。


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


# create a weight matrix and scale it:[创建一个权重矩阵和它的规模:]
## Not run: [#不运行:]
wij <- distmat
# with distmat from a nearest.dist(..., upper=TRUE) call[一个nearest.dist(上= TRUE)调用与distmat]

n <- dim(wij)[1]

wij@entries &lt;- kernel( wij@entries, h) # for some function kernel[一些核函数]
wij &lt;- wij + t(wij) + diag.spam(n)     # adjust from diag=FALSE, upper=TRUE[从diag = FALSE,上= TRUE调整]

sumwij <- wij %*% rep(1,n)
    # row scaling:[行缩放:]
    #   wij@entries &lt;- wij@entries/sumwij[ wij@colindices][WIJ @项 -  WIJ @条目/ sumwij [WIJ @ colindices]]
    # col scaling:[山坳缩放:]
wij@entries <- wij@entries/sumwij[ rep(1:n, diff(wij@rowpointers))]

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 22:36 , Processed in 0.026197 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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