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

Method allocate

XM/include/Utils/memory.h:767–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

765 }
766
767 inline void allocate(const int size, bool as_byte = false) {
768 if (this->vals == nullptr) {
769 if (as_byte) {
770 this->size = (size + sizeof(double) - 1) / sizeof(double);
771 } else {
772 this->size = size;
773 }
774 this->vals = (double*) malloc(sizeof(double) * this->size);
775 }
776 return;
777 }
778 inline double get_norm() {
779 return cblas_dnrm2(this->size, this->vals, 1);
780 }

Callers 1

HostDnVecDoubleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected