The R Project SVN R-packages

Rev

Rev 1044 | Rev 1765 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1044 Rev 1190
Line 13... Line 13...
13
	ncol, nrow, nnz = length(islot),
13
	ncol, nrow, nnz = length(islot),
14
	*xj = INTEGER(jslot),
14
	*xj = INTEGER(jslot),
15
	*xi = INTEGER(islot);
15
	*xi = INTEGER(islot);
16
 
16
 
17
    if (length(xslot) != nnz || length(jslot) != nnz)
17
    if (length(xslot) != nnz || length(jslot) != nnz)
18
	return mkString("lengths of slots i, j, and x must match");
18
	return mkString(_("lengths of slots i, j, and x must match"));
19
    if (length(dimslot) != 2)
19
    if (length(dimslot) != 2)
20
	return mkString("slot Dim must have length 2");
20
	return mkString(_("slot Dim must have length 2"));
21
    nrow = dims[0]; ncol = dims[1];
21
    nrow = dims[0]; ncol = dims[1];
22
    for (j = 0; j < nnz; j++) {
22
    for (j = 0; j < nnz; j++) {
23
	if (xi[j] < 0 || xi[j] >= nrow)
23
	if (xi[j] < 0 || xi[j] >= nrow)
24
	    return mkString("all row indices must be between 0 and nrow-1");
24
	    return mkString(_("all row indices must be between 0 and nrow-1"));
25
	if (xj[j] < 0 || xj[j] >= ncol)
25
	if (xj[j] < 0 || xj[j] >= ncol)
26
	    return mkString("all column indices must be between 0 and ncol-1");
26
	    return mkString(_("all column indices must be between 0 and ncol-1"));
27
    }
27
    }
28
    return ScalarLogical(1);
28
    return ScalarLogical(1);
29
}
29
}
30
 
30
 
31
SEXP dgTMatrix_to_dgCMatrix(SEXP x)
31
SEXP dgTMatrix_to_dgCMatrix(SEXP x)