Skip to content

Commit 618fb79

Browse files
committed
Update template formatting for tests
Fixed extraneous divergence Fixed extraneous divergence
1 parent f32f90d commit 618fb79

38 files changed

Lines changed: 153 additions & 86 deletions

GridKit/CommonMath.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ namespace GridKit
335335
{
336336
assert(limit_min <= limit_max);
337337
using ScalarT = scalar_type;
338+
using RealT = real_type;
338339

339340
ScalarT above_min = above(x, limit_min);
340341
ScalarT below_max = below(x, limit_max);

GridKit/LinearAlgebra/Solver/ResolveSystemSolver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace GridKit
1313
namespace LinearAlgebra
1414
{
1515
template <typename scalar_type, typename index_type>
16-
class ResolveSystemSolver : public LinearSolver<ScalarT, IdxT>
16+
class ResolveSystemSolver : public LinearSolver<scalar_type, index_type>
1717
{
1818
public:
1919
using ScalarT = scalar_type;

GridKit/Model/PhasorDynamics/Bus/BusDataJSONParser.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace GridKit
2222
template <typename real_type, typename index_type>
2323
void from_json(const json& j, BusData<real_type, index_type>& bd)
2424
{
25-
using RealT = real_type;
26-
using IdxT = index_type;
25+
using RealT = real_type;
26+
using IdxT = index_type;
2727
using BusDataT = BusData<RealT, IdxT>;
2828

2929
j.at("name").get_to(bd.name);

GridKit/Model/PowerFlow/Generator2/Generator2.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ namespace GridKit
3737
using ModelEvaluatorImpl<scalar_type, index_type>::param_lo_;
3838

3939
public:
40-
using ScalarT = scalar_type;
41-
using IdxT = index_type;
42-
using RealT = typename ModelEvaluatorImpl<ScalarT, IdxT>::RealT;
43-
using BusT = BaseBus<ScalarT, IdxT>;
40+
using ScalarT = scalar_type;
41+
using IdxT = index_type;
42+
using RealT = typename ModelEvaluatorImpl<ScalarT, IdxT>::RealT;
43+
using BusT = BaseBus<ScalarT, IdxT>;
4444

4545
Generator2(BusT* bus);
4646
virtual ~Generator2();

GridKit/Solver/Dynamic/Ida.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ namespace AnalysisManager
266266
* repeated time-step arithmetic.
267267
*/
268268
template <typename scalar_type, typename index_type>
269-
typename Ida<scalar_type, index_type>::RealT Ida<scalar_type, IdxT>::getMonitorTime(RealT tf, RealT dt_monitor, int step, int nsteps) const
269+
typename Ida<scalar_type, index_type>::RealT Ida<scalar_type, index_type>::getMonitorTime(RealT tf, RealT dt_monitor, int step, int nsteps) const
270270
{
271271
return step == nsteps ? tf : std::fma((RealT) step, dt_monitor, t_init_);
272272
}

GridKit/Solver/Dynamic/Ida.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace AnalysisManager
4343
template <typename scalar_type, typename index_type>
4444
class Ida : public DynamicSolver<scalar_type, index_type>
4545
{
46-
using DynamicSolver<ScalarT, IdxT>::model_;
46+
using DynamicSolver<scalar_type, index_type>::model_;
4747

4848
public:
4949
using ScalarT = scalar_type;

GridKit/Solver/Dynamic/Native/FixedStep.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace AnalysisManager
1717
template <typename real_type>
1818
class FixedStep : public StepController<real_type>
1919
{
20+
using RealT = real_type;
21+
2022
StepControl<RealT> nextStep(RealT err, StepControl<RealT> prev_step, uint8_t method_order) final;
2123

2224
/**

GridKit/Solver/Dynamic/Rosenbrock.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ namespace AnalysisManager
229229
*/
230230
template <typename scalar_type, typename index_type>
231231
Rosenbrock<scalar_type, index_type>::Rosenbrock(Tableau&& tab,
232-
GridKit::Model::Evaluator<ScalarT, IdxT>* model,
233-
GridKit::LinearAlgebra::LinearSolver<ScalarT, IdxT>& lin_solver,
234-
GridKit::LinearAlgebra::VectorHandler<ScalarT, IdxT>& vector_handler,
235-
const ErrorNorm<ScalarT, IdxT>* err_norm,
236-
GridKit::memory::MemorySpace memspace)
232+
GridKit::Model::Evaluator<ScalarT, IdxT>* model,
233+
GridKit::LinearAlgebra::LinearSolver<ScalarT, IdxT>& lin_solver,
234+
GridKit::LinearAlgebra::VectorHandler<ScalarT, IdxT>& vector_handler,
235+
const ErrorNorm<ScalarT, IdxT>* err_norm,
236+
GridKit::memory::MemorySpace memspace)
237237
: tab_(std::move(tab)),
238238
model_(model),
239239
lin_solver_(lin_solver),
@@ -401,10 +401,10 @@ namespace AnalysisManager
401401
*/
402402
template <typename scalar_type, typename index_type>
403403
int Rosenbrock<scalar_type, index_type>::integrate(const std::vector<RealT>& out_times,
404-
StepController<RealT>& step_controller,
405-
Parameters params,
406-
std::optional<std::function<void(RealT)>> out_cb,
407-
std::optional<std::function<void(const StepInfo&)>> step_cb)
404+
StepController<RealT>& step_controller,
405+
Parameters params,
406+
std::optional<std::function<void(RealT)>> out_cb,
407+
std::optional<std::function<void(const StepInfo&)>> step_cb)
408408
{
409409
constexpr RealT ONE = GridKit::ONE<RealT>;
410410
constexpr RealT ZERO = GridKit::ZERO<RealT>;
@@ -781,7 +781,7 @@ namespace AnalysisManager
781781
* @return A reference to the estimated error.
782782
*/
783783
template <typename scalar_type, typename index_type>
784-
Rosenbrock<scalar_type, index_type>::State& Rosenbrock<ScalarT, IdxT>::errorEstimate() const
784+
Rosenbrock<scalar_type, index_type>::State& Rosenbrock<scalar_type, index_type>::errorEstimate() const
785785
{
786786
// Test to see if the tableau allows us to use a stage as the error estimate,
787787
// avoiding extra computation.

GridKit/Solver/Optimization/DynamicConstraint.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace AnalysisManager
2525
*
2626
*/
2727
template <typename scalar_type, typename index_type>
28-
class DynamicConstraint : public Ipopt::TNLP, public OptimizationSolver<ScalarT, IdxT>
28+
class DynamicConstraint : public Ipopt::TNLP, public OptimizationSolver<scalar_type, index_type>
2929
{
3030
using OptimizationSolver<scalar_type, index_type>::integrator_;
3131
using OptimizationSolver<scalar_type, index_type>::model_;

GridKit/Utilities/FileIO.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace GridKit
3434
*/
3535
template <typename scalar_type>
3636
void setLookupTable(std::vector<std::vector<scalar_type>>& table,
37-
std::istream& idata,
37+
std::istream& idata,
3838
scalar_type& ti,
3939
scalar_type& tf)
4040
{

0 commit comments

Comments
 (0)