Kiretu
Functions

/home/wu/Desktop/kiretu-0.8/Util.cpp File Reference

#include "Util.h"

Functions

float strToFloat (std::string &str)
 Converts a string to float.
std::string intToStr (int i)
void printVec (std::vector< float > &vec)
 Prints the given vector to the standard-output.
void printMat (std::vector< std::vector< float > > &mat)
 Prints the given matrix to the standard-output.
void matMult (std::vector< std::vector< float > > &mat, std::vector< float > &vec, std::vector< float > &res)
 Multiplies the matrix mat with the vector vec and saves the result in the vector res.
void vecAdd (std::vector< float > &vec1, std::vector< float > &vec2, std::vector< float > &res)
 Adds the vectores vec1 and vec2 and saves the result in the vector res.

Detailed Description

Implementation of Util.h. Contains some often used functions.

Author:
Daniel Wunderlich (d.wunderlich@stud.uni-heidelberg.de)
Version:
0.5
Date:
2011-01-05

Function Documentation

std::string intToStr ( int  i)
void matMult ( std::vector< std::vector< float > > &  mat,
std::vector< float > &  vec,
std::vector< float > &  res 
)

Multiplies the matrix mat with the vector vec and saves the result in the vector res.

Parameters:
matThe matrix, which should be multiplied.
vecThe vector, which should be multiplied.
resThe vector the result should be saved in.
void printMat ( std::vector< std::vector< float > > &  mat)

Prints the given matrix to the standard-output.

Parameters:
matThe matrix, which should be printed.
void printVec ( std::vector< float > &  vec)

Prints the given vector to the standard-output.

Parameters:
vecThe vector, which should be printed.
float strToFloat ( std::string &  str)

Converts a string to float.

Parameters:
strThe string, which should be converted.
Returns:
The converted float.
void vecAdd ( std::vector< float > &  vec1,
std::vector< float > &  vec2,
std::vector< float > &  res 
)

Adds the vectores vec1 and vec2 and saves the result in the vector res.

Parameters:
vec1The first vector, which should be added.
vec2The second vector, which should be added.
resThe vector the result should be saved in.
 All Data Structures Files Functions Variables Enumerations Enumerator
[Page Up]