// file: $USFS/util/usfs_eval/v1.0/imgev_ga_0.cc
//

// isip include files
//
#include "image_eval.h"

#include <integral_constants.h>
#include "image_eval_constants.h"
	  
// method: grow_arrays_cc
//
// arguments:
//  float_4* ptr_float_p: (input/output) arrays to be resized
//  int_4& cur_size_p: (input/output) number of elements in each array
//  int_4 grow_size_p: (input) amount to increment the array
//
// return:
//  a logical_1 value indicating status
//
// this method grows arrays by creating a new copy.
//
logical_1 Image_eval::grow_arrays_cc(float_4* ptr_floats_p,
				     int_4& cur_size_p,
				     int_4 grow_size_p) {

  // allocate new, larger, buffers
  //
  float_4* new_array = new float_4[cur_size_p + grow_size_p];

  // copy pointers
  //
  for (int_4 counter=0; counter<cur_size_p; counter++) {
      new_array[counter] = ptr_floats_p[counter];
  }

  // delete the old space
  //
  delete [] ptr_floats_p;

  // increment the size
  //
  cur_size_p += grow_size_p;

  // swap pointers
  //
  ptr_floats_p = new_array;

  // exit gracefully
  //
  return ISIP_TRUE;
}




