Skip to content

Commit

Permalink
Now passing HighsSparseMatrix matrix to getSubVectors and getSubVecto…
Browse files Browse the repository at this point in the history
…rsTranspose by reference, not value; formatted
  • Loading branch information
jajhall committed Jan 10, 2025
1 parent 8787beb commit a5f01ca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,14 @@ class Highs {
return ekk_instance_.primal_phase1_dual_;
}

/**
* @brief Development methods
*/
HighsInt defineClock(const char* name) {
return this->timer_.clock_def(name);
}
void writeAllClocks() { this->timer_.writeAllClocks(); }

// Start of deprecated methods

std::string compilationDate() const { return "deprecated"; }
Expand Down
5 changes: 2 additions & 3 deletions src/lp_data/HighsLpUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "util/HighsCDouble.h"
#include "util/HighsMatrixUtils.h"
#include "util/HighsSort.h"
#include "util/HighsTimer.h"

using std::fabs;
using std::max;
Expand Down Expand Up @@ -3081,7 +3080,7 @@ void removeRowsOfCountOne(const HighsLogOptions& log_options, HighsLp& lp) {
void getSubVectors(const HighsIndexCollection& index_collection,
const HighsInt data_dim, const double* data0,
const double* data1, const double* data2,
const HighsSparseMatrix matrix, HighsInt& num_sub_vector,
const HighsSparseMatrix& matrix, HighsInt& num_sub_vector,
double* sub_vector_data0, double* sub_vector_data1,
double* sub_vector_data2, HighsInt& sub_matrix_num_nz,
HighsInt* sub_matrix_start, HighsInt* sub_matrix_index,
Expand Down Expand Up @@ -3137,7 +3136,7 @@ void getSubVectors(const HighsIndexCollection& index_collection,
void getSubVectorsTranspose(const HighsIndexCollection& index_collection,
const HighsInt data_dim, const double* data0,
const double* data1, const double* data2,
const HighsSparseMatrix matrix,
const HighsSparseMatrix& matrix,
HighsInt& num_sub_vector, double* sub_vector_data0,
double* sub_vector_data1, double* sub_vector_data2,
HighsInt& sub_matrix_num_nz,
Expand Down
4 changes: 2 additions & 2 deletions src/lp_data/HighsLpUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void removeRowsOfCountOne(const HighsLogOptions& log_options, HighsLp& lp);
void getSubVectors(const HighsIndexCollection& index_collection,
const HighsInt data_dim, const double* data0,
const double* data1, const double* data2,
const HighsSparseMatrix matrix, HighsInt& num_sub_vector,
const HighsSparseMatrix& matrix, HighsInt& num_sub_vector,
double* sub_vector_data0, double* sub_vector_data1,
double* sub_vector_data2, HighsInt& sub_matrix_num_nz,
HighsInt* sub_matrix_start, HighsInt* sub_matrix_index,
Expand All @@ -287,7 +287,7 @@ void getSubVectors(const HighsIndexCollection& index_collection,
void getSubVectorsTranspose(const HighsIndexCollection& index_collection,
const HighsInt data_dim, const double* data0,
const double* data1, const double* data2,
const HighsSparseMatrix matrix,
const HighsSparseMatrix& matrix,
HighsInt& num_sub_vector, double* sub_vector_data0,
double* sub_vector_data1, double* sub_vector_data2,
HighsInt& sub_matrix_num_nz,
Expand Down
10 changes: 10 additions & 0 deletions src/util/HighsTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ class HighsTimer {
}
}

/**
* @brief write all clocks
*/
void writeAllClocks() {
for (HighsInt i = 0; i < num_clock; i++)
if (clock_num_call[i])
printf("Time %7.5f for %9d calls of clock %3d: %s\n", clock_time[i],
int(clock_num_call[i]), int(i), clock_names[i].c_str());
}

/**
* @brief Start a clock
*/
Expand Down

0 comments on commit a5f01ca

Please sign in to comment.