The R Project SVN R

Rev

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

Rev 1073 Rev 1130
Line 18... Line 18...
18
 */
18
 */
19
 
19
 
20
#include "Defn.h"
20
#include "Defn.h"
21
#include "Mathlib.h"
21
#include "Mathlib.h"
22
 
22
 
-
 
23
#ifdef not_used_currently
-
 
24
 
23
static void CheckDims(SEXP dims)
25
static void CheckDims(SEXP dims)
24
{
26
{
25
	int i;
27
	int i;
26
 
28
 
27
	for (i = 0; i < LENGTH(dims); i++) {
29
	for (i = 0; i < LENGTH(dims); i++) {
28
		if (INTEGER(dims)[i] < 0)
30
		if (INTEGER(dims)[i] < 0)
29
			error("invalid array extent\n");
31
			error("invalid array extent\n");
30
	}
32
	}
31
}
33
}
32
 
34
 
-
 
35
#endif
-
 
36
 
33
SEXP do_matrix(SEXP call, SEXP op, SEXP args, SEXP rho)
37
SEXP do_matrix(SEXP call, SEXP op, SEXP args, SEXP rho)
34
{
38
{
35
	SEXP vals, snr, snc;
39
	SEXP vals, snr, snc;
36
	int nr, nc, byrow, lendat;
40
	int nr, nc, byrow, lendat;
37
 
41
 
Line 88... Line 92...
88
	setAttrib(s, R_DimSymbol, t);
92
	setAttrib(s, R_DimSymbol, t);
89
	UNPROTECT(2);
93
	UNPROTECT(2);
90
	return s;
94
	return s;
91
}
95
}
92
 
96
 
-
 
97
#ifdef use_do_array/*--- unused (1998, April 24 -- 0.62 unstable */
-
 
98
 
93
SEXP do_array(SEXP call, SEXP op, SEXP args, SEXP rho)
99
SEXP do_array(SEXP call, SEXP op, SEXP args, SEXP rho)
94
{
100
{
95
	SEXP vals, dims, ans;
101
	SEXP vals, dims, ans;
96
 
102
 
97
	if (length(args) != 2)
103
	if (length(args) != 2)
Line 108... Line 114...
108
		return ans;
114
		return ans;
109
	}
115
	}
110
	else error("bad arguments to array\n");
116
	else error("bad arguments to array\n");
111
	return call;/* never used; just for -Wall */
117
	return call;/* never used; just for -Wall */
112
}
118
}
-
 
119
#endif
113
 
120
 
114
SEXP allocArray(SEXPTYPE mode, SEXP dims)
121
SEXP allocArray(SEXPTYPE mode, SEXP dims)
115
{
122
{
116
	SEXP array;
123
	SEXP array;
117
	int i, n;
124
	int i, n;