Posts

Showing posts with the label Sample

Simplex implementation in Java with sample code

Simplex is one of the powerful algorithm to solve linear programming problems. With simplex, we can maximise or minimise objective function with the given list of constraint. public class Simplex { private double[][] tableaux; // tableaux private int numberOfConstraints; // number of constraints private int numberOfOriginalVariables; // number of original variables private boolean maximizeOrMinimize; private static final boolean MAXIMIZE = true; private static final boolean MINIMIZE = false; private int[] basis; // basis[i] = basic variable corresponding to row i public Simplex(double[][] tableaux, int numberOfConstraint, int numberOfOriginalVariable, boolean maximizeOrMinimize) { this.maximizeOrMinimize = maximizeOrMinimize; this.numberOfConstraints = numberOfConstraint; this.numberOfOriginalVariables = numberOfOriginalVariable; this.tableaux = tableaux; basis = new int[numberOfConstraints]; for (int i = 0; i < ...

Tutorial on porting OpenCV(revision:5578) to android in Windows Environment

Image
Software Prerequisites svn client (eg.Tortoise SVN) ·          cmake tool   http://www.cmake.org/ ·          Android NDK (revision r5 or newer)   http://developer.android.com/sdk/ndk/index.html ·          OpenCV trunk   https://code.ros.org/svn/opencv/trunk/opencv      Additional requirements for Java wrapper and Android samples ·          SWIG   http://www.swig.org/ ·          JDK 5/JDK 6   http://www.oracle.com/technetwork/java/javase/downloads/index.html ·          Android SDK   http://developer.android.com/sdk/index.html ·          ant   http://ant.apache.org      Windows additional prerequisites At the moment OpenCV cross compilation under cy...