SetSize
Description
Sets the number of currently saved elements.
Prototype
ge::graphStatus SetSize(const size_t size)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
size |
Input |
Number of currently saved elements. |
Returns
If the operation is successful, ge::GRAPH_SUCCESS is returned.
If the value of size is greater than that of capacity, ge::GRAPH_FAILED is returned.
Restrictions
None
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->GetSize(101U); // ge::GRAPH_FAILED
Parent topic: ContinuousVector