src/CVXcanon.cpp
void build_matrix_3(std::vector<LinOp*> constraints,
		    std::map<int, int> id_to_col,
		    std::vector<int> constr_offsets,
		    Rcpp::XPtr<ProblemData> prob_data){
  
  /* Function also verifies the offsets are valid */
  int num_rows = get_total_constraint_length(constraints, constr_offsets);
  prob_data->const_vec = std::vector<double> (num_rows, 0);
  prob_data->id_to_col = id_to_col;
  int horiz_offset  = 0;
  
  /* Build matrix one constraint at a time */
  for (unsigned i = 0; i < constraints.size(); i++){
    LinOp *constr = constraints[i];
#ifdef _R_DEBUG_
    Rcpp::Rcout << "Processing constraint " << i << std::endl;
#endif
    int vert_offset = constr_offsets[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;
  }
}
/*  See comment above for build_matrix. Requires specification of a vertical
    offset, VERT_OFFSET, for each constraint in the vector CONSTR_OFFSETS. 
    
    Valid CONSTR_OFFSETS assume that a vertical offset is provided for each 
    constraint and that the offsets are not overlapping. In particular, 
    the vertical offset for constraint i + the size of constraint i must be
    less than the vertical offset for constraint i+1.
*/
See comment above for build_matrix. Requires specification of a vertical
offset, VERT_OFFSET, for each constraint in the vector CONSTR_OFFSETS.

Valid CONSTR_OFFSETS assume that a vertical offset is provided for each
constraint and that the offsets are not overlapping. In particular,
the vertical offset for constraint i + the size of constraint i must be
less than the vertical offset for constraint i+1.
See comment above for build_matrix . Requires specification of a vertical offset VERT_OFFSET for each constraint in the vector CONSTR_OFFSETS . Valid CONSTR_OFFSETS assume that a vertical offset is provided for each constraint and that the offsets are not overlapping . In particular the vertical offset for constraint i + the size of constraint i must be less than the vertical offset for constraint i + 1 .
void build_matrix_3(std::vector<LinOp*> constraints,
		    std::map<int, int> id_to_col,
		    std::vector<int> constr_offsets,
		    Rcpp::XPtr<ProblemData> prob_data){
  int num_rows = get_total_constraint_length(constraints, constr_offsets);
  prob_data->const_vec = std::vector<double> (num_rows, 0);
  prob_data->id_to_col = id_to_col;
  int horiz_offset  = 0;
  for (unsigned i = 0; i < constraints.size(); i++){
    LinOp *constr = constraints[i];
#ifdef _R_DEBUG_
    Rcpp::Rcout << "Processing constraint " << i << std::endl;
#endif
    int vert_offset = constr_offsets[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;
  }
}
void build_matrix_3 ( std :: vector < LinOp * > constraints , std :: map < int , int > id_to_col , std :: vector < int > constr_offsets , Rcpp :: XPtr < ProblemData > prob_data ) { int num_rows = get_total_constraint_length ( constraints , constr_offsets ) ; prob_data -> const_vec = std :: vector < double > ( num_rows , 0 ) ; prob_data -> id_to_col = id_to_col ; int horiz_offset = 0 ; for ( unsigned i = 0 ; i < constraints . size ( ) ; i ++ ) { LinOp * constr = constraints [ i ] ; #ifdef _R_DEBUG_ Rcpp :: Rcout << " " << i << std :: endl ; #endif int vert_offset = constr_offsets [ 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 ; } }
See comment above for build_matrix.
See comment above for build_matrix .
/* Function also verifies the offsets are valid */ /* Build matrix one constraint at a time */