Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
b4277f1a
Commit
b4277f1a
authored
18 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
use size_type instead of int
[[Imported from SVN: r4828]]
parent
c64f972a
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
common/fmatrix.hh
+20
-22
20 additions, 22 deletions
common/fmatrix.hh
with
20 additions
and
22 deletions
common/fmatrix.hh
+
20
−
22
View file @
b4277f1a
...
@@ -196,7 +196,7 @@ namespace Dune {
...
@@ -196,7 +196,7 @@ namespace Dune {
//===== assignment from scalar
//===== assignment from scalar
FieldMatrix
&
operator
=
(
const
K
&
k
)
FieldMatrix
&
operator
=
(
const
K
&
k
)
{
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
p
[
i
]
=
k
;
p
[
i
]
=
k
;
return
*
this
;
return
*
this
;
}
}
...
@@ -206,7 +206,7 @@ namespace Dune {
...
@@ -206,7 +206,7 @@ namespace Dune {
//! vector space addition
//! vector space addition
FieldMatrix
&
operator
+=
(
const
FieldMatrix
&
y
)
FieldMatrix
&
operator
+=
(
const
FieldMatrix
&
y
)
{
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
p
[
i
]
+=
y
.
p
[
i
];
p
[
i
]
+=
y
.
p
[
i
];
return
*
this
;
return
*
this
;
}
}
...
@@ -214,7 +214,7 @@ namespace Dune {
...
@@ -214,7 +214,7 @@ namespace Dune {
//! vector space subtraction
//! vector space subtraction
FieldMatrix
&
operator
-=
(
const
FieldMatrix
&
y
)
FieldMatrix
&
operator
-=
(
const
FieldMatrix
&
y
)
{
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
p
[
i
]
-=
y
.
p
[
i
];
p
[
i
]
-=
y
.
p
[
i
];
return
*
this
;
return
*
this
;
}
}
...
@@ -222,7 +222,7 @@ namespace Dune {
...
@@ -222,7 +222,7 @@ namespace Dune {
//! vector space multiplication with scalar
//! vector space multiplication with scalar
FieldMatrix
&
operator
*=
(
const
K
&
k
)
FieldMatrix
&
operator
*=
(
const
K
&
k
)
{
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
p
[
i
]
*=
k
;
p
[
i
]
*=
k
;
return
*
this
;
return
*
this
;
}
}
...
@@ -230,7 +230,7 @@ namespace Dune {
...
@@ -230,7 +230,7 @@ namespace Dune {
//! vector space division by scalar
//! vector space division by scalar
FieldMatrix
&
operator
/=
(
const
K
&
k
)
FieldMatrix
&
operator
/=
(
const
K
&
k
)
{
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
p
[
i
]
/=
k
;
p
[
i
]
/=
k
;
return
*
this
;
return
*
this
;
}
}
...
@@ -417,10 +417,10 @@ namespace Dune {
...
@@ -417,10 +417,10 @@ namespace Dune {
{
{
FieldMatrix
<
K
,
n
,
m
>
C
(
*
this
);
FieldMatrix
<
K
,
n
,
m
>
C
(
*
this
);
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
for
(
int
j
=
0
;
j
<
m
;
j
++
)
{
for
(
size_type
j
=
0
;
j
<
m
;
j
++
)
{
(
*
this
)[
i
][
j
]
=
0
;
(
*
this
)[
i
][
j
]
=
0
;
for
(
int
k
=
0
;
k
<
n
;
k
++
)
for
(
size_type
k
=
0
;
k
<
n
;
k
++
)
(
*
this
)[
i
][
j
]
+=
M
[
i
][
k
]
*
C
[
k
][
j
];
(
*
this
)[
i
][
j
]
+=
M
[
i
][
k
]
*
C
[
k
][
j
];
}
}
...
@@ -432,10 +432,10 @@ namespace Dune {
...
@@ -432,10 +432,10 @@ namespace Dune {
{
{
FieldMatrix
<
K
,
n
,
m
>
C
(
*
this
);
FieldMatrix
<
K
,
n
,
m
>
C
(
*
this
);
for
(
int
i
=
0
;
i
<
n
;
i
++
)
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
for
(
int
j
=
0
;
j
<
m
;
j
++
)
{
for
(
size_type
j
=
0
;
j
<
m
;
j
++
)
{
(
*
this
)[
i
][
j
]
=
0
;
(
*
this
)[
i
][
j
]
=
0
;
for
(
int
k
=
0
;
k
<
m
;
k
++
)
for
(
size_type
k
=
0
;
k
<
m
;
k
++
)
(
*
this
)[
i
][
j
]
+=
C
[
i
][
k
]
*
M
[
k
][
j
];
(
*
this
)[
i
][
j
]
+=
C
[
i
][
k
]
*
M
[
k
][
j
];
}
}
return
*
this
;
return
*
this
;
...
@@ -693,30 +693,28 @@ namespace Dune {
...
@@ -693,30 +693,28 @@ namespace Dune {
// initialize inverse
// initialize inverse
*
this
=
0
;
*
this
=
0
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
for
(
size_type
i
=
0
;
i
<
n
;
++
i
)
p
[
i
][
i
]
=
1
;
p
[
i
][
i
]
=
1
;
// L Y = I; multiple right hand sides
// L Y = I; multiple right hand sides
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
for
(
size_type
i
=
0
;
i
<
n
;
i
++
)
{
int
row
=
pivot
[
i
];
for
(
size_type
j
=
0
;
j
<
i
;
j
++
)
for
(
int
j
=
0
;
j
<
i
;
j
++
)
for
(
size_type
k
=
0
;
k
<
n
;
k
++
)
for
(
int
k
=
0
;
k
<
n
;
k
++
)
p
[
i
][
k
]
-=
L
[
i
][
j
]
*
p
[
j
][
k
];
p
[
i
][
k
]
-=
L
[
i
][
j
]
*
p
[
j
][
k
];
}
}
// U A^{-1} = Y
// U A^{-1} = Y
for
(
int
i
=
n
-
1
;
i
>=
0
;
i
--
)
{
for
(
size_type
i
=
n
-
1
;
i
>=
0
;
i
--
)
{
int
row
=
pivot
[
i
];
for
(
size_type
k
=
0
;
k
<
n
;
k
++
)
{
for
(
int
k
=
0
;
k
<
n
;
k
++
)
{
for
(
size_type
j
=
i
+
1
;
j
<
n
;
j
++
)
for
(
int
j
=
i
+
1
;
j
<
n
;
j
++
)
p
[
i
][
k
]
-=
U
[
i
][
j
]
*
p
[
j
][
k
];
p
[
i
][
k
]
-=
U
[
i
][
j
]
*
p
[
j
][
k
];
p
[
i
][
k
]
/=
U
[
i
][
i
];
p
[
i
][
k
]
/=
U
[
i
][
i
];
}
}
}
}
for
(
int
i
=
n
-
1
;
i
>=
0
;
--
i
)
{
for
(
size_type
i
=
n
-
1
;
i
>=
0
;
--
i
)
{
if
(
i
!=
pivot
[
i
])
if
(
i
!=
pivot
[
i
])
for
(
int
j
=
0
;
j
<
n
;
++
j
)
for
(
size_type
j
=
0
;
j
<
n
;
++
j
)
std
::
swap
(
p
[
j
][
pivot
[
i
]],
p
[
j
][
i
]);
std
::
swap
(
p
[
j
][
pivot
[
i
]],
p
[
j
][
i
]);
}
}
}
}
...
...
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