39 #ifndef TRIVIALVECTORIALREPRESENTER_H
40 #define TRIVIALVECTORIALREPRESENTER_H
45 #include "CommonTypes.h"
47 #include "HDF5Utils.h"
48 #include "Representer.h"
55 PointIdType(
unsigned ptId_) : ptId(ptId_) {}
56 PointIdType() : ptId(0) {}
64 struct RepresenterTraits<statismo::VectorType> {
65 typedef statismo::VectorType DatasetPointerType;
66 typedef statismo::VectorType DatasetConstPointerType;
68 typedef PointIdType PointType;
88 typedef Representer<statismo::VectorType> RepresenterBaseType;
98 void Load(
const H5::Group& fg) {
100 initializeObject(numPoints);
106 void Delete()
const {
113 std::string GetName()
const {
114 return "TrivialVectorialRepresenter";
116 unsigned GetDimensions()
const {
119 std::string GetVersion()
const {
122 RepresenterBaseType::RepresenterDataType GetType()
const {
123 return RepresenterBaseType::VECTOR;
127 void DeleteDataset(DatasetPointerType d)
const { };
128 DatasetPointerType CloneDataset(DatasetConstPointerType d)
const {
136 DatasetConstPointerType GetReference()
const {
140 VectorType PointToVector(
const PointType& pt)
const {
146 DatasetPointerType DatasetToSample(DatasetConstPointerType ds)
const {
149 VectorType SampleToSampleVector(DatasetConstPointerType sample)
const {
152 DatasetPointerType SampleVectorToSample(
const statismo::VectorType& sample)
const {
156 VectorType PointSampleToPointSampleVector(
const ValueType& v)
const {
157 VectorType vec = VectorType::Zero(1);
163 ValueType PointSampleFromSample(DatasetConstPointerType sample,
unsigned ptid)
const {
166 ValueType PointSampleVectorToPointSample(
const VectorType& pointSample)
const {
167 return pointSample(0);
171 void Save(
const H5::Group& fg)
const {
175 unsigned GetPointIdForPoint(
const PointType& point)
const {
184 initializeObject(numberOfPoints);
187 void initializeObject(
unsigned numberOfPoints) {
190 DomainType::DomainPointsListType domainPoints;
191 for (
unsigned i = 0; i < numberOfPoints; i++) {
192 domainPoints.push_back(PointIdType(i));
const unsigned GetNumberOfPoints() const
Definition: Domain.h:72
A trivial representer, that does no representation at all, but works directly with vectorial data...
Definition: TrivialVectorialRepresenter.h:83
static H5::DataSet writeInt(const H5::CommonFG &fg, const char *name, int value)
Definition: HDF5Utils.hxx:426
float ScalarType
the type that is used for all vector and matrices throughout the library.
Definition: CommonTypes.h:60
static int readInt(const H5::CommonFG &fg, const char *name)
Definition: HDF5Utils.hxx:434