Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
prodigy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Winkler
prodigy
Commits
d9ede04a
Commit
d9ede04a
authored
3 years ago
by
Tobias Winkler
Browse files
Options
Downloads
Patches
Plain Diff
remove some old useless code
parent
5d5481d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Dist.cpp
+2
-34
2 additions, 34 deletions
src/Dist.cpp
with
2 additions
and
34 deletions
src/Dist.cpp
+
2
−
34
View file @
d9ede04a
...
...
@@ -290,41 +290,9 @@ namespace prodigy {
res
=
res
.
subs
(
term
==
x
*
term
);
}
else
if
(
is_a
<
mul
>
(
term
))
{
throw
prodigy
::
not_implemented_error
{};
// todo the following does not work more than one f_1 is an inf support variable
// x += f_1 * ... * f_n, all f_i either non-neg int or variable
// algorithm:
// tmp = 1
// tmp *= f_1
// ...
// tmp *= f_n
// x += tmp
// tmp = 0
const
std
::
string
TMP_NAME
=
"TMP_SYMB_FOR_MUL"
;
symbol
tmp
(
TMP_NAME
);
// temporarily register symbol as variable, this is expected by public interface of Dist
assert
(
!
isSymbKnown
(
TMP_NAME
));
Dist
::
registerAsVar
(
tmp
);
res
*=
tmp
;
for
(
const
auto
&
f
:
term
)
{
if
(
f
.
info
(
info_flags
::
nonnegint
))
{
res
=
res
.
subs
(
tmp
==
pow
(
tmp
,
f
));
}
else
if
(
f
.
info
(
info_flags
::
symbol
))
{
const
auto
&
fSym
=
ex_to
<
symbol
>
(
f
);
Dist
tmpDist
{
res
};
// wrap in Dist to access "areIndependent"
if
(
tmpDist
.
areIndependent
(
TMP_NAME
,
fSym
.
get_name
())
==
troolean
::
YES
)
{
// this line implements "tmp *= f"
res
=
res
.
subs
(
tmp
==
tmpDist
.
marginal
(
fSym
.
get_name
()).
gf
().
subs
(
fSym
==
tmp
));
}
else
{
throw
prodigy
::
not_implemented_error
{};
}
}
}
// this line implements x += tmp; tmp = 0
res
=
res
.
subs
(
tmp
==
x
);
// deregister temporary symbol tmp
Dist
::
deregister
(
TMP_NAME
);
// todo implement multiplication for finite-support case
}
else
{
throw
prodigy
::
not_implemented_error
{}
;
EXPECTS
(
false
,
"requested update operation is not supported"
)
;
}
return
Dist
{
res
};
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment