コード例 #1
0
ファイル: cyclic_utils.c プロジェクト: demorest/cyclic_tools
int cyclic_pscrunch_ps(PS *d, float xgain, float ygain) {

    if (d->npol<2) { return(-1); }

    int ichan, iphase;
    float *xx, *yy;
    for (ichan=0; ichan<d->nchan; ichan++) {
        for (iphase=0; iphase<d->nphase; iphase++) {
            xx = get_ps(d, iphase, 0, ichan);
            yy = get_ps(d, iphase, 1, ichan);
            *xx = xgain * (*xx) + ygain * (*yy);
        }
    }

    d->npol = 1;
    return(0);
}
コード例 #2
0
ファイル: cyclic_utils.c プロジェクト: demorest/cyclic_tools
int cyclic_fscrunch_ps(struct profile_phase *out, PS *in) {

    /* Only 1 pol for now */
    if (in->npol>1) return(-1); 

    int iphase, ichan;
    for (iphase=0; iphase<in->nphase; iphase++) {
        out->data[iphase] = 0.0;
        for (ichan=0; ichan<in->nchan; ichan++) {
            const float *tmp = get_ps(in,iphase,0,ichan);
            out->data[iphase] += *tmp;
        }
        out->data[iphase] /= (float)in->nchan;
    }

    return(0);
}
コード例 #3
0
ファイル: coquille_up.c プロジェクト: Mayeu/OS-Project-SSIK
// params: no param
void
ps(int argc, char *argv[])
{
  int             pid[MAXPCB];
  //char            buf[255];
  //char            num[15];
  int             i, len;
  pcbinfo         pinf;

  // init the pid list
  for (i = 0; i < MAXPCB; i++)
    pid[i] = -1;

  len = get_ps(pid);

  print("Process: ");
  printi(len);
  printn();
  print("PID\tNAME\tSTATE\tPRIO\n");
  print("_______________________________\n");
  for (i = 0; i < len; i++)
  {
    if (pid[i] != -1)
    {
      get_proc_info(pid[i], &pinf);
      printi(pid[i]);
      print("\t");
      print(pinf.name);
      print("\t");

      switch (pinf.state)
      {
      case READY:
        print("READY");
        break;
      case RUNNING:
        print("RUNNING");
        break;
      case BLOCKED:
        print("BLOCKED");
        break;
      case SLEEPING:
        print("SLEEPING");
        break;
      case WAITING_IO:
        print("WAITING_IO");
        break;
      case DOING_IO:
        print("DOING_IO");
        break;
      case WAITING_PCB:
        print("WAITING_PCB");
        break;
      case OMG_ZOMBIE:
        print("OMG_ZOMBIE");
        break;
      }
      print("\t");
      printi(pinf.pri);
      printn();
    }
  }
  print("_______________________________\n");

  exit(0);
}
コード例 #4
0
ファイル: structure.cpp プロジェクト: shze/biosim
 // get length
 size_t structure::get_length() const { return get_ps().size(); }