MCPcopy Create free account
hub / github.com/cvxpy/cvxpy / init_data_tensor

Function init_data_tensor

cvxpy/cvxcore/src/cvxcore.cpp:133–144  ·  view source on GitHub ↗

Create a tensor with a problem data entry for each parameter, as a vector with entries equal to the parameter size.

Source from the content-addressed store, hash-verified

131// Create a tensor with a problem data entry for each parameter,
132// as a vector with entries equal to the parameter size.
133ProblemData init_data_tensor(std::map<int, int> param_to_size) {
134 ProblemData output;
135 // Get CONSTANT_ID.
136 output.init_id(CONSTANT_ID, 1);
137 typedef std::map<int, int>::iterator it_type;
138 for (it_type it = param_to_size.begin(); it != param_to_size.end(); ++it) {
139 int param_id = it->first;
140 int param_size = it->second;
141 output.init_id(param_id, param_size);
142 }
143 return output;
144}
145
146/* function: build_matrix
147 *

Callers 1

build_matrixFunction · 0.85

Calls 3

init_idMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected