VBA-Expressions v3.1.0
A little bit more!
Improvements
- Added
SUM
function to aggregate the elements of a list. - Added
GET
function to assign/retrieve variable values from expression arguments. Below is an example of detailed usage:
''' <summary>
''' Variable assignments through parameters
''' </summary>
Private Sub GETfunctionExample()
Dim expr As VBAexpressions
Set expr = New VBAexpressions
With expr
.Create "GET('A';{{2;1;3};{3;-2;-1}}); GET('B';{{2;3};{1;-5};{-2;4}})": .Eval
.Create "GET('C';MMULT(A;B))", False: .Eval 'Creates new expression without clean saved variables values
.Create "ROUND(SUM(SIN(C[0;0]);SIN(C[1;1]));4)", False: .Eval
Debug.Print "Sum sines of diagonal elements on matrix C: "; vbCr; .expression; "| Result: "; .result; " for: "; .CurrentVarValues
Debug.Print "///////////////*****************////////////////////********************//////////////////*********************////////"
End With
Set expr = Nothing
End Sub
''' <OUTPUT>
''' Sum sines of diagonal elements on matrix C:
''' ROUND(SUM(SIN(C[0;0]);SIN(C[1;1]));4)| Result: -0.1912 for: A = {{2;1;3};{3;-2;-1}}; B = {{2;3};{1;-5};{-2;4}}; C = {{-1;13};{6;15}}
''' ///////////////*****************////////////////////********************//////////////////*********************////////
''' </OUTPUT>
- Added
VarValue2
property. This property needs to be used to work with arrays variables assignments. - Added an option to the
Create
method to allow users to create expressions without resetting variables. - Library can already access elements within matrices. For example, the expression
ROUND(SUM(SIN(A[0;0]);SIN(A[1;1]));4)
, with the matrixA={{-1;13};{6;15}}
as a variable, performs the sum of sines for the diagonal elements ofA
with four digits precision, giving-0.1912
as result. - Changed output behaviour of the equation solver and regression calculator. Results are now returned in a column vector.
- Refactored
MMULT
function. - Formated procedures headers.
Bug fixes
- Row vectors were passed as a reference when column vectors were expected in functions involving matrix multiplications, such as the equation system solver and regression computation functions.