parameters: (selected_schemes)
return_statement: return ''.join(res)
docstring: Generate cpp code to fill points & weights.
docstring_summary: Generate cpp code to fill points & weights.
docstring_tokens: Generate cpp code to fill points & weights .
function: def generate_cpp(selected_schemes):
      """
      Generate cpp code to fill points & weights.
      """
      res = []
      for order, scheme in selected_schemes:
          try:
              name = scheme.name
          except AttributeError:
              name = scheme.__class__.__name__
          code = """\
          case {order}: // {name}
              points.resize({num_pts}, 3);
              weights.resize({num_pts}, 1);
              points << {points};
              weights << {weights};
              break;
          """.format(order=order,
                     name=name,
                     num_pts=len(scheme.weights),
                     points=', '.join('{:.64g}'.format(w)
                                      for w in scheme.points.flatten()),
                     weights=', '.join('{:.64g}'.format(w) for w in scheme.weights))
          res.append(textwrap.dedent(code))
      return ''.join(res)
function_tokens: def generate_cpp ( selected_schemes ) : res = [ ] for order , scheme in selected_schemes : try : name = scheme . name except AttributeError : name = scheme . __class__ . __name__ code = """\
          case {order}: // {name}
              points.resize({num_pts}, 3);
              weights.resize({num_pts}, 1);
              points << {points};
              weights << {weights};
              break;
          """ . format ( order = order , name = name , num_pts = len ( scheme . weights ) , points = ', ' . join ( '{:.64g}' . format ( w ) for w in scheme . points . flatten ( ) ) , weights = ', ' . join ( '{:.64g}' . format ( w ) for w in scheme . weights ) ) res . append ( textwrap . dedent ( code ) ) return '' . join ( res )