Ejemplo n.º 1
0
Archivo: main.cpp Proyecto: CCJY/coliru
int main()
{
	//Exercise 1
	transformIntToStringVector();

	//Exercise 2
	printStrUpper("exercise");

	//Exercise 3
	printEvenValuesOfVectorInt(populateVector());

	//Exercise 4
	printMinMax(populateVector());

	//Exercise 5
	printOddValues(populateVector());

	//Exercise 6/7
	printUniqueValues(populateVector());

	//Exercise 8
	CFileParser parser("file.txt");
	parser.printAll();

	return 0;
}
Ejemplo n.º 2
0
  //pa6 morphing and interpolation combination
  //creates a vector of images
int ImageHandler::pa6Interpolate(const char* keypointfilename)
{
    //unimplemented:: all of these methods need to be checked

    //get the number of output locations
    int N = pa6OutputNumber(keypointfilename);
    
    //this means the kp file has less than 3 keypoint locations for
    //each keypoint
    //could mean it only had source and/or dest or was completely empty
    if(N < 1)
    {
        return -1;
    }

    //fills pspdstore with copies of the source image
    //this guarentees they will be the same size
    populateVector(PsPdStore, (2*N));

    //morphs 2N images so minimum PsPdStore should look like:
    // PsFile1 // morphed image using the source
    // PdFile1 //morphed image using the dest
    if(fillPsPdStore(2*N, keypointfilename)==-1)return -1;

    populateVector(interpolatedStore, N);

    fillInterpolatedStore(N);

    return 0;
}
Ejemplo n.º 3
0
Archivo: main.cpp Proyecto: CCJY/coliru
//Exercise 1
void transformIntToStringVector()
{
	std::cout << "Exercise 1" << std::endl;
	std::vector<int> vectInt = populateVector();

	//std::vector<std::string> stringVector(vectInt.size());
	//std::transform(vectInt.begin(), vectInt.end(), stringVector.begin(), static_cast<std::string(*)(int)>(std::to_string));

	std::vector<std::string> stringVector2;
	std::transform(vectInt.begin(), vectInt.end(), std::back_inserter(stringVector2), static_cast<std::string(*)(int)>(std::to_string));
	printValues(vectInt);
}