Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Dmitri Naumov
ogs
Commits
dc4bc3ba
Commit
dc4bc3ba
authored
4 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[MaL] MathTools; remove scalarProduct.
Scalar product was substituted everywhere with Eigen's dot() function.
parent
32fce1bd
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
MathLib/MathTools.h
+0
-47
0 additions, 47 deletions
MathLib/MathTools.h
with
0 additions
and
47 deletions
MathLib/MathTools.h
+
0
−
47
View file @
dc4bc3ba
...
@@ -9,60 +9,13 @@
...
@@ -9,60 +9,13 @@
#pragma once
#pragma once
#include
<Eigen/Eigen>
#include
<cstddef>
#include
<cstddef>
#ifdef _OPENMP
#include
<omp.h>
#endif
namespace
MathLib
namespace
MathLib
{
{
template
<
typename
T
,
std
::
size_t
DIM
>
class
TemplatePoint
;
template
<
typename
T
,
std
::
size_t
DIM
>
class
TemplatePoint
;
using
Point3d
=
MathLib
::
TemplatePoint
<
double
,
3
>
;
using
Point3d
=
MathLib
::
TemplatePoint
<
double
,
3
>
;
/**
* standard inner product in R^N
* \param v0 array of type T representing the vector
* \param v1 array of type T representing the vector
* */
template
<
typename
T
,
int
N
>
inline
T
scalarProduct
(
T
const
*
const
v0
,
T
const
*
const
v1
)
{
T
res
(
v0
[
0
]
*
v1
[
0
]);
#pragma omp parallel for reduction (+:res)
for
(
int
k
=
1
;
k
<
N
;
k
++
)
{
res
+=
v0
[
k
]
*
v1
[
k
];
}
return
res
;
}
template
<
>
inline
double
scalarProduct
<
double
,
3
>
(
double
const
*
const
v0
,
double
const
*
const
v1
)
{
double
res
(
v0
[
0
]
*
v1
[
0
]);
for
(
std
::
size_t
k
(
1
);
k
<
3
;
k
++
)
{
res
+=
v0
[
k
]
*
v1
[
k
];
}
return
res
;
}
template
<
typename
T
>
inline
T
scalarProduct
(
T
const
*
const
v0
,
T
const
*
const
v1
,
int
const
n
)
{
T
res
(
v0
[
0
]
*
v1
[
0
]);
#pragma omp parallel for reduction (+:res)
for
(
int
k
=
1
;
k
<
n
;
k
++
)
{
res
+=
v0
[
k
]
*
v1
[
k
];
}
return
res
;
}
/**
/**
* calcProjPntToLineAndDists computes the orthogonal projection
* calcProjPntToLineAndDists computes the orthogonal projection
* of a point p to the line described by the points a and b,
* of a point p to the line described by the points a and b,
...
...
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