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:
2025-12-04 05:14:22 +00:00
parent e768ed066c
commit ed69521892
18 changed files with 930 additions and 236 deletions
+32
View File
@@ -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