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

Method init_id

cvxpy/cvxcore/src/ProblemData.hpp:36–52  ·  view source on GitHub ↗

Initialize TensorV/I/J for the given parameter.

Source from the content-addressed store, hash-verified

34
35 // Initialize TensorV/I/J for the given parameter.
36 void init_id(int new_param_id, int param_size) {
37 assert(TensorV.count(new_param_id) == 0);
38 std::vector<std::vector<double> > vecV(param_size);
39 std::vector<std::vector<int> > vecI(param_size);
40 std::vector<std::vector<int> > vecJ(param_size);
41 for (int i = 0; i < param_size; ++i) {
42 std::vector<double> elemV;
43 std::vector<int> elemI;
44 std::vector<int> elemJ;
45 vecV.push_back(elemV);
46 vecI.push_back(elemI);
47 vecJ.push_back(elemJ);
48 }
49 TensorV[new_param_id] = vecV;
50 TensorI[new_param_id] = vecI;
51 TensorJ[new_param_id] = vecJ;
52 }
53
54 /*******************************************
55 * The functions below return problemData vectors as contiguous 1d

Callers 1

init_data_tensorFunction · 0.45

Calls 2

countMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected