MCPcopy Create free account
hub / github.com/apache/arrow / SetUp

Method SetUp

cpp/src/arrow/sparse_tensor_test.cc:1056–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1054class TestSparseCSCMatrixBase : public TestSparseTensorBase<Int64Type> {
1055 public:
1056 void SetUp() {
1057 shape_ = {6, 4};
1058 dim_names_ = {"foo", "bar"};
1059
1060 // Dense representation:
1061 // [
1062 // 1 0 2 0
1063 // 0 3 0 4
1064 // 5 0 6 0
1065 // 0 11 0 12
1066 // 13 0 14 0
1067 // 0 15 0 16
1068 // ]
1069 dense_values_ = {1, 0, 2, 0, 0, 3, 0, 4, 5, 0, 6, 0,
1070 0, 11, 0, 12, 13, 0, 14, 0, 0, 15, 0, 16};
1071 auto dense_data = Buffer::Wrap(dense_values_);
1072 NumericTensor<Int64Type> dense_tensor(dense_data, shape_, {}, dim_names_);
1073 ASSERT_OK_AND_ASSIGN(sparse_tensor_from_dense_,
1074 SparseCSCMatrix::Make(
1075 dense_tensor, TypeTraits<IndexValueType>::type_singleton()));
1076 }
1077
1078 protected:
1079 std::vector<int64_t> dense_values_;

Callers

nothing calls this directly

Calls 4

WrapFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
MakeFunction · 0.70
type_singletonFunction · 0.70

Tested by

no test coverage detected