예제 #1
0
        inline String *get(unsigned index) const
        {
            if (index > len())
                throw RangeError();

            return (String*)&array()[index];
        }
예제 #2
0
Vector<T> Matrix<T>::getRow(int rowIndex) const
{
  if(rowIndex < 0 || rowIndex >= getNumCols()) { throw RangeError(rowIndex,"getRow"); }
  Vector<T> retVal( getNumCols() );
  for(int i=0; i < getNumCols(); i++)
  {
    retVal[i] = operator()(rowIndex,i);
  }
  return retVal;
}
예제 #3
0
Vector<T> Matrix<T>::getColumn(int colIndex) const
{
  if(colIndex < 0 || colIndex >= getNumCols()) { throw RangeError(colIndex,"getColumn"); }
  Vector<T> retVal( getNumRows() );
  for(int i=0; i < getNumRows(); i++)
  {
    retVal[i] = operator()(i,colIndex);
  }
  return retVal;
}
예제 #4
0
void Length::setLengthFromFloat(qreal nanometers) throw (RangeError)
{
    LengthBase_t min = std::numeric_limits<LengthBase_t>::min();
    LengthBase_t max = std::numeric_limits<LengthBase_t>::max();
    qreal value = qRound(nanometers);
    if ((value > max) || (value < min))
    {
        throw RangeError(__FILE__, __LINE__, QString("value=%1; min=%2; max=%3")
            .arg(value).arg(min).arg(max), tr("Range error!"));
    }

    mNanometers = value;
}
예제 #5
0
void throw_RangeError(const char*) {
	throw RangeError();
}
예제 #6
0
const T& Matrix<T>::operator()(int row, int col) const
{
  if(row < 0 || row >= getNumRows()) throw RangeError(row,"operator(): const row");
  if(col < 0 || col >= getNumCols()) throw RangeError(col,"operator(): const col");
  return head[row][col];
}
예제 #7
0
 inline void popIndex(lx_s *destp, int index)
 { if (lx_sa_pop_index(&sa, destp, index)) throw RangeError(); }
예제 #8
0
 inline void popFront(lx_s *destp)
 { if (lx_sa_pop_front(&sa, destp)) throw RangeError(); }
예제 #9
0
 inline void popBack(lx_s *destp)
 { if (lx_sa_pop_back(&sa, destp)) throw RangeError(); }
예제 #10
0
 void Vector::check(const int idx) const
 {
     if(idx < 0 || idx >= sz)
         throw RangeError();
 }
예제 #11
0
 void Matrix::check(int idx) const
 {
     if(idx < 0 || idx >= rows)
         throw RangeError();
 }
예제 #12
0
 void Vec4::check(const int idx) const
 {
     if(idx < 0 || idx >= VEC_SIZE)
         throw RangeError();
 }
예제 #13
0
 void Mat4::check(int idx) const
 {
     if(idx < 0 || idx >= MAT_SIZE)
         throw RangeError();
 }