Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CI1164 Engenharia de Performance 2021
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Harbor Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armando Luiz Nicolini Delgado
CI1164 Engenharia de Performance 2021
Commits
dae707d4
Commit
dae707d4
authored
3 years ago
by
Armando Luiz Nicolini Delgado
Browse files
Options
Downloads
Patches
Plain Diff
malloc em geraMatPtr devia ter sizeof(double *)
parent
aa516786
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matriz.c
+2
-21
2 additions, 21 deletions
matriz.c
with
2 additions
and
21 deletions
matriz.c
+
2
−
21
View file @
dae707d4
...
...
@@ -43,7 +43,7 @@ static inline double generateRandomB( )
MatPtr
geraMatPtr
(
int
m
,
int
n
,
int
zerar
)
{
MatPtr
matriz
=
(
double
**
)
malloc
(
m
*
sizeof
(
double
));
MatPtr
matriz
=
(
double
**
)
malloc
(
m
*
sizeof
(
double
*
));
if
(
matriz
)
{
for
(
int
i
=
0
;
i
<
m
;
++
i
)
{
...
...
@@ -281,22 +281,3 @@ void prnVetor (Vetor vet, int n)
printf
(
SEP_RES
);
}
/**
* Funcao prodEscalar: Calcula o produto escalar entre 2 vetores
* @param v1 vetor com 'n' elementos
* @param v2 vetor com 'n' elementos
* @param n número de elementos dos vetores
* @return Valor do produto escalar
*/
double
prodEscalar
(
Vetor
v1
,
Vetor
v2
,
int
n
)
{
double
prod
=
0
.
0
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
prod
+=
v1
[
i
]
*
v2
[
i
];
return
prod
;
}
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