Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
2b452e36
Commit
2b452e36
authored
Nov 13, 2012
by
Kenneth Vanhoey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for completing a Tensor that is partially filled and supposed
to be symmetric.
parent
92e95d00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
include/Geometry/tensor.h
include/Geometry/tensor.h
+12
-0
include/Geometry/tensor.hpp
include/Geometry/tensor.hpp
+15
-0
No files found.
include/Geometry/tensor.h
View file @
2b452e36
...
...
@@ -29,6 +29,9 @@
* \file tensor.h
*/
#define CONST_VAL -5212368.54127 // random value
namespace
CGoGN
{
...
...
@@ -192,6 +195,15 @@ class Tensor
*/
static
bool
incremIndex
(
std
::
vector
<
unsigned
int
>&
p
)
;
/*!
* \brief method to complete a symmetric tensor that was
* only filled in its first half (defined by an index that
* is order ascendantly)
*
* \param T the tensor to fill
*/
void
completeSymmetricTensor
()
;
/**********************************************/
/* STREAM OPERATORS */
/**********************************************/
...
...
include/Geometry/tensor.hpp
View file @
2b452e36
...
...
@@ -134,6 +134,21 @@ Tensor<SIZE, REAL>::getIndex(std::vector<unsigned int> p) const
return
res
;
}
template
<
unsigned
int
SIZE
,
typename
REAL
>
void
Tensor
<
SIZE
,
REAL
>::
completeSymmetricTensor
()
{
std
::
vector
<
unsigned
int
>
p
;
p
.
resize
(
order
(),
0
)
;
do
{
std
::
vector
<
unsigned
int
>
sorted_p
=
p
;
std
::
sort
(
sorted_p
.
begin
(),
sorted_p
.
begin
()
+
(
*
this
).
order
())
;
(
*
this
)(
p
)
=
(
*
this
)(
sorted_p
)
;
}
while
(
incremIndex
(
p
))
;
}
template
<
unsigned
int
SIZE
,
typename
REAL
>
const
unsigned
int
&
Tensor
<
SIZE
,
REAL
>::
order
()
const
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment