Skip to content

Commit 8641446

Browse files
committed
Implement VectorDataClosure#materialize
1 parent 84a0444 commit 8641446

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/VectorDataClosure.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
package com.oracle.truffle.r.runtime.data;
2424

25+
import com.oracle.truffle.api.CompilerDirectives;
2526
import com.oracle.truffle.api.interop.TruffleObject;
2627
import com.oracle.truffle.api.library.CachedLibrary;
2728
import com.oracle.truffle.api.library.ExportLibrary;
@@ -111,8 +112,18 @@ public Object materialize(@CachedLibrary("this.data") VectorDataLibrary dataLib)
111112
switch (getType()) {
112113
case Integer:
113114
return new RIntArrayVectorData(getIntDataCopy(dataLib), dataLib.getNACheck(data).neverSeenNA());
115+
case Double:
116+
return new RDoubleArrayVectorData(getDoubleDataCopy(dataLib), dataLib.getNACheck(data).neverSeenNA());
117+
case Raw:
118+
return new RRawArrayVectorData(getRawDataCopy(dataLib));
119+
case Logical:
120+
return new RLogicalArrayVectorData(getLogicalDataCopy(dataLib), dataLib.getNACheck(data).neverSeenNA());
121+
case Complex:
122+
return new RComplexArrayVectorData(getComplexDataCopy(dataLib), dataLib.getNACheck(data).neverSeenNA());
123+
case Character:
124+
return new RStringArrayVectorData(getStringDataCopy(dataLib), dataLib.getNACheck(data).neverSeenNA());
114125
default:
115-
throw RInternalError.unimplemented("TODO");
126+
throw CompilerDirectives.shouldNotReachHere(getType().toString());
116127
}
117128
}
118129

0 commit comments

Comments
 (0)