MCPcopy Create free account
hub / github.com/apache/singa / Init

Method Init

test/gtest/gtest.h:7962–7972  ·  view source on GitHub ↗

Initializes this object; makes a copy of the input array if 'relation' is kCopy.

Source from the content-addressed store, hash-verified

7960 // Initializes this object; makes a copy of the input array if
7961 // 'relation' is kCopy.
7962 void Init(const Element* array, size_t a_size, RelationToSource relation) {
7963 if (relation == kReference) {
7964 array_ = array;
7965 } else {
7966 Element* const copy = new Element[a_size];
7967 CopyArray(array, a_size, copy);
7968 array_ = copy;
7969 }
7970 size_ = a_size;
7971 relation_to_source_ = relation;
7972 }
7973
7974 const Element* array_;
7975 size_t size_;

Callers

nothing calls this directly

Calls 1

CopyArrayFunction · 0.85

Tested by

no test coverage detected