Idea for beginner's OpenMP project [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a parallel programming project that I have to do in C++ and openMP that's due in a week, and I was wondering if someone could give me an idea on something a beginner in both C++ and OpenMP can accomplish in this time. I've got pretty extensive experience in Java, but this class randomly started us on C++ without it being introduced to us before had (and I understand 80% of learning code should be on my own time, but I expected more forewarning before they throw a new language at us). The instructor hasn't given us any ideas, our labs have just been tutorials through basics, and our lectures have been about how to implement bits and pieces of parallel programming... so I'm at a loss at what would be good enough for a class project. It's an elective class, so he's not expecting much, but I just don't know where to start. Thanks guys

Basics examples for OpenMP are computing PI and matrix multiplication.
More interesting topics may be:
Image convolution (edge detection, sharpening, blurring, etc.). You could use NetPBM image format for simplicity.
K-Means clustering.
You could find serial C++ examples in the Internet and adopt them to OpenMP, which is relatively easy task.

Related

Good C++ alternative to MATLAB's "fminunc"? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to convert some code written in MATLAB to C++. I'm having some (or actually quite a lot of) trouble finding an alternative to the "fminunc" function which is used in the MATLAB code that I can replace and use in the C++ code. I've been looking at the "dlib"-library because I've heard it could be a function there I can use, but I'm not sure what function to use.
This is how the "fminunc" is used in the MATLAB code I want to convert:
[theta, cost] = ...
fminunc(#(t)(costFunction(t, X, y)), initial_theta, options);
Does anyone know any good optimizing functions like this in C++?
I believe what you are looking for is Google's Ceres Solver, an open source C++ library for modeling and solving large, complicated optimization problems. The code is designed to handle two classes of problems:
Non-linear Least Squares problems with bounds constraints.
General unconstrained optimization problems.
Automatic Differentiation is also supported.
Several cool example applications can be found here.
There are a bunch of optimizers in dlib, some that use gradients and others than just work on black-box functions. You can see some examples here http://dlib.net/optimization_ex.cpp.html and more generally here http://dlib.net/optimization.html.

AI for time table generator software [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to develop a time table generator software for my college. Obviously it requires a great deal of constraint satisfaction i.e. I need to satisfy a lot of rules in order to generate a bunch of time tables where classes do not clash. After doing some research and reading this article, I feel I need to use some AI in it. Now, I am a complete newbie to AI. Can anyone tell me which algorithm will work best in my case?
The simplest algorithm that you can use for this problem is genetic algorithm (or any other evolutionary algorithm). Solving this problem using GA is very simple but yet effective. There are lots of papers and codes that have used this approach for this problem.
If you have few rules and constraints, you may want to use exact straightforward techniques like backtracking with CSP heuristics to speed it up, but if there are lots of classes and constraints, I suggest Genetic Algorithm.
Well, not a trivial task indeed. Problems like this one are VERY hard to solve.
Here I can recommend you two things:
Use an existing CSP/COP solver and describe your constraints in its language. These solvers are very good, fast and tuned, being developed for years.
Educate yourself in the area of Discrete Optimization (there was a course at coursera.org with the same name which was great). Only after you grasp the basics of how these things work can you try to write your own solver. But let you be warned! Discrete optimization is pain and suffering :-).
This is by no means a suitable place to just tell you how CSP/COP works. It is a very broad and difficult field.
I wish you good luck!

What can a second year computer undergrad do which might be considered worthwhile in the future? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Besides taking classes I mean. I want to make myself stand out from the crowd. I am very good at building logic/algorithms. Like I can implement any problem in C. But I don't know how to harness it! Like what to code!?!
All I have made upto this point is games that too in C's console, using ASCII and character arrays. Snake, Sudoku (making a puzzle and solving too), rip-off of Mario Bros., tictactoe with AI. But making games won't get me anywhere.
I was wondering if I could get suggestions from you guys?
I know C++/C and a little Java. I have just got started with data structures. So, it would be great if it would be relevant to data structures. I know about most trees and types of data structures. Thanks a lot for your help.
I know it's off topic but I have nowhere else to turn to.
Pay attention in your finite automata classes. Learning the basis of all languages makes "knowing" a language irrelevant.
If your school offers it, take some business computer systems classes.
Try to get some project management experience under your belt. This could be done by doing work for charity or an internship for a prof.
Of course there is always open source projects as well.
Get a job. I was working for a small development shop as a second year student.
Open your own company, and start doing some mobile apps. The sky is the limit.
If you want to have long term impact, you can do one of two things:
Be a genius, and invent a new gizmo everybody needs. [Extra points].
Build a foundation for something. Add to it cleanly, continuously. Eventually it will have enough mass to have an impact.

Suggest websites to practice C/C++ algorithms/puzzles [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to practice problem solving in C/C++. But I want to avoid writing the whole program from scratch. Is there any website where they give me puzzles and the code skeleton along with it and expect me to only fill a function or two to solve the problem at hand? This would save a lot of time and I can concentrate only on the problem solving part.
Thanks.
Advent of Code posts new problems every year starting on Dec 1. The problems have a Christmas-themed story, involving Santa Claus and his elves. There are leader boards so you can compete with your friends. You can also revisit previous years problems and solve them.
Project Euler has almost 400 programming puzzles. There are no frameworks, but the first few puzzles are simple enough that this shouldn't be a problem.
TopCoder Is an online coding competition site. You can open past problems in their competition arena applet for practice. All you need to do is write the one function described in the problem. However, the problems have a wide range of difficulty. Even the easiest ones are more difficult than the beginning ones at Project Euler.
I don't know any website that works the way you said, but most of these is just simples. You just have to read from standard input and print to standard output.
http://www.spoj.pl/
http://www.topcoder.com/
http://code.google.com/codejam/
Also, most of the problems of the same site will work the same way, so once you solve your first problem, you just have to use its skeleton to solve others.
There are so many. Few of them are :
http://www.leetcode.com/
http://cpp-wiki.wikidot.com/
http://www.parashift.com/c++-faq-lite/
http://www.coderholic.com/10-more-puzzle-websites-to-sharpen-your-programming-skills/

boost vs POCO as for learning curve and suitability for beginners (HTTP client) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
which library would you advise me to use? I don't know any of these libraries.
I heard, that Boost is very often used but also it's hard to code in.
So to make this question as objective as possible:
Just simply from the aspect of beginner programmer (I've coded ~1000 LOC in C++ in my life)
which library would be better to learn?
I'll be using it mainly for HTTP client.
The answer is bound to be subjective but with particular emphasis on for a beginner then I think POCO is clearly the way to go. It actually has some HTTPClient classes and once you get beyond the point of being happy that something works the code is clear enough to follow so that you can dig in and understand why it works if that is where things lead you.
POCO is well written OOP code and does not require much in the way of understanding templates and such. The classes are well integrated with one another, extensive, and the documentation more or less points you to the next (or previous) class that you need. You won't be dashing around 20 separate libs as Boost is likely to have you doing. (There is always time for that later!)