| 80 | } |
| 81 | |
| 82 | int tiny_codegen_with_sensitivity(TinySolver* solver, const char* output_dir, |
| 83 | tinyMatrix* dK, tinyMatrix* dP, |
| 84 | tinyMatrix* dC1, tinyMatrix* dC2, int verbose) { |
| 85 | if (!solver) { |
| 86 | std::cout << "Error in tiny_codegen_with_sensitivity: solver is nullptr" << std::endl; |
| 87 | return 1; |
| 88 | } |
| 89 | |
| 90 | // Only store sensitivity matrices if adaptive rho is enabled |
| 91 | if (solver->settings->adaptive_rho) { |
| 92 | // Store the sensitivity matrices in the solver's cache |
| 93 | solver->cache->dKinf_drho = *dK; |
| 94 | solver->cache->dPinf_drho = *dP; |
| 95 | solver->cache->dC1_drho = *dC1; |
| 96 | solver->cache->dC2_drho = *dC2; |
| 97 | } |
| 98 | |
| 99 | // Call the regular codegen function which will now include the sensitivity matrices if adaptive_rho is enabled |
| 100 | return tiny_codegen(solver, output_dir, verbose); |
| 101 | } |
| 102 | |
| 103 | // Create code generation folder structure in whichever directory the executable calling tiny_codegen was called |
| 104 | int codegen_create_directories(const char* output_dir, int verbose) { |
nothing calls this directly
no test coverage detected