numericalboy / ccvt Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/ccvt
License: GNU General Public License v3.0
Automatically exported from code.google.com/p/ccvt
License: GNU General Public License v3.0
What steps will reproduce the problem?
Compile with g++ versions 4.3 or 4.4
What is the expected output? What do you see instead?
compiling generates the error:
ccvt_optimizer.h:36: error: declaration of ‘typedef struct
ccvt::Site<Point> ccvt::Optimizer<Point, Metric>::Site’
What version of the product are you using? On what operating system?
g++ versions 4.3 or 4.4 on linux
Please provide any additional information below.
Renaming the typedef from Site to PointSite throughout ccvt_optimizer.h and
in main.cpp fixes the problem.
Original issue reported on code.google.com by [email protected]
on 17 Jun 2009 at 8:02
What steps will reproduce the problem?
compile with g++ version 4.3 or 4.4
What is the expected output? What do you see instead?
need () around "unsigned int" in the while statement.
RAND_MAX has the value MAX_INT, so adding 1 to it generates and overflow.
If the value of RAND_MAX was less than MAX_INT, then taking "rand() %
(RAND_MAX + 1)" would be a no-op (since 0 <= rand() <= RAND_MAX), so that
whole expression might as well be left out.
What version of the product are you using? On what operating system?
version 0.1
Please provide any additional information below.
This function is painfully slow when run using the constants provided for
the constant_density() function. Why not replace it with a different
function that generates the points explicitly as in the constant_density
case? For instance:
void nonconstant_density(Point2::List& points, const int numberOfPoints,
const double torusSize) {
double n = sqrt(double(numberOfPoints));
for (int x = 0; x < n; ++x) {
double dx = x / n;
dx = (sin(4 * M_PI * dx) / (8 * M_PI) + dx) * torusSize;
for (int y = 0; y < n; ++y) {
double dy = y / n;
dy = (sin(4 * M_PI * dy) / (8 * M_PI) + dy) * torusSize;
points.push_back(Point2(dx, dy));
}
}
}
Not the same output, but gets the effect across much faster.
Original issue reported on code.google.com by [email protected]
on 17 Jun 2009 at 8:15
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.