MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / resize

Method resize

external_libraries/pybind11/numpy.h:1256–1270  ·  view source on GitHub ↗

Resize array to given shape If refcheck is true and more that one reference exist to this array then resize will succeed only if it makes a reshape, i.e. original size doesn't change

Source from the content-addressed store, hash-verified

1254 /// If refcheck is true and more that one reference exist to this array
1255 /// then resize will succeed only if it makes a reshape, i.e. original size doesn't change
1256 void resize(ShapeContainer new_shape, bool refcheck = true) {
1257 detail::npy_api::PyArray_Dims d
1258 = {// Use reinterpret_cast for PyPy on Windows (remove if fixed, checked on 7.3.1)
1259 reinterpret_cast<Py_intptr_t *>(new_shape->data()),
1260 int(new_shape->size())};
1261 // try to resize, set ordering param to -1 cause it's not used anyway
1262 auto new_array = reinterpret_steal<object>(
1263 detail::npy_api::get().PyArray_Resize_(m_ptr, &d, int(refcheck), -1));
1264 if (!new_array) {
1265 throw error_already_set();
1266 }
1267 if (isinstance<array>(new_array)) {
1268 *this = std::move(new_array);
1269 }
1270 }
1271
1272 /// Optional `order` parameter omitted, to be added as needed.
1273 array reshape(ShapeContainer new_shape) {

Callers 15

DisposeAllOutRecsMethod · 0.45
BuildPath64Function · 0.45
BuildPaths64Method · 0.45
BuildTree64Method · 0.45
BuildPathDFunction · 0.45
BuildPathsDMethod · 0.45
BuildTreeDMethod · 0.45
~PolyPath64Method · 0.45
ClearMethod · 0.45
~PolyPathDMethod · 0.45
ClearMethod · 0.45
dispatcherMethod · 0.45

Calls 4

moveFunction · 0.85
getFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected