MCPcopy Create free account
hub / github.com/numpy/numpy / resize

Method resize

tools/swig/test/Array1.cxx:55–70  ·  view source on GitHub ↗

Resize array

Source from the content-addressed store, hash-verified

53
54// Resize array
55void Array1::resize(int length, long* data)
56{
57 if (length < 0) throw std::invalid_argument("Array1 length less than 0");
58 if (length == _length) return;
59 deallocateMemory();
60 _length = length;
61 if (!data)
62 {
63 allocateMemory();
64 }
65 else
66 {
67 _ownData = false;
68 _buffer = data;
69 }
70}
71
72// Set item accessor
73long & Array1::operator[](int i)

Callers 6

testResize0Method · 0.45
testResize1Method · 0.45
testResize0Method · 0.45
testResize1Method · 0.45
testResize0Method · 0.45
testResize1Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected