OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr38811.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
 
3
typedef unsigned long ULONG;
4
void iwos_ErrorMessage(long error, const char * const file_name,
5
                       ULONG line_num, const char * const message);
6
class AbcA2d {
7
public:
8
    double x;
9
    double y;
10
    ~AbcA2d() { }
11
};
12
enum AbcZyParamType { ABC_SP_1 };
13
class AbcExtent2d {
14
    AbcA2d m_vMin;
15
    AbcA2d m_vMax;
16
public:
17
    AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax);
18
    AbcA2d ClampPoint2d(const AbcA2d & rPoint) const;
19
    AbcA2d GetMax() const { return m_vMax; }
20
    AbcA2d GetMin() const { }
21
    AbcA2d Evaluate(double dNormalizedX, double dNormalizedY) const;
22
};
23
inline AbcExtent2d::AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax)
24
{
25
    if (rMin.x > rMax.x || rMin.y > rMax.y)
26
      {
27
        long sErr = (1007);
28
        if (sErr != 1000)
29
          iwos_ErrorMessage(sErr,(const char * const)__null,
30
                            0,(const char * const)__null);
31
      }
32
    else
33
      {
34
        m_vMin = rMin;
35
        m_vMax = rMax;
36
      }
37
}
38
inline AbcA2d AbcExtent2d::ClampPoint2d(const AbcA2d & rPoint) const
39
{
40
    AbcA2d sRet = rPoint;
41
    if (rPoint.x < m_vMin.x)
42
      sRet.x = m_vMin.x;
43
    return sRet;
44
}
45
inline AbcA2d AbcExtent2d::Evaluate(double dNormalizedX, double dNormalizedY)
46
const
47
{
48
    AbcA2d sRet;
49
    sRet.x = m_vMin.x + dNormalizedX * (m_vMax.x - m_vMin.x);
50
    sRet.y = m_vMin.y + dNormalizedY * (m_vMax.y - m_vMin.y);
51
    return ClampPoint2d(sRet);
52
}
53
class AbcAbcdTracer {
54
    AbcExtent2d m_vUVDomain;
55
    virtual long TestIsoAbcde(AbcZyParamType eZyParam, double dParam,
56
                              int & rbZyxIsSolution);
57
    virtual int DoesPointLieOnAbcde(AbcA2d & rUV, int bRefinePoint) const;
58
};
59
long AbcAbcdTracer::TestIsoAbcde(AbcZyParamType eZyParam, double dParam,
60
                                 int & rbZyxIsSolution)
61
{
62
    AbcA2d sUV1(m_vUVDomain.GetMin());
63
    AbcA2d sUV2(m_vUVDomain.GetMax());
64
    AbcExtent2d sUVIso(sUV1,sUV2);
65
    for (ULONG i=0; i<10; i++)
66
      {
67
        double dT = i / (10 -1.0);
68
        AbcA2d sUV = sUVIso.Evaluate(dT,dT);
69
        if (!DoesPointLieOnAbcde(sUV,0))
70
          ;
71
      }
72
}
73
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.