NDEVR
API Documentation
jacobian_workspace.h
1#pragma once
2#include <Eigen/Core>
3#include <Eigen/StdVector>
4
5#include "Base/Headers/Buffer.hpp"
6#include "hyper_graph.h"
7
8namespace NDEVR {
9
10 struct OptimizableGraph;
11
20 class JacobianWorkspace
21 {
22 public:
23 JacobianWorkspace()
24 : _maxNumVertices(0U)
25 , _maxDimension(0U)
26 {
27 }
31 void allocate()
32 {
33 _workspace.resize(_maxNumVertices * _maxDimension);
34 }
35
40
44 void updateSize(const OptimizableGraph& graph);
45
49 void updateSize(uint04 numVertices, uint04 dimension)
50 {
53 }
54
57 uint04 maxDimension() const { return _maxDimension; }
58 uint04 maxNumVertices() const { return _maxNumVertices; }
59 g_type* workspaceForVertex(uint04 vertexIndex)
60 {
61 lib_assert(_workspace.size() > vertexIndex * _maxDimension, "Bad workplace dimension");
62 return &_workspace.at(vertexIndex * _maxDimension);
63 }
64 protected:
65 std::vector<g_type, Eigen::aligned_allocator<g_type>> _workspace;
68 };
69
70}
Abstract Edge class.
Definition hyper_graph.h:54
void allocate()
allocate the workspace
uint04 maxDimension() const
return the workspace for a vertex in an edge
void updateSize(const HyperGraph::HGEdge *e)
update the maximum required workspace needed by taking into account this edge
void updateSize(uint04 numVertices, uint04 dimension)
manually update with the given parameters
void updateSize(const OptimizableGraph &graph)
update the required workspace by looking at a full graph
uint04 _maxNumVertices
the maximum number of vertices connected by a hyper-edge
uint04 _maxDimension
the maximum dimension (number of elements) for a Jacobian
The primary namespace for the NDEVR SDK.
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
This is an abstract class that represents one optimization problem.