src/CVXcanon.cpp
void build_matrix_2(std::vector< LinOp* > constraints,
		    std::map<int, int> id_to_col,
		    Rcpp::XPtr<ProblemData> prob_data) {
#ifdef _R_DEBUG_
  Rcpp::Rcout << "In Build_matrix_2" <<std::endl;    
#endif  

  int num_rows = get_total_constraint_length(constraints);
#ifdef _R_DEBUG_
  Rcpp::Rcout << "In Build_matrix_2 after length constraints " << num_rows <<std::endl;    
#endif  

  prob_data->const_vec = std::vector<double> (num_rows, 0);
#ifdef _R_DEBUG_
  Rcpp::Rcout << "Build_matrix_2 before id_to_col" <<std::endl;    
#endif  

  prob_data->id_to_col = id_to_col;
#ifdef _R_DEBUG_
  Rcpp::Rcout << "Build_matrix_2 after id_to_col" <<std::endl;    
#endif  

  int vert_offset = 0;
  int horiz_offset  = 0;

  /* Build matrix one constraint at a time */
  for (unsigned i = 0; i < constraints.size(); i++){
#ifdef _R_DEBUG_
    Rcpp::Rcout << "In Build_matrix_2 loop " << i << std::endl;    
#endif  
    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];
  }

}
/* 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 and an Rcpp XPtr to a newly created ProblemData instance,
* 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.
* Output: None
*
*/
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 and an Rcpp XPtr to a newly created ProblemData instance,
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.
Output: None
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 and an Rcpp XPtr to a newly created ProblemData instance 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 . Output : None
void build_matrix_2(std::vector< LinOp* > constraints,
		    std::map<int, int> id_to_col,
		    Rcpp::XPtr<ProblemData> prob_data) {
#ifdef _R_DEBUG_
  Rcpp::Rcout << "In Build_matrix_2" <<std::endl;    
#endif  
  int num_rows = get_total_constraint_length(constraints);
#ifdef _R_DEBUG_
  Rcpp::Rcout << "In Build_matrix_2 after length constraints " << num_rows <<std::endl;    
#endif  
  prob_data->const_vec = std::vector<double> (num_rows, 0);
#ifdef _R_DEBUG_
  Rcpp::Rcout << "Build_matrix_2 before id_to_col" <<std::endl;    
#endif  
  prob_data->id_to_col = id_to_col;
#ifdef _R_DEBUG_
  Rcpp::Rcout << "Build_matrix_2 after id_to_col" <<std::endl;    
#endif  
  int vert_offset = 0;
  int horiz_offset  = 0;
  for (unsigned i = 0; i < constraints.size(); i++){
#ifdef _R_DEBUG_
    Rcpp::Rcout << "In Build_matrix_2 loop " << i << std::endl;    
#endif  
    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];
  }
}
void build_matrix_2 ( std :: vector < LinOp * > constraints , std :: map < int , int > id_to_col , Rcpp :: XPtr < ProblemData > prob_data ) { #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << std :: endl ; #endif int num_rows = get_total_constraint_length ( constraints ) ; #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << num_rows << std :: endl ; #endif prob_data -> const_vec = std :: vector < double > ( num_rows , 0 ) ; #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << std :: endl ; #endif prob_data -> id_to_col = id_to_col ; #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << std :: endl ; #endif int vert_offset = 0 ; int horiz_offset = 0 ; for ( unsigned i = 0 ; i < constraints . size ( ) ; i ++ ) { #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << i << std :: endl ; #endif 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 ] ; } }
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 */