DC2DT6::DC2DT6(Mesh& ms, SkSMatrix<real_t>& a, Vect<real_t>& b) { _tr = NULL; _ln = NULL; _theMesh = &ms; _A = &a; if (b.size()==0) { } _equation_name = "Diffusion/Convection"; _finite_element = "2-D, 6-Node Triangles (P2)"; }
void problem3(){ cout<<"Problem 3 25pts\n"; cout<<"create Vect size=10, fill range 0-5\n"; Vect v; for(int i=0;i<10;i++){ v.append(rand()%6); } cout<<"print data\n"; for(int i=0;i<v.size();i++){ cout<<v[i]<<" "; } cout<<endl; cout<<"call stat function\n"; statClass *result = stat(v,1); }
bool diameter2(Vect x, double maxDist, std::vector<Vect> clust, Vect sum, int count) { int dim = x.size(); maxDist = maxDist*maxDist; // we keep the center of the cluster Vect center = sum + x; center /= count + 1; double dist = 0; for (int d=0; d < dim; d++) dist += (x[d]-center[d])*(x[d]-center[d]); if(dist > maxDist) return false; for (int i=0; i<clust.size(); i++) { double dist = 0; for (int d=0; d<dim; d++) dist += (clust[i][d]-center[d])*(clust[i][d]-center[d]); if(dist > maxDist) return false; } return true; }
void randomVect (Rand& r, Vect& v) { size_t s = v.size(); for (size_t i = 0; i < s; ++i) r.random(v[i]); }