Exemplo n.º 1
0
double  CAMvectorBase::minAbs() const
{
//
//  Need Conversion Check
//
    CAMvectorBase A;
    double* AdataP;
    long n;
    double  value;

    if(A.Structure.isSubset() == 1)
    {
    A.initializeMinDuplicate(*this);
    AdataP = (double*)A.getDataPointer();
    n      = A.Structure.getFullDataCount();
    }
    else
    {
    AdataP = (double*)getDataPointer();
    n      = Structure.getFullDataCount();
    }

    CAMbinaryEngine::doubleMinAbsValue(AdataP, n, value);
    return value;
}
Exemplo n.º 2
0
double CAMvectorBase::dot(const CAMvectorBase& V) const
{
//
//  Need Conversion Check
//

   if(Structure.isConformingTo(V.Structure) != 1)
   {CAMvectorBase::nonConformingMessage(Structure,V.Structure);}

    long M;

    CAMvectorBase A;
    double* AdataPtr;

    CAMvectorBase Vb;
    double* VdataPtr;
    long    Vcount;

    if(Structure.isSubset() == 1)
    {
    A.initializeMinDuplicate(*this);
    AdataPtr    = (double*)A.getDataPointer();
    M = A.getIndexCount();
    }
    else
    {
    AdataPtr  = (double*)getDataPointer();
    M = getIndexCount();
    }

    if(V.Structure.isSubset() == 1)
    {
    Vb.initializeMinDuplicate(V);
    VdataPtr    = (double*)Vb.getDataPointer();
    }
    else
    {
    VdataPtr    = (double*)V.getDataPointer();
    }

   double sum = 0.0;
   long i;
   for(i = 0; i < M; i++)
   {
   sum += (*(VdataPtr + i))*(*(AdataPtr + i));
   }
   return sum;
}
Exemplo n.º 3
0
void CAMmvaGraphics::vectorBasePlot(const CAMvectorBase& V, int callType, int p_arg, int p_style)
{
//
//  Need Conversion Check
//
//
// extract data from vector
//
    long M;
    CAMvectorBase A;
    double* AdataPtr;

    if(V.Structure.isSubset() == 1)
    {
    A.initializeMinDuplicate(V);
    AdataPtr    = (double*)A.getDataPointer();
    M = A.getIndexCount();
    }
    else
    {
    AdataPtr  = (double*)(V.getDataPointer());
    M = V.getIndexCount();
    }
//
// get reference to the graphics base class
//
   CAMgraphicsProcess& G = *this;
//
// plot
//
   switch(callType)
   {
    case 0 : G.plot(AdataPtr,M); break;
   case 1 : G.plot(AdataPtr,M,p_arg); break;
   case 2 : G.plot(AdataPtr,M,p_arg,p_style); break;
   }
}
Exemplo n.º 4
0
void CAMmvaGraphics::vectorBasePlot(const CAMvectorBase& Vx, const CAMvectorBase& Vy,
int callType, int p_arg, int p_style)
{
//
//  Need Conversion Check
//
    long M;

    CAMvectorBase A;
    double* AdataPtr;

    CAMvectorBase O;
    double* OdataPtr;
    long    Ocount;

    if(Vx.Structure.isSubset() == 1)
    {
    A.initializeMinDuplicate(Vx);
    AdataPtr    = (double*)A.getDataPointer();
    M = A.getIndexCount();
    }
    else
    {
    AdataPtr  = (double*)Vx.getDataPointer();
    M = Vx.getIndexCount();
    }

    if(Vy.Structure.isSubset() == 1)
    {
    O.initializeMinDuplicate(Vy);
    OdataPtr    = (double*)O.getDataPointer();
    Ocount      = O.getIndexCount();
    }
    else
    {
    OdataPtr    = (double*)Vy.getDataPointer();
    Ocount      = Vy.getIndexCount();
    }

    if(M != Ocount)
    {CAMmvaGraphics::ordinateError(Vy.Structure);}
//
// get reference to the graphics base class
//
   CAMgraphicsProcess& G = *this;
//
// plot
//
   switch(callType)
   {
    case 0 : G.plot(AdataPtr,OdataPtr,M); break;
   case 1 : G.plot(AdataPtr,OdataPtr,M,p_arg); break;
   case 2 : G.plot(AdataPtr,OdataPtr,M,p_arg,p_style); break;
   }

}