Major Rewrite and Refactoring
CPP Code:
- Rewritten large parts of the C++ code.
- Improved memory management with several new classes handling memory on the heap.
- Introduced support for bool, int, and double data types.
- Migrated from C++17 to C++20, reducing lines of code.
- Added traits to differentiate between r and l vectors, optimizing memory assignment.
- Changed subsetting to use pointers and indices vectors, making it more efficient.
- Designed the memory management system to allow for easy addition of new memory classes.
R Code:
- Added the possibility for users to define types with six supported types: Logical, Int, Double, Logical Vector, Int Vector, and Double Vector.
- Users can declare types when defining variables using
var::type
. - Improved argument passing to the
ast2ast
function to allow more detailed declarations.
Error Management:
- Enhanced error management throughout the codebase.
Future Plans:
- Further improvements to the R code for robustness and potential complete rewrite.
- Consider changing variable declaration syntax to
var %type% "type"
. - Enhancing the subsetting mechanism to make it even more lazy.
Derivative Calculation System:
The functionality of the J
function has been replaced with a more flexible system for calculating derivatives. The key components are:
set_indep(x)
: Setsx
as the independent variable.get_deriv(var)
: Retrieves the derivative ofvar
with respect tox
.unset_indep(x)
: Unsets the independent variable.
Example Usage:
set_indep(x)
y = x * x
assign(y, get_deriv(x) * x + x * get_deriv(x))
unset_indep(x)