MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / allocate

Method allocate

XM/include/Utils/memory.h:231–240  ·  view source on GitHub ↗

Allocate memory for the values

Source from the content-addressed store, hash-verified

229
230 // Allocate memory for the values
231 void allocate() {
232 if (this->vals == nullptr) {
233 this->vals = (T*)malloc(sizeof(T) * total_size);
234 if (this->vals && is_initial_value) {
235 std::fill(this->vals, this->vals + total_size, initial_value);
236 }
237 }else{
238 std::cout << "Error: Vec already allocated!" << std::endl;
239 }
240 }
241
242 // Print matrix, if matrix is larger the 3-dimension then donot print
243 void print() {

Callers 1

HostDnTenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected