dgTMatrix-class(Matrix)
dgTMatrix-class()所属R语言包:Matrix
Sparse matrices in triplet form
稀疏矩阵的三元组形式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The "dgTMatrix" class is the class of sparse matrices stored as (possibly redundant) triplets. The internal representation is not at all unique, contrary to the one for class dgCMatrix.
类"dgTMatrix"类(可能是多余的)三胞胎存储稀疏矩阵。内部表示是在所有独特的,相反一类dgCMatrix。
类的对象----------Objects from the Class----------
Objects can be created by calls of the form new("dgTMatrix", ...), but more typically via as(*, "dgTMatrix").
创建的对象可以通过电话的形式new("dgTMatrix", ...),但更典型,通过as(*, "dgTMatrix")。
插槽----------Slots----------
i: Object of class "integer" - the row indices of non-zero entries in 0-base, i.e., must be in
i:Object类的"integer" - 0基非零项的行指数,即必须是在
j: Object of class "integer" - the column indices of non-zero entries. Must be the same length as slot
j:Object类的"integer" - 非零项的列索引。必须作为相同长度的插槽
x: Object of class "numeric" - the (non-zero) entry at position (i,j). Must be the same length as slot i. If an index pair occurs more than once the corresponding
x类"numeric" - 位置(i,j)(非零)项的对象。槽i必须是相同的长度。如果一个索引对不止一次发生相应的
Dim: Object of class "integer" of length 2 -
Dim:对象类"integer"长度为2 -
方法----------Methods----------
+ signature(e1 = "dgTMatrix", e2 = "dgTMatrix")
+signature(e1 = "dgTMatrix", e2 = "dgTMatrix")
coerce signature(from = "dgTMatrix", to = "dgCMatrix")
强制signature(from = "dgTMatrix", to = "dgCMatrix")
coerce signature(from = "dgTMatrix", to = "dgeMatrix")
强制signature(from = "dgTMatrix", to = "dgeMatrix")
coerce signature(from = "dgTMatrix", to = "matrix"), and typically coercion methods for more specific signatures, we are not mentioning here.
要挟signature(from = "dgTMatrix", to = "matrix"),通常胁迫更具体的签名方法,我们不提。
Note that these are not guaranteed to continue to exist, but rather you should use calls like as(x, "CsparseMatrix"), as(x, "generalMatrix"),
请注意,这些都不能保证继续存在,而是你应该使用像调用as(x, "CsparseMatrix"),as(x, "generalMatrix")
coerce signature(from = "matrix", to = "dgTMatrix"),
要挟signature(from = "matrix", to = "dgTMatrix"),
crossprod signature(x = "dgTMatrix", y = "missing")
crossprodsignature(x = "dgTMatrix", y = "missing")
crossprod signature(x = "dgTMatrix", y = "matrix"): ...
crossprodsignature(x = "dgTMatrix", y = "matrix")...
crossprod signature(x = "dgTMatrix", y = "numeric"): ...
crossprodsignature(x = "dgTMatrix", y = "numeric")...
image signature(x = "dgTMatrix"): plots an image of
图像signature(x = "dgTMatrix"):图图像
t signature(x = "dgTMatrix"): returns the transpose of
Tsignature(x = "dgTMatrix"):返回的转
注意----------Note----------
Triplet matrices are a convenient form in which to construct sparse matrices after which they can be coerced to
三重矩阵是一种方便的形式,在其中构造稀疏矩阵之后,他们可以强迫
参见----------See Also----------
Class dgCMatrix or the superclasses dsparseMatrix and TsparseMatrix;
类dgCMatrix或父dsparseMatrix和TsparseMatrix;
举例----------Examples----------
m <- Matrix(0+1:28, nrow = 4)
m[-3,c(2,4:5,7)] <- m[ 3, 1:4] <- m[1:3, 6] <- 0
(mT <- as(m, "dgTMatrix"))
str(mT)
mT[1,]
mT[4, drop = FALSE]
stopifnot(identical(mT[lower.tri(mT)],
m [lower.tri(m) ]))
mT[lower.tri(mT,diag=TRUE)] <- 0
mT
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|