| 843 | } |
| 844 | |
| 845 | void FactorGraph::computeUnweightedErrorMatrix(const FactorType CurrentFactorType, Matrix &ErrorMatrix) |
| 846 | { |
| 847 | /** get the data */ |
| 848 | std::vector<double> ErrorVector; |
| 849 | this->computeUnweightedError(CurrentFactorType, ErrorVector); |
| 850 | |
| 851 | /** check for empty vector */ |
| 852 | if (ErrorVector.size() == 0) |
| 853 | { |
| 854 | PRINT_WARNING("Factors of type ", CurrentFactorType, " are missing!"); |
| 855 | return; |
| 856 | } |
| 857 | |
| 858 | /** get the factor IDs */ |
| 859 | std::vector<FactorID> FactorVector; |
| 860 | _Structure.getFactorIDs(CurrentFactorType, FactorVector); |
| 861 | |
| 862 | /** get the dimensions */ |
| 863 | const int Dim = ErrorVector.size() / FactorVector.size(); |
| 864 | const int Length = FactorVector.size(); |
| 865 | |
| 866 | /** map std vector to matrix */ |
| 867 | ErrorMatrix = Eigen::Map<Matrix, Eigen::Unaligned, Eigen::Stride<1, Dynamic>>(ErrorVector.data(), Dim, Length, Eigen::Stride<1,Dynamic>(1, Dim)); |
| 868 | } |
| 869 | |
| 870 | void FactorGraph::computeUnweightedError(const FactorType CurrentFactorType, const string &Name, StateDataSet &ErrorData) |
| 871 | { |
nothing calls this directly
no test coverage detected