src/qcparameter.cpp

00001 /***************************************************************************
00002  *   Quantum Construct (qC++)                                                                  *
00003  *   The Quantum Physics Computational Library                                         *
00004  *   Copyright (C) 2005 by Shekhar S. Chandra                                      *
00005  *   Shekhar.Chandra@sci.monash,edu.au                                     *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 
00023 #include "qcparameter.h"
00024 
00025 QCParameter::QCParameter()
00026 {
00027     //ctor
00028 }
00029 
00030 QCParameter::~QCParameter()
00031 {
00032     //dtor
00033 }
00034 
00035 bool QCParameter::withinBounds(int parameterIndex)
00036 {
00037     if(parameterIndex < Parameters.extent(firstDim))
00038         return true;
00039     else
00040         return false;
00041 }
00042 
00043 parameterType QCParameter::getParameter(int parameterIndex)
00044 {
00045     if(!withinBounds(parameterIndex))
00046     {
00047         cerr << "Parameter Reference Out of Bounds. All index referencing should be made C style." << endl;
00048         exit(0); //Exit Program.
00049     }
00050     else
00051         return Parameters(parameterIndex);
00052 }

Generated on Sat May 13 13:22:49 2006 for Quantum Construct (qC++) by  doxygen 1.4.6-NO