release/4.3a0
kartik arcot 2023-01-20 17:44:00 -08:00 committed by Frank Dellaert
parent a1c5e306a6
commit 08ce2f7a1e
8 changed files with 28 additions and 21 deletions

View File

@ -18,7 +18,6 @@
*/
#include <gtsam/linear/ConjugateGradientSolver.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
using namespace std;
@ -49,7 +48,9 @@ std::string ConjugateGradientParameters::blasTranslator(const BLASKernel value)
/*****************************************************************************/
ConjugateGradientParameters::BLASKernel ConjugateGradientParameters::blasTranslator(
const std::string &src) {
std::string s = src; boost::algorithm::to_upper(s);
std::string s = src;
// Convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "GTSAM") return ConjugateGradientParameters::GTSAM;
/* default is SBM */

View File

@ -19,7 +19,6 @@
#include <gtsam/linear/IterativeSolver.h>
#include <gtsam/linear/GaussianFactorGraph.h>
#include <gtsam/linear/VectorValues.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
using namespace std;
@ -57,7 +56,8 @@ ostream& operator<<(ostream &os, const IterativeOptimizationParameters &p) {
IterativeOptimizationParameters::Verbosity IterativeOptimizationParameters::verbosityTranslator(
const string &src) {
string s = src;
boost::algorithm::to_upper(s);
// Convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SILENT")
return IterativeOptimizationParameters::SILENT;
else if (s == "COMPLEXITY")

View File

@ -13,7 +13,6 @@
#include <gtsam/linear/SubgraphPreconditioner.h>
#include <gtsam/linear/NoiseModel.h>
#include <memory>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <vector>
@ -41,7 +40,9 @@ void PreconditionerParameters::print(ostream &os) const {
/***************************************************************************************/
PreconditionerParameters::Kernel PreconditionerParameters::kernelTranslator(const std::string &src) {
std::string s = src; boost::algorithm::to_upper(s);
std::string s = src;
// convert string s to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "GTSAM") return PreconditionerParameters::GTSAM;
else if (s == "CHOLMOD") return PreconditionerParameters::CHOLMOD;
/* default is cholmod */
@ -50,7 +51,9 @@ PreconditionerParameters::Kernel PreconditionerParameters::kernelTranslator(cons
/***************************************************************************************/
PreconditionerParameters::Verbosity PreconditionerParameters::verbosityTranslator(const std::string &src) {
std::string s = src; boost::algorithm::to_upper(s);
std::string s = src;
// convert string to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SILENT") return PreconditionerParameters::SILENT;
else if (s == "COMPLEXITY") return PreconditionerParameters::COMPLEXITY;
else if (s == "ERROR") return PreconditionerParameters::ERROR;

View File

@ -24,7 +24,6 @@
#include <gtsam/linear/GaussianFactorGraph.h>
#include <gtsam/linear/SubgraphBuilder.h>
#include <boost/algorithm/string.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
@ -154,7 +153,8 @@ ostream &operator<<(ostream &os, const SubgraphBuilderParameters &p) {
SubgraphBuilderParameters::Skeleton
SubgraphBuilderParameters::skeletonTranslator(const std::string &src) {
std::string s = src;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "NATURALCHAIN")
return NATURALCHAIN;
else if (s == "BFS")
@ -182,7 +182,8 @@ std::string SubgraphBuilderParameters::skeletonTranslator(Skeleton s) {
SubgraphBuilderParameters::SkeletonWeight
SubgraphBuilderParameters::skeletonWeightTranslator(const std::string &src) {
std::string s = src;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "EQUAL")
return EQUAL;
else if (s == "RHS")
@ -217,7 +218,8 @@ SubgraphBuilderParameters::AugmentationWeight
SubgraphBuilderParameters::augmentationWeightTranslator(
const std::string &src) {
std::string s = src;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SKELETON") return SKELETON;
// else if (s == "STRETCH") return STRETCH;
// else if (s == "GENERALIZED_STRETCH") return GENERALIZED_STRETCH;

View File

@ -24,13 +24,13 @@
#include <gtsam/linear/GaussianFactorGraph.h>
#include <gtsam/linear/VectorValues.h>
#include <boost/algorithm/string.hpp>
namespace gtsam {
/* ************************************************************************* */
DoglegParams::VerbosityDL DoglegParams::verbosityDLTranslator(const std::string &verbosityDL) const {
std::string s = verbosityDL; boost::algorithm::to_upper(s);
std::string s = verbosityDL;
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SILENT") return DoglegParams::SILENT;
if (s == "VERBOSE") return DoglegParams::VERBOSE;

View File

@ -16,7 +16,6 @@
*/
#include <gtsam/nonlinear/ISAM2Params.h>
#include <boost/algorithm/string.hpp>
using namespace std;
@ -46,7 +45,8 @@ DoglegOptimizerImpl::TrustRegionAdaptationMode
ISAM2DoglegParams::adaptationModeTranslator(
const string& adaptationMode) const {
string s = adaptationMode;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SEARCH_EACH_ITERATION")
return DoglegOptimizerImpl::SEARCH_EACH_ITERATION;
if (s == "ONE_STEP_PER_ITERATION")
@ -60,7 +60,8 @@ ISAM2DoglegParams::adaptationModeTranslator(
ISAM2Params::Factorization ISAM2Params::factorizationTranslator(
const string& str) {
string s = str;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "QR") return ISAM2Params::QR;
if (s == "CHOLESKY") return ISAM2Params::CHOLESKY;

View File

@ -19,7 +19,6 @@
*/
#include <gtsam/nonlinear/LevenbergMarquardtParams.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <iostream>
#include <string>
@ -31,7 +30,8 @@ namespace gtsam {
LevenbergMarquardtParams::VerbosityLM LevenbergMarquardtParams::verbosityLMTranslator(
const std::string &src) {
std::string s = src;
boost::algorithm::to_upper(s);
// convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SILENT")
return LevenbergMarquardtParams::SILENT;
if (s == "SUMMARY")

View File

@ -9,7 +9,6 @@
*/
#include <gtsam/nonlinear/NonlinearOptimizerParams.h>
#include <boost/algorithm/string.hpp>
namespace gtsam {
@ -17,7 +16,8 @@ namespace gtsam {
NonlinearOptimizerParams::Verbosity NonlinearOptimizerParams::verbosityTranslator(
const std::string &src) {
std::string s = src;
boost::algorithm::to_upper(s);
// Convert to upper case
std::transform(s.begin(), s.end(), s.begin(), ::toupper);
if (s == "SILENT")
return NonlinearOptimizerParams::SILENT;
if (s == "ERROR")