コード例 #1
0
ファイル: test2014_03.C プロジェクト: 8l/rose
int main()
   {
  // Discretization specification.

  // First-order forward and backward discretization operators (primatives) for the X-axis
     D_plus dpx(0);
     D_minus dmx(0);

  // Build a second order operator (X-axis)
     Operator DPDMx = dpx(dmx);

  // First-order forward and backward discretization operators (primatives) for the Y-axis
     D_plus dpy(1);
     D_minus dmy(1);

  // Build a second order operator (Y-axis)
     Operator DPDMy = dpy(dmy);

  // Build the multidimensional (2D) second order operator (X-axis and Y-axis)
     Operator Laplace2D = DPDMx + DPDMy;

  // Build data on which to apply operator.
     GridFunction u,v;

  // Initialize the data
     u = 0.0;

  // Application of stencil on u saved in v.
     v = Laplace2D(u);

  // Output data in v.
     v.print();
   } 
コード例 #2
0
ファイル: r_real.cpp プロジェクト: Trottel/mkvtoolnix
void
real_reader_c::parse_headers() {

  if (rmff_read_headers(file) != RMFF_ERR_OK)
    return;

  int ndx;
  for (ndx = 0; ndx < file->num_tracks; ndx++) {
    rmff_track_t *track = file->tracks[ndx];

    if ((RMFF_TRACK_TYPE_UNKNOWN == track->type) || (get_uint32_be(&track->mdpr_header.type_specific_size) == 0))
      continue;
    if ((RMFF_TRACK_TYPE_VIDEO == track->type) && !demuxing_requested('v', track->id))
      continue;
    if ((RMFF_TRACK_TYPE_AUDIO == track->type) && !demuxing_requested('a', track->id))
      continue;
    if ((NULL == track->mdpr_header.mime_type)
        ||
        (   strcmp(track->mdpr_header.mime_type, "audio/x-pn-realaudio")
         && strcmp(track->mdpr_header.mime_type, "video/x-pn-realvideo")))
      continue;

    unsigned char *ts_data = track->mdpr_header.type_specific_data;
    uint32_t ts_size       = get_uint32_be(&track->mdpr_header.type_specific_size);

    real_demuxer_cptr dmx(new real_demuxer_t(track));

    if (RMFF_TRACK_TYPE_VIDEO == track->type) {
      dmx->rvp = (real_video_props_t *)track->mdpr_header.type_specific_data;

      memcpy(dmx->fourcc, &dmx->rvp->fourcc2, 4);
      dmx->fourcc[4]    = 0;
      dmx->width        = get_uint16_be(&dmx->rvp->width);
      dmx->height       = get_uint16_be(&dmx->rvp->height);
      uint32_t i        = get_uint32_be(&dmx->rvp->fps);
      dmx->fps          = (float)((i & 0xffff0000) >> 16) + ((float)(i & 0x0000ffff)) / 65536.0;
      dmx->private_data = (unsigned char *)safememdup(ts_data, ts_size);
      dmx->private_size = ts_size;

      demuxers.push_back(dmx);

    } else if (RMFF_TRACK_TYPE_AUDIO == track->type) {