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
74163848
Commit
74163848
authored
8 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Start cleaning up the multi-dof
parent
93571870
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
spm.h
+1
-0
1 addition, 0 deletions
spm.h
spm_expand.c
+12
-7
12 additions, 7 deletions
spm_expand.c
z_spm.h
+18
-5
18 additions, 5 deletions
z_spm.h
z_spm_expand.c
+44
-25
44 additions, 25 deletions
z_spm_expand.c
with
75 additions
and
37 deletions
spm.h
+
1
−
0
View file @
74163848
...
...
@@ -99,6 +99,7 @@ pastix_int_t spmSymmetrize( pastix_spm_t *spm );
pastix_spm_t
*
spmCheckAndCorrect
(
pastix_spm_t
*
spm
);
void
spmExpand
(
pastix_spm_t
*
spm
);
void
dofVar
(
pastix_spm_t
*
spm
);
//tmp
#endif
/* _SPM_H_ */
This diff is collapsed.
Click to expand it.
spm_expand.c
+
12
−
7
View file @
74163848
...
...
@@ -15,25 +15,30 @@
**/
#include
"common.h"
#include
"spm.h"
#include
"z_spm.h"
#include
"c_spm.h"
#include
"d_spm.h"
#include
"s_spm.h"
#include
"p_spm.h"
void
spmExpand
CSC
(
pastix_spm_t
*
spm
)
spmExpand
(
pastix_spm_t
*
spm
)
{
switch
(
spm
->
flttype
)
{
case
PastixFloat
:
s_
extandCSC
(
spm
);
s_
spmExpand
(
spm
);
break
;
case
PastixComplex32
:
c_
extandCSC
(
spm
);
c_
spmExpand
(
spm
);
break
;
case
PastixComplex64
:
z_
extandCSC
(
spm
);
z_
spmExpand
(
spm
);
break
;
case
PastixDouble
:
default:
d_
extandCSC
(
spm
);
d_
spmExpand
(
spm
);
break
;
}
}
...
...
@@ -141,7 +146,7 @@ dofCst(pastix_spm_t* spm,pastix_int_t dof)
for
(
i
=
0
;
i
<
spm
->
n
+
1
;
i
++
)
dofs
[
i
]
=
dof
*
i
;
spmExpand
CSC
(
spm
);
spmExpand
(
spm
);
}
...
...
@@ -194,7 +199,7 @@ dofVar(pastix_spm_t* spm)
pastix_int_t
*
tab
=
computeCorrespondIndex
(
dofs
,
spm
->
n
);
spm
->
dofs
=
tab
;
spmExpand
CSC
(
spm
);
spmExpand
(
spm
);
/*
print_tab_int(spm->colptr,spm->n);
...
...
This diff is collapsed.
Click to expand it.
z_spm.h
+
18
−
5
View file @
74163848
...
...
@@ -18,6 +18,9 @@
#ifndef _z_spm_H_
#define _z_spm_H_
/**
* Conversion routines
*/
int
z_spmConvertCSC2CSR
(
pastix_spm_t
*
spm
);
int
z_spmConvertCSC2IJV
(
pastix_spm_t
*
spm
);
int
z_spmConvertCSR2CSC
(
pastix_spm_t
*
spm
);
...
...
@@ -25,10 +28,21 @@ int z_spmConvertCSR2IJV( pastix_spm_t *spm );
int
z_spmConvertIJV2CSC
(
pastix_spm_t
*
spm
);
int
z_spmConvertIJV2CSR
(
pastix_spm_t
*
spm
);
void
z_spmConvertColMaj2RowMaj
(
pastix_spm_t
*
spm
);
void
z_spmConvertRowMaj2ColMaj
(
pastix_spm_t
*
spm
);
pastix_complex64_t
*
z_spm2dense
(
const
pastix_spm_t
*
spm
);
/**
* Matrix-Vector product routines
*/
int
z_spmGeCSCv
(
int
trans
,
pastix_complex64_t
alpha
,
const
pastix_spm_t
*
csc
,
const
pastix_complex64_t
*
x
,
pastix_complex64_t
beta
,
pastix_complex64_t
*
y
);
int
z_spmSyCSCv
(
pastix_complex64_t
alpha
,
const
pastix_spm_t
*
csc
,
const
pastix_complex64_t
*
x
,
pastix_complex64_t
beta
,
pastix_complex64_t
*
y
);
int
z_spmHeCSCv
(
pastix_complex64_t
alpha
,
const
pastix_spm_t
*
csc
,
const
pastix_complex64_t
*
x
,
pastix_complex64_t
beta
,
pastix_complex64_t
*
y
);
/**
* Extra routines
*/
double
z_spmNorm
(
int
ntype
,
const
pastix_spm_t
*
csc
);
void
z_spmSort
(
pastix_spm_t
*
csc
);
pastix_int_t
z_spmMergeDuplicate
(
pastix_spm_t
*
csc
);
...
...
@@ -37,15 +51,14 @@ pastix_int_t z_spmSymmetrize( pastix_spm_t *csc );
int
z_spmGenRHS
(
int
type
,
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x
,
int
ldx
,
void
*
b
,
int
ldb
);
int
z_spmCheckAxb
(
int
nrhs
,
const
pastix_spm_t
*
spm
,
void
*
x0
,
int
ldx0
,
void
*
b
,
int
ldb
,
const
void
*
x
,
int
ldx
);
pastix_complex64_t
*
z_spm2dense
(
const
pastix_spm_t
*
spm
);
/**
* Output routines
*/
void
z_spmDensePrint
(
pastix_int_t
m
,
pastix_int_t
n
,
pastix_complex64_t
*
A
,
pastix_int_t
lda
);
void
z_spmPrint
(
const
pastix_spm_t
*
spm
);
void
z_spmConvertColMaj2RowMaj
(
pastix_spm_t
*
spm
);
void
z_spmConvertRowMaj2ColMaj
(
pastix_spm_t
*
spm
);
void
z_extandCSC
(
pastix_spm_t
*
spm
);
void
z_spmExpand
(
pastix_spm_t
*
spm
);
void
z_spmDofs2Flat
(
pastix_spm_t
*
spm
);
#endif
/* _z_spm_H_ */
This diff is collapsed.
Click to expand it.
z_spm_expand.c
+
44
−
25
View file @
74163848
...
...
@@ -8,7 +8,6 @@
*
* @version 5.1.0
* @author Mathieu Faverge
* @author Theophile Terraz
* @author Alban Bellot
* @date 2015-01-01
*
...
...
@@ -18,29 +17,49 @@
#include
"spm.h"
#include
"z_spm.h"
void
z_extandCSC
(
pastix_spm_t
*
spm
)
/**
* TODO: This function is incorrect
*/
int
z_spmExpand
(
pastix_spm_t
*
spm
)
{
pastix_int_t
col
,
row
,
i
,
cpt
,
dofj
,
dofi
,
baseval
;
cpt
=
0
;
pastix_complex64_t
*
valptr
=
(
pastix_complex64_t
*
)
spm
->
values
;
pastix_complex64_t
*
newval
=
calloc
(
spm
->
nnzexp
,
sizeof
(
pastix_complex64_t
));
baseval
=
spmFindBase
(
spm
);
for
(
col
=
0
;
col
<
spm
->
n
;
col
++
)
{
for
(
row
=
spm
->
colptr
[
col
]
-
baseval
;
row
<
spm
->
colptr
[
col
+
1
]
-
baseval
;
row
++
)
{
dofi
=
(
spm
->
dof
>
0
)
?
spm
->
dof
:
spm
->
dofs
[
col
+
1
]
-
spm
->
dofs
[
col
];
dofj
=
(
spm
->
dof
>
0
)
?
spm
->
dof
:
spm
->
dofs
[
spm
->
rowptr
[
row
]
-
baseval
+
1
]
-
spm
->
dofs
[
spm
->
rowptr
[
row
]
-
baseval
];
for
(
i
=
0
;
i
<
dofi
*
dofj
;
i
++
)
{
newval
[
cpt
]
=
valptr
[
row
]
/
((
i
/
dofj
)
+
(
i
%
dofj
)
+
2
);
// Col major
cpt
++
;
}
}
}
spm
->
values
=
newval
;
pastix_int_t
i
,
col
,
row
,
cpt
,
dofj
,
dofi
,
baseval
;
pastix_complex64_t
*
oldvalptr
;
pastix_complex64_t
*
newvalptr
;
if
(
1
)
{
return
PASTIX_ERR_NOTIMPLEMENTED
;
}
baseval
=
spmFindBase
(
spm
);
oldvalptr
=
(
pastix_complex64_t
*
)
spm
->
values
;
spm
->
values
=
malloc
(
spm
->
nnzexp
*
sizeof
(
pastix_complex64_t
)
);
newvalptr
=
(
pastix_complex64_t
*
)
spm
->
values
;
cpt
=
0
;
dofi
=
spm
->
dof
;
dofj
=
spm
->
dof
;
for
(
col
=
0
;
col
<
spm
->
n
;
col
++
)
{
if
(
spm
->
dof
<=
0
)
{
dofi
=
spm
->
dofs
[
col
+
1
]
-
spm
->
dofs
[
col
];
}
for
(
row
=
spm
->
colptr
[
col
]
-
baseval
;
row
<
spm
->
colptr
[
col
+
1
]
-
baseval
;
row
++
)
{
if
(
spm
->
dof
<=
0
)
{
dofj
=
spm
->
dofs
[
spm
->
rowptr
[
row
]
-
baseval
+
1
]
-
spm
->
dofs
[
spm
->
rowptr
[
row
]
-
baseval
];
}
for
(
i
=
0
;
i
<
dofi
*
dofj
;
i
++
)
{
newvalptr
[
cpt
]
=
oldvalptr
[
row
]
/
((
i
/
dofj
)
+
(
i
%
dofj
)
+
2
);
// Col major
cpt
++
;
}
}
}
free
(
oldvalptr
);
}
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