Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CertiCompil
CompCert-KVX
Commits
7c2020e9
Commit
7c2020e9
authored
Jan 14, 2021
by
David Monniaux
Browse files
a slightly different matrix product
parent
1d265f0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/monniaux/many_temporaries/matrix_product2.py
0 → 100644
View file @
7c2020e9
m
=
4
n
=
5
p
=
6
number_type
=
'double'
with
open
(
'matrix_product2.c'
,
'w'
)
as
cfile
:
cfile
.
write
(
f
'void matrix_product(
{
number_type
}
c[
{
m
}
][
{
p
}
], const
{
number_type
}
a[
{
m
}
][
{
n
}
], const
{
number_type
}
b[
{
n
}
][
{
p
}
]) {{
\n
'
)
for
i
in
range
(
m
):
for
j
in
range
(
n
):
for
k
in
range
(
p
):
cfile
.
write
(
f
' const
{
number_type
}
p_
{
i
}
_
{
j
}
_
{
k
}
= a[
{
i
}
][
{
j
}
] * b[
{
j
}
][
{
k
}
];
\n
'
)
for
i
in
range
(
m
):
for
k
in
range
(
p
):
cfile
.
write
(
f
' const
{
number_type
}
r_
{
i
}
_
{
k
}
= '
)
for
j
in
range
(
n
):
if
j
>
0
:
cfile
.
write
(
' + '
)
cfile
.
write
(
f
'p_
{
i
}
_
{
j
}
_
{
k
}
'
)
cfile
.
write
(
';
\n
'
)
for
i
in
range
(
m
):
for
k
in
range
(
p
):
cfile
.
write
(
f
' c[
{
i
}
][
{
k
}
] = r_
{
i
}
_
{
k
}
;
\n
'
)
cfile
.
write
(
'}
\n
'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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