This API walkthrough introduces the wrapped classes LinearContainerFactor declared by LinearContainerFactor.h and demonstrates their principal Python operations.
import gtsam
import numpy as np
from gtsam.symbol_shorthand import L, XOverview¶
The LinearContainerFactor class in GTSAM is a specialized factor that encapsulates a linear factor within a nonlinear factor graph. This is used extensively when marginalizing out variables.
Key Features¶
Encapsulation of Linear Factors: The primary function of the
LinearContainerFactoris to store a linear factor and its associated values, enabling it to be used within a nonlinear context.Error Calculation: It provides mechanisms to compute the error of the factor given a set of values.
Jacobian Computation: The class can compute the Jacobian matrix, which is essential for optimization processes.
Key Methods¶
LinearContainerFactor: This constructor initializes the
LinearContainerFactorwith a linear factor and optionally with values. It serves as the entry point for creating an instance of this class.
Python wrapper walkthrough¶
The following cell exercises the wrapped API directly.
def public_api(qualified_name):
value = gtsam
for component in qualified_name.split('.'):
value = getattr(value, component, None)
if value is None:
return []
return [name for name in dir(value) if not name.startswith('_')]
print('\nLinearContainerFactor')
print(public_api('LinearContainerFactor'))