Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AVA
FloVer
Commits
0fef1430
Commit
0fef1430
authored
Sep 20, 2016
by
Heiko Becker
Browse files
Fix some minor details, as discussed in Merge Request
parent
6c7edec9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/scala/daisy/analysis/RangeErrorPhase.scala
View file @
0fef1430
...
...
@@ -33,7 +33,7 @@ object RangeErrorPhase extends DaisyPhase with ErrorFunctions {
optionPrecision
)
implicit
val
debugSection
=
DebugSectionAnalysis
override
implicit
val
debugSection
=
DebugSectionAnalysis
var
reporter
:
Reporter
=
null
...
...
src/main/scala/daisy/utils/ErrorFunctions.scala
View file @
0fef1430
...
...
@@ -32,7 +32,8 @@ trait ErrorFunctions {
var
uniformPrecision
:
Precision
=
Float64
var
reporter
:
Reporter
val
debugSection
:
DebugSection
implicit
val
debugSection
=
DebugSectionAnalysis
/**
* Calculate static error using interval ranges and interval errors
...
...
@@ -48,7 +49,7 @@ trait ErrorFunctions {
val
(
_
,
error
)
=
evaluate
[
Interval
,
Interval
](
expr
,
inputValMap
,
inputErrorMap
.
map
Values
(
Interval
.
fromError
(
_
)),
inputErrorMap
.
map
(
x
=>
(
x
.
_1
->
Interval
.
fromError
(
x
.
_2
)
)),
Interval
.
apply
,
Interval
.
zero
,
Interval
.
fromError
,
...
...
@@ -323,7 +324,7 @@ trait ErrorFunctions {
x
.
absError
=
maxAbs
(
error
.
toInterval
)
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
error
)
case
x
@
RealLiteral
(
r
)
=>
...
...
@@ -338,7 +339,7 @@ trait ErrorFunctions {
x
.
interval
=
range
.
toInterval
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
error
)
case
x
@
Plus
(
lhs
,
rhs
)
=>
...
...
@@ -355,7 +356,7 @@ trait ErrorFunctions {
x
.
interval
=
range
.
toInterval
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
newError
)
case
x
@
Minus
(
lhs
,
rhs
)
=>
...
...
@@ -372,7 +373,7 @@ trait ErrorFunctions {
x
.
interval
=
range
.
toInterval
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
newError
)
case
x
@
Times
(
lhs
,
rhs
)
=>
...
...
@@ -395,7 +396,7 @@ trait ErrorFunctions {
x
.
interval
=
range
.
toInterval
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
newError
)
case
x
@
Division
(
lhs
,
rhs
)
=>
...
...
@@ -425,7 +426,7 @@ trait ErrorFunctions {
x
.
interval
=
range
.
toInterval
}
//print state
reporter
.
info
(
s
"$x: ${x.interval},${x.absError}"
)
reporter
.
debug
(
s
"$x: ${x.interval},${x.absError}"
)
(
range
,
newError
)
case
x
@
UMinus
(
t
)
=>
...
...
src/main/scala/daisy/utils/Interval.scala
View file @
0fef1430
...
...
@@ -15,10 +15,10 @@ object Interval {
def
apply
(
i
:
Interval
)
:
Interval
=
i
def
fromError
(
absError
:
Rational
)
:
Interval
=
{
Interval
(-
absError
,
absError
)
//TODO verify
Interval
(-
absError
,
absError
)
}
val
zero
:
Interval
=
Interval
(
0
,
0
)
val
zero
:
Interval
=
Interval
(
0
)
}
case
class
PartialInterval
(
xlo
:
Option
[
Rational
],
xhi
:
Option
[
Rational
])
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment