00001 #ifndef QUADRATUREPOINTS_H 00002 #define QUADRATUREPOINTS_H 00003 00004 #include "SundanceDefs.h" 00005 #include "DenseSerialVector.h" 00006 #include "Point.h" 00007 #include "TSFArray.h" 00008 #include "TSFUtils.h" 00009 #include "TSFVector.h" 00010 00011 namespace Sundance 00012 { 00013 00014 using namespace TSF; 00015 using std::string; 00016 using std::ostream; 00017 00018 /** \ingroup LowLevelFE 00019 * Simple container for a set of quadrature points and weights 00020 */ 00021 00022 class QuadraturePoints 00023 { 00024 public: 00025 /** */ 00026 QuadraturePoints() : weights_(), pts_() {} 00027 00028 /** construction is simple: just supply the weights and nodes */ 00029 QuadraturePoints(const DenseSerialVector& weights, 00030 const TSFArray<Point>& pts); 00031 00032 /** get the number of points */ 00033 int nPoints() const {return weights_.length();} 00034 00035 /** get the weights */ 00036 const DenseSerialVector& weights() const {return weights_;} 00037 00038 /** get the nodes */ 00039 const TSFArray<Point>& nodes() const {return pts_;} 00040 private: 00041 DenseSerialVector weights_; 00042 TSFArray<Point> pts_; 00043 }; 00044 00045 00046 } 00047 00048 namespace TSF 00049 { 00050 inline string toString(const Sundance::QuadraturePoints& qp) 00051 { 00052 return "QuadPoints[w=" + qp.weights().toString() 00053 + ", x=" + TSF::toString(qp.nodes()) + "]"; 00054 } 00055 } 00056 00057 #endif