Ejemplo n.º 1
0
Archivo: newdar.cpp Proyecto: pwoo/admb
/**
 * Description not yet available.
 * \param
 */
void df_check_derivative_values_indexed(void)
{
  //char label[20];
  int index=restore_int_value();
  adstring str=get_string_marker();
  double * temp_ptr = gradient_structure::get_ARRAY_MEMBLOCK_BASE();
  unsigned long int max_last_offset =
    gradient_structure::ARR_LIST1->get_max_last_offset();
  size_t size = sizeof(double_and_int);

  int icount=0;
  int exit_flag=0;
  cout << str << " index = " << index << endl;
  unsigned int i;
  for (i=0 ; i< (max_last_offset/size) ; i++ )
  {
    if (fabs(temp_ptr[i])>1.e+8)
    {
      if (ad_kill_flag) exit_flag=1;
      icount++;
      cout << i << " " << setscientific() << temp_ptr[i] << endl;
      if (icount>10) break;
    }
  }

  icount=0;
  for (i=0; i<gradient_structure::GRAD_LIST->nlinks; i++)
  {
    if (* (double*) (gradient_structure::GRAD_LIST->dlink_addresses[i])
      > 1.e+8)
    {
      icount++;
      if (ad_kill_flag) exit_flag=1;
       cout << "dlist " << i << " " << setscientific() <<
         * (double*) (gradient_structure::GRAD_LIST->dlink_addresses[i])
          << endl;
      if (icount>10)
      {
         break;
      }
    }
  }
  if (exit_flag) exit(1);
}
Ejemplo n.º 2
0
/**
* Print a dvar_vector to the screen in scientific notation, with 5 significant figures
* @param v The dvar_vector
* @return Nothing
**/
void pads(const dvar_vector & v)
{
  cout << setscientific() << setprecision(5) << v << endl;
}