Skip to content

Commit

Permalink
[iss-241]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 3b9e7d2
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Wed Sep 20 15:34:39 2023 -0300

    Added fbas function to math package.
  • Loading branch information
joaquinffernandez committed Sep 20, 2023
1 parent b630048 commit 0768624
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/math.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package math

function fabs
input Real x;
output Real y;
external "C" y = fabs(x);
end fabs;

function random
input Real x;
output Real y;
Expand Down
6 changes: 6 additions & 0 deletions src/mmoc/tests/system/gt_data/packages/math.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package math

function fabs
input Real x;
output Real y;
external "C" y = fabs(x);
end fabs;

function random
input Real x;
output Real y;
Expand Down
10 changes: 9 additions & 1 deletion src/mmoc/tests/system/gt_data/packages/pkg_math.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <math.h>
#include <stdlib.h>
#include "./system/test_data/packages/pkg_math.h"
#include "/home/joaquin/work/qss-solver/packages/pkg_math.h"
#include <mmo_math.h>
double __math__exponential(double x)
{
Expand All @@ -10,6 +10,14 @@ y = mmo_exponential(x);
return y;
}

double __math__fabs(double x)
{
double y;

y = fabs(x);
return y;
}

double __math__getRandomMarkedValue(double x)
{
double y;
Expand Down
3 changes: 3 additions & 0 deletions src/mmoc/tests/system/gt_data/packages/pkg_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
double __math__exponential(double x);


double __math__fabs(double x);


double __math__getRandomMarkedValue(double x);


Expand Down
11 changes: 11 additions & 0 deletions src/mmoc/tests/system/gt_data/packages/pkg_math.moo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ ENDLIBRARIES
ENDDEFINITION
DEFINITION
FUNCTION
fabs
ENDFUNCTION
INCLUDEDIRECTORY
/home/joaquin/work/qss-solver/src/usr/include
ENDINCLUDEDIRECTORY
LIBRARYDIRECTORY
/home/joaquin/work/qss-solver/lib
ENDLIBRARYDIRECTORY
ENDDEFINITION
DEFINITION
FUNCTION
getRandomMarkedValue
ENDFUNCTION
INCLUDEDIRECTORY
Expand Down

0 comments on commit 0768624

Please sign in to comment.