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:
@@ -1,5 +1,6 @@
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include "lexer.h"
|
||||
#include "../utils/safe_alloc.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
@@ -73,7 +74,12 @@ RavaToken_t* rava_lexer_parse_string(RavaLexer_t *lexer) {
|
||||
|
||||
if (length + 1 >= capacity) {
|
||||
capacity *= 2;
|
||||
str = realloc(str, capacity);
|
||||
char *new_str = rava_safe_realloc(str, capacity);
|
||||
if (!new_str) {
|
||||
lexer->error_message = strdup("Out of memory");
|
||||
return _rava_lexer_create_token(lexer, RAVA_TOKEN_ERROR);
|
||||
}
|
||||
str = new_str;
|
||||
}
|
||||
str[length++] = c;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user