00001 /* 00002 * constvectorFunction.cpp 00003 * 00004 * Created on: Sep 15, 2008 00005 * Author: marcosm 00006 */ 00007 00008 #include "constvectorfunction.h" 00009 #include <assert.h> 00010 00011 ConstVectorFunction::ConstVectorFunction(double v1, double v2, double v3) 00012 :Function3D(3) 00013 { 00014 m_v.resize(3); 00015 m_v[0]=v1; 00016 m_v[1]=v2; 00017 m_v[2]=v3; 00018 } 00019 00020 ConstVectorFunction::~ConstVectorFunction() 00021 { 00022 m_v.clear(); 00023 } 00024 00025 00026 double ConstVectorFunction::operator() (const VecDouble &p, const unsigned int component) const 00027 { 00028 00029 assert(component < 3); 00030 return m_v[component]; 00031 }