目录

SetSize

Function Description

Sets the number of currently saved elements.

Function Prototype

ge::graphStatus SetSize(const size_t size)

Parameters

Parameter Input/Output Description
size Input Number of currently saved elements.

Return Value

ge::GRAPH_SUCCESS on success.

If the value of size is greater than that of capacity, ge::GRAPH_FAILED is returned.

Restrictions

None

Calling Example

size_t capacity = 100U;
auto cv_holder = ContinuousVector::Create<int64_t>(capacity);
auto cv = reinterpret_cast<ContinuousVector *>(cv_holder.get());
auto ret = cv->SetSize(10U); // ge::GRAPH_SUCCESS
ret = cv->SetSize(101U); // ge::GRAPH_FAILED