Example #1
0
func (this *NumericVector) CopyFrom(src []float64) {
	C.Rf_protect(this.expr)
	defer C.Rf_unprotect(1)
	for i := 0; i < this.length; i++ {
		C.SetNumericVectorElt(this.expr, C.int(i), C.double(src[i]))
	}
}
Example #2
0
func (this *NumericVector) Set(i int, val float64) {
	this.boundsCheck(i)
	C.Rf_protect(this.expr)
	defer C.Rf_unprotect(1)
	C.SetNumericVectorElt(this.expr, C.int(i), C.double(val))
}