src/CVXcanon.cpp
ProblemData build_matrix(std::vector< LinOp* > constraints,
                         std::map<int, int> id_to_col) {
	ProblemData prob_data;
	int num_rows = get_total_constraint_length(constraints);
	prob_data.const_vec = std::vector<double> (num_rows, 0);
	prob_data.id_to_col = id_to_col;
	int vert_offset = 0;
	int horiz_offset  = 0;

	/* Build matrix one constraint at a time */
	for (unsigned i = 0; i < constraints.size(); i++){
		LinOp constr = *constraints[i];
		process_constraint(constr, prob_data.V, prob_data.I, prob_data.J,
		                   prob_data.const_vec, vert_offset,
		                   prob_data.id_to_col, horiz_offset);
		prob_data.const_to_row[i] = vert_offset;
		vert_offset += constr.size[0] * constr.size[1];
	}
	return prob_data;
}
/* function: build_matrix
*
* Description: Given a list of linear operations, this function returns a data
* structure containing a sparse matrix representation of the cone program.
*
* Input: std::vector<LinOp *> constraints, our list of constraints represented
* as a linear operation tree
*
* Output: prob_data, a data structure which contains a sparse representation
* of the coefficient matrix, a dense representation of the constant vector,
* and maps containing our mapping from variables, and a map from the rows of our
* matrix to their corresponding constraint.
*
*/
build_matrix
Description: Given a list of linear operations, this function returns a data
structure containing a sparse matrix representation of the cone program.

:vector constraints, our list of constraints represented
as a linear operation tree

prob_data, a data structure which contains a sparse representation
of the coefficient matrix, a dense representation of the constant vector,
and maps containing our mapping from variables, and a map from the rows of our
matrix to their corresponding constraint.
build_matrix Description : Given a list of linear operations this function returns a data structure containing a sparse matrix representation of the cone program . : vector constraints our list of constraints represented as a linear operation tree prob_data a data structure which contains a sparse representation of the coefficient matrix a dense representation of the constant vector and maps containing our mapping from variables and a map from the rows of our matrix to their corresponding constraint .
ProblemData build_matrix(std::vector< LinOp* > constraints,
                         std::map<int, int> id_to_col) {
	ProblemData prob_data;
	int num_rows = get_total_constraint_length(constraints);
	prob_data.const_vec = std::vector<double> (num_rows, 0);
	prob_data.id_to_col = id_to_col;
	int vert_offset = 0;
	int horiz_offset  = 0;
	for (unsigned i = 0; i < constraints.size(); i++){
		LinOp constr = *constraints[i];
		process_constraint(constr, prob_data.V, prob_data.I, prob_data.J,
		                   prob_data.const_vec, vert_offset,
		                   prob_data.id_to_col, horiz_offset);
		prob_data.const_to_row[i] = vert_offset;
		vert_offset += constr.size[0] * constr.size[1];
	}
	return prob_data;
}
ProblemData build_matrix ( std :: vector < LinOp * > constraints , std :: map < int , int > id_to_col ) { ProblemData prob_data ; int num_rows = get_total_constraint_length ( constraints ) ; prob_data . const_vec = std :: vector < double > ( num_rows , 0 ) ; prob_data . id_to_col = id_to_col ; int vert_offset = 0 ; int horiz_offset = 0 ; for ( unsigned i = 0 ; i < constraints . size ( ) ; i ++ ) { LinOp constr = * constraints [ i ] ; process_constraint ( constr , prob_data . V , prob_data . I , prob_data . J , prob_data . const_vec , vert_offset , prob_data . id_to_col , horiz_offset ) ; prob_data . const_to_row [ i ] = vert_offset ; vert_offset += constr . size [ 0 ] * constr . size [ 1 ] ; } return prob_data ; }
function: build_matrix
Description: Given a list of linear operations, this function returns a data
structure containing a sparse matrix representation of the cone program.
function : build_matrix Description : Given a list of linear operations this function returns a data structure containing a sparse matrix representation of the cone program .
/* Build matrix one constraint at a time */