本文整理汇总了C++中ARRAY::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ ARRAY::Size方法的具体用法?C++ ARRAY::Size怎么用?C++ ARRAY::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ARRAY
的用法示例。
在下文中一共展示了ARRAY::Size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ARRAY
/// array copy
explicit ARRAY (const ARRAY<T> & a2)
: FlatArray<T, BASE> (a2.Size(), a2.Size() ? new T[a2.Size()] : 0)
{
allocsize = this->size;
ownmem = 1;
for (int i = BASE; i < this->size+BASE; i++)
(*this)[i] = a2[i];
}
示例2: GetTrig
//get all trigs:
int GetTrig(int i) const
{
if (i <= charttrigs->Size()) {
return charttrigs->Get(i);
}
else {
return outertrigs->Get(i-charttrigs->Size());
}
}
示例3: QickSort
void QickSort (const ARRAY<double> & values,
ARRAY<int> & order)
{
int i, n = values.Size();
order.SetSize (n);
for (i = 1; i <= n; i++)
order.Elem(i) = i;
QickSortRec (values, order, 1, order.Size());
}
示例4: SetFlag
void Flags :: SetFlag (const char * name, const ARRAY<double> & val)
{
ARRAY<double> * numarray = new ARRAY<double>;
for (int i = 1; i <= val.Size(); i++)
numarray->Append (val.Get(i));
numlistflags.Set (name, numarray);
}
示例5: SetElementVector
void BaseVector :: SetElementVector (const ARRAY<INDEX> & pnum,
const BaseVector & elvec)
{
int i;
for (i = 1; i <= pnum.Size(); i++)
(*this)(pnum.Get(i)) = elvec(i);
}
示例6: GetElementVector
void BaseVector :: GetElementVector (const ARRAY<INDEX> & pnum,
BaseVector & elvec) const
{
int i;
for (i = 1; i <= pnum.Size(); i++)
elvec(i) = (*this)(pnum.Get(i));
}
示例7: AddElementVector
void Vector :: AddElementVector (const ARRAY<INDEX> & pnum,
const BaseVector & elvec)
{
int i;
const Vector & helvec = elvec.CastToVector();
for (i = 1; i <= pnum.Size(); i++)
Elem(pnum.Get(i)) += helvec.Get(i);
}
示例8: CalcVolume
double CalcVolume (const ARRAY<Point3d> & points,
const ARRAY<Element> & elements)
{
double vol;
Vec3d v1, v2, v3;
vol = 0;
for (int i = 0; i < elements.Size(); i++)
{
v1 = points.Get(elements[i][1]) - points.Get(elements[i][0]);
v2 = points.Get(elements[i][2]) - points.Get(elements[i][0]);
v3 = points.Get(elements[i][3]) - points.Get(elements[i][0]);
vol -= (Cross (v1, v2) * v3) / 6;
}
return vol;
}
示例9: Sort
void Sort (const ARRAY<double> & values,
ARRAY<int> & order)
{
int n = values.Size();
int i, j;
order.SetSize (n);
for (i = 1; i <= n; i++)
order.Elem(i) = i;
for (i = 1; i <= n-1; i++)
for (j = 1; j <= n-1; j++)
if (values.Get(order.Elem(j)) > values.Get(order.Elem(j+1)))
{
Swap (order.Elem(j), order.Elem(j+1));
}
}
示例10: GetPolySurfs
void Polyhedra :: GetPolySurfs(ARRAY < ARRAY<int> * > & polysurfs)
{
int maxnum = -1;
for(int i = 0; i<faces.Size(); i++)
{
if(faces[i].inputnr > maxnum)
maxnum = faces[i].inputnr;
}
polysurfs.SetSize(maxnum+1);
for(int i=0; i<polysurfs.Size(); i++)
polysurfs[i] = new ARRAY<int>;
for(int i = 0; i<faces.Size(); i++)
polysurfs[faces[i].inputnr]->Append(faces[i].planenr);
}
示例11: LineIntersections
void CircleSeg<D> :: LineIntersections (const double a, const double b, const double c,
ARRAY < Point<D> > & points, const double eps) const
{
points.SetSize(0);
double px=0,py=0;
if(fabs(b) > 1e-20)
py = -c/b;
else
px = -c/a;
const double c1 = a*a + b*b;
const double c2 = 2. * ( a*(py-pm(1)) - b*(px-pm(0)));
const double c3 = pow(px-pm(0),2) + pow(py-pm(1),2) - pow(Radius(),2);
const double discr = c2*c2 - 4*c1*c3;
if(discr < 0)
return;
ARRAY<double> t;
if(fabs(discr) < 1e-20)
t.Append(-0.5*c2/c1);
else
{
t.Append((-c2+sqrt(discr))/(2.*c1));
t.Append((-c2-sqrt(discr))/(2.*c1));
}
for(int i=0; i<t.Size(); i++)
{
Point<D> p (px-t[i]*b,py+t[i]*a);
double angle = atan2(p(1),p(0))+M_PI;
if(angle > StartAngle()-eps && angle < EndAngle()+eps)
points.Append(p);
}
}
示例12: GetNChartT
int GetNChartT() const {
return charttrigs->Size();
}
示例13: GetNOuterT
int GetNOuterT() const {
return outertrigs->Size();
}
示例14: NOSegments
int NOSegments() {
return boundary.Size();
};
示例15: BubbleSort
inline void BubbleSort (ARRAY<T> & data)
{
BubbleSort (data.Size(), &data[0]);
}