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

Method allocate

XM/include/Utils/memory.h:802–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800 }
801
802 inline void allocate(const int size, bool as_byte = false) {
803 if (this->vals == nullptr) {
804 if (as_byte) {
805 this->size = (size + sizeof(float) - 1) / sizeof(float);
806 } else {
807 this->size = size;
808 }
809 this->vals = (float*) malloc(sizeof(float) * this->size);
810 }
811 return;
812 }
813 inline float get_norm() {
814 return cblas_snrm2(this->size, this->vals, 1);
815 }

Callers 1

HostDnVecFloatMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected