Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
MostafaMollaali
dynamic
Commits
cc7b3671
Commit
cc7b3671
authored
7 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[MaL] don't use std::size_t in EigenVector and EigenMatrix interface
parent
5d8ca6b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
MathLib/LinAlg/Eigen/EigenMatrix.h
+5
-5
5 additions, 5 deletions
MathLib/LinAlg/Eigen/EigenMatrix.h
MathLib/LinAlg/Eigen/EigenVector.h
+4
-4
4 additions, 4 deletions
MathLib/LinAlg/Eigen/EigenVector.h
MathLib/LinAlg/UnifiedMatrixSetters.cpp
+4
-4
4 additions, 4 deletions
MathLib/LinAlg/UnifiedMatrixSetters.cpp
with
13 additions
and
13 deletions
MathLib/LinAlg/Eigen/EigenMatrix.h
+
5
−
5
View file @
cc7b3671
...
@@ -39,23 +39,23 @@ public:
...
@@ -39,23 +39,23 @@ public:
* @param n the number of rows (that is equal to the number of columns)
* @param n the number of rows (that is equal to the number of columns)
* @param n_nonzero_columns the number of non-zero columns used for preallocation
* @param n_nonzero_columns the number of non-zero columns used for preallocation
*/
*/
explicit
EigenMatrix
(
std
::
size_t
n
,
std
::
size_t
n_nonzero_columns
=
0
)
:
_mat
(
n
,
n
)
explicit
EigenMatrix
(
IndexType
n
,
IndexType
n_nonzero_columns
=
0
)
:
_mat
(
n
,
n
)
{
{
if
(
n_nonzero_columns
>
0
)
if
(
n_nonzero_columns
>
0
)
_mat
.
reserve
(
Eigen
::
VectorXi
::
Constant
(
n
,
n_nonzero_columns
));
_mat
.
reserve
(
Eigen
::
VectorXi
::
Constant
(
n
,
n_nonzero_columns
));
}
}
/// return the number of rows
/// return the number of rows
std
::
size_t
getNumberOfRows
()
const
{
return
_mat
.
rows
();
}
IndexType
getNumberOfRows
()
const
{
return
_mat
.
rows
();
}
/// return the number of columns
/// return the number of columns
std
::
size_t
getNumberOfColumns
()
const
{
return
_mat
.
cols
();
}
IndexType
getNumberOfColumns
()
const
{
return
_mat
.
cols
();
}
/// return a start index of the active data range
/// return a start index of the active data range
std
::
size_t
getRangeBegin
()
const
{
return
0
;
}
IndexType
getRangeBegin
()
const
{
return
0
;
}
/// return an end index of the active data range
/// return an end index of the active data range
std
::
size_t
getRangeEnd
()
const
{
return
getNumberOfRows
();
}
IndexType
getRangeEnd
()
const
{
return
getNumberOfRows
();
}
/// reset data entries to zero.
/// reset data entries to zero.
void
setZero
()
void
setZero
()
...
...
This diff is collapsed.
Click to expand it.
MathLib/LinAlg/Eigen/EigenVector.h
+
4
−
4
View file @
cc7b3671
...
@@ -37,19 +37,19 @@ public:
...
@@ -37,19 +37,19 @@ public:
/// Constructor for initialization of the number of rows
/// Constructor for initialization of the number of rows
/// @param length number of rows
/// @param length number of rows
explicit
EigenVector
(
std
::
size_t
length
)
:
_vec
(
length
)
{}
explicit
EigenVector
(
IndexType
length
)
:
_vec
(
length
)
{}
/// copy constructor
/// copy constructor
EigenVector
(
EigenVector
const
&
src
)
=
default
;
EigenVector
(
EigenVector
const
&
src
)
=
default
;
/// return a vector length
/// return a vector length
std
::
size_t
size
()
const
{
return
_vec
.
size
();
}
IndexType
size
()
const
{
return
_vec
.
size
();
}
/// return a start index of the active data range
/// return a start index of the active data range
std
::
size_t
getRangeBegin
()
const
{
return
0
;}
IndexType
getRangeBegin
()
const
{
return
0
;}
/// return an end index of the active data range
/// return an end index of the active data range
std
::
size_t
getRangeEnd
()
const
{
return
size
();
}
IndexType
getRangeEnd
()
const
{
return
size
();
}
// TODO preliminary
// TODO preliminary
void
setZero
()
{
_vec
.
setZero
();
}
void
setZero
()
{
_vec
.
setZero
();
}
...
...
This diff is collapsed.
Click to expand it.
MathLib/LinAlg/UnifiedMatrixSetters.cpp
+
4
−
4
View file @
cc7b3671
...
@@ -133,8 +133,8 @@ void setMatrix(EigenMatrix& m,
...
@@ -133,8 +133,8 @@ void setMatrix(EigenMatrix& m,
Eigen
::
MatrixXd
tmp
(
rows
,
cols
);
Eigen
::
MatrixXd
tmp
(
rows
,
cols
);
auto
it
=
values
.
begin
();
auto
it
=
values
.
begin
();
for
(
std
::
size_t
r
=
0
;
r
<
rows
;
++
r
)
{
for
(
GlobalIndexType
r
=
0
;
r
<
rows
;
++
r
)
{
for
(
std
::
size_t
c
=
0
;
c
<
cols
;
++
c
)
{
for
(
GlobalIndexType
c
=
0
;
c
<
cols
;
++
c
)
{
tmp
(
r
,
c
)
=
*
(
it
++
);
tmp
(
r
,
c
)
=
*
(
it
++
);
}
}
}
}
...
@@ -157,8 +157,8 @@ void addToMatrix(EigenMatrix& m,
...
@@ -157,8 +157,8 @@ void addToMatrix(EigenMatrix& m,
Eigen
::
Matrix
<
double
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
,
Eigen
::
RowMajor
>
tmp
(
rows
,
cols
);
Eigen
::
Matrix
<
double
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
,
Eigen
::
RowMajor
>
tmp
(
rows
,
cols
);
auto
it
=
values
.
begin
();
auto
it
=
values
.
begin
();
for
(
std
::
size_t
r
=
0
;
r
<
rows
;
++
r
)
{
for
(
GlobalIndexType
r
=
0
;
r
<
rows
;
++
r
)
{
for
(
std
::
size_t
c
=
0
;
c
<
cols
;
++
c
)
{
for
(
GlobalIndexType
c
=
0
;
c
<
cols
;
++
c
)
{
tmp
(
r
,
c
)
=
*
(
it
++
);
tmp
(
r
,
c
)
=
*
(
it
++
);
}
}
}
}
...
...
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