Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
spm
Commits
cc8bb92b
Commit
cc8bb92b
authored
8 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
duplicate the loop to avoid if at each iteration
parent
4f43f305
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
z_spm_expand.c
+59
-34
59 additions, 34 deletions
z_spm_expand.c
with
59 additions
and
34 deletions
z_spm_expand.c
+
59
−
34
View file @
cc8bb92b
...
@@ -24,7 +24,7 @@ pastix_spm_t *
...
@@ -24,7 +24,7 @@ pastix_spm_t *
z_spmExpand
(
const
pastix_spm_t
*
spm
)
z_spmExpand
(
const
pastix_spm_t
*
spm
)
{
{
pastix_spm_t
*
newspm
;
pastix_spm_t
*
newspm
;
pastix_int_t
i
,
j
,
k
,
ii
,
jj
,
dofi
,
dofj
,
col
,
row
,
baseval
,
cpt
;
pastix_int_t
i
,
j
,
k
,
ii
,
jj
,
dof
,
dofi
,
dofj
,
col
,
row
,
baseval
,
cpt
;
pastix_int_t
*
newcol
,
*
newrow
,
*
oldcol
,
*
oldrow
,
*
dofs
;
pastix_int_t
*
newcol
,
*
newrow
,
*
oldcol
,
*
oldrow
,
*
dofs
;
#if !defined(PRECISION_p)
#if !defined(PRECISION_p)
pastix_complex64_t
*
newval
,
*
oldval
;
pastix_complex64_t
*
newval
,
*
oldval
;
...
@@ -64,54 +64,79 @@ z_spmExpand(const pastix_spm_t *spm)
...
@@ -64,54 +64,79 @@ z_spmExpand(const pastix_spm_t *spm)
/**
/**
* Loop on col
* Loop on col
*/
*/
for
(
i
=
0
;
i
<
spm
->
n
;
i
++
)
if
(
spm
->
dof
>
0
)
{
{
col
=
0
;
if
(
spm
->
dof
>
0
)
{
dof
=
spm
->
dof
;
col
=
spm
->
dof
*
i
;
dofi
=
spm
->
dof
;
for
(
i
=
0
;
i
<
spm
->
n
;
i
++
,
col
+=
dof
)
{
for
(
ii
=
0
;
ii
<
dof
;
ii
++
,
newcol
++
)
{
/**
* Loop on rows
*/
for
(
k
=
oldcol
[
i
];
k
<
oldcol
[
i
+
1
];
k
++
,
row
+=
dof
)
{
j
=
oldrow
[
k
-
baseval
]
-
baseval
;
for
(
jj
=
0
;
jj
<
dof
;
jj
++
,
newrow
++
)
{
(
*
newcol
)
++
;
(
*
newrow
)
=
row
+
jj
+
baseval
;
#if !defined(PRECISION_p)
if
(
(
spm
->
mtxtype
!=
PastixGeneral
)
&&
(
row
+
jj
<
col
+
ii
)
)
{
(
*
newval
)
=
oldval
[
cpt
];
newval
++
;
}
cpt
++
;
#endif
}
}
(
*
newcol
)
+=
baseval
;
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
spm
->
n
;
i
++
)
{
col
=
dofs
[
i
];
col
=
dofs
[
i
];
dofi
=
dofs
[
i
+
1
]
-
dofs
[
i
];
dofi
=
dofs
[
i
+
1
]
-
dofs
[
i
];
}
for
(
ii
=
0
;
ii
<
dofi
;
ii
++
,
newcol
++
)
for
(
ii
=
0
;
ii
<
dofi
;
ii
++
,
newcol
++
)
{
/**
* Loop on rows
*/
for
(
k
=
oldcol
[
i
];
k
<
oldcol
[
i
+
1
];
k
++
)
{
{
j
=
oldrow
[
k
-
baseval
]
-
baseval
;
/**
if
(
spm
->
dof
>
0
)
{
* Loop on rows
row
=
spm
->
dof
*
j
;
*/
dofj
=
spm
->
dof
;
for
(
k
=
oldcol
[
i
];
k
<
oldcol
[
i
+
1
];
k
++
)
}
{
else
{
j
=
oldrow
[
k
-
baseval
]
-
baseval
;
row
=
dofs
[
j
];
row
=
dofs
[
j
];
dofj
=
dofs
[
j
+
1
]
-
dofs
[
j
];
dofj
=
dofs
[
j
+
1
]
-
dofs
[
j
];
}
for
(
jj
=
0
;
jj
<
dofj
;
jj
++
,
newrow
++
)
for
(
jj
=
0
;
jj
<
dofj
;
jj
++
,
newrow
++
)
{
{
(
*
newcol
)
++
;
(
*
newcol
)
++
;
(
*
newrow
)
=
row
+
jj
+
baseval
;
(
*
newrow
)
=
row
+
jj
+
baseval
;
#if !defined(PRECISION_p)
#if !defined(PRECISION_p)
if
(
(
spm
->
mtxtype
!=
PastixGeneral
)
&&
if
(
(
spm
->
mtxtype
!=
PastixGeneral
)
&&
(
row
+
jj
<
col
+
ii
)
)
(
row
+
jj
<
col
+
ii
)
)
{
{
(
*
newval
)
=
oldval
[
cpt
];
(
*
newval
)
=
oldval
[
cpt
];
newval
++
;
newval
++
;
}
}
cpt
++
;
cpt
++
;
#endif
#endif
}
}
}
(
*
newcol
)
+=
baseval
;
}
}
(
*
newcol
)
+=
baseval
;
}
}
}
}
break
;
break
;
case
PastixCSR
:
case
PastixCSR
:
case
PastixIJV
:
case
PastixIJV
:
free
(
newspm
);
free
(
newspm
);
...
...
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