The R Project SVN R

Rev

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

Rev 29902 Rev 34294
Line 98... Line 98...
98
 
98
 
99
    for (i = 0; i < n; i++) {
99
    for (i = 0; i < n; i++) {
100
	if (i > 0 && width + w > R_print.width) {
100
	if (i > 0 && width + w > R_print.width) {
101
	    DO_newline;
101
	    DO_newline;
102
	}
102
	}
103
	Rprintf("%s", EncodeReal(x[i], w, d, e));
103
	Rprintf("%s", EncodeReal(x[i], w, d, e, OutDec));
104
	width += w;
104
	width += w;
105
    }
105
    }
106
    Rprintf("\n");
106
    Rprintf("\n");
107
}
107
}
108
 
108
 
Line 119... Line 119...
119
    for (i = 0; i < n; i++) {
119
    for (i = 0; i < n; i++) {
120
	if (i > 0 && width + w > R_print.width) {
120
	if (i > 0 && width + w > R_print.width) {
121
	    DO_newline;
121
	    DO_newline;
122
	}
122
	}
123
	if (ISNA(x[i].r) || ISNA(x[i].i))
123
	if (ISNA(x[i].r) || ISNA(x[i].i))
124
	    Rprintf("%s", EncodeReal(NA_REAL, w, 0, 0));
124
	    Rprintf("%s", EncodeReal(NA_REAL, w, 0, 0, OutDec));
125
	else
125
	else
126
	    Rprintf("%s", EncodeComplex(x[i], wr + R_print.gap , dr, er,
126
	    Rprintf("%s", EncodeComplex(x[i], wr + R_print.gap , dr, er,
127
					wi, di, ei));
127
					wi, di, ei, OutDec));
128
	width += w;
128
	width += w;
129
    }
129
    }
130
    Rprintf("\n");
130
    Rprintf("\n");
131
}
131
}
132
 
132
 
Line 257... Line 257...
257
#undef INI_F_REAL
257
#undef INI_F_REAL
258
#define INI_F_REAL	int d, e; formatReal(x, n, &w, &d, &e, 0)
258
#define INI_F_REAL	int d, e; formatReal(x, n, &w, &d, &e, 0)
259
 
259
 
260
static void printNamedRealVector(double * x, int n, SEXP * names)
260
static void printNamedRealVector(double * x, int n, SEXP * names)
261
    PRINT_N_VECTOR(INI_F_REAL,
261
    PRINT_N_VECTOR(INI_F_REAL,
262
		   Rprintf("%s%*s", EncodeReal(x[k],w,d,e),R_print.gap,""))
262
		   Rprintf("%s%*s", EncodeReal(x[k],w,d,e, OutDec),R_print.gap,""))
263
 
263
 
264
#undef INI_F_CPLX
264
#undef INI_F_CPLX
265
#define INI_F_CPLX					\
265
#define INI_F_CPLX					\
266
    int wr, dr, er, wi, di, ei;				\
266
    int wr, dr, er, wi, di, ei;				\
267
    formatComplex(x, n, &wr, &dr, &er, &wi, &di, &ei, 0);	\
267
    formatComplex(x, n, &wr, &dr, &er, &wi, &di, &ei, 0);	\
Line 276... Line 276...
276
static void printNamedComplexVector(Rcomplex * x, int n, SEXP * names)
276
static void printNamedComplexVector(Rcomplex * x, int n, SEXP * names)
277
    PRINT_N_VECTOR(INI_F_CPLX,
277
    PRINT_N_VECTOR(INI_F_CPLX,
278
	{ /* PRINT_1 */
278
	{ /* PRINT_1 */
279
	    if(j) Rprintf("%*s", R_print.gap, "");
279
	    if(j) Rprintf("%*s", R_print.gap, "");
280
	    if (ISNA(x[j].r) || ISNA(x[j].i)) {
280
	    if (ISNA(x[j].r) || ISNA(x[j].i)) {
281
		Rprintf("%s", EncodeReal(NA_REAL, w, 0, 0));
281
		Rprintf("%s", EncodeReal(NA_REAL, w, 0, 0, OutDec));
282
	    }
282
	    }
283
	    else {
283
	    else {
284
		Rprintf("%s", EncodeReal(x[k].r, wr, dr, er));
284
		Rprintf("%s", EncodeReal(x[k].r, wr, dr, er, OutDec));
285
		P_IMAG_NA
285
		P_IMAG_NA
286
		if (x[k].i >= 0)
286
		if (x[k].i >= 0)
287
		    Rprintf("+%si", EncodeReal(x[k].i, wi, di, ei));
287
		    Rprintf("+%si", EncodeReal(x[k].i, wi, di, ei, OutDec));
288
		else
288
		else
289
		    Rprintf("-%si", EncodeReal(-x[k].i, wi, di, ei));
289
		    Rprintf("-%si", EncodeReal(-x[k].i, wi, di, ei, OutDec));
290
	    }
290
	    }
291
	})
291
	})
292
 
292
 
293
static void printNamedStringVector(SEXP * x, int n, int quote, SEXP * names)
293
static void printNamedStringVector(SEXP * x, int n, int quote, SEXP * names)
294
    PRINT_N_VECTOR(formatString(x, n, &w, quote),
294
    PRINT_N_VECTOR(formatString(x, n, &w, quote),