Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions include/OpenABF/ABF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,24 @@ class ABF
using Mesh = MeshType;

/** @brief Set the maximum number of iterations */
void setMaxIterations(const std::size_t it) { maxIters_ = it; }
void set_max_iterations(const std::size_t it) { max_iters_ = it; }

/** @brief Set the gradient convergence threshold */
void setGradientThreshold(T t) { gradThreshold_ = t; }
void set_gradient_threshold(T t) { grad_threshold_ = t; }

/** @deprecated Use `set_max_iterations`; will be removed in 3.0. */
[[deprecated("Use set_max_iterations; will be removed in 3.0")]] void setMaxIterations(
const std::size_t it)
{
set_max_iterations(it);
}

/** @deprecated Use `set_gradient_threshold`; will be removed in 3.0. */
[[deprecated("Use set_gradient_threshold; will be removed in 3.0")]] void setGradientThreshold(
T t)
{
set_gradient_threshold(t);
}

/**
* @brief Get the mesh gradient
Expand All @@ -257,7 +271,7 @@ class ABF
/** @copydoc ABF::Compute */
void compute(typename Mesh::Pointer& mesh)
{
Compute(mesh, iters_, grad_, maxIters_, gradThreshold_);
Compute(mesh, iters_, grad_, max_iters_, grad_threshold_);
}

/**
Expand Down Expand Up @@ -436,9 +450,9 @@ class ABF
/** Number of executed iterations */
std::size_t iters_{0};
/** Max iterations */
std::size_t maxIters_{10};
std::size_t max_iters_{10};
/** Gradient convergence threshold */
T gradThreshold_{0.001};
T grad_threshold_{0.001};
};

} // namespace OpenABF
24 changes: 19 additions & 5 deletions include/OpenABF/ABFPlusPlus.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,24 @@ class ABFPlusPlus
using Mesh = MeshType;

/** @brief Set the maximum number of iterations */
void setMaxIterations(std::size_t it) { maxIters_ = it; }
void set_max_iterations(std::size_t it) { max_iters_ = it; }

/** @brief Set the gradient convergence threshold */
void setGradientThreshold(T t) { gradThreshold_ = t; }
void set_gradient_threshold(T t) { grad_threshold_ = t; }

/** @deprecated Use `set_max_iterations`; will be removed in 3.0. */
[[deprecated("Use set_max_iterations; will be removed in 3.0")]] void setMaxIterations(
std::size_t it)
{
set_max_iterations(it);
}

/** @deprecated Use `set_gradient_threshold`; will be removed in 3.0. */
[[deprecated("Use set_gradient_threshold; will be removed in 3.0")]] void setGradientThreshold(
T t)
{
set_gradient_threshold(t);
}

/**
* @brief Get the mesh gradient
Expand All @@ -70,7 +84,7 @@ class ABFPlusPlus
/** @copydoc ABFPlusPlus::Compute */
void compute(typename Mesh::Pointer& mesh)
{
Compute(mesh, iters_, grad_, maxIters_, gradThreshold_);
Compute(mesh, iters_, grad_, max_iters_, grad_threshold_);
}

/**
Expand Down Expand Up @@ -273,9 +287,9 @@ class ABFPlusPlus
/** Number of executed iterations */
std::size_t iters_{0};
/** Max iterations */
std::size_t maxIters_{10};
std::size_t max_iters_{10};
/** Gradient convergence threshold */
T gradThreshold_{0.001};
T grad_threshold_{0.001};
};

} // namespace OpenABF
16 changes: 8 additions & 8 deletions include/OpenABF/AngleBasedLSCM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class AngleBasedLSCM
void set_pins(PinMap pins)
{
pins_ = std::move(pins);
legacyPinIndices_.reset();
legacy_pin_indices_.reset();
}

/**
Expand All @@ -157,7 +157,7 @@ class AngleBasedLSCM
[[deprecated("Use set_pins(PinMap); will be removed in 3.0")]] void setPinnedVertices(
std::size_t pin0Idx, std::size_t pin1Idx)
{
legacyPinIndices_ = {pin0Idx, pin1Idx};
legacy_pin_indices_ = {pin0Idx, pin1Idx};
pins_.reset();
}

Expand All @@ -166,9 +166,9 @@ class AngleBasedLSCM
{
if (pins_) {
Compute(mesh, *pins_);
} else if (legacyPinIndices_) {
ComputeImpl(mesh, detail::lscm::AutoPlacePair<T, Mesh>(mesh, legacyPinIndices_->first,
legacyPinIndices_->second));
} else if (legacy_pin_indices_) {
ComputeImpl(mesh, detail::lscm::AutoPlacePair<T, Mesh>(mesh, legacy_pin_indices_->first,
legacy_pin_indices_->second));
} else {
Compute(mesh);
}
Expand Down Expand Up @@ -229,7 +229,7 @@ class AngleBasedLSCM
/** Optional explicit pin set configured via `set_pins()`. */
std::optional<PinMap> pins_;
/** Deprecated: legacy two-pin index pair set via `setPinnedVertices`. */
std::optional<std::pair<std::size_t, std::size_t>> legacyPinIndices_;
std::optional<std::pair<std::size_t, std::size_t>> legacy_pin_indices_;

/**
* @brief Core solver: build the LSCM system from the PinMap, solve for free
Expand All @@ -240,9 +240,9 @@ class AngleBasedLSCM
using SparseMatrix = Eigen::SparseMatrix<T>;
using DenseMatrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;

// LSCM system assembly (shared with HierarchicalLSCM). buildSystem
// LSCM system assembly (shared with HierarchicalLSCM). BuildSystem
// does not mutate the mesh; pin UVs are written below.
auto parts = detail::lscm::buildSystem<T, Mesh>(mesh, pins);
auto parts = detail::lscm::BuildSystem<T, Mesh>(mesh, pins);

// Solve for x
auto x = detail::SolveLeastSquares<SparseMatrix, DenseMatrix, Solver>(parts.A, parts.b);
Expand Down
Loading
Loading