Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
Gauthier Quesnel
irritator
Commits
c34c0c63
Commit
c34c0c63
authored
Aug 12, 2020
by
Gauthier Quesnel
Browse files
core: fix abstract_cross for both QSS2 and QSS3
parent
b7502a5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
c34c0c63
...
...
@@ -5071,7 +5071,7 @@ struct abstract_cross
sigma
=
time_domain
<
time
>::
infinity
;
if
(
value
[
1
])
{
const
auto
wakeup
=
(
threshold
-
value
[
0
])
/
value
[
1
];
if
(
wakeup
>
=
0.
)
if
(
wakeup
>
0.
)
sigma
=
wakeup
;
}
}
...
...
@@ -5080,24 +5080,33 @@ struct abstract_cross
sigma
=
time_domain
<
time
>::
infinity
;
if
(
value
[
1
])
{
if
(
value
[
2
])
{
const
auto
d
=
value
[
2
]
*
value
[
2
]
-
4
*
value
[
1
]
-
(
threshold
-
value
[
0
]);
if
(
d
==
0.
)
{
const
auto
wakeup
=
-
value
[
1
]
/
(
2
*
value
[
2
]);
if
(
wakeup
>=
0.
)
sigma
=
wakeup
;
}
else
if
(
d
>
0
)
{
const
auto
wakeup
=
-
value
[
1
]
+
std
::
sqrt
(
value
[
1
]
*
value
[
1
]
-
4
*
value
[
2
]
*
(
threshold
-
value
[
0
]))
/
(
2.
*
value
[
2
]);
if
(
wakeup
>=
0
)
sigma
=
wakeup
;
const
auto
a
=
value
[
2
];
const
auto
b
=
value
[
1
];
const
auto
c
=
value
[
0
]
-
threshold
;
const
auto
d
=
b
*
b
-
4.
*
a
*
c
;
if
(
d
>
0.
)
{
const
auto
x1
=
(
-
b
+
std
::
sqrt
(
d
))
/
(
2.
*
a
);
const
auto
x2
=
(
-
b
-
std
::
sqrt
(
d
))
/
(
2.
*
a
);
if
(
x1
>
0.
)
{
if
(
x2
>
0.
)
{
sigma
=
std
::
min
(
x1
,
x2
);
}
else
{
sigma
=
x1
;
}
}
else
{
if
(
x2
>
0
)
sigma
=
x2
;
}
}
if
(
d
==
0.
)
{
const
auto
x
=
-
b
/
(
2.
*
a
);
if
(
x
>
0.
)
sigma
=
x
;
}
}
else
{
const
auto
wakeup
=
(
threshold
-
value
[
0
])
/
value
[
1
];
if
(
wakeup
>
=
0.
)
if
(
wakeup
>
0.
)
sigma
=
wakeup
;
}
}
...
...
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