builtin_lag

18 views
Skip to first unread message

César Pablo Camusso

unread,
Oct 8, 2018, 2:51:23 PM10/8/18
to 'César Pablo Camusso' via wasora
Hello.
I need to call the builtin_lag function in the source code. For example:

double x,t;
t=1;// time constant.
x=0;
x+=1;

builtin_lag(x,t);

But that is wrong because builtin_lag takes a factor_t * (builtin_lag(factor_t *expr)).
So, how do I translate the x in a factor to be given to builtin_lag?

Thank you.

Ramiro Vignolo

unread,
Oct 8, 2018, 2:58:08 PM10/8/18
to was...@seamplex.com
wasora_parse_expression? 

--
You received this message because you are subscribed to the Google Groups "wasora" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wasora+un...@seamplex.com.
To post to this group, send email to was...@seamplex.com.
Visit this group at https://groups.google.com/a/seamplex.com/group/wasora/.
To view this discussion on the web visit https://groups.google.com/a/seamplex.com/d/msgid/wasora/1698981716.6430305.1539024678574%40mail.yahoo.com.
For more options, visit https://groups.google.com/a/seamplex.com/d/optout.

Ramiro Vignolo

unread,
Oct 8, 2018, 3:08:18 PM10/8/18
to was...@seamplex.com
I cannot help you right now but please checkout algebra.c and take a look to wasora_parse_madeup_expression(...), wasora_parse_factor(...) and wasora_parse_expression(...). They should do what you need.

Regards,
Ramiro

jeremy theler

unread,
Oct 8, 2018, 6:27:33 PM10/8/18
to was...@seamplex.com
you can call wasora_parse_expression("x") and pass that pointer to the builtin_lag() but maybe it is easier to re-code the lag expression (which is a single line) in your custom code. Get (set) the value of wasora's variable x with wasora_get_var_value("x") (wasora_set_var_value("x")) and you will be fine.

--
--
jeremy theler
www.seamplex.com

jeremy theler

unread,
Oct 8, 2018, 6:44:25 PM10/8/18
to was...@seamplex.com
sorry, I thought Ramiro was asking because he needed something from wasora for the kind of math he does

if you are asking about milonga, just find the right pointers to the var_t struct and change the current value using the one-liner lag model (which is taken from dynetz actually)

César Pablo Camusso

unread,
Oct 9, 2018, 7:10:44 AM10/9/18
to was...@seamplex.com
Dears Ramiro and German,
Yes I asked for milonga.
I also think it is easier to recode the lag for this case; but I will try the wasora_parse_expression.
Thank you.


jeremy theler

unread,
Oct 9, 2018, 7:15:54 AM10/9/18
to was...@seamplex.com
The second option is far too expensive.
One might accept it for one-step computation of a few scalar values but not for the transient of thousands.


César Pablo Camusso

unread,
Oct 9, 2018, 7:17:38 AM10/9/18
to was...@seamplex.com
So, I will code a new builtin_lag only for this case.
Thank you.


Reply all
Reply to author
Forward
0 new messages