gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
54 for(
int i = 0; i < n; i++)
vals[i] = 0.0;
62 for(
int i = 0; i <
nbvals; i++)
vals[i] = (x1 *
vals[i] + x2 * v[i]);
69 if(std::abs(1.0 - scale_inp) <=
eps) scale_inp = 1.0;
82 auto it =
c.find(xyz);
99 auto it =
c.find(xyz);
114 auto it =
c.find(
xyzv(x, y,
z));
115 if(it ==
c.end())
return false;
116 for(
int k = 0; k < n; k++) vals[k] = it->vals[k];
123 auto it =
c.find(
xyzv(x, y,
z));
124 if(it ==
c.end())
return false;
125 (*scale_val) = it->scaleValue;
132 while(it !=
c.end()) {
133 if(it->nbvals == 3)
norme(it->vals);
140 FILE *fp =
Fopen(filename.c_str(),
"w");
141 if(!fp)
return false;
142 fprintf(fp,
"View \"data\" {\n");
144 while(it !=
c.end()) {
147 fprintf(fp,
"SP(%.16g,%.16g,%.16g){%.16g};\n", it->x, it->y, it->z,
151 fprintf(fp,
"VP(%.16g,%.16g,%.16g){%.16g,%.16g,%.16g};\n", it->x, it->y,
152 it->z, it->vals[0], it->vals[1], it->vals[2]);
178 double const cosc =
prosca(a, b);
179 double const sinc = std::sqrt(
c[0] *
c[0] +
c[1] *
c[1] +
c[2] *
c[2]);
180 double const angplan =
myatan2(sinc, cosc);
181 return (
float)(angplan * 180. / M_PI);
187 if(
n.size() > 100)
return;
194 for(std::size_t i = 0; i <
n.size(); i++) {
195 if(tol >= 180. || std::abs(
angle(i, nx, ny, nz)) < tol) {
199 float c1 = (float)(
n[i].nb) / (float)(
n[i].nb + 1);
200 float c2 = 1.0F / (float)(
n[i].nb + 1);
201 n[i].nx = (char)(
c1 *
n[i].nx + c2 * nx);
202 n[i].ny = (char)(
c1 *
n[i].ny + c2 * ny);
203 n[i].nz = (char)(
c1 *
n[i].nz + c2 * nz);
211 nnb nn = {nx, ny, nz, 0};
218 xyzn xyz((
float)x, (
float)y, (
float)
z);
219 auto it =
c.find(xyz);
238 c.find(
xyzn((
float)x, (
float)y, (
float)
z));
240 if(it ==
c.end())
return false;
243 for(std::size_t i = 0; i < p->
n.size(); i++) {
void update(int n, double *v)
float angle(int i, char n0, char n1, char n2)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
xyzv(double xx, double yy, double zz)
bool get(double x, double y, double z, int n, double *vals) const
void add(double x, double y, double z, int n, double *vals)
xyzv & operator=(const xyzv &other)
void add(double x, double y, double z, double nx, double ny, double nz)
FILE * Fopen(const char *f, const char *mode)
void update(char n0, char n1, char n2, float tol)
double myatan2(double a, double b)
std::set< xyzn, lessthanxyzn > c
double prosca(double const a[3], double const b[3])
void add_scale(double x, double y, double z, double scale_val)
void prodve(double a[3], double b[3], double c[3])
std::set< xyzv, lessthanxyzv > c
bool get(double x, double y, double z, double &nx, double &ny, double &nz) const
bool exportview(const std::string &filename) const
bool get_scale(double x, double y, double z, double *scale_val) const
void scale_update(double scale_val)
double norme(double a[3])