The R Project SVN R

Rev

Rev 29864 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29864 Rev 30691
Line 144... Line 144...
144
		for (i = 0; i < nr; i++)
144
		for (i = 0; i < nr; i++)
145
		    for (j = 0; j < nc; j++)
145
		    for (j = 0; j < nc; j++)
146
			COMPLEX(snr)[i + j * nr] = na_cmplx;
146
			COMPLEX(snr)[i + j * nr] = na_cmplx;
147
	    }
147
	    }
148
	    break;
148
	    break;
-
 
149
	case RAWSXP:
-
 
150
	    for (i = 0; i < nr; i++)
-
 
151
		for (j = 0; j < nc; j++)
-
 
152
		    RAW(snr)[i + j * nr] = 0;
-
 
153
	    break;
149
	}
154
	}
150
    }
155
    }
151
    UNPROTECT(1);
156
    UNPROTECT(1);
152
    return snr;
157
    return snr;
153
}
158
}
Line 785... Line 790...
785
    case VECSXP:
790
    case VECSXP:
786
	for (i = 0; i < len; i++)
791
	for (i = 0; i < len; i++)
787
	    SET_VECTOR_ELT(r, i,
792
	    SET_VECTOR_ELT(r, i,
788
			   VECTOR_ELT(a, (i / ncol) + (i % ncol) * nrow));
793
			   VECTOR_ELT(a, (i / ncol) + (i % ncol) * nrow));
789
	break;
794
	break;
-
 
795
    case RAWSXP:
-
 
796
	for (i = 0; i < len; i++)
-
 
797
	    RAW(r)[i] = RAW(a)[(i / ncol) + (i % ncol) * nrow];
-
 
798
	break;
790
    default:
799
    default:
791
	goto not_matrix;
800
	goto not_matrix;
792
    }
801
    }
793
    PROTECT(dims = allocVector(INTSXP, 2));
802
    PROTECT(dims = allocVector(INTSXP, 2));
794
    INTEGER(dims)[0] = ncol;
803
    INTEGER(dims)[0] = ncol;
Line 942... Line 951...
942
	    SET_VECTOR_ELT(r, i, VECTOR_ELT(a, j));
951
	    SET_VECTOR_ELT(r, i, VECTOR_ELT(a, j));
943
	    CLICKJ;
952
	    CLICKJ;
944
	}
953
	}
945
	break;
954
	break;
946
 
955
 
-
 
956
    case RAWSXP:
-
 
957
	for (j=0, i=0; i<len; i++) {
-
 
958
	    RAW(r)[i] = RAW(a)[j];
-
 
959
	    CLICKJ;
-
 
960
	}
-
 
961
	break;
-
 
962
 
947
    default:
963
    default:
948
	errorcall(call, "unsupported type of array");
964
	errorcall(call, "unsupported type of array");
949
    }
965
    }
950
 
966
 
951
    /* handle the resize */
967
    /* handle the resize */