Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
780b353f
Commit
780b353f
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
88fe00da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Numeric/GmshMatrix.cpp
+6
-18
6 additions, 18 deletions
Numeric/GmshMatrix.cpp
with
6 additions
and
18 deletions
Numeric/GmshMatrix.cpp
+
6
−
18
View file @
780b353f
...
...
@@ -127,33 +127,21 @@ bool gmshMatrix<double>::invert(gmshMatrix<double> &result)
{
int
M
=
size1
(),
N
=
size2
(),
lda
=
size1
(),
info
;
int
*
ipiv
=
new
int
[
std
::
min
(
M
,
N
)];
bool
ret
=
true
;
result
=
*
this
;
dgetrf_
(
&
M
,
&
N
,
result
.
_data
,
&
lda
,
ipiv
,
&
info
);
if
(
info
==
0
){
int
lwork
=
M
*
4
;
double
*
work
=
new
double
[
lwork
];
dgetri_
(
&
M
,
result
.
_data
,
&
lda
,
ipiv
,
work
,
&
lwork
,
&
info
);
if
(
info
>
0
){
Msg
::
Error
(
"U(%d, %d)=0 in LU decomposition"
,
info
,
info
);
ret
=
false
;
}
else
if
(
info
<
0
){
Msg
::
Error
(
"Wrong %d-th argument in matrix inversion"
,
-
info
);
ret
=
false
;
}
delete
[]
work
;
}
else
if
(
info
>
0
){
Msg
::
Error
(
"U(%d, %d)=0 in LU decomposition"
,
info
,
info
);
ret
=
false
;
}
else
{
Msg
::
Error
(
"Wrong %d-th argument in matrix factorization"
,
-
info
);
ret
=
false
;
}
delete
[]
ipiv
;
return
ret
;
if
(
info
==
0
)
return
true
;
else
if
(
info
>
0
)
Msg
::
Error
(
"U(%d, %d)=0 in LU decomposition"
,
info
,
info
);
else
Msg
::
Error
(
"Wrong %d-th argument in matrix inversion"
,
-
info
);
return
false
;
}
template
<
>
...
...
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