Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GTMesh
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
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
Tomáš Jakubec
GTMesh
Commits
24821406
There was an error fetching the commit references. Please try again later.
Commit
24821406
authored
4 years ago
by
Tomáš Jakubec
Browse files
Options
Downloads
Patches
Plain Diff
generalization of verctor operators
parent
32acfc63
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/GTMesh/NumericStaticArray/Vertex.h
+20
-18
20 additions, 18 deletions
src/GTMesh/NumericStaticArray/Vertex.h
with
20 additions
and
18 deletions
src/GTMesh/NumericStaticArray/Vertex.h
+
20
−
18
View file @
24821406
...
...
@@ -39,20 +39,25 @@ public:
Vertex
<
Dim
,
Real
>
operator
+
(
const
Vertex
<
Dim
,
Real
>&
)
const
;
Vertex
<
Dim
,
Real
>
operator
*
(
const
Real
&
)
const
;
template
<
typename
RealOp
>
Vertex
<
Dim
,
Real
>
operator
*
(
const
RealOp
&
)
const
;
Vertex
<
Dim
,
Real
>
operator
/
(
const
Real
&
)
const
;
template
<
typename
RealOp
>
Vertex
<
Dim
,
Real
>
operator
/
(
const
RealOp
&
)
const
;
/**
* @brief Scalar product of two vectors
*/
Real
operator
*
(
const
Vertex
<
Dim
,
Real
>&
v
);
Real
operator
*
(
const
Vertex
<
Dim
,
Real
>&
v
)
const
;
Vertex
<
Dim
,
Real
>&
operator
+=
(
const
Vertex
<
Dim
,
Real
>&
);
Vertex
<
Dim
,
Real
>&
operator
-=
(
const
Vertex
<
Dim
,
Real
>&
);
Vertex
<
Dim
,
Real
>&
operator
*=
(
const
Real
&
);
Vertex
<
Dim
,
Real
>&
operator
/=
(
const
Real
&
);
template
<
typename
RealOp
>
Vertex
<
Dim
,
Real
>&
operator
*=
(
const
RealOp
&
);
template
<
typename
RealOp
>
Vertex
<
Dim
,
Real
>&
operator
/=
(
const
RealOp
&
);
bool
operator
==
(
const
Vertex
<
Dim
,
Real
>&
)
const
;
bool
operator
!=
(
const
Vertex
<
Dim
,
Real
>&
)
const
;
...
...
@@ -110,7 +115,8 @@ Vertex<Dim, Real> Vertex<Dim, Real>::operator+(const Vertex<Dim, Real>& v) const
//multiplying coordinates with real number
template
<
unsigned
int
Dim
,
typename
Real
>
Vertex
<
Dim
,
Real
>
Vertex
<
Dim
,
Real
>::
operator
*
(
const
Real
&
x
)
const
{
template
<
typename
RealOP
>
Vertex
<
Dim
,
Real
>
Vertex
<
Dim
,
Real
>::
operator
*
(
const
RealOP
&
x
)
const
{
Vertex
<
Dim
,
Real
>
res
;
inlineMultiplication
<
Dim
,
Real
>::
computation
(
res
.
data
(),
this
->
data
(),
x
);
return
res
;
...
...
@@ -125,20 +131,14 @@ Vertex<Dim, Real> operator*(const Real& x, const Vertex<Dim, Real>& vert) {
//division
template
<
unsigned
int
Dim
,
typename
Real
>
Vertex
<
Dim
,
Real
>
Vertex
<
Dim
,
Real
>::
operator
/
(
const
Real
&
x
)
const
{
return
this
->
operator
*
(
Real
(
1.0
)
/
x
);
}
//division coordinates by a real number
template
<
unsigned
int
Dim
,
typename
Real
>
Vertex
<
Dim
,
Real
>
operator
/
(
const
Real
&
x
,
const
Vertex
<
Dim
,
Real
>&
vert
)
{
return
vert
*
(
1.0
/
x
);
template
<
typename
RealOP
>
Vertex
<
Dim
,
Real
>
Vertex
<
Dim
,
Real
>::
operator
/
(
const
RealOP
&
x
)
const
{
return
this
->
operator
*
(
RealOP
(
1.0
)
/
x
);
}
template
<
unsigned
int
Dim
,
typename
Real
>
Real
Vertex
<
Dim
,
Real
>::
operator
*
(
const
Vertex
<
Dim
,
Real
>
&
v
)
Real
Vertex
<
Dim
,
Real
>::
operator
*
(
const
Vertex
<
Dim
,
Real
>
&
v
)
const
{
return
inlineScalarProduct
<
Dim
,
Real
>::
computation
(
this
->
data
(),
v
.
data
());
}
...
...
@@ -162,14 +162,16 @@ Vertex<Dim, Real>& Vertex<Dim, Real>::operator-=(const Vertex<Dim, Real>& v){
// Adds value of coordinates of another Point
template
<
unsigned
int
Dim
,
typename
Real
>
Vertex
<
Dim
,
Real
>&
Vertex
<
Dim
,
Real
>::
operator
*=
(
const
Real
&
x
){
template
<
typename
RealOP
>
Vertex
<
Dim
,
Real
>&
Vertex
<
Dim
,
Real
>::
operator
*=
(
const
RealOP
&
x
){
inlineMultiplication
<
Dim
,
Real
>::
computation
(
this
->
data
(),
x
);
return
*
this
;
}
// Subtracts value of coordinates of another Point
template
<
unsigned
int
Dim
,
typename
Real
>
Vertex
<
Dim
,
Real
>&
Vertex
<
Dim
,
Real
>::
operator
/=
(
const
Real
&
x
){
template
<
typename
RealOP
>
Vertex
<
Dim
,
Real
>&
Vertex
<
Dim
,
Real
>::
operator
/=
(
const
RealOP
&
x
){
this
->
operator
*=
(
Real
(
1.0
)
/
x
);
return
*
this
;
}
...
...
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