Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

FPcommon.h

Go to the documentation of this file.
00001 /**************************************************************************
00002 ***    
00003 *** Copyright (c) 1995-2000 Regents of the University of California,
00004 ***               Andrew E. Caldwell, Andrew B. Kahng and Igor L. Markov
00005 *** Copyright (c) 2000-2004 Regents of the University of Michigan,
00006 ***               Saurabh N. Adya, Jarrod A. Roy and Igor L. Markov
00007 ***
00008 ***  Contact author(s): abk@cs.ucsd.edu, imarkov@umich.edu
00009 ***  Original Affiliation:   UCLA, Computer Science Department,
00010 ***                          Los Angeles, CA 90095-1596 USA
00011 ***
00012 ***  Permission is hereby granted, free of charge, to any person obtaining 
00013 ***  a copy of this software and associated documentation files (the
00014 ***  "Software"), to deal in the Software without restriction, including
00015 ***  without limitation 
00016 ***  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00017 ***  and/or sell copies of the Software, and to permit persons to whom the 
00018 ***  Software is furnished to do so, subject to the following conditions:
00019 ***
00020 ***  The above copyright notice and this permission notice shall be included
00021 ***  in all copies or substantial portions of the Software.
00022 ***
00023 *** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
00024 *** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
00025 *** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
00026 *** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00027 *** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
00028 *** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00029 *** THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00030 ***
00031 ***
00032 ***************************************************************************/
00033 
00034 
00035 
00036 
00037 #ifndef FPCOMMON
00038 #define FPCOMMON
00039 
00040 #include <string>
00041 #include <iostream>
00042 #include <iomanip>
00043 #include <fstream>
00044 #include <vector>
00045 #include <algorithm>
00046 #include <math.h>
00047 #include <stdlib.h>
00048 #include <time.h>
00049 #include "ABKCommon/abktimer.h"
00050 
00051 using namespace std;
00052 
00053 namespace parquetfp
00054 {
00055    enum ORIENT {N, E, S, W, FN, FE, FS, FW};
00056 
00057    ostream& operator<<(ostream&, const ORIENT&);
00058 
00059    struct ltstr
00060    {
00061       bool operator()(const char* s1, const char* s2) const
00062          {
00063             return strcmp(s1, s2) < 0;
00064          }
00065    };
00066 
00067    struct Point
00068    {
00069       Point() {}
00070       Point(double x_, double y_)
00071          : x(x_), y(y_) {}
00072       double x;
00073       double y;
00074    };
00075 
00076    struct IntPoint
00077    {
00078       IntPoint(int x_, int y_)
00079          : x(x_), y(y_) {}
00080       int x;
00081       int y;
00082    };
00083 
00084    class BBox
00085    {
00086    private:
00087       double _minX;
00088       double _maxX;
00089       double _minY;
00090       double _maxY;
00091 
00092       bool _valid;
00093   
00094    public:
00095       //ctor
00096       BBox();
00097       BBox(double minX, double minY,
00098            double maxX, double maxY)
00099          : _minX(minX), _maxX(maxX),
00100            _minY(minY), _maxY(maxY) {}
00101 
00102       void put(Point& point);
00103       void clear(void);  
00104       double getHPWL(void);
00105       double getXSize(void);
00106       double getYSize(void);
00107       bool isValid(void);
00108    };
00109 
00110 //global parsing functions
00111    void eatblank(ifstream& i);
00112 
00113    void skiptoeol(ifstream& i);
00114 
00115    void eathash(ifstream& i);
00116 
00117    bool needCaseChar(ifstream& i, char character);
00118 
00119 //functions to manage the orientations
00120    ORIENT toOrient(char* orient);
00121    char* toChar(ORIENT orient);
00122 } // using namespace parquetfp;
00123 
00124 
00125         
00126 #endif
00127 
00128 
00129 

Generated on Mon Apr 25 01:09:24 2005 for Parquete by doxygen 1.3.2