MCPcopy Create free account
hub / github.com/Cantera/cantera / resize

Method resize

src/base/SolutionArray.cpp:172–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void SolutionArray::resize(int size)
173{
174 if (apiNdim() > 1) {
175 throw CanteraError("SolutionArray::resize",
176 "Resize is ambiguous for multi-dimensional arrays; use setApiShape "
177 "instead.");
178 }
179 if (m_data.use_count() > 1) {
180 throw CanteraError("SolutionArray::resize",
181 "Unable to resize as data are shared by multiple objects.");
182 }
183 _resize(static_cast<size_t>(size));
184 m_apiShape[0] = static_cast<long>(size);
185}
186
187void SolutionArray::setApiShape(const vector<long int>& shape)
188{

Callers 5

restore_dataMethod · 0.95
SolutionArrayMethod · 0.45
_resizeMethod · 0.45
resizeSingleFunction · 0.45
resizeMultiFunction · 0.45

Calls 1

CanteraErrorClass · 0.85

Tested by

no test coverage detected