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

#include "WImage/debug.h"
#include "WImage/miscdefs.h"
#include "WImage/ColumnVector.hh"
#include <stdexcept>

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

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

coeff
ColumnVector::at (int pos) 
{ 
  return m_array->at (pos, m_vroot);
}

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

int
ColumnVector::size (void)
{ 
  return m_array->rows (); 
} 

void 
ColumnVector::update (void) 
{ 
  ImageVector::update ();
  if (m_vroot > m_xsize)
    {
      m_vroot = m_xsize;
    }
}
