Skip to content

Commit 0e03058

Browse files
committed
remove Unicode characters that causes display issues on Windows
1 parent 794bcde commit 0e03058

12 files changed

+139
-139
lines changed

examples/advanced_integrators_usage.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ void exponential_decay(double t, const std::vector<double>& y, std::vector<doubl
1414
dydt[0] = -y[0];
1515
}
1616

17-
// 2. Van der Pol oscillator: d²x/dt² - μ(1-x²)dx/dt + x = 0
17+
// 2. Van der Pol oscillator: d^2x/dt^2 - mu*(1-x^2)*dx/dt + x = 0
1818
class VanderPolOscillator {
1919
public:
2020
explicit VanderPolOscillator(double mu) : mu_(mu) {}
2121

2222
void operator()(double t, const std::vector<double>& y, std::vector<double>& dydt) {
2323
dydt[0] = y[1]; // dx/dt = v
24-
dydt[1] = mu_ * (1 - y[0]*y[0]) * y[1] - y[0]; // dv/dt = μ(1-x²)v - x
24+
dydt[1] = mu_ * (1 - y[0]*y[0]) * y[1] - y[0]; // dv/dt = mu*(1-x^2)*v - x
2525
}
2626

2727
private:
@@ -34,9 +34,9 @@ void lorenz_system(double t, const std::vector<double>& y, std::vector<double>&
3434
const double rho = 28.0;
3535
const double beta = 8.0/3.0;
3636

37-
dydt[0] = sigma * (y[1] - y[0]); // dx/dt = σ(y - x)
38-
dydt[1] = y[0] * (rho - y[2]) - y[1]; // dy/dt = x - z) - y
39-
dydt[2] = y[0] * y[1] - beta * y[2]; // dz/dt = xy - βz
37+
dydt[0] = sigma * (y[1] - y[0]); // dx/dt = sigma*(y - x)
38+
dydt[1] = y[0] * (rho - y[2]) - y[1]; // dy/dt = x*(rho - z) - y
39+
dydt[2] = y[0] * y[1] - beta * y[2]; // dz/dt = xy - beta*z
4040
}
4141

4242
// 4. Stiff test problem: Robertson chemical kinetics
@@ -70,7 +70,7 @@ double time_integrator(Integrator& integrator, std::vector<double>& y,
7070
std::cout << std::setw(12) << std::scientific << std::setprecision(4) << y[i];
7171
if (i < y.size() - 1) std::cout << ", ";
7272
}
73-
std::cout << "] (Time: " << duration.count() << " μs)";
73+
std::cout << "] (Time: " << duration.count() << " us)";
7474

7575
if (!completed) {
7676
std::cout << " [TIMEOUT]";
@@ -126,8 +126,8 @@ void demonstrate_exponential_decay() {
126126
}
127127

128128
void demonstrate_van_der_pol() {
129-
std::cout << "\n=== Van der Pol Oscillator: μ = 5 (moderately stiff) ===" << std::endl;
130-
std::cout << "x''(t) - μ(1-x²)x'(t) + x(t) = 0" << std::endl;
129+
std::cout << "\n=== Van der Pol Oscillator: mu = 5 (moderately stiff) ===" << std::endl;
130+
std::cout << "x''(t) - mu*(1-x^2)*x'(t) + x(t) = 0" << std::endl;
131131
std::cout << "Initial conditions: x(0) = 1, x'(0) = 0" << std::endl << std::endl;
132132

133133
VanderPolOscillator vdp(5.0);
@@ -185,8 +185,8 @@ void demonstrate_van_der_pol() {
185185

186186
void demonstrate_lorenz_system() {
187187
std::cout << "\n=== Lorenz System (Chaotic) ===" << std::endl;
188-
std::cout << "dx/dt = σ(y - x), dy/dt = x - z) - y, dz/dt = xy - βz" << std::endl;
189-
std::cout << "σ = 10, ρ = 28, β = 8/3" << std::endl;
188+
std::cout << "dx/dt = sigma*(y - x), dy/dt = x*(rho - z) - y, dz/dt = xy - beta*z" << std::endl;
189+
std::cout << "sigma = 10, rho = 28, beta = 8/3" << std::endl;
190190
std::cout << "Initial conditions: x(0) = 1, y(0) = 1, z(0) = 1" << std::endl << std::endl;
191191

192192
double t_start = 0.0, t_end = 0.5, dt = 0.01; // Reduced from 5.0 to 0.5 for faster execution
@@ -295,13 +295,13 @@ int main() {
295295
demonstrate_adaptive_features();
296296

297297
std::cout << "\n=== Summary ===" << std::endl;
298-
std::cout << " RK4: Simple, fixed-step 4th order method" << std::endl;
299-
std::cout << " RK23: Adaptive 3rd order with embedded error estimation" << std::endl;
300-
std::cout << " RK45: Adaptive 5th order Dormand-Prince (scipy default)" << std::endl;
301-
std::cout << " DOP853: High-accuracy 8th order for demanding problems" << std::endl;
302-
std::cout << " Radau: Implicit 5th order for stiff systems (not yet implemented)" << std::endl;
303-
std::cout << " BDF: Variable-order implicit multistep for stiff systems" << std::endl;
304-
std::cout << " LSODA: Automatic method switching (Adams BDF)" << std::endl;
298+
std::cout << "[OK] RK4: Simple, fixed-step 4th order method" << std::endl;
299+
std::cout << "[OK] RK23: Adaptive 3rd order with embedded error estimation" << std::endl;
300+
std::cout << "[OK] RK45: Adaptive 5th order Dormand-Prince (scipy default)" << std::endl;
301+
std::cout << "[OK] DOP853: High-accuracy 8th order for demanding problems" << std::endl;
302+
std::cout << "- Radau: Implicit 5th order for stiff systems (not yet implemented)" << std::endl;
303+
std::cout << "[OK] BDF: Variable-order implicit multistep for stiff systems" << std::endl;
304+
std::cout << "[OK] LSODA: Automatic method switching (Adams <-> BDF)" << std::endl;
305305

306306
} catch (const std::exception& e) {
307307
std::cerr << "Error: " << e.what() << std::endl;

examples/parallelism_usage_demo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void modern_parallel_integration_example() {
4545
auto end_time = std::chrono::high_resolution_clock::now();
4646
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);
4747

48-
std::cout << " Parallel integration completed in " << duration.count() << " μs!" << std::endl;
48+
std::cout << "[PASS] Parallel integration completed in " << duration.count() << " us!" << std::endl;
4949
std::cout << "Result for initial condition 10: [" << initial_conditions[10][0]
5050
<< ", " << initial_conditions[10][1] << "]" << std::endl;
5151
}
@@ -103,8 +103,8 @@ void demonstrate_realtime_control() {
103103
auto end_time = std::chrono::high_resolution_clock::now();
104104
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time);
105105

106-
std::cout << "Parallel control completed in " << duration.count() << " μs" << std::endl;
107-
std::cout << "Average per joint: " << duration.count() / joint_states.size() << " μs" << std::endl;
106+
std::cout << "Parallel control completed in " << duration.count() << " us" << std::endl;
107+
std::cout << "Average per joint: " << duration.count() / joint_states.size() << " us" << std::endl;
108108

109109
// Advanced async approach using diffeq async capabilities
110110
std::cout << "\n--- Advanced Async Approach ---" << std::endl;

examples/rk4_integrator_usage.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ void exponential_decay(double t, const std::vector<double>& y, std::vector<doubl
1313
}
1414

1515
// Example 2: Lorenz attractor (simplified)
16-
// dx/dt = σ(y - x)
17-
// dy/dt = x - z) - y
18-
// dz/dt = xy - βz
16+
// dx/dt = sigma*(y - x)
17+
// dy/dt = x*(rho - z) - y
18+
// dz/dt = xy - beta*z
1919
void lorenz_system(double t, const std::vector<double>& state, std::vector<double>& dydt) {
2020
const double sigma = 10.0;
2121
const double rho = 28.0;
@@ -31,14 +31,14 @@ void lorenz_system(double t, const std::vector<double>& state, std::vector<doubl
3131
}
3232

3333
// Example 3: Damped harmonic oscillator
34-
// d²x/dt² + (dx/dt) + ω²x = 0
34+
// d^2x/dt^2 + 2*gamma*(dx/dt) + omega^2*x = 0
3535
// State: [x, dx/dt]
3636
void damped_oscillator(float t, const std::array<float, 2>& state, std::array<float, 2>& dydt) {
3737
const float gamma = 0.1f; // damping coefficient
38-
const float omega_sq = 4.0f; // ω² = 4
38+
const float omega_sq = 4.0f; // omega^2 = 4
3939

4040
dydt[0] = state[1]; // dx/dt = v
41-
dydt[1] = -2.0f * gamma * state[1] - omega_sq * state[0]; // dv/dt = -2γv - ω²x
41+
dydt[1] = -2.0f * gamma * state[1] - omega_sq * state[0]; // dv/dt = -2*gamma*v - omega^2*x
4242
}
4343

4444
int main() {

examples/test_rk4_only.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ int main() {
1515
integrator.set_time(0.0);
1616
integrator.integrate(y, 0.1, 1.0);
1717
std::cout << "RK4 result: " << y[0] << " (expected: " << std::exp(-1.0) << ")" << std::endl;
18-
std::cout << " RK4 test passed!" << std::endl;
19-
} catch (const std::exception& e) {
20-
std::cout << " RK4 test failed: " << e.what() << std::endl;
18+
std::cout << "[PASS] RK4 test passed!" << std::endl;
19+
} catch (const std::exception& e) {
20+
std::cout << "[FAIL] RK4 test failed: " << e.what() << std::endl;
2121
return 1;
2222
}
2323

simple_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main() {
2626
integrator.set_time(t_start);
2727
integrator.integrate(y, dt, t_end);
2828
std::cout << std::setprecision(6) << y[0] << std::endl;
29-
std::cout << " Basic RK4 test successful!" << std::endl;
29+
std::cout << "[PASS] Basic RK4 test successful!" << std::endl;
3030
} catch (const std::exception& e) {
3131
std::cout << "Failed: " << e.what() << std::endl;
3232
return 1;

test/integration/test_standard_parallelism.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void test_std_execution_multiple_conditions() {
9393
double tolerance = 0.1;
9494
assert(std::abs(states[0][0] - expected) < tolerance);
9595

96-
std::cout << " std::execution multiple conditions test passed\n";
96+
std::cout << "[PASS] std::execution multiple conditions test passed\n";
9797
}
9898

9999
void test_parameter_sweep() {
@@ -151,7 +151,7 @@ void test_parameter_sweep() {
151151
assert(results[1][0] > results[2][0]);
152152
assert(results[2][0] > results[3][0]);
153153

154-
std::cout << " Parameter sweep test passed (flexibility beyond initial conditions)\n";
154+
std::cout << "[PASS] Parameter sweep test passed (flexibility beyond initial conditions)\n";
155155
}
156156

157157
void test_different_integrators() {
@@ -236,7 +236,7 @@ void test_different_integrators() {
236236
assert(euler_results[0][0] > 0.1 && euler_results[0][0] < 1.0);
237237
assert(rk2_results[0][0] > 0.1 && rk2_results[0][0] < 1.0);
238238

239-
std::cout << " Different integrators test passed\n";
239+
std::cout << "[PASS] Different integrators test passed\n";
240240
}
241241

242242
#ifdef _OPENMP
@@ -274,7 +274,7 @@ void test_openmp() {
274274
double tolerance = 0.1;
275275
assert(std::abs(states[0][0] - expected) < tolerance);
276276

277-
std::cout << " OpenMP integration test passed\n";
277+
std::cout << "[PASS] OpenMP integration test passed\n";
278278
}
279279
#endif
280280

@@ -298,8 +298,8 @@ void test_hardware_detection() {
298298
#endif
299299

300300
std::cout << "Hardware/Library Detection (using standard functions):\n";
301-
std::cout << "- std::execution: " << (std_execution_available ? "" : "") << "\n";
302-
std::cout << "- OpenMP: " << (openmp_available ? "" : "");
301+
std::cout << "- std::execution: " << (std_execution_available ? "[OK]" : "[FAIL]") << "\n";
302+
std::cout << "- OpenMP: " << (openmp_available ? "[OK]" : "[FAIL]");
303303
if (openmp_available) {
304304
std::cout << " (" << num_threads << " threads)";
305305
}
@@ -309,18 +309,18 @@ void test_hardware_detection() {
309309
std::cout << "- GPU: Use cudaGetDeviceCount() for CUDA detection\n";
310310
std::cout << "- TBB: Use tbb::task_scheduler_init() for TBB detection\n";
311311

312-
std::cout << " Hardware detection test passed (using standard library functions)\n";
312+
std::cout << "[PASS] Hardware detection test passed (using standard library functions)\n";
313313
}
314314

315315
int main() {
316316
std::cout << "=================================================================\n";
317317
std::cout << "Testing Standard Library Parallelism Integration\n";
318318
std::cout << "=================================================================\n";
319319
std::cout << "This demonstrates the approach requested:\n";
320-
std::cout << " Use standard libraries instead of custom parallel classes\n";
321-
std::cout << " Show flexibility beyond just initial conditions\n";
322-
std::cout << " No custom 'facade' classes needed\n";
323-
std::cout << " Standard library hardware detection\n\n";
320+
std::cout << "- Use standard libraries instead of custom parallel classes\n";
321+
std::cout << "- Show flexibility beyond just initial conditions\n";
322+
std::cout << "- No custom 'facade' classes needed\n";
323+
std::cout << "- Standard library hardware detection\n\n";
324324

325325
try {
326326
test_hardware_detection();
@@ -340,18 +340,18 @@ int main() {
340340
std::cout << "\n";
341341
#endif
342342

343-
std::cout << " All standard library parallelism tests passed!\n";
343+
std::cout << "[PASS] All standard library parallelism tests passed!\n";
344344
std::cout << "\nKey Benefits Demonstrated:\n";
345-
std::cout << "• ✓ No custom 'facade' classes - use proven standard libraries\n";
346-
std::cout << "• ✓ std::execution::par for simple parallel loops\n";
347-
std::cout << "• ✓ OpenMP for CPU-intensive computation\n";
348-
std::cout << "• ✓ Flexibility: vary parameters, integrators, callbacks\n";
349-
std::cout << "• ✓ Standard library hardware detection\n";
350-
std::cout << "• ✓ Choose the right tool for each specific use case\n";
351-
std::cout << "• ✓ GPU support via Thrust (no custom kernels needed)\n";
345+
std::cout << "- [OK] No custom 'facade' classes - use proven standard libraries\n";
346+
std::cout << "- [OK] std::execution::par for simple parallel loops\n";
347+
std::cout << "- [OK] OpenMP for CPU-intensive computation\n";
348+
std::cout << "- [OK] Flexibility: vary parameters, integrators, callbacks\n";
349+
std::cout << "- [OK] Standard library hardware detection\n";
350+
std::cout << "- [OK] Choose the right tool for each specific use case\n";
351+
std::cout << "- [OK] GPU support via Thrust (no custom kernels needed)\n";
352352

353353
} catch (const std::exception& e) {
354-
std::cerr << " Test failed: " << e.what() << std::endl;
354+
std::cerr << "[FAIL] Test failed: " << e.what() << std::endl;
355355
return 1;
356356
}
357357

test/unit/test_high_performance_sde.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ TEST_CASE("Convenience factory functions", "[sde_multithreading]") {
391391
auto latency = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start);
392392

393393
REQUIRE(noise.increments.size() == 1);
394-
REQUIRE(latency.count() < 100000); // Should be sub-100μs
394+
REQUIRE(latency.count() < 100000); // Should be sub-100us
395395
}
396396

397397
SECTION("create_numa_system") {

test/unit/test_output_facilities.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ bool test_interpolation_decorator() {
5959
assert(times.size() == 11);
6060
assert(states.size() == 11);
6161

62-
std::cout << " PASSED\n";
62+
std::cout << "[PASS] PASSED\n";
6363
return true;
6464

6565
} catch (const std::exception& e) {
66-
std::cout << " FAILED: " << e.what() << "\n";
66+
std::cout << "[FAIL] FAILED: " << e.what() << "\n";
6767
return false;
6868
}
6969
}
@@ -113,11 +113,11 @@ bool test_event_decorator() {
113113
assert(stats.total_events > 0);
114114
assert(stats.sensor_events > 0);
115115

116-
std::cout << " PASSED (events: " << stats.total_events << ")\n";
116+
std::cout << "[PASS] PASSED (events: " << stats.total_events << ")\n";
117117
return true;
118118

119119
} catch (const std::exception& e) {
120-
std::cout << " FAILED: " << e.what() << "\n";
120+
std::cout << "[FAIL] FAILED: " << e.what() << "\n";
121121
return false;
122122
}
123123
}
@@ -148,17 +148,17 @@ bool test_interprocess_decorator() {
148148
assert(ipc_decorator->config().direction == IPCDirection::PRODUCER);
149149
assert(ipc_decorator->config().buffer_size == 1024);
150150

151-
std::cout << " PASSED (IPC created)\n";
151+
std::cout << "[PASS] PASSED (IPC created)\n";
152152
return true;
153153

154154
} catch (const std::runtime_error& e) {
155155
// IPC setup failed - this is expected in many test environments
156-
std::cout << " PASSED (IPC unavailable, but decorator created)\n";
156+
std::cout << "[PASS] PASSED (IPC unavailable, but decorator created)\n";
157157
return true;
158158
}
159159

160160
} catch (const std::exception& e) {
161-
std::cout << " FAILED: " << e.what() << "\n";
161+
std::cout << "[FAIL] FAILED: " << e.what() << "\n";
162162
return false;
163163
}
164164
}
@@ -203,11 +203,11 @@ bool test_sde_synchronization() {
203203
auto stats = synchronizer.get_statistics();
204204
assert(stats.noise_requests > 0);
205205

206-
std::cout << " PASSED\n";
206+
std::cout << "[PASS] PASSED\n";
207207
return true;
208208

209209
} catch (const std::exception& e) {
210-
std::cout << " FAILED: " << e.what() << "\n";
210+
std::cout << "[FAIL] FAILED: " << e.what() << "\n";
211211
return false;
212212
}
213213
}
@@ -301,11 +301,11 @@ bool test_configuration_validation() {
301301
assert(caught_exception);
302302
}
303303

304-
std::cout << " PASSED\n";
304+
std::cout << "[PASS] PASSED\n";
305305
return true;
306306

307307
} catch (const std::exception& e) {
308-
std::cout << " FAILED: " << e.what() << "\n";
308+
std::cout << "[FAIL] FAILED: " << e.what() << "\n";
309309
return false;
310310
}
311311
}
@@ -341,10 +341,10 @@ int main() {
341341
std::cout << "Test Results: " << passed << "/" << total << " passed\n";
342342

343343
if (passed == total) {
344-
std::cout << "🎉 All tests passed!\n";
344+
std::cout << "[PASS] All tests passed!\n";
345345
return 0;
346346
} else {
347-
std::cout << " Some tests failed.\n";
347+
std::cout << "[FAIL] Some tests failed.\n";
348348
return 1;
349349
}
350350
}

test/unit/test_rk4_integrator.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ void exponential_decay_float(float t, const std::vector<float>& y, std::vector<f
3333
dydt[0] = -y[0];
3434
}
3535

36-
// Harmonic oscillator: d²x/dt² = -ω²x
36+
// Harmonic oscillator: d^2x/dt^2 = -omega^2*x
3737
// State vector: [x, dx/dt]
38-
// dy/dt = [y[1], -ω²*y[0]]
38+
// dy/dt = [y[1], -omega^2*y[0]]
3939
void harmonic_oscillator(double t, const std::vector<double>& y, std::vector<double>& dydt) {
40-
const double omega_squared = 1.0; // ω² = 1
40+
const double omega_squared = 1.0; // omega^2 = 1
4141
dydt[0] = y[1]; // dx/dt = v
42-
dydt[1] = -omega_squared * y[0]; // dv/dt = -ω²x
42+
dydt[1] = -omega_squared * y[0]; // dv/dt = -omega^2*x
4343
}
4444

4545
bool test_rk4_double() {
@@ -163,17 +163,17 @@ int main() {
163163

164164
std::cout << "\n=== Test Results ===" << std::endl;
165165
if (all_passed) {
166-
std::cout << "🎉 All tests PASSED!" << std::endl;
166+
std::cout << "[PASS] All tests PASSED!" << std::endl;
167167
return 0;
168168
} else {
169-
std::cout << " Some tests FAILED!" << std::endl;
169+
std::cout << "[FAIL] Some tests FAILED!" << std::endl;
170170
return 1;
171171
}
172172
} catch (const std::exception& e) {
173-
std::cerr << " Test execution failed with exception: " << e.what() << std::endl;
173+
std::cerr << "[FAIL] Test execution failed with exception: " << e.what() << std::endl;
174174
return 1;
175175
} catch (...) {
176-
std::cerr << " Test execution failed with unknown exception" << std::endl;
176+
std::cerr << "[FAIL] Test execution failed with unknown exception" << std::endl;
177177
return 1;
178178
}
179179
}

0 commit comments

Comments
 (0)