Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
agnumpde
dune-solvers
Commits
ed3a7bbf
Commit
ed3a7bbf
authored
8 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
crossProduct moved to dune-matrix-vector
parent
1888608d
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
dune/solvers/common/arithmetic.hh
+2
-27
2 additions, 27 deletions
dune/solvers/common/arithmetic.hh
with
2 additions
and
27 deletions
dune/solvers/common/arithmetic.hh
+
2
−
27
View file @
ed3a7bbf
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include
<dune/istl/scaledidmatrix.hh>
#include
<dune/istl/scaledidmatrix.hh>
#include
<dune/matrix-vector/axpy.hh>
#include
<dune/matrix-vector/axpy.hh>
#include
<dune/matrix-vector/crossproduct.hh>
#include
<dune/matrix-vector/transpose.hh>
#include
<dune/matrix-vector/transpose.hh>
#include
<dune/solvers/common/resize.hh>
#include
<dune/solvers/common/resize.hh>
...
@@ -145,32 +146,6 @@ namespace Arithmetic
...
@@ -145,32 +146,6 @@ namespace Arithmetic
template
<
bool
Condition
,
typename
Type
=
void
>
template
<
bool
Condition
,
typename
Type
=
void
>
using
enable_if_t
=
typename
std
::
enable_if
<
Condition
,
Type
>::
type
;
using
enable_if_t
=
typename
std
::
enable_if
<
Condition
,
Type
>::
type
;
//! Helper class for computing the cross product
template
<
class
T
,
int
n
>
struct
CrossProductHelper
{
static
Dune
::
FieldVector
<
T
,
n
>
crossProduct
(
const
Dune
::
FieldVector
<
T
,
n
>&
a
,
const
Dune
::
FieldVector
<
T
,
n
>&
b
)
{
DUNE_UNUSED_PARAMETER
(
a
);
DUNE_UNUSED_PARAMETER
(
b
);
DUNE_THROW
(
Dune
::
Exception
,
"You can only call crossProduct with dim==3"
);
}
};
//! Specialisation for n=3
template
<
class
T
>
struct
CrossProductHelper
<
T
,
3
>
{
static
Dune
::
FieldVector
<
T
,
3
>
crossProduct
(
const
Dune
::
FieldVector
<
T
,
3
>&
a
,
const
Dune
::
FieldVector
<
T
,
3
>&
b
)
{
Dune
::
FieldVector
<
T
,
3
>
r
;
r
[
0
]
=
a
[
1
]
*
b
[
2
]
-
a
[
2
]
*
b
[
1
];
r
[
1
]
=
a
[
2
]
*
b
[
0
]
-
a
[
0
]
*
b
[
2
];
r
[
2
]
=
a
[
0
]
*
b
[
1
]
-
a
[
1
]
*
b
[
0
];
return
r
;
}
};
template
<
class
MatrixType
>
template
<
class
MatrixType
>
using
Transposed
=
typename
Dune
::
MatrixVector
::
Transposed
<
MatrixType
>
;
using
Transposed
=
typename
Dune
::
MatrixVector
::
Transposed
<
MatrixType
>
;
...
@@ -212,7 +187,7 @@ namespace Arithmetic
...
@@ -212,7 +187,7 @@ namespace Arithmetic
template
<
class
T
,
int
n
>
template
<
class
T
,
int
n
>
Dune
::
FieldVector
<
T
,
n
>
crossProduct
(
const
Dune
::
FieldVector
<
T
,
n
>&
a
,
const
Dune
::
FieldVector
<
T
,
n
>&
b
)
Dune
::
FieldVector
<
T
,
n
>
crossProduct
(
const
Dune
::
FieldVector
<
T
,
n
>&
a
,
const
Dune
::
FieldVector
<
T
,
n
>&
b
)
{
{
return
CrossProductHelper
<
T
,
n
>
::
crossProduct
(
a
,
b
);
return
Dune
::
MatrixVector
::
crossProduct
(
a
,
b
);
}
}
//! Compute the transposed of a matrix
//! Compute the transposed of a matrix
...
...
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