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

Method SetUp

cpp/src/arrow/sparse_tensor_test.cc:721–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719class TestSparseCSRMatrixBase : public TestSparseTensorBase<Int64Type> {
720 public:
721 void SetUp() {
722 shape_ = {6, 4};
723 dim_names_ = {"foo", "bar"};
724
725 // Dense representation:
726 // [
727 // 1 0 2 0
728 // 0 3 0 4
729 // 5 0 6 0
730 // 0 11 0 12
731 // 13 0 14 0
732 // 0 15 0 16
733 // ]
734 dense_values_ = {1, 0, 2, 0, 0, 3, 0, 4, 5, 0, 6, 0,
735 0, 11, 0, 12, 13, 0, 14, 0, 0, 15, 0, 16};
736 auto dense_data = Buffer::Wrap(dense_values_);
737 NumericTensor<Int64Type> dense_tensor(dense_data, shape_, {}, dim_names_);
738 ASSERT_OK_AND_ASSIGN(sparse_tensor_from_dense_,
739 SparseCSRMatrix::Make(
740 dense_tensor, TypeTraits<IndexValueType>::type_singleton()));
741 }
742
743 protected:
744 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