include
sot
core
memory-task-sot.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2010,
3
* François Bleibel,
4
* Olivier Stasse,
5
*
6
* CNRS/AIST
7
*
8
*/
9
10
#ifndef __SOT_MEMORY_TASK_HH
11
#define __SOT_MEMORY_TASK_HH
12
13
#include <
sot/core/matrix-svd.hh
>
14
#include <
sot/core/task-abstract.hh
>
15
16
#include "
sot/core/api.hh
"
17
18
/* --------------------------------------------------------------------- */
19
/* --- CLASS ----------------------------------------------------------- */
20
/* --------------------------------------------------------------------- */
21
22
namespace
dynamicgraph
{
23
namespace
sot {
24
25
class
SOT_CORE_EXPORT
MemoryTaskSOT
:
public
TaskAbstract::MemoryTaskAbstract
{
26
public
:
// protected:
27
typedef
Eigen::Map<Matrix, Eigen::internal::traits<Matrix>::Alignment>
28
Kernel_t
;
29
typedef
Eigen::Map<const Matrix, Eigen::internal::traits<Matrix>::Alignment>
30
KernelConst_t
;
31
32
/* Internal memory to reduce the dynamic allocation at task resolution. */
33
dynamicgraph::Vector
err
, tmpTask,
tmpVar
, tmpControl;
34
dynamicgraph::Matrix
Jt
;
//( nJ,mJ );
35
36
dynamicgraph::Matrix
JK
;
//(nJ,mJ);
37
38
SVD_t
svd
;
39
Kernel_t
kernel
;
40
41
void
resizeKernel
(
const
Matrix::Index
r
,
const
Matrix::Index
c
) {
42
if
(kernel.rows() !=
r
|| kernel.cols() !=
c
) {
43
if
(kernelMem.size() <
r
*
c
) kernelMem.resize(
r
,
c
);
44
new
(&kernel)
Kernel_t
(kernelMem.data(),
r
,
c
);
45
}
46
}
47
48
Kernel_t
&
getKernel
(
const
Matrix::Index
r
,
const
Matrix::Index
c
) {
49
resizeKernel(
r
,
c
);
50
return
kernel;
51
}
52
53
public
:
58
MemoryTaskSOT
(
const
Matrix::Index
nJ = 0,
const
Matrix::Index
mJ = 0);
59
60
void
display
(std::ostream &os)
const
;
61
62
private
:
63
void
initMemory(
const
Matrix::Index
nJ,
const
Matrix::Index
mJ);
64
65
Matrix
kernelMem
;
66
};
67
68
}
/* namespace sot */
69
}
/* namespace dynamicgraph */
70
71
#endif // __SOT_MEMORY_TASK_HH
dynamicgraph::sot::MemoryTaskSOT::kernelMem
Matrix kernelMem
Definition:
memory-task-sot.hh:65
dynamicgraph::sot::MemoryTaskSOT::JK
dynamicgraph::Matrix JK
Definition:
memory-task-sot.hh:36
SOT_CORE_EXPORT
#define SOT_CORE_EXPORT
Definition:
api.hh:20
dynamicgraph::sot::TaskAbstract::MemoryTaskAbstract
Definition:
task-abstract.hh:54
Kernel_t
MemoryTaskSOT::Kernel_t Kernel_t
Definition:
sot.cpp:351
dynamicgraph
dynamicgraph::SVD_t
Eigen::JacobiSVD< Matrix > SVD_t
Definition:
matrix-svd.hh:23
c
Vec3f c
dynamicgraph::Matrix
Eigen::MatrixXd Matrix
dynamicgraph::sot::MemoryTaskSOT::getKernel
Kernel_t & getKernel(const Matrix::Index r, const Matrix::Index c)
Definition:
memory-task-sot.hh:48
r
FCL_REAL r
dynamicgraph::sot::MemoryTaskSOT::tmpVar
dynamicgraph::Vector tmpVar
Definition:
memory-task-sot.hh:33
dynamicgraph::sot::MemoryTaskSOT::svd
SVD_t svd
Definition:
memory-task-sot.hh:38
api.hh
Index
std::size_t Index
dynamicgraph::sot::MemoryTaskSOT::kernel
Kernel_t kernel
Definition:
memory-task-sot.hh:39
display
dynamicgraph::Vector
Eigen::VectorXd Vector
dynamicgraph::sot::MemoryTaskSOT::Kernel_t
Eigen::Map< Matrix, Eigen::internal::traits< Matrix >::Alignment > Kernel_t
Definition:
memory-task-sot.hh:28
dynamicgraph::sot::MemoryTaskSOT::Jt
dynamicgraph::Matrix Jt
Definition:
memory-task-sot.hh:34
dynamicgraph::sot::MemoryTaskSOT
Definition:
memory-task-sot.hh:25
matrix-svd.hh
err
err
task-abstract.hh
dynamicgraph::sot::MemoryTaskSOT::KernelConst_t
Eigen::Map< const Matrix, Eigen::internal::traits< Matrix >::Alignment > KernelConst_t
Definition:
memory-task-sot.hh:30
dynamicgraph::sot::MemoryTaskSOT::resizeKernel
void resizeKernel(const Matrix::Index r, const Matrix::Index c)
Definition:
memory-task-sot.hh:41
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31