feat: add power scaling factor to plot generation in plot.py
The plot.py module now includes a power scaling parameter that adjusts the amplitude of generated curves by a configurable exponent, enabling non-linear transformations for enhanced visualization flexibility.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#ifndef RAVA_SAFE_ALLOC_H
|
||||
#define RAVA_SAFE_ALLOC_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define RAVA_ERROR_BUFFER_SIZE 512
|
||||
|
||||
static inline void* rava_safe_realloc(void *ptr, size_t size) {
|
||||
if (size == 0) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
void *new_ptr = realloc(ptr, size);
|
||||
if (!new_ptr) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
return new_ptr;
|
||||
}
|
||||
|
||||
static inline void* rava_safe_malloc(size_t size) {
|
||||
if (size == 0) return NULL;
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
static inline void* rava_safe_calloc(size_t count, size_t size) {
|
||||
if (count == 0 || size == 0) return NULL;
|
||||
return calloc(count, size);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user