/*
 * Implementation of class FullVector
 *
 * $Date$
 * $Revision$
 *
 */

#include "WImage/debug.h"
#include "WImage/miscdefs.h"
#include "WImage/FullVector.hh"
#ifndef _WIN32_WCE
#include <iostream>
#endif
#include <stdexcept>

#if !(defined __WATCOMC__ && __WATCOMC__ < 1230)
using namespace std;
#endif

void 
FullVector::go (int root)
{
  ImageVector::go (root);
  if (this->m_vroot > this->m_xysize)
    {
      throw invalid_argument ("go: root cannot be greater than size.");
    }
}

coeff 
FullVector::at (int pos) 
{ 
  return m_array->at (this->m_vroot + pos);
}

void 
FullVector::to (int pos, coeff val) 
{ 
  m_array->to (this->m_vroot + pos, val);
}

int
FullVector::size (void)
{ 
  return m_array->size () - this->m_vroot; 
} 

void 
FullVector::update (void) 
{ 
  ImageVector::update ();
  m_xysize = m_xsize * m_ysize;
  if (m_vroot > m_xysize)
    {
      m_vroot = m_xysize;
    }
}

